(w io.Writer, entries []mcp.OAuthTokenEntry)
| 81 | } |
| 82 | |
| 83 | func 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 | |
| 101 | func printOAuthListText(w io.Writer, entries []mcp.OAuthTokenEntry) { |
| 102 | for i, e := range entries { |
no test coverage detected