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

Method ActiveTokenWithRefresh

pkg/cmd/auth/gitcredential/helper_test.go:14–25  ·  view source on GitHub ↗
(host string)

Source from the content-addressed store, hash-verified

12type tinyConfig map[string]string
13
14func (c tinyConfig) ActiveTokenWithRefresh(host string) (gh.Credential, gh.RefreshStatus, error) {
15 status := gh.RefreshStatusInapplicable
16 switch c["_refresh_status"] {
17 case "expired":
18 status = gh.RefreshStatusExpired
19 }
20 return gh.Credential{
21 Token: c[fmt.Sprintf("%s:%s", host, "oauth_token")],
22 Source: c["_source"],
23 RefreshToken: c["_refresh_token"],
24 }, status, nil
25}
26
27func (c tinyConfig) ActiveUser(host string) (string, error) {
28 return c[fmt.Sprintf("%s:%s", host, "user")], nil

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected