Skip to content

test(e2e): cover intent and consent across every auth strategy - #1916

Open
rohanchkrabrty wants to merge 1 commit into
feature/featauthenticate-map-the-gate-and-consent-errors-on-bothfrom
feature/teste2e-cover-intent-and-consent-across-every-auth-strategy
Open

test(e2e): cover intent and consent across every auth strategy#1916
rohanchkrabrty wants to merge 1 commit into
feature/featauthenticate-map-the-gate-and-consent-errors-on-bothfrom
feature/teste2e-cover-intent-and-consent-across-every-auth-strategy

Conversation

@rohanchkrabrty

@rohanchkrabrty rohanchkrabrty commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The cross-cutting matrix for RFC 0002 through a real server: three intents against an address that does and does not have an account, at both enforcement points, one case per strategy, and the complete, incomplete and unknown-id consent sets. Every unit test in the stack holds with the rest of it mocked out; none of them answers whether a signup that goes out to a provider and comes back leaves a user row and a consent record that say the right things.
  • Two suites, because app.consent is read at boot and cannot be changed on a running server. The enabled one drives mail OTP through test users, OIDC through mockoidc and passkey up to the ceremony; the disabled one is the promise the RFC makes to every existing deployment, that nothing changes.
  • The rollback case injects a failing insert with a temporary trigger, because nothing reachable through the API can produce one — a bad payload is rejected before the transaction opens, and a well-formed write satisfies every constraint. It then drops the trigger and reruns the same signup successfully, so the failure is provably the injected one.
  • The suites read users and user_consents directly, for the two things the API deliberately does not serve: the absence of a user row, and the contents of a consent record.
  • Neither passkey finish method is reachable, and a skipped case says so rather than leaving the hole invisible — the register method puts the gate behind a WebAuthn attestation, and the login method needs an account carrying a credential only that same ceremony writes. Closing it needs a virtual authenticator, which is a new dependency and its own change.

@rohanchkrabrty rohanchkrabrty self-assigned this Aug 31, 2026
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
frontier Ready Ready Preview Sep 2, 2026 7:03pm UTC

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: f48d70d4-b54d-49eb-b34c-c1d1deeafa8d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coveralls

coveralls commented Aug 31, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 33670689282

Coverage remained the same at 50.22%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 41093
Covered Lines: 20637
Line Coverage: 50.22%
Coverage Strength: 15.98 hits per line

💛 - Coveralls

The cross-cutting matrix for RFC 0002 (docs/rfcs/0002-explicit-consent-at-signup.md),
through a real server: the three intents against an address that does and does not
have an account, at both enforcement points, one case per strategy, and the complete,
incomplete and unknown-id consent sets. This is the coverage no single ticket in the
stack owns, because it spans the intent, the consent rules and every strategy at once.

Two suites, because app.consent is read at boot and cannot be changed on a running
server. The enabled one drives mail OTP through test users, OIDC through mockoidc,
and passkey up to the ceremony; the disabled one is the promise the RFC makes to
every existing deployment, that nothing changes.

The rollback case injects a failing insert on user_consents with a trigger, because
nothing in the API can produce one: a bad payload is rejected before the transaction
opens, and a well-formed write satisfies every constraint on the table. The suites
read users and user_consents directly for the two things the API deliberately does
not serve, the absence of a user row and the contents of a consent record.

Neither passkey finish method is reachable, for two different reasons, and a skipped
case says so rather than leaving the hole invisible. The register method validates
the attestation before it reaches the gate, so the gate sits behind a ceremony no
test here can perform. The login method runs the gate first, but reaching it needs
an account carrying a passkey_credentials blob, which only that same ceremony writes.
They are untested at unit level too, since the finish flow unit tests drive mail OTP.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hf1XuPCWcHZ7QY5u4WBB2G
@rohanchkrabrty
rohanchkrabrty force-pushed the feature/teste2e-cover-intent-and-consent-across-every-auth-strategy branch from 161d506 to 9926a2f Compare September 2, 2026 19:00
@rohanchkrabrty
rohanchkrabrty marked this pull request as ready for review September 2, 2026 20:07
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.

3 participants