Skip to content

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

Draft
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
Draft

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 (UTC)
frontier Ready Ready Preview Aug 31, 2026 7:12pm

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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 33429109833

Coverage remained the same at 50.11%

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: 41058
Covered Lines: 20574
Line Coverage: 50.11%
Coverage Strength: 15.97 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 cde08a6 to 58c08a5 Compare August 31, 2026 19:10
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.

2 participants