Skip to content

test(verify): step up the owner session before admin writes - #309

Merged
Bccorb merged 3 commits into
mainfrom
fix/harness-admin-step-up
Oct 24, 2026
Merged

Bccorb merged 3 commits into
mainfrom
fix/harness-admin-step-up

Conversation

@Bccorb

@Bccorb Bccorb commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

fells-code/seamless-auth-api#490 puts admin write routes (and DELETE /users/delete) behind a fresh step-up. The harness's owner signs in with an email OTP, which does not count, so the conformance run on that PR fails in importEnrollment and oauthCutover with 403 step_up_required. nextjs/roles would fail the same way through setUserRoles.

  • SoftwareAuthenticator takes an optional seed (deterministic key and credential id) and can sign assertions. Its sign count is the current time in seconds, so it keeps increasing across Playwright worker restarts.
  • New lib/stepUp.ts: stepUpOwner enrolls the owner's seeded passkey the first time it is needed, then runs /step-up/webauthn/start and /finish. ownerAdminToken and ownerAccessToken call it.
  • enrollPasskey now shares registerPasskey.

This also works against API v0.19.x, which already supports WebAuthn step-up, so it can merge before #490.

Checked: I verified a registration and an assertion from a second instance with the same seed using @simplewebauthn/server. tsc --strict on the touched files passes, and npm test passes (1413). The harness itself runs in this PR's conformance check.

Admin write routes require a fresh step-up from seamless-auth-api#490. The owner signs
in with an email OTP, which does not count, so the harness now steps up with a software
passkey derived from OWNER_EMAIL, enrolled the first time it is needed.
Enrollment and step-up run in the same second, and the API refuses an assertion whose count
does not exceed the stored one. Count from the last use as well as the clock, and keep one
owner authenticator per worker.
@Bccorb
Bccorb merged commit 846891c into main Oct 24, 2026
6 checks passed
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