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

Method ActiveToken

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

ActiveToken retrieves the active credential for the given hostname, searching environment variables, general configuration, and finally encrypted storage. It returns the last stored token as-is, including the current access token of a refreshable credential, and never contacts the token endpoint to

(hostname string)

Source from the content-addressed store, hash-verified

239 // access token of a refreshable credential, and never contacts the token endpoint to refresh it. A caller that
240 // needs a token valid for API calls should use ActiveTokenWithRefresh instead.
241 ActiveToken(hostname string) Credential
242
243 // ActiveTokenType reports what kind of credential the active token for the
244 // hostname is, so a caller can decide whether it will do without handling

Implementers 1

AuthConfiginternal/config/config.go

Calls

no outgoing calls