MCPcopy Index your code
hub / github.com/docker/docker-agent / printOAuthListJSON

Function printOAuthListJSON

cmd/root/debug_oauth.go:83–99  ·  view source on GitHub ↗
(w io.Writer, entries []mcp.OAuthTokenEntry)

Source from the content-addressed store, hash-verified

81}
82
83func printOAuthListJSON(w io.Writer, entries []mcp.OAuthTokenEntry) error {
84 var out []oauthListEntry
85 for _, e := range entries {
86 out = append(out, oauthListEntry{
87 ResourceURL: e.ResourceURL,
88 TokenType: e.Token.TokenType,
89 Scope: e.Token.Scope,
90 ExpiresAt: e.Token.ExpiresAt,
91 Expired: e.Token.IsExpired(),
92 AccessToken: truncateToken(e.Token.AccessToken),
93 RefreshToken: e.Token.RefreshToken != "",
94 })
95 }
96 enc := json.NewEncoder(w)
97 enc.SetIndent("", " ")
98 return enc.Encode(out) //nolint:gosec // debug command intentionally surfaces (truncated) access tokens
99}
100
101func printOAuthListText(w io.Writer, entries []mcp.OAuthTokenEntry) {
102 for i, e := range entries {

Callers 1

newDebugOAuthListCmdFunction · 0.85

Calls 2

truncateTokenFunction · 0.85
IsExpiredMethod · 0.80

Tested by

no test coverage detected