From c65407ab9f58e255484e95e15d214af8eb582805 Mon Sep 17 00:00:00 2001 From: hkfires <10558748+hkfires@users.noreply.github.com> Date: Fri, 23 Jan 2026 21:35:43 +0800 Subject: [PATCH] refactor(auth): extract Antigravity OAuth constants to internal/auth --- internal/auth/antigravity/constants.go | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 internal/auth/antigravity/constants.go diff --git a/internal/auth/antigravity/constants.go b/internal/auth/antigravity/constants.go new file mode 100644 index 00000000..680c8e3c --- /dev/null +++ b/internal/auth/antigravity/constants.go @@ -0,0 +1,34 @@ +// Package antigravity provides OAuth2 authentication functionality for the Antigravity provider. +package antigravity + +// OAuth client credentials and configuration +const ( + ClientID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com" + ClientSecret = "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" + CallbackPort = 51121 +) + +// Scopes defines the OAuth scopes required for Antigravity authentication +var Scopes = []string{ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email", + "https://www.googleapis.com/auth/userinfo.profile", + "https://www.googleapis.com/auth/cclog", + "https://www.googleapis.com/auth/experimentsandconfigs", +} + +// OAuth2 endpoints for Google authentication +const ( + TokenEndpoint = "https://oauth2.googleapis.com/token" + AuthEndpoint = "https://accounts.google.com/o/oauth2/v2/auth" + UserInfoEndpoint = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json" +) + +// Antigravity API configuration +const ( + APIEndpoint = "https://cloudcode-pa.googleapis.com" + APIVersion = "v1internal" + APIUserAgent = "google-api-nodejs-client/9.15.1" + APIClient = "google-cloud-sdk vscode_cloudshelleditor/0.1" + ClientMetadata = `{"ideType":"IDE_UNSPECIFIED","platform":"PLATFORM_UNSPECIFIED","pluginType":"GEMINI"}` +)