Repository navigation
Centralize workflow repository visibility and sink overrides - #16059
Conversation
Co-authored-by: lpcox <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The logging changes remove a required missing-repository message, breaking an integration test, and bypass delegation redaction, exposing repository names in stderr and file logs.
2 open issues
What changed in this PR
Centralizes workflow repository visibility lookup and sink-visibility enforcement in MCP Gateway, reducing duplicated logic across server and proxy paths.
Changes:
- Adds shared helpers for repository/token lookup and public-only sink overrides.
- Caches repository identity alongside visibility while retaining caller-owned lookup policies.
- Adds coverage for omitted visibility, token precedence, override rules, and shared caching.
| File | Description |
|---|---|
internal/server/unified.go |
Stores repository identity, visibility, and lookup errors together. |
internal/server/sink_visibility_test.go |
Verifies omitted sink visibility skips the lookup. |
internal/server/guard_visibility.go |
Uses shared lookup and override helpers with server-side caching. |
internal/server/force_public_repos_test.go |
Covers shared caching for successful and failed lookups. |
internal/githubhttp/visibility.go |
Defines shared workflow lookup and sink-visibility decisions. |
internal/githubhttp/visibility_test.go |
Tests normalization, overrides, lookup skips, and token fallback. |
internal/cmd/proxy.go |
Uses the shared workflow repository lookup. |
internal/cmd/proxy_force_public_repos_test.go |
Verifies explicit token and API endpoint precedence. |
Review effort: Max (auto)
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
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 write leaked on any surface. Part A/C reads confirm the gateway allows reads correctly. Part B could not confirm gateway-level write enforcement because the write tools were never exposed in the catalog (backend/toolset config via gh-aw's
|

Sink-visibility enforcement duplicated a security-critical override rule, while server and proxy paths repeated workflow repository and token lookups.
githubhttp.FetchWorkflowRepoVisibilityfor repository/token resolution; retain caller-owned API endpoints, timeouts, caching, and fallback policy.EffectiveSinkVisibilityfor normalization and public-only overrides. Never relax an explicitly public sink.