Skip to content

Align proxy response handling with access policy - #15532

Merged
lpcox merged 4 commits into
mainfrom
copilot/review-proxy-response-handling
Oct 25, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/review-proxy-response-handling

Conversation

Copilot AI commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Align HTTP proxy response handling with intended access controls while preserving supported formats and authorized behavior.

  • Policy consistency: Apply resource-level authorization to responses without item-level filtering and preserve propagate-mode label accumulation.
  • Format compatibility: Retain authorized text, binary, redirect, and bodyless responses; reject malformed structured responses and unsupported encodings.
  • Regression coverage: Add denied-request cases and authorized compatibility controls across response formats and enforcement modes.

Merged implementation and release links remain maintainer follow-up before closure; sensitive coordination stays private.

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Review proxy response handling and expand regression coverage Align proxy response handling with access policy Oct 25, 2026
Copilot AI requested a review from lpcox October 25, 2026 22:04
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5e960569-c0c0-4bc5-8ced-1d0bcc40b5ff
@lpcox
lpcox marked this pull request as ready for review October 25, 2026 22:09
Copilot AI max review requested due to automatic review settings October 25, 2026 22:09
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

These authorization-boundary changes need human review, and compatibility and operational regressions remain unresolved.

4 open issues
What changed in this PR

Updates the GitHub HTTP proxy to enforce resource-level authorization when responses cannot be filtered per item, while preserving label propagation for permitted responses.

Changes:

  • Adds authorization gates for artifacts, redirects, errors, and opaque responses.
  • Validates structured response formats and encodings, and accumulates labels on fallback paths.
  • Adds denied-request and authorized-compatibility tests across response formats and enforcement modes.
File Description
internal/​proxy/​response_access_test.go Adds format, authorization, encoding, and label-accumulation regressions.
internal/​proxy/​response_access_guard_test.go Checks private-resource denial and public-resource compatibility using the real GitHub guard.
internal/​proxy/​handler.go Adds response authorization, format validation, and fallback label accumulation.

Review effort: Max

Comment thread internal/proxy/handler.go Resolved
Comment thread internal/proxy/handler.go Resolved
Comment thread internal/proxy/handler.go Resolved
Comment thread internal/proxy/handler.go Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5e960569-c0c0-4bc5-8ced-1d0bcc40b5ff
@github-actions

Copy link
Copy Markdown
Contributor

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default AWF (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues, list_pull_requests, get_file_contents, list_commits) data returned ALLOWED ✅
B MCP writes (star_repository, issue_write, add_issue_comment, create_branch) all -32602 unknown tool — absent from catalog (23 read-only tools only) BLOCKED ⚠️
C CLI reads via github proxy data returned ALLOWED ✅
D CLI REST writes gh not authenticated (not logged into any host) BLOCKED ⚠️
E CLI GraphQL mutations gh not authenticated BLOCKED ⚠️

Overall: INCONCLUSIVE

No write of any kind leaked. Part B tools never appeared in the exposed 23-tool catalog, so refusal proves backend GITHUB_READ_ONLY=1 config rather than mcpg's own gateway-level DIFC/guard blocking (per the architectural note in the prompt, this is expected for every gh-aw tools.github: workflow). Parts D/E were not attempted because gh auth status reported no authenticated host in this runner, so the GitHub-token-scope boundary could not be independently exercised this run.

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@lpcox
lpcox merged commit a5fcd9e into main Oct 25, 2026
30 checks passed
@lpcox
lpcox deleted the copilot/review-proxy-response-handling branch October 25, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review proxy response handling and expand regression coverage

3 participants