Documentation
¶
Overview ¶
Package antigravity provides OAuth2 authentication functionality for the Antigravity provider.
Package antigravity provides OAuth2 authentication functionality for the Antigravity provider.
Index ¶
- Constants
- func BuildMetadata(tokenResp *TokenResponse, email, projectID string) map[string]any
- func CredentialFileName(email string) string
- type Auth
- func (o *Auth) BuildAuthURL(state, redirectURI string) string
- func (o *Auth) ExchangeCodeForTokens(ctx context.Context, code, redirectURI string) (*TokenResponse, error)
- func (o *Auth) FetchProjectID(ctx context.Context, accessToken string) (string, error)
- func (o *Auth) FetchUserInfo(ctx context.Context, accessToken string) (string, error)
- type TokenResponse
Constants ¶
const ( ClientID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com" ClientSecret = "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" CallbackPort = 51121 )
OAuth client credentials and configuration
const (
TokenEndpoint = "https://oauth2.googleapis.com/token"
)
OAuth2 endpoints for Google authentication
Variables ¶
This section is empty.
Functions ¶
func BuildMetadata ¶
func BuildMetadata(tokenResp *TokenResponse, email, projectID string) map[string]any
BuildMetadata constructs the standard metadata map for an antigravity token response.
func CredentialFileName ¶
CredentialFileName returns the filename used to persist Antigravity credentials. It uses the email as a suffix to disambiguate accounts.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth handles Antigravity OAuth authentication
func (*Auth) BuildAuthURL ¶
BuildAuthURL generates the OAuth authorization URL.
func (*Auth) ExchangeCodeForTokens ¶
func (o *Auth) ExchangeCodeForTokens(ctx context.Context, code, redirectURI string) (*TokenResponse, error)
ExchangeCodeForTokens exchanges authorization code for access and refresh tokens
func (*Auth) FetchProjectID ¶
FetchProjectID retrieves the project ID for the authenticated user via loadCodeAssist