Skip to content

test(conformance): shared Swift/Rust vectors in CI; align Linux AuthPolicy - #41

Merged
chaodu-agent merged 1 commit into
mainfrom
conformance/vectors-in-ci
Sep 29, 2026
Merged

chaodu-agent merged 1 commit into
mainfrom
conformance/vectors-in-ci

Conversation

@chaodu-agent

Copy link
Copy Markdown
Contributor

Part of #24 (and #32 item 2).

What: conformance/auth_vectors.json (16) and conformance/reverse_attach_vectors.json (23), previously only in scratch folders on rpi1, now in the repo and run by both implementations on every PR:

  • Swift (oracle): new ConformanceVectorTests — passes on macmini.
  • Rust: auth::conformance, attach::conformance via cargo test, newly added to the Linux CI job.

Drift found and fixed. The shipped Linux AuthPolicy did not match the oracle: Bearer scheme case-sensitive (Swift: case-insensitive), different deny reason strings, and a request with X-Forwarded-For could still be treated as local under MCP_INSECURE_LOCAL (Swift: never local if relayed — a small tightening). Rewritten as a pure decide() with Swift's algorithm; check() adapts the request. Deployed nodes (token + allow-login behind tailscale serve) are unaffected.

Mutation check: changing bad token → wrong token and dropping 4010 from the stop set fails both tests with the exact case diffs; restored → green.

Still open on #24: MCP-surface wire fixtures, and the parity checklist for the retire-Swift gate.

…olicy with the oracle

conformance/{auth,reverse_attach}_vectors.json (16 + 23 cases, from the rpi1
suites) now live in the repo and run on both sides: Swift
ConformanceVectorTests (the oracle) and Rust auth::conformance /
attach::conformance; the Linux CI job gains cargo test.

Running them exposed drift in the shipped Linux AuthPolicy: the Bearer scheme
was case-sensitive, deny reasons differed, and a request carrying
X-Forwarded-For could still count as local. Rewritten as a pure decide() with
the Swift algorithm and reason strings; check() adapts a request to it.
Mutation-checked: a changed reason or close code fails with the exact diff.

Refs #24 #32.
@chaodu-agent
chaodu-agent merged commit 3832197 into main Sep 29, 2026
6 checks passed
@chaodu-agent
chaodu-agent deleted the conformance/vectors-in-ci branch September 29, 2026 23:33
jinwei-pikmin added a commit to jinwei-pikmin/instance-mcp that referenced this pull request Sep 30, 2026
auth::conformance and attach::client::conformance read the language-neutral
vectors in conformance/ (Swift is the oracle, openabdev#24/openabdev#41): 16/16 AuthPolicy
cases including exact deny reasons, 23/23 reverse-attach close-code,
handshake-status and attachURL cases pass unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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