MCPcopy Index your code
hub / github.com/coder/coder / convertMCPServerConfigRedacted

Function convertMCPServerConfigRedacted

coderd/mcp.go:1288–1298  ·  view source on GitHub ↗

convertMCPServerConfigRedacted is the same as convertMCPServerConfig but strips admin-only fields (OAuth2 details, API key header) for non-admin callers.

(config database.MCPServerConfig)

Source from the content-addressed store, hash-verified

1286// but strips admin-only fields (OAuth2 details, API key header) for
1287// non-admin callers.
1288func 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.

Callers 2

listMCPServerConfigsMethod · 0.85
getMCPServerConfigMethod · 0.85

Calls 1

convertMCPServerConfigFunction · 0.85

Tested by

no test coverage detected