test(oauth): pin the entry scheme in loopback matching #10
No reviewers
Labels
No labels
waiting-on-julian
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jlxq0/jmap-mcp!10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "test/loopback-guard-coverage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #9, prompted by two findings from the m365-mcp worker. Both were
already implemented here —
candidate.scheme() == "http"and the querycomparison are in the merged matcher — so instead I removed each of the six
terms of
loopback_redirect_matchesin turn and recorded which test died.Before
httphttploopback_allowlist_varies_only_the_portloopback_allowlist_varies_only_the_portloopback_allowlist_varies_only_the_portloopback_allowlist_varies_only_the_portGuard 1 was load-bearing and untested. The port carve-out has to key off the
allowlist entry's scheme, not just the request's. Without it, an operator who
allowlists
https://localhost:8443/cbhas it satisfied byhttp://localhost:3118/cb— verified,false→trueon removal. That is theauthorization code on the wire in cleartext. No test allowlisted an https
loopback entry, so nothing caught it.
Guard 3 is unreachable, not untested.
validate_redirect_urialready refusesan
httpentry on a non-loopback host, so while guard 1 stands, guard 3 can neverbe the deciding term. No mutation can turn it red. It stays as the second lock and
now carries a comment saying why, so the next reader does not delete it as dead.
After
httploopback_https_entry_is_not_downgraded_to_cleartexthttploopback_allowlist_varies_only_the_portloopback_allowlist_varies_only_the_portloopback_allowlist_varies_only_the_portloopback_allowlist_varies_only_the_portAGENTS.md
Records the URL-normalisation behaviour a hand-written host check runs into,
measured rather than reasoned about:
127.1and0177.0.0.1canonicalise to127.0.0.1and/x/../cbto/cb, so they match;[::ffff:127.0.0.1]and/%63bdo not.Gates
cargo fmt --all --checkclean,cargo clippy --all-targets --all-features --locked -- -D warningsclean,cargo test --all-features --locked→ 165 passed,0 failed.
Tests and docs only; no behaviour change, so no release tag. Production stays on
v0.2.14.
Refs #8