MCPcopy Index your code
hub / github.com/cli/cli / TokenFromKeyringForUser

Method TokenFromKeyringForUser

internal/gh/gh.go:124–124  ·  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

122 // An empty username will return an error because the potential to return the currently active token under
123 // surprising cases is just too high to risk compared to the utility of having the function being smart.
124 TokenFromKeyringForUser(hostname, username string) (token string, err error)
125
126 // ActiveUser will retrieve the username for the active user at the given hostname.
127 //

Callers 3

tokenRunFunction · 0.65

Implementers 1

AuthConfiginternal/config/config.go

Calls

no outgoing calls