Repository navigation
agents(pr-queue): allow authenticated proxy hosts and show cache dates - #4554
Merged
Merged
Conversation
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`.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remote IDE gateways inject
X-Sidecar-Tokenwhile forwarding externalHostandOriginheaders unchanged to loopback. Becausepr-queuerejected 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
Hostheaders and matchinghttp/httpsOriginendpoints inpr-queuewhenX-Sidecar-Tokenmatches (documented in
.agents/rules/python.md), while preservingloopback DNS-rebinding guards for unauthenticated requests. Format
toolbar fetch and cache labels with the calendar date alongside the
local time.