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

Function maskToken

pkg/cmd/auth/status/status.go:338–345  ·  view source on GitHub ↗
(token string)

Source from the content-addressed store, hash-verified

336var knownTokenPrefixes = []string{"github_pat_", "ghp_", "gho_", "ghu_", "ghs_", "ghr_"}
337
338func maskToken(token string) string {
339 for _, prefix := range knownTokenPrefixes {
340 if strings.HasPrefix(token, prefix) {
341 return prefix + strings.Repeat("*", len(token)-len(prefix))
342 }
343 }
344 return strings.Repeat("*", len(token))
345}
346
347func displayScopes(scopes string) string {
348 if scopes == "" {

Callers 2

statusRunFunction · 0.85
TestMaskTokenFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestMaskTokenFunction · 0.68