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

Method ActiveToken

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

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

Implementers 1

AuthConfiginternal/config/config.go

Calls

no outgoing calls