auth

package
v0.0.0-...-6fecb69 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteToken

func DeleteToken() error

DeleteToken removes the OAuth token from the keychain

func GetToken

func GetToken() (*oauth2.Token, error)

GetToken retrieves the OAuth token from the OS keychain

func GetValidToken

func GetValidToken(clientSecretPath string) (*oauth2.Token, error)

GetValidToken returns a valid token, refreshing if necessary

func HasToken

func HasToken() bool

HasToken checks if a token exists in the keychain

func LoadClientConfig

func LoadClientConfig(clientSecretPath string) (*oauth2.Config, error)

LoadClientConfig loads OAuth2 config from client_secret.json

func LoginFlow

func LoginFlow(clientSecretPath string) (*oauth2.Token, error)

LoginFlow performs the OAuth2 login flow with browser-based consent

func RefreshToken

func RefreshToken(clientSecretPath string, token *oauth2.Token) (*oauth2.Token, error)

RefreshToken refreshes an expired token

func SetToken

func SetToken(token *oauth2.Token) error

SetToken stores the OAuth token in the OS keychain

Types

type TokenInfo

type TokenInfo struct {
	HasToken  bool
	Expiry    time.Time
	IsExpired bool
	TokenType string
}

TokenInfo returns basic info about the stored token

func GetTokenInfo

func GetTokenInfo() (*TokenInfo, error)

GetTokenInfo returns information about the stored token

Jump to

Keyboard shortcuts

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