mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
feat(image): 接入 ChatGPT Web 生图反代
This commit is contained in:
@@ -51,6 +51,18 @@ pub const GENERIC_PROVIDER_OAUTH_TEMPLATES: &[GenericProviderOAuthTemplate] = &[
|
||||
use_pkce: true,
|
||||
uses_json_payload: false,
|
||||
},
|
||||
GenericProviderOAuthTemplate {
|
||||
provider_type: "chatgpt_web",
|
||||
display_name: "ChatGPT Web",
|
||||
authorize_url: "https://auth.openai.com/oauth/authorize",
|
||||
token_url: "https://auth.openai.com/oauth/token",
|
||||
client_id: "app_EMoamEEZ73f0CkXaXp7hrann",
|
||||
client_secret: "",
|
||||
scopes: &["openid", "email", "profile", "offline_access"],
|
||||
redirect_uri: "http://localhost:1455/auth/callback",
|
||||
use_pkce: true,
|
||||
uses_json_payload: false,
|
||||
},
|
||||
GenericProviderOAuthTemplate {
|
||||
provider_type: "gemini_cli",
|
||||
display_name: "GeminiCli",
|
||||
|
||||
@@ -26,7 +26,7 @@ impl ProviderOAuthService {
|
||||
.with_adapter(Arc::new(KiroProviderOAuthAdapter::default()))
|
||||
.with_adapter(Arc::new(CodexProviderOAuthAdapter::default()))
|
||||
.with_adapter(Arc::new(AntigravityProviderOAuthAdapter::default()));
|
||||
for provider_type in ["claude_code", "gemini_cli"] {
|
||||
for provider_type in ["claude_code", "chatgpt_web", "gemini_cli"] {
|
||||
if let Some(adapter) = GenericProviderOAuthAdapter::for_provider_type(provider_type) {
|
||||
service = service.with_adapter(Arc::new(adapter));
|
||||
}
|
||||
@@ -121,7 +121,14 @@ mod tests {
|
||||
fn builtin_provider_service_registers_supported_provider_types() {
|
||||
let service = ProviderOAuthService::with_builtin_adapters();
|
||||
|
||||
for provider_type in ["claude_code", "codex", "gemini_cli", "antigravity", "kiro"] {
|
||||
for provider_type in [
|
||||
"claude_code",
|
||||
"codex",
|
||||
"chatgpt_web",
|
||||
"gemini_cli",
|
||||
"antigravity",
|
||||
"kiro",
|
||||
] {
|
||||
assert!(
|
||||
service.adapter(provider_type).is_ok(),
|
||||
"{provider_type} adapter should be registered"
|
||||
|
||||
Reference in New Issue
Block a user