Repository navigation
test(verify): step up the owner session before admin writes - #309
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inimportEnrollmentandoauthCutoverwith403 step_up_required.nextjs/roleswould fail the same way throughsetUserRoles.SoftwareAuthenticatortakes 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.lib/stepUp.ts:stepUpOwnerenrolls the owner's seeded passkey the first time it is needed, then runs/step-up/webauthn/startand/finish.ownerAdminTokenandownerAccessTokencall it.enrollPasskeynow sharesregisterPasskey.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 --stricton the touched files passes, andnpm testpasses (1413). The harness itself runs in this PR's conformance check.