antigravity

package
v0.411.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GoogleClientID = "407408718192.apps.googleusercontent.com"
)

Variables

View Source
var (
	GoogleAuthorizeURL     = "https://accounts.google.com/o/oauth2/v2/auth"
	GoogleTokenURL         = "https://oauth2.googleapis.com/token"
	GoogleUserInfoURL      = "https://openidconnect.googleapis.com/v1/userinfo"
	AntigravityProjectsURL = "https://antigravity.ai/api/v1/projects"
)
View Source
var DefaultScopes = []string{"openid", "email", "profile", "https://www.googleapis.com/auth/cloud-platform.read-only"}

Functions

func CodeChallenge

func CodeChallenge(verifier string) string

func ResolveProjectID

func ResolveProjectID(client *http.Client, accessToken string) (string, error)

Types

type Project

type Project struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
}

type Session

type Session struct {
	State        string `json:"state"`
	CodeVerifier string `json:"codeVerifier"`
	RedirectURI  string `json:"redirectUri"`
}

func NewSession

func NewSession(redirectURI string) (*Session, error)

func (Session) AuthURL

func (s Session) AuthURL() (string, error)

func (Session) ValidateCallback

func (s Session) ValidateCallback(state string) error

type Token

type Token struct {
	AccessToken  string   `json:"accessToken"`
	RefreshToken string   `json:"refreshToken,omitempty"`
	TokenType    string   `json:"tokenType,omitempty"`
	Expiry       int64    `json:"expiry,omitempty"`
	Scopes       []string `json:"scopes,omitempty"`
	IDToken      string   `json:"idToken,omitempty"`
}

func ExchangeCode

func ExchangeCode(client *http.Client, code, verifier, redirectURI string) (*Token, error)

func RefreshToken

func RefreshToken(client *http.Client, refreshToken string) (*Token, error)

type UserInfo

type UserInfo struct {
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
	Name          string `json:"name"`
	Picture       string `json:"picture"`
	Subject       string `json:"sub"`
}

func FetchUserInfo

func FetchUserInfo(client *http.Client, accessToken string) (*UserInfo, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL