MCPcopy Create free account
hub / github.com/cli/cli / TokenFromKeyringForUser

Method TokenFromKeyringForUser

internal/gh/gh.go:162–162  ·  view source on GitHub ↗

TokenFromKeyringForUser will retrieve the auth token for the given hostname and username, only searching in encrypted storage. An empty username will return an error because the potential to return the currently active token under surprising cases is just too high to risk compared to the utility of

(hostname, username string)

Source from the content-addressed store, hash-verified

160 // An empty username will return an error because the potential to return the currently active token under
161 // surprising cases is just too high to risk compared to the utility of having the function being smart.
162 TokenFromKeyringForUser(hostname, username string) (token string, err error)
163
164 // ActiveUser will retrieve the username for the active user at the given hostname.
165 //

Callers 3

tokenRunFunction · 0.65

Implementers 1

AuthConfiginternal/config/config.go

Calls

no outgoing calls