convertMCPServerConfigRedacted is the same as convertMCPServerConfig but strips admin-only fields (OAuth2 details, API key header) for non-admin callers.
(config database.MCPServerConfig)
| 1286 | // but strips admin-only fields (OAuth2 details, API key header) for |
| 1287 | // non-admin callers. |
| 1288 | func convertMCPServerConfigRedacted(config database.MCPServerConfig) codersdk.MCPServerConfig { |
| 1289 | c := convertMCPServerConfig(config) |
| 1290 | c.URL = "" |
| 1291 | c.Transport = "" |
| 1292 | c.OAuth2ClientID = "" |
| 1293 | c.OAuth2AuthURL = "" |
| 1294 | c.OAuth2TokenURL = "" |
| 1295 | c.OAuth2Scopes = "" |
| 1296 | c.APIKeyHeader = "" |
| 1297 | return c |
| 1298 | } |
| 1299 | |
| 1300 | // marshalCustomHeaders encodes a map of custom headers to JSON for |
| 1301 | // database storage. A nil map produces an empty JSON object. |
no test coverage detected