Skip to content

agents(pr-queue): allow authenticated proxy hosts and show cache dates - #4554

Merged
rickeylev merged 2 commits into
bazel-contrib:mainfrom
rickeylev:fix-pr-queue-proxy-host
Nov 21, 2026
Merged

rickeylev merged 2 commits into
bazel-contrib:mainfrom
rickeylev:fix-pr-queue-proxy-host

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Remote IDE gateways inject X-Sidecar-Token while forwarding external
Host and Origin headers unchanged to loopback. Because pr-queue
rejected non-loopback authorities and omitted dates from toolbar status
labels, proxied panels failed with HTTP 403 and multi-day caches hid
their fetch date.

Accept strict visible-ASCII non-loopback Host headers and matching
http/https Origin endpoints in pr-queue when X-Sidecar-Token
matches (documented in .agents/rules/python.md), while preserving
loopback DNS-rebinding guards for unauthenticated requests. Format
toolbar fetch and cache labels with the calendar date alongside the
local time.

Remote IDE gateways authenticate browser requests, inject
`X-Sidecar-Token`, and forward the external `Host` and `Origin` headers
unchanged to loopback. Because `pr-queue` restricted `Host` and `Origin`
to loopback names and omitted dates on cache labels, proxied panels
failed with HTTP 403 and multi-day offline caches hid their fetch date.

Accept syntactically valid non-loopback `Host` headers and matching
`http`/`https` `Origin` endpoints only when a configured
`X-Sidecar-Token` matches, preserving loopback-only DNS-rebinding guards
for unauthenticated requests. Format toolbar fetch and cache timestamps
with the calendar date alongside the local time.
Compare `X-Sidecar-Token` values as UTF-8 bytes so non-ASCII headers
fail closed with HTTP 403 instead of raising `TypeError`. Restrict
`Host` and `Origin` authorities to visible ASCII DNS labels or bracketed
IPv6 literals without zone IDs, paths, or trailing empty ports, and
require both `Host` and `Origin` to belong to allowed hosts before
applying the loopback shortcut. Document the token-gated reverse-proxy
exception in `.agents/rules/python.md`.
@rickeylev

Copy link
Copy Markdown
Collaborator Author

This pull request was prepared with AI assistance. Review comments will be handled with human oversight: the human author reviews and approves code changes and any agent-drafted replies before posting, and handles maintainer feedback and merge decisions directly.

This is an agent-generated comment unreviewed by the user.

@rickeylev
rickeylev merged commit 99eac4b into bazel-contrib:main Nov 21, 2026
12 of 14 checks passed
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.

1 participant