Versions in this module Expand all Collapse all v1 v1.0.0 Sep 16, 2026 Changes in this version + func BuildAuthorizeURL(cfg OAuthProviderConfig, pkce PKCECodes, state, redirectURI string) string + func DeleteAllCredentials() error + func DeleteCredential(provider string) error + func GenerateState() (string, error) + func OpenBrowser(url string) error + func SaveStore(store *AuthStore) error + func SetCredential(provider string, cred *AuthCredential) error + type AnthropicUsage struct + FiveHourUtilization float64 + SevenDayUtilization float64 + func FetchAnthropicUsage(token string) (*AnthropicUsage, error) + type AuthCredential struct + AccessToken string + AccountID string + AuthMethod string + Email string + ExpiresAt time.Time + ProjectID string + Provider string + RefreshToken string + func ExchangeCodeForTokens(cfg OAuthProviderConfig, code, codeVerifier, redirectURI string) (*AuthCredential, error) + func GetCredential(provider string) (*AuthCredential, error) + func LoginBrowser(cfg OAuthProviderConfig) (*AuthCredential, error) + func LoginBrowserWithOptions(cfg OAuthProviderConfig, opts LoginBrowserOptions) (*AuthCredential, error) + func LoginDeviceCode(cfg OAuthProviderConfig) (*AuthCredential, error) + func LoginPasteToken(provider string, r io.Reader) (*AuthCredential, error) + func LoginSetupToken(r io.Reader) (*AuthCredential, error) + func PollDeviceCodeOnce(cfg OAuthProviderConfig, deviceAuthID, userCode string) (*AuthCredential, error) + func RefreshAccessToken(cred *AuthCredential, cfg OAuthProviderConfig) (*AuthCredential, error) + func (c *AuthCredential) IsExpired() bool + func (c *AuthCredential) NeedsRefresh() bool + type AuthStore struct + Credentials map[string]*AuthCredential + func LoadStore() (*AuthStore, error) + type DeviceCodeInfo struct + DeviceAuthID string + Interval int + UserCode string + VerifyURL string + func RequestDeviceCode(cfg OAuthProviderConfig) (*DeviceCodeInfo, error) + type LoginBrowserOptions struct + NoBrowser bool + type OAuthProviderConfig struct + ClientID string + ClientSecret string + Issuer string + Originator string + Port int + Scopes string + TokenURL string + func GoogleAntigravityOAuthConfig() OAuthProviderConfig + func OpenAIOAuthConfig() OAuthProviderConfig + type PKCECodes struct + CodeChallenge string + CodeVerifier string + func GeneratePKCE() (PKCECodes, error)