Versions in this module Expand all Collapse all v0 v0.1.0 May 23, 2026 Changes in this version + var ErrCredentialsNotFound = errors.New("credentials not found") + var ErrInvalidCredentials = errors.New("invalid credentials") + var ErrRefreshFailed = errors.New("token refresh failed") + var ErrTokenExpired = errors.New("token expired") + var ErrTokenNotFound = errors.New("token not found") + var ErrUnsupportedCredentialType = errors.New("unsupported credential type") + var ErrVaultNotConfigured = errors.New("vault not configured") + func CredentialsDir() (string, error) + type Config struct + AutoRefresh bool + CredentialsPrefix string + Logger *slog.Logger + RefreshBuffer time.Duration + TokensPrefix string + Vault vault.Vault + func DefaultConfig() Config + func (c *Config) Validate() error + type CredentialsStore struct + func NewCredentialsStore(v vault.Vault, prefix string, logger *slog.Logger) *CredentialsStore + func (cs *CredentialsStore) Delete(ctx context.Context, name string) error + func (cs *CredentialsStore) Exists(ctx context.Context, name string) (bool, error) + func (cs *CredentialsStore) Get(ctx context.Context, name string) (*goauth.Credentials, error) + func (cs *CredentialsStore) GetWithTimeout(name string, timeout time.Duration) (*goauth.Credentials, error) + func (cs *CredentialsStore) List(ctx context.Context) ([]string, error) + func (cs *CredentialsStore) LoadCredentialsSet(ctx context.Context) (*goauth.CredentialsSet, error) + func (cs *CredentialsStore) SaveCredentialsSet(ctx context.Context, set *goauth.CredentialsSet) error + func (cs *CredentialsStore) Set(ctx context.Context, name string, creds *goauth.Credentials) error + type TokenManager struct + func New(cfg Config) (*TokenManager, error) + func NewAuto() (*TokenManager, error) + func NewFromCredentials(name string, creds *goauth.Credentials) (*TokenManager, error) + func NewFromCredentialsFile(credentialsFile string) (*TokenManager, error) + func NewFromCredentialsSet(set *goauth.CredentialsSet) (*TokenManager, error) + func NewFromDirectory(directory string) (*TokenManager, error) + func NewFromEnv(prefix string) (*TokenManager, error) + func NewFromVaultURI(uri string) (*TokenManager, error) + func NewWithVault(v vault.Vault) (*TokenManager, error) + func (tm *TokenManager) Close() error + func (tm *TokenManager) CredentialsStore() *CredentialsStore + func (tm *TokenManager) DeleteCredentials(ctx context.Context, name string) error + func (tm *TokenManager) GetClient(ctx context.Context, name string) (*http.Client, error) + func (tm *TokenManager) GetCredentials(ctx context.Context, name string) (*goauth.Credentials, error) + func (tm *TokenManager) GetToken(ctx context.Context, name string) (*oauth2.Token, error) + func (tm *TokenManager) ListCredentials(ctx context.Context) ([]string, error) + func (tm *TokenManager) LoadGoauthCredentials(ctx context.Context, name, credentialsFile, accountKey string) error + func (tm *TokenManager) LoadGoogleServiceAccount(ctx context.Context, name, serviceAccountFile string, scopes []string) error + func (tm *TokenManager) RefreshToken(ctx context.Context, name string) (*oauth2.Token, error) + func (tm *TokenManager) SetCredentials(ctx context.Context, name string, creds *goauth.Credentials) error + func (tm *TokenManager) TokenSet() tokens.TokenSet + type VaultTokenSet struct + func NewVaultTokenSet(v vault.Vault, prefix string, logger *slog.Logger) *VaultTokenSet + func (ts *VaultTokenSet) DeleteToken(key string) error + func (ts *VaultTokenSet) ExistsToken(key string) (bool, error) + func (ts *VaultTokenSet) GetToken(key string) (*oauth2.Token, error) + func (ts *VaultTokenSet) GetTokenInfo(key string) (*tokens.TokenInfo, error) + func (ts *VaultTokenSet) ListTokens() ([]string, error) + func (ts *VaultTokenSet) SetTokenInfo(key string, tokenInfo *tokens.TokenInfo) error