Documentation
¶
Overview ¶
Package keyring provides secure credential storage using the OS keychain. It falls back to file-based storage when the keychain is unavailable (e.g., in CI environments).
Index ¶
- func MockForTesting()
- func ResetForTesting()
- type Keyring
- func (k *Keyring) Delete(org string) error
- func (k *Keyring) DeleteRefreshToken(org string) error
- func (k *Keyring) Get(org string) (string, error)
- func (k *Keyring) GetRefreshToken(org string) (string, error)
- func (k *Keyring) IsAvailable() bool
- func (k *Keyring) Set(org, token string) error
- func (k *Keyring) SetRefreshToken(org, token string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockForTesting ¶
func MockForTesting()
MockForTesting replaces the keyring backend with an in-memory store and marks it as available so subsequent New() calls use the mock.
func ResetForTesting ¶ added in v3.35.0
func ResetForTesting()
ResetForTesting resets the availability cache so that the next call to New() re-evaluates the environment. Intended for use in tests only.
Types ¶
type Keyring ¶
type Keyring struct {
// contains filtered or unexported fields
}
Keyring provides secure credential storage with fallback support
func New ¶
func New() *Keyring
New creates a new Keyring instance. It automatically detects if the system keyring is available.
func (*Keyring) DeleteRefreshToken ¶ added in v3.42.0
DeleteRefreshToken removes a refresh token for the given organization
func (*Keyring) GetRefreshToken ¶ added in v3.42.0
GetRefreshToken retrieves a refresh token for the given organization
func (*Keyring) IsAvailable ¶
IsAvailable returns true if the system keyring is available
func (*Keyring) SetRefreshToken ¶ added in v3.42.0
SetRefreshToken stores a refresh token for the given organization