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

Function resolveUsername

pkg/cmd/auth/token/token.go:171–177  ·  view source on GitHub ↗
(authCfg gh.AuthConfig, hostname, username string)

Source from the content-addressed store, hash-verified

169}
170
171func resolveUsername(authCfg gh.AuthConfig, hostname, username string) string {
172 if username != "" {
173 return username
174 }
175 user, _ := authCfg.ActiveUser(hostname)
176 return user
177}
178
179// getTokenReadOnly resolves the stored active token for the hostname and optional username without contacting the
180// token endpoint. It still surfaces a refreshable credential's stored access token, so an expiring token is

Callers 1

tokenRunFunction · 0.85

Calls 1

ActiveUserMethod · 0.65

Tested by

no test coverage detected