Repository navigation
Unify force-public-repos gating across gateway and proxy - #17149
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Critical logging regressions suppress skipped-check diagnostics when DEBUG is unset and omit lookup-failure causes, breaking existing integration log assertions.
1 open issue
What changed in this PR
Centralizes the public-repository policy gate used by the MCP gateway and standalone proxy, addressing #17142 and making their opt-out behavior consistent.
Changes:
- Adds a shared gate where any config, environment, or CLI opt-out disables forcing.
- Adds proxy
--config/-csupport through the validated gateway TOML loader. - Expands tests and documentation while preserving gateway-lifetime visibility caching and existing policy overrides.
| File | Description |
|---|---|
internal/server/guard_visibility.go |
Uses the shared gate while retaining visibility caching. |
internal/server/force_public_repos_test.go |
Verifies opt-outs skip visibility lookups. |
internal/config/guard_policy_public.go |
Defines the shared force-public-repos decision. |
internal/config/guard_policy_public_test.go |
Covers opt-out precedence, visibility results, and lookup failures. |
internal/cmd/proxy.go |
Loads optional TOML config and uses the shared gate. |
internal/cmd/proxy_force_public_repos_test.go |
Tests proxy opt-outs and config loading; updates existing cases. |
docs/PROXY_MODE.md |
Documents the config flag, opt-out precedence, and lookup lifetime. |
Review effort: Max (adaptive)
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Fixed the testifylint failure by comparing the policy JSON with |
This comment has been minimized.
This comment has been minimized.
Updated logging statements to use logger.LogInfo and logger.LogWarn for better error handling. Co-authored-by: Copilot Autofix powered by AI <[email protected]>
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes leaked. No artifacts created/modified.
|

The gateway and CLI proxy duplicated the force-public-repos decision, with divergent failure reporting. The proxy also ignored the gateway’s config-file opt-out.
config.ShouldForcePublicRepos. Config, environment, or CLIfalsedisables forcing—even when another source explicitly enables it.--configsupport using the validated gateway TOML loader; consume onlygateway.force_public_repos.