Documentation
¶
Overview ¶
Package auth stores and resolves YouTrack tokens.
Tokens live in the OS keyring under service "ytrack:<host key>". When no keyring is usable, storing fails unless the caller opts into insecure storage, which writes credentials.yml (mode 0600) in the config directory. Nothing silently downgrades from the keyring to the file.
Index ¶
Constants ¶
const ( SourceEnv = "YTRACK_TOKEN" SourceKeyring = config.StorageKeyring SourceFile = config.StorageFile )
Token sources, as reported by Resolve.
Variables ¶
var ErrNoKeyring = errors.New("no usable OS keyring")
ErrNoKeyring means the OS keyring could not store the token.
Functions ¶
func KeyringService ¶
KeyringService returns the keyring service name for a host key.
Types ¶
type Store ¶
type Store struct {
// Dir is the config directory holding the insecure credentials file.
Dir string
}
Store reads and writes tokens for hosts.
func (Store) Delete ¶
Delete removes hostKey's token from the keyring and the credentials file. A keyring failure is reported only when the file held no copy, since a host saved with --insecure-storage may have no usable keyring at all.