refactor(open-sse): dedupe Google OAuth client credentials (#4)
clientId/clientSecret của antigravity + gemini bị lặp 3 nơi (registry, usage.js, src/lib/oauth). Gom vào shared.js (ANTIGRAVITY_OAUTH_CLIENT, GOOGLE_OAUTH_CLIENT), các file spread vào. Byte-for-byte: PROVIDERS/alias/oauth-url equal, golden 142 pass. Thêm test guard nội dung + alias resolution. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { platform, arch } from "os";
|
||||
import { ANTIGRAVITY_OAUTH_CLIENT } from "../shared.js";
|
||||
|
||||
export default {
|
||||
id: "antigravity",
|
||||
@@ -10,8 +11,7 @@ export default {
|
||||
],
|
||||
format: "antigravity",
|
||||
headers: { "User-Agent": `antigravity/1.107.0 ${platform()}/${arch()}` },
|
||||
clientId: "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",
|
||||
clientSecret: "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"
|
||||
...ANTIGRAVITY_OAUTH_CLIENT
|
||||
},
|
||||
models: [
|
||||
{ id: "gemini-3-flash-agent", name: "Gemini 3.5 Flash (High)" },
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { GOOGLE_OAUTH_CLIENT } from "../shared.js";
|
||||
|
||||
export default {
|
||||
"id": "gemini-cli",
|
||||
"alias": "gc",
|
||||
"transport": {
|
||||
"baseUrl": "https://cloudcode-pa.googleapis.com/v1internal",
|
||||
"format": "gemini-cli",
|
||||
"clientId": "681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",
|
||||
"clientSecret": "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"
|
||||
...GOOGLE_OAUTH_CLIENT
|
||||
},
|
||||
"models": [
|
||||
{
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { GOOGLE_OAUTH_CLIENT } from "../shared.js";
|
||||
|
||||
export default {
|
||||
"id": "gemini",
|
||||
"alias": "gemini",
|
||||
"transport": {
|
||||
"baseUrl": "https://generativelanguage.googleapis.com/v1beta/models",
|
||||
"format": "gemini",
|
||||
"clientId": "681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",
|
||||
"clientSecret": "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"
|
||||
...GOOGLE_OAUTH_CLIENT
|
||||
},
|
||||
"models": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user