Documentation
¶
Overview ¶
Package credstore stores account secrets in the OS keyring (macOS Keychain, Windows Credential Manager, Secret Service on Linux), with an explicit opt-in plain-file fallback for headless environments.
Index ¶
Constants ¶
const Service = "reearth-cli"
Service is the keyring service name.
Variables ¶
var ErrNotFound = errors.New("credentials not found")
Functions ¶
func CheckKeyring ¶
func CheckKeyring() error
CheckKeyring verifies that the OS keyring is usable by writing and deleting a probe entry.
func DefaultFilePath ¶
DefaultFilePath is where the insecure fallback store lives.
Types ¶
type AccessToken ¶
AccessToken is a cached access token for one audience.
type Secret ¶
type Secret struct {
Kind string `json:"kind"`
RefreshToken string `json:"refresh_token,omitempty"`
Token string `json:"token,omitempty"`
AccessTokens map[string]AccessToken `json:"access_tokens,omitempty"`
}
Secret is everything sensitive about an account. Only RefreshToken (oauth) or Token (token accounts) is essential; AccessTokens is a best-effort cache.