MCPcopy
hub / github.com/cli/cli / TokenFromKeyring

Method TokenFromKeyring

internal/config/config.go:299–301  ·  view source on GitHub ↗

TokenFromKeyring will retrieve the auth token for the given hostname, only searching in encrypted storage.

(hostname string)

Source from the content-addressed store, hash-verified

297// TokenFromKeyring will retrieve the auth token for the given hostname,
298// only searching in encrypted storage.
299func (c *AuthConfig) TokenFromKeyring(hostname string) (string, error) {
300 return keyring.Get(keyringServiceName(hostname), "")
301}
302
303// TokenFromKeyringForUser will retrieve the auth token for the given hostname
304// and username, only searching in encrypted storage.

Callers 1

ActiveTokenMethod · 0.95

Calls 2

GetFunction · 0.92
keyringServiceNameFunction · 0.70

Tested by

no test coverage detected