Skip to content

test(verify): send the cookie transport header and cover the request guards - #345

Merged
Bccorb merged 2 commits into
mainfrom
test/conformance-transport-header
Nov 3, 2026
Merged

Bccorb merged 2 commits into
mainfrom
test/conformance-transport-header

Conversation

@Bccorb

@Bccorb Bccorb commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

The adapter conformance suite sends x-seamless-auth-transport: cookie on cookie transport requests, as @seamless-auth/client now does (fells-code/seamless-auth-js PR alongside this one), and gains cases for the request guards from the v0.21 security review (fells-code/seamless-auth-api#558).

Changes

  • newAdapterActor sends the header on every request. Bearer specs override it per request. All four adapters treat only bearer as bearer, so cookie changes nothing for adapters that have not shipped the gate.
  • New verify/harness/adapter/requestGuards.spec.ts:
    • A signed-in cross-site POST /auth/recovery-codes and DELETE /auth/logout answer 403 cross_site_request_blocked, and the session survives. Already true on every adapter's main, so this case is not gated.
    • A body-less form-encoded POST /auth/recovery-codes without the header answers 415 unsupported_media_type, and the same request with the header then answers 201.
  • The 415 case is a pending contract (verify/harness/lib/pendingContracts.ts). It runs only when SEAMLESS_VERIFY_CONTRACTS names content-type-gate (or all). Each adapter sets that in its conformance job once it releases the gate, and the entry is removed once all four have. This matters because the Go, Python and Rust jobs check out this repo's default branch unpinned.
  • The conformance grid no longer shows a skipped case as a failure.
  • Known gap: the reference app contract fixes cookies at SameSite=None, so the suite cannot exercise Lax or Strict. CONFORMANCE.md says so; each adapter's unit tests cover those.

Checks

Harness tsc --noEmit clean, build passes, vitest 1718 passed, 4 skipped. The 415 case was confirmed to skip by default and to run with the variable set. The full seamless verify run against the Docker stack was not done locally; CI runs it.

…guards

The adapter actor now sends x-seamless-auth-transport: cookie, as the
official client does, so body-less unsafe requests pass the content-type
gate adapters add in v0.23. New request guard cases assert that a
cross-site unsafe request answers 403 and leaves the session alone, and
that a body-less form POST to /auth/recovery-codes without the header
answers 415.

The 415 case is a pending contract: it skips unless
SEAMLESS_VERIFY_CONTRACTS names it, because the Go, Python and Rust
adapters run these specs from main unpinned. The matrix reporter no
longer counts a skipped case as a failure.

Refs fells-code/seamless-auth-api#558
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