@softistx/janus 0.0.0-stage → 0.73.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2928 -2
- package/dist/auth/api-keys/authenticate-key.d.ts +21 -0
- package/dist/auth/api-keys/authenticate-key.d.ts.map +1 -0
- package/dist/auth/api-keys/bound.d.ts +11 -0
- package/dist/auth/api-keys/bound.d.ts.map +1 -0
- package/dist/auth/api-keys/count.d.ts +8 -0
- package/dist/auth/api-keys/count.d.ts.map +1 -0
- package/dist/auth/api-keys/create/checks.d.ts +42 -0
- package/dist/auth/api-keys/create/checks.d.ts.map +1 -0
- package/dist/auth/api-keys/create/index.d.ts +10 -0
- package/dist/auth/api-keys/create/index.d.ts.map +1 -0
- package/dist/auth/api-keys/events.d.ts +22 -0
- package/dist/auth/api-keys/events.d.ts.map +1 -0
- package/dist/auth/api-keys/expiry.d.ts +11 -0
- package/dist/auth/api-keys/expiry.d.ts.map +1 -0
- package/dist/auth/api-keys/flows.d.ts +13 -0
- package/dist/auth/api-keys/flows.d.ts.map +1 -0
- package/dist/auth/api-keys/index.d.ts +11 -0
- package/dist/auth/api-keys/index.d.ts.map +1 -0
- package/dist/auth/api-keys/read.d.ts +10 -0
- package/dist/auth/api-keys/read.d.ts.map +1 -0
- package/dist/auth/api-keys/shape.d.ts +24 -0
- package/dist/auth/api-keys/shape.d.ts.map +1 -0
- package/dist/auth/api-keys/to-api-key.d.ts +8 -0
- package/dist/auth/api-keys/to-api-key.d.ts.map +1 -0
- package/dist/auth/api-keys/token.d.ts +23 -0
- package/dist/auth/api-keys/token.d.ts.map +1 -0
- package/dist/auth/api-keys/user-bound.d.ts +10 -0
- package/dist/auth/api-keys/user-bound.d.ts.map +1 -0
- package/dist/auth/at.d.ts +9 -0
- package/dist/auth/at.d.ts.map +1 -0
- package/dist/auth/avatar/any-type.d.ts +13 -0
- package/dist/auth/avatar/any-type.d.ts.map +1 -0
- package/dist/auth/avatar/flows.d.ts +7 -0
- package/dist/auth/avatar/flows.d.ts.map +1 -0
- package/dist/auth/avatar/id.d.ts +10 -0
- package/dist/auth/avatar/id.d.ts.map +1 -0
- package/dist/auth/avatar/index.d.ts +7 -0
- package/dist/auth/avatar/index.d.ts.map +1 -0
- package/dist/auth/avatar/remove.d.ts +10 -0
- package/dist/auth/avatar/remove.d.ts.map +1 -0
- package/dist/auth/avatar/set.d.ts +12 -0
- package/dist/auth/avatar/set.d.ts.map +1 -0
- package/dist/auth/concurrency-limit.d.ts +13 -0
- package/dist/auth/concurrency-limit.d.ts.map +1 -0
- package/dist/auth/config/api-keys-config.d.ts +33 -0
- package/dist/auth/config/api-keys-config.d.ts.map +1 -0
- package/dist/auth/config/hasher.d.ts +22 -0
- package/dist/auth/config/hasher.d.ts.map +1 -0
- package/dist/auth/config/index.d.ts +24 -0
- package/dist/auth/config/index.d.ts.map +1 -0
- package/dist/auth/config/invitations-config.d.ts +74 -0
- package/dist/auth/config/invitations-config.d.ts.map +1 -0
- package/dist/auth/config/janus-config.d.ts +233 -0
- package/dist/auth/config/janus-config.d.ts.map +1 -0
- package/dist/auth/config/magic-link-config.d.ts +6 -0
- package/dist/auth/config/magic-link-config.d.ts.map +1 -0
- package/dist/auth/config/names.d.ts +9 -0
- package/dist/auth/config/names.d.ts.map +1 -0
- package/dist/auth/config/normalize.d.ts +26 -0
- package/dist/auth/config/normalize.d.ts.map +1 -0
- package/dist/auth/config/passkeys-config.d.ts +49 -0
- package/dist/auth/config/passkeys-config.d.ts.map +1 -0
- package/dist/auth/config/password-config.d.ts +22 -0
- package/dist/auth/config/password-config.d.ts.map +1 -0
- package/dist/auth/config/reserved.d.ts +14 -0
- package/dist/auth/config/reserved.d.ts.map +1 -0
- package/dist/auth/config/resolve-api-keys.d.ts +5 -0
- package/dist/auth/config/resolve-api-keys.d.ts.map +1 -0
- package/dist/auth/config/resolve-config.d.ts +9 -0
- package/dist/auth/config/resolve-config.d.ts.map +1 -0
- package/dist/auth/config/resolve-cookie.d.ts +5 -0
- package/dist/auth/config/resolve-cookie.d.ts.map +1 -0
- package/dist/auth/config/resolve-devices.d.ts +5 -0
- package/dist/auth/config/resolve-devices.d.ts.map +1 -0
- package/dist/auth/config/resolve-invitation-types.d.ts +5 -0
- package/dist/auth/config/resolve-invitation-types.d.ts.map +1 -0
- package/dist/auth/config/resolve-invitations.d.ts +5 -0
- package/dist/auth/config/resolve-invitations.d.ts.map +1 -0
- package/dist/auth/config/resolve-magic-link.d.ts +4 -0
- package/dist/auth/config/resolve-magic-link.d.ts.map +1 -0
- package/dist/auth/config/resolve-passkeys.d.ts +5 -0
- package/dist/auth/config/resolve-passkeys.d.ts.map +1 -0
- package/dist/auth/config/resolve-second-factor.d.ts +5 -0
- package/dist/auth/config/resolve-second-factor.d.ts.map +1 -0
- package/dist/auth/config/resolve-social.d.ts +17 -0
- package/dist/auth/config/resolve-social.d.ts.map +1 -0
- package/dist/auth/config/resolve-throttle.d.ts +37 -0
- package/dist/auth/config/resolve-throttle.d.ts.map +1 -0
- package/dist/auth/config/resolve-type.d.ts +6 -0
- package/dist/auth/config/resolve-type.d.ts.map +1 -0
- package/dist/auth/config/resolved-config.d.ts +126 -0
- package/dist/auth/config/resolved-config.d.ts.map +1 -0
- package/dist/auth/config/social-config.d.ts +154 -0
- package/dist/auth/config/social-config.d.ts.map +1 -0
- package/dist/auth/config/user-type.d.ts +79 -0
- package/dist/auth/config/user-type.d.ts.map +1 -0
- package/dist/auth/config/warn-throttle-window.d.ts +14 -0
- package/dist/auth/config/warn-throttle-window.d.ts.map +1 -0
- package/dist/auth/context/create-context.d.ts +31 -0
- package/dist/auth/context/create-context.d.ts.map +1 -0
- package/dist/auth/context/index.d.ts +17 -0
- package/dist/auth/context/index.d.ts.map +1 -0
- package/dist/auth/context/logins.d.ts +28 -0
- package/dist/auth/context/logins.d.ts.map +1 -0
- package/dist/auth/context/password.d.ts +34 -0
- package/dist/auth/context/password.d.ts.map +1 -0
- package/dist/auth/context/records.d.ts +27 -0
- package/dist/auth/context/records.d.ts.map +1 -0
- package/dist/auth/context/user.d.ts +21 -0
- package/dist/auth/context/user.d.ts.map +1 -0
- package/dist/auth/context/validate-fields.d.ts +12 -0
- package/dist/auth/context/validate-fields.d.ts.map +1 -0
- package/dist/auth/counter-key.d.ts +20 -0
- package/dist/auth/counter-key.d.ts.map +1 -0
- package/dist/auth/derived-keys.d.ts +9 -0
- package/dist/auth/derived-keys.d.ts.map +1 -0
- package/dist/auth/devices/cookie.d.ts +56 -0
- package/dist/auth/devices/cookie.d.ts.map +1 -0
- package/dist/auth/devices/hint.d.ts +42 -0
- package/dist/auth/devices/hint.d.ts.map +1 -0
- package/dist/auth/devices/index.d.ts +11 -0
- package/dist/auth/devices/index.d.ts.map +1 -0
- package/dist/auth/devices/report.d.ts +11 -0
- package/dist/auth/devices/report.d.ts.map +1 -0
- package/dist/auth/devices/token.d.ts +13 -0
- package/dist/auth/devices/token.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-change-email.d.ts +18 -0
- package/dist/auth/email-flows/any-type-change-email.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-reset-password.d.ts +19 -0
- package/dist/auth/email-flows/any-type-reset-password.d.ts.map +1 -0
- package/dist/auth/email-flows/any-type-verify-email.d.ts +18 -0
- package/dist/auth/email-flows/any-type-verify-email.d.ts.map +1 -0
- package/dist/auth/email-flows/change-email-token.d.ts +47 -0
- package/dist/auth/email-flows/change-email-token.d.ts.map +1 -0
- package/dist/auth/email-flows/change-email.d.ts +17 -0
- package/dist/auth/email-flows/change-email.d.ts.map +1 -0
- package/dist/auth/email-flows/confirm-reset.d.ts +16 -0
- package/dist/auth/email-flows/confirm-reset.d.ts.map +1 -0
- package/dist/auth/email-flows/email-token.d.ts +30 -0
- package/dist/auth/email-flows/email-token.d.ts.map +1 -0
- package/dist/auth/email-flows/flows.d.ts +13 -0
- package/dist/auth/email-flows/flows.d.ts.map +1 -0
- package/dist/auth/email-flows/index.d.ts +10 -0
- package/dist/auth/email-flows/index.d.ts.map +1 -0
- package/dist/auth/email-flows/owner-of.d.ts +17 -0
- package/dist/auth/email-flows/owner-of.d.ts.map +1 -0
- package/dist/auth/email-flows/prove-first.d.ts +45 -0
- package/dist/auth/email-flows/prove-first.d.ts.map +1 -0
- package/dist/auth/email-flows/reset-password.d.ts +17 -0
- package/dist/auth/email-flows/reset-password.d.ts.map +1 -0
- package/dist/auth/email-flows/set-email-verified.d.ts +19 -0
- package/dist/auth/email-flows/set-email-verified.d.ts.map +1 -0
- package/dist/auth/email-flows/verify-email.d.ts +25 -0
- package/dist/auth/email-flows/verify-email.d.ts.map +1 -0
- package/dist/auth/email-sign-in.d.ts +51 -0
- package/dist/auth/email-sign-in.d.ts.map +1 -0
- package/dist/auth/events.d.ts +166 -0
- package/dist/auth/events.d.ts.map +1 -0
- package/dist/auth/first-proof.d.ts +43 -0
- package/dist/auth/first-proof.d.ts.map +1 -0
- package/dist/auth/hashers.d.ts +52 -0
- package/dist/auth/hashers.d.ts.map +1 -0
- package/dist/auth/index.d.ts +22 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/invitations/accept.d.ts +10 -0
- package/dist/auth/invitations/accept.d.ts.map +1 -0
- package/dist/auth/invitations/change-pending.d.ts +17 -0
- package/dist/auth/invitations/change-pending.d.ts.map +1 -0
- package/dist/auth/invitations/claim.d.ts +31 -0
- package/dist/auth/invitations/claim.d.ts.map +1 -0
- package/dist/auth/invitations/events.d.ts +46 -0
- package/dist/auth/invitations/events.d.ts.map +1 -0
- package/dist/auth/invitations/find-invitee.d.ts +20 -0
- package/dist/auth/invitations/find-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/find-pending.d.ts +5 -0
- package/dist/auth/invitations/find-pending.d.ts.map +1 -0
- package/dist/auth/invitations/flows.d.ts +7 -0
- package/dist/auth/invitations/flows.d.ts.map +1 -0
- package/dist/auth/invitations/history-input.d.ts +29 -0
- package/dist/auth/invitations/history-input.d.ts.map +1 -0
- package/dist/auth/invitations/history.d.ts +10 -0
- package/dist/auth/invitations/history.d.ts.map +1 -0
- package/dist/auth/invitations/index.d.ts +11 -0
- package/dist/auth/invitations/index.d.ts.map +1 -0
- package/dist/auth/invitations/input.d.ts +30 -0
- package/dist/auth/invitations/input.d.ts.map +1 -0
- package/dist/auth/invitations/invited-type.d.ts +22 -0
- package/dist/auth/invitations/invited-type.d.ts.map +1 -0
- package/dist/auth/invitations/invitee.d.ts +11 -0
- package/dist/auth/invitations/invitee.d.ts.map +1 -0
- package/dist/auth/invitations/issue.d.ts +9 -0
- package/dist/auth/invitations/issue.d.ts.map +1 -0
- package/dist/auth/invitations/limit.d.ts +7 -0
- package/dist/auth/invitations/limit.d.ts.map +1 -0
- package/dist/auth/invitations/password-invitee.d.ts +18 -0
- package/dist/auth/invitations/password-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/passwordless-invitee.d.ts +13 -0
- package/dist/auth/invitations/passwordless-invitee.d.ts.map +1 -0
- package/dist/auth/invitations/preview.d.ts +8 -0
- package/dist/auth/invitations/preview.d.ts.map +1 -0
- package/dist/auth/invitations/read.d.ts +10 -0
- package/dist/auth/invitations/read.d.ts.map +1 -0
- package/dist/auth/invitations/resend.d.ts +12 -0
- package/dist/auth/invitations/resend.d.ts.map +1 -0
- package/dist/auth/invitations/to-invitation.d.ts +11 -0
- package/dist/auth/invitations/to-invitation.d.ts.map +1 -0
- package/dist/auth/invitations/write.d.ts +17 -0
- package/dist/auth/invitations/write.d.ts.map +1 -0
- package/dist/auth/issuers/cache.d.ts +21 -0
- package/dist/auth/issuers/cache.d.ts.map +1 -0
- package/dist/auth/issuers/create.d.ts +18 -0
- package/dist/auth/issuers/create.d.ts.map +1 -0
- package/dist/auth/issuers/index.d.ts +3 -0
- package/dist/auth/issuers/index.d.ts.map +1 -0
- package/dist/auth/issuers/types.d.ts +45 -0
- package/dist/auth/issuers/types.d.ts.map +1 -0
- package/dist/auth/janus.d.ts +39 -0
- package/dist/auth/janus.d.ts.map +1 -0
- package/dist/auth/magic-link.d.ts +25 -0
- package/dist/auth/magic-link.d.ts.map +1 -0
- package/dist/auth/mail-requests.d.ts +55 -0
- package/dist/auth/mail-requests.d.ts.map +1 -0
- package/dist/auth/one-time/codes.d.ts +46 -0
- package/dist/auth/one-time/codes.d.ts.map +1 -0
- package/dist/auth/one-time/index.d.ts +15 -0
- package/dist/auth/one-time/index.d.ts.map +1 -0
- package/dist/auth/one-time/issue.d.ts +45 -0
- package/dist/auth/one-time/issue.d.ts.map +1 -0
- package/dist/auth/one-time/refusals.d.ts +26 -0
- package/dist/auth/one-time/refusals.d.ts.map +1 -0
- package/dist/auth/one-time/spend.d.ts +24 -0
- package/dist/auth/one-time/spend.d.ts.map +1 -0
- package/dist/auth/one-time/window.d.ts +50 -0
- package/dist/auth/one-time/window.d.ts.map +1 -0
- package/dist/auth/outage.d.ts +66 -0
- package/dist/auth/outage.d.ts.map +1 -0
- package/dist/auth/parse-sealing-keys.d.ts +26 -0
- package/dist/auth/parse-sealing-keys.d.ts.map +1 -0
- package/dist/auth/passkeys/assert.d.ts +51 -0
- package/dist/auth/passkeys/assert.d.ts.map +1 -0
- package/dist/auth/passkeys/assertion-options.d.ts +9 -0
- package/dist/auth/passkeys/assertion-options.d.ts.map +1 -0
- package/dist/auth/passkeys/challenge.d.ts +19 -0
- package/dist/auth/passkeys/challenge.d.ts.map +1 -0
- package/dist/auth/passkeys/commit.d.ts +33 -0
- package/dist/auth/passkeys/commit.d.ts.map +1 -0
- package/dist/auth/passkeys/flows.d.ts +13 -0
- package/dist/auth/passkeys/flows.d.ts.map +1 -0
- package/dist/auth/passkeys/index.d.ts +12 -0
- package/dist/auth/passkeys/index.d.ts.map +1 -0
- package/dist/auth/passkeys/manage.d.ts +11 -0
- package/dist/auth/passkeys/manage.d.ts.map +1 -0
- package/dist/auth/passkeys/name.d.ts +4 -0
- package/dist/auth/passkeys/name.d.ts.map +1 -0
- package/dist/auth/passkeys/register.d.ts +20 -0
- package/dist/auth/passkeys/register.d.ts.map +1 -0
- package/dist/auth/passkeys/registration-options.d.ts +22 -0
- package/dist/auth/passkeys/registration-options.d.ts.map +1 -0
- package/dist/auth/passkeys/remove-all.d.ts +26 -0
- package/dist/auth/passkeys/remove-all.d.ts.map +1 -0
- package/dist/auth/passkeys/sign-in-options.d.ts +12 -0
- package/dist/auth/passkeys/sign-in-options.d.ts.map +1 -0
- package/dist/auth/passkeys/sign-in.d.ts +21 -0
- package/dist/auth/passkeys/sign-in.d.ts.map +1 -0
- package/dist/auth/passkeys/verifier.d.ts +113 -0
- package/dist/auth/passkeys/verifier.d.ts.map +1 -0
- package/dist/auth/passkeys/view.d.ts +5 -0
- package/dist/auth/passkeys/view.d.ts.map +1 -0
- package/dist/auth/passkeys/wiring.d.ts +24 -0
- package/dist/auth/passkeys/wiring.d.ts.map +1 -0
- package/dist/auth/password-written.d.ts +55 -0
- package/dist/auth/password-written.d.ts.map +1 -0
- package/dist/auth/port/assert-api-keys.d.ts +21 -0
- package/dist/auth/port/assert-api-keys.d.ts.map +1 -0
- package/dist/auth/port/assert-invitations.d.ts +15 -0
- package/dist/auth/port/assert-invitations.d.ts.map +1 -0
- package/dist/auth/port/assert-stores.d.ts +16 -0
- package/dist/auth/port/assert-stores.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/capabilities.d.ts +8 -0
- package/dist/auth/port/memory/api-keys/capabilities.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/index.d.ts +13 -0
- package/dist/auth/port/memory/api-keys/index.d.ts.map +1 -0
- package/dist/auth/port/memory/api-keys/pages.d.ts +7 -0
- package/dist/auth/port/memory/api-keys/pages.d.ts.map +1 -0
- package/dist/auth/port/memory/copy.d.ts +6 -0
- package/dist/auth/port/memory/copy.d.ts.map +1 -0
- package/dist/auth/port/memory/index.d.ts +10 -0
- package/dist/auth/port/memory/index.d.ts.map +1 -0
- package/dist/auth/port/memory/invitations-pending.d.ts +6 -0
- package/dist/auth/port/memory/invitations-pending.d.ts.map +1 -0
- package/dist/auth/port/memory/invitations.d.ts +12 -0
- package/dist/auth/port/memory/invitations.d.ts.map +1 -0
- package/dist/auth/port/memory/passkeys.d.ts +9 -0
- package/dist/auth/port/memory/passkeys.d.ts.map +1 -0
- package/dist/auth/port/memory/sessions.d.ts +4 -0
- package/dist/auth/port/memory/sessions.d.ts.map +1 -0
- package/dist/auth/port/memory/social-links.d.ts +10 -0
- package/dist/auth/port/memory/social-links.d.ts.map +1 -0
- package/dist/auth/port/memory/stores.d.ts +26 -0
- package/dist/auth/port/memory/stores.d.ts.map +1 -0
- package/dist/auth/port/memory/tokens.d.ts +4 -0
- package/dist/auth/port/memory/tokens.d.ts.map +1 -0
- package/dist/auth/port/memory/user-index.d.ts +20 -0
- package/dist/auth/port/memory/user-index.d.ts.map +1 -0
- package/dist/auth/port/memory/user-update.d.ts +10 -0
- package/dist/auth/port/memory/user-update.d.ts.map +1 -0
- package/dist/auth/port/memory/users.d.ts +4 -0
- package/dist/auth/port/memory/users.d.ts.map +1 -0
- package/dist/auth/port/types/api-keys.d.ts +199 -0
- package/dist/auth/port/types/api-keys.d.ts.map +1 -0
- package/dist/auth/port/types/credentials.d.ts +46 -0
- package/dist/auth/port/types/credentials.d.ts.map +1 -0
- package/dist/auth/port/types/index.d.ts +75 -0
- package/dist/auth/port/types/index.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/index.d.ts +15 -0
- package/dist/auth/port/types/invitations/index.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/page.d.ts +52 -0
- package/dist/auth/port/types/invitations/page.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/records.d.ts +101 -0
- package/dist/auth/port/types/invitations/records.d.ts.map +1 -0
- package/dist/auth/port/types/invitations/store.d.ts +82 -0
- package/dist/auth/port/types/invitations/store.d.ts.map +1 -0
- package/dist/auth/port/types/json.d.ts +27 -0
- package/dist/auth/port/types/json.d.ts.map +1 -0
- package/dist/auth/port/types/passkeys.d.ts +94 -0
- package/dist/auth/port/types/passkeys.d.ts.map +1 -0
- package/dist/auth/port/types/sessions.d.ts +142 -0
- package/dist/auth/port/types/sessions.d.ts.map +1 -0
- package/dist/auth/port/types/social-links.d.ts +64 -0
- package/dist/auth/port/types/social-links.d.ts.map +1 -0
- package/dist/auth/port/types/stores.d.ts +48 -0
- package/dist/auth/port/types/stores.d.ts.map +1 -0
- package/dist/auth/port/types/tokens.d.ts +168 -0
- package/dist/auth/port/types/tokens.d.ts.map +1 -0
- package/dist/auth/port/types/users.d.ts +260 -0
- package/dist/auth/port/types/users.d.ts.map +1 -0
- package/dist/auth/prepared.d.ts +21 -0
- package/dist/auth/prepared.d.ts.map +1 -0
- package/dist/auth/proven-sign-in.d.ts +22 -0
- package/dist/auth/proven-sign-in.d.ts.map +1 -0
- package/dist/auth/sealer-for.d.ts +44 -0
- package/dist/auth/sealer-for.d.ts.map +1 -0
- package/dist/auth/sealing.d.ts +36 -0
- package/dist/auth/sealing.d.ts.map +1 -0
- package/dist/auth/second-factor/activate.d.ts +9 -0
- package/dist/auth/second-factor/activate.d.ts.map +1 -0
- package/dist/auth/second-factor/app-code-attempts.d.ts +47 -0
- package/dist/auth/second-factor/app-code-attempts.d.ts.map +1 -0
- package/dist/auth/second-factor/challenge.d.ts +15 -0
- package/dist/auth/second-factor/challenge.d.ts.map +1 -0
- package/dist/auth/second-factor/codes-left.d.ts +14 -0
- package/dist/auth/second-factor/codes-left.d.ts.map +1 -0
- package/dist/auth/second-factor/disable.d.ts +10 -0
- package/dist/auth/second-factor/disable.d.ts.map +1 -0
- package/dist/auth/second-factor/enroll.d.ts +6 -0
- package/dist/auth/second-factor/enroll.d.ts.map +1 -0
- package/dist/auth/second-factor/factor.d.ts +33 -0
- package/dist/auth/second-factor/factor.d.ts.map +1 -0
- package/dist/auth/second-factor/flows.d.ts +36 -0
- package/dist/auth/second-factor/flows.d.ts.map +1 -0
- package/dist/auth/second-factor/lifecycle.d.ts +14 -0
- package/dist/auth/second-factor/lifecycle.d.ts.map +1 -0
- package/dist/auth/second-factor/passkey-confirm.d.ts +21 -0
- package/dist/auth/second-factor/passkey-confirm.d.ts.map +1 -0
- package/dist/auth/second-factor/recovery-codes.d.ts +36 -0
- package/dist/auth/second-factor/recovery-codes.d.ts.map +1 -0
- package/dist/auth/second-factor/recovery.d.ts +20 -0
- package/dist/auth/second-factor/recovery.d.ts.map +1 -0
- package/dist/auth/second-factor/redeem.d.ts +42 -0
- package/dist/auth/second-factor/redeem.d.ts.map +1 -0
- package/dist/auth/second-factor/refusal.d.ts +6 -0
- package/dist/auth/second-factor/refusal.d.ts.map +1 -0
- package/dist/auth/second-factor/regenerate.d.ts +12 -0
- package/dist/auth/second-factor/regenerate.d.ts.map +1 -0
- package/dist/auth/second-factor/reseal.d.ts +17 -0
- package/dist/auth/second-factor/reseal.d.ts.map +1 -0
- package/dist/auth/second-factor/spend-recovery-code.d.ts +15 -0
- package/dist/auth/second-factor/spend-recovery-code.d.ts.map +1 -0
- package/dist/auth/secrets.d.ts +17 -0
- package/dist/auth/secrets.d.ts.map +1 -0
- package/dist/auth/sessions/amr.d.ts +36 -0
- package/dist/auth/sessions/amr.d.ts.map +1 -0
- package/dist/auth/sessions/authenticate.d.ts +12 -0
- package/dist/auth/sessions/authenticate.d.ts.map +1 -0
- package/dist/auth/sessions/collect-expired.d.ts +15 -0
- package/dist/auth/sessions/collect-expired.d.ts.map +1 -0
- package/dist/auth/sessions/cookie.d.ts +9 -0
- package/dist/auth/sessions/cookie.d.ts.map +1 -0
- package/dist/auth/sessions/fresh.d.ts +35 -0
- package/dist/auth/sessions/fresh.d.ts.map +1 -0
- package/dist/auth/sessions/index.d.ts +12 -0
- package/dist/auth/sessions/index.d.ts.map +1 -0
- package/dist/auth/sessions/open-session.d.ts +22 -0
- package/dist/auth/sessions/open-session.d.ts.map +1 -0
- package/dist/auth/sessions/presented-token.d.ts +25 -0
- package/dist/auth/sessions/presented-token.d.ts.map +1 -0
- package/dist/auth/sessions/shared-api.d.ts +17 -0
- package/dist/auth/sessions/shared-api.d.ts.map +1 -0
- package/dist/auth/sessions/standing.d.ts +32 -0
- package/dist/auth/sessions/standing.d.ts.map +1 -0
- package/dist/auth/shared-api.d.ts +139 -0
- package/dist/auth/shared-api.d.ts.map +1 -0
- package/dist/auth/sign-in-attempts.d.ts +45 -0
- package/dist/auth/sign-in-attempts.d.ts.map +1 -0
- package/dist/auth/sign-in-code.d.ts +26 -0
- package/dist/auth/sign-in-code.d.ts.map +1 -0
- package/dist/auth/social/attach.d.ts +31 -0
- package/dist/auth/social/attach.d.ts.map +1 -0
- package/dist/auth/social/begin.d.ts +30 -0
- package/dist/auth/social/begin.d.ts.map +1 -0
- package/dist/auth/social/complete-link.d.ts +17 -0
- package/dist/auth/social/complete-link.d.ts.map +1 -0
- package/dist/auth/social/complete.d.ts +54 -0
- package/dist/auth/social/complete.d.ts.map +1 -0
- package/dist/auth/social/cookie.d.ts +16 -0
- package/dist/auth/social/cookie.d.ts.map +1 -0
- package/dist/auth/social/find-provider.d.ts +23 -0
- package/dist/auth/social/find-provider.d.ts.map +1 -0
- package/dist/auth/social/finish.d.ts +60 -0
- package/dist/auth/social/finish.d.ts.map +1 -0
- package/dist/auth/social/flow-cookie-value.d.ts +26 -0
- package/dist/auth/social/flow-cookie-value.d.ts.map +1 -0
- package/dist/auth/social/flow-secret.d.ts +40 -0
- package/dist/auth/social/flow-secret.d.ts.map +1 -0
- package/dist/auth/social/index.d.ts +19 -0
- package/dist/auth/social/index.d.ts.map +1 -0
- package/dist/auth/social/link-holder.d.ts +33 -0
- package/dist/auth/social/link-holder.d.ts.map +1 -0
- package/dist/auth/social/provider-call.d.ts +31 -0
- package/dist/auth/social/provider-call.d.ts.map +1 -0
- package/dist/auth/social/redeem.d.ts +45 -0
- package/dist/auth/social/redeem.d.ts.map +1 -0
- package/dist/auth/social/return-to.d.ts +18 -0
- package/dist/auth/social/return-to.d.ts.map +1 -0
- package/dist/auth/social/sign-in.d.ts +41 -0
- package/dist/auth/social/sign-in.d.ts.map +1 -0
- package/dist/auth/social/sign-up.d.ts +37 -0
- package/dist/auth/social/sign-up.d.ts.map +1 -0
- package/dist/auth/social/start.d.ts +21 -0
- package/dist/auth/social/start.d.ts.map +1 -0
- package/dist/auth/social/step-up-proof.d.ts +26 -0
- package/dist/auth/social/step-up-proof.d.ts.map +1 -0
- package/dist/auth/social/step-up-request.d.ts +28 -0
- package/dist/auth/social/step-up-request.d.ts.map +1 -0
- package/dist/auth/social/step-up.d.ts +19 -0
- package/dist/auth/social/step-up.d.ts.map +1 -0
- package/dist/auth/social/types-of.d.ts +12 -0
- package/dist/auth/social/types-of.d.ts.map +1 -0
- package/dist/auth/social/unlink.d.ts +16 -0
- package/dist/auth/social/unlink.d.ts.map +1 -0
- package/dist/auth/social/wiring.d.ts +10 -0
- package/dist/auth/social/wiring.d.ts.map +1 -0
- package/dist/auth/standard-schema.d.ts +41 -0
- package/dist/auth/standard-schema.d.ts.map +1 -0
- package/dist/auth/step-up/codes.d.ts +35 -0
- package/dist/auth/step-up/codes.d.ts.map +1 -0
- package/dist/auth/step-up/flows.d.ts +18 -0
- package/dist/auth/step-up/flows.d.ts.map +1 -0
- package/dist/auth/step-up/open.d.ts +23 -0
- package/dist/auth/step-up/open.d.ts.map +1 -0
- package/dist/auth/step-up/passkey.d.ts +31 -0
- package/dist/auth/step-up/passkey.d.ts.map +1 -0
- package/dist/auth/step-up/request.d.ts +15 -0
- package/dist/auth/step-up/request.d.ts.map +1 -0
- package/dist/auth/step-up/spend.d.ts +4 -0
- package/dist/auth/step-up/spend.d.ts.map +1 -0
- package/dist/auth/totp.d.ts +36 -0
- package/dist/auth/totp.d.ts.map +1 -0
- package/dist/auth/types/api-keys-of.d.ts +19 -0
- package/dist/auth/types/api-keys-of.d.ts.map +1 -0
- package/dist/auth/types/api-keys.d.ts +164 -0
- package/dist/auth/types/api-keys.d.ts.map +1 -0
- package/dist/auth/types/avatar.d.ts +72 -0
- package/dist/auth/types/avatar.d.ts.map +1 -0
- package/dist/auth/types/change-email.d.ts +82 -0
- package/dist/auth/types/change-email.d.ts.map +1 -0
- package/dist/auth/types/checks.d.ts +147 -0
- package/dist/auth/types/checks.d.ts.map +1 -0
- package/dist/auth/types/email-flows.d.ts +117 -0
- package/dist/auth/types/email-flows.d.ts.map +1 -0
- package/dist/auth/types/find-by-email.d.ts +31 -0
- package/dist/auth/types/find-by-email.d.ts.map +1 -0
- package/dist/auth/types/find-or-create.d.ts +59 -0
- package/dist/auth/types/find-or-create.d.ts.map +1 -0
- package/dist/auth/types/index.d.ts +38 -0
- package/dist/auth/types/index.d.ts.map +1 -0
- package/dist/auth/types/inference.d.ts +62 -0
- package/dist/auth/types/inference.d.ts.map +1 -0
- package/dist/auth/types/invitations/api.d.ts +203 -0
- package/dist/auth/types/invitations/api.d.ts.map +1 -0
- package/dist/auth/types/invitations/history.d.ts +87 -0
- package/dist/auth/types/invitations/history.d.ts.map +1 -0
- package/dist/auth/types/invitations/index.d.ts +10 -0
- package/dist/auth/types/invitations/index.d.ts.map +1 -0
- package/dist/auth/types/invitations/invitation.d.ts +76 -0
- package/dist/auth/types/invitations/invitation.d.ts.map +1 -0
- package/dist/auth/types/invitations/issue-type.d.ts +15 -0
- package/dist/auth/types/invitations/issue-type.d.ts.map +1 -0
- package/dist/auth/types/invitations-of.d.ts +26 -0
- package/dist/auth/types/invitations-of.d.ts.map +1 -0
- package/dist/auth/types/janus.d.ts +51 -0
- package/dist/auth/types/janus.d.ts.map +1 -0
- package/dist/auth/types/magic-link.d.ts +69 -0
- package/dist/auth/types/magic-link.d.ts.map +1 -0
- package/dist/auth/types/passkeys.d.ts +183 -0
- package/dist/auth/types/passkeys.d.ts.map +1 -0
- package/dist/auth/types/password.d.ts +113 -0
- package/dist/auth/types/password.d.ts.map +1 -0
- package/dist/auth/types/prepared.d.ts +68 -0
- package/dist/auth/types/prepared.d.ts.map +1 -0
- package/dist/auth/types/proven-sign-in.d.ts +43 -0
- package/dist/auth/types/proven-sign-in.d.ts.map +1 -0
- package/dist/auth/types/reset-password.d.ts +46 -0
- package/dist/auth/types/reset-password.d.ts.map +1 -0
- package/dist/auth/types/second-factor.d.ts +164 -0
- package/dist/auth/types/second-factor.d.ts.map +1 -0
- package/dist/auth/types/session.d.ts +68 -0
- package/dist/auth/types/session.d.ts.map +1 -0
- package/dist/auth/types/shared-api.d.ts +96 -0
- package/dist/auth/types/shared-api.d.ts.map +1 -0
- package/dist/auth/types/sign-in.d.ts +102 -0
- package/dist/auth/types/sign-in.d.ts.map +1 -0
- package/dist/auth/types/social-flow.d.ts +28 -0
- package/dist/auth/types/social-flow.d.ts.map +1 -0
- package/dist/auth/types/social-step-up.d.ts +38 -0
- package/dist/auth/types/social-step-up.d.ts.map +1 -0
- package/dist/auth/types/social.d.ts +193 -0
- package/dist/auth/types/social.d.ts.map +1 -0
- package/dist/auth/types/step-up.d.ts +133 -0
- package/dist/auth/types/step-up.d.ts.map +1 -0
- package/dist/auth/types/type-api.d.ts +29 -0
- package/dist/auth/types/type-api.d.ts.map +1 -0
- package/dist/auth/types/user-type.d.ts +106 -0
- package/dist/auth/types/user-type.d.ts.map +1 -0
- package/dist/auth/types/user.d.ts +62 -0
- package/dist/auth/types/user.d.ts.map +1 -0
- package/dist/auth/types/verify-email.d.ts +190 -0
- package/dist/auth/types/verify-email.d.ts.map +1 -0
- package/dist/auth/users/any-type-api.d.ts +6 -0
- package/dist/auth/users/any-type-api.d.ts.map +1 -0
- package/dist/auth/users/by-login.d.ts +10 -0
- package/dist/auth/users/by-login.d.ts.map +1 -0
- package/dist/auth/users/change-password.d.ts +26 -0
- package/dist/auth/users/change-password.d.ts.map +1 -0
- package/dist/auth/users/delete.d.ts +10 -0
- package/dist/auth/users/delete.d.ts.map +1 -0
- package/dist/auth/users/email-move-guard.d.ts +20 -0
- package/dist/auth/users/email-move-guard.d.ts.map +1 -0
- package/dist/auth/users/email-prefix.d.ts +23 -0
- package/dist/auth/users/email-prefix.d.ts.map +1 -0
- package/dist/auth/users/fields-patch.d.ts +21 -0
- package/dist/auth/users/fields-patch.d.ts.map +1 -0
- package/dist/auth/users/find-by-email.d.ts +11 -0
- package/dist/auth/users/find-by-email.d.ts.map +1 -0
- package/dist/auth/users/find-many.d.ts +29 -0
- package/dist/auth/users/find-many.d.ts.map +1 -0
- package/dist/auth/users/find-or-create.d.ts +12 -0
- package/dist/auth/users/find-or-create.d.ts.map +1 -0
- package/dist/auth/users/flow-types.d.ts +15 -0
- package/dist/auth/users/flow-types.d.ts.map +1 -0
- package/dist/auth/users/index.d.ts +9 -0
- package/dist/auth/users/index.d.ts.map +1 -0
- package/dist/auth/users/insert.d.ts +15 -0
- package/dist/auth/users/insert.d.ts.map +1 -0
- package/dist/auth/users/name-prefix.d.ts +19 -0
- package/dist/auth/users/name-prefix.d.ts.map +1 -0
- package/dist/auth/users/password-flows.d.ts +11 -0
- package/dist/auth/users/password-flows.d.ts.map +1 -0
- package/dist/auth/users/record-flows.d.ts +11 -0
- package/dist/auth/users/record-flows.d.ts.map +1 -0
- package/dist/auth/users/sign-in.d.ts +24 -0
- package/dist/auth/users/sign-in.d.ts.map +1 -0
- package/dist/auth/users/sign-up.d.ts +13 -0
- package/dist/auth/users/sign-up.d.ts.map +1 -0
- package/dist/auth/users/type-api.d.ts +10 -0
- package/dist/auth/users/type-api.d.ts.map +1 -0
- package/dist/auth/users/update.d.ts +16 -0
- package/dist/auth/users/update.d.ts.map +1 -0
- package/dist/background/background.d.ts +22 -0
- package/dist/background/background.d.ts.map +1 -0
- package/dist/chunks/index-2ttdcz7n.js +354 -0
- package/dist/chunks/index-2ttdcz7n.js.map +16 -0
- package/dist/chunks/index-5dxynm32.js +85 -0
- package/dist/chunks/index-5dxynm32.js.map +10 -0
- package/dist/chunks/index-ftz0ne6j.js +127 -0
- package/dist/chunks/index-ftz0ne6j.js.map +11 -0
- package/dist/chunks/index-k6y18nx9.js +724 -0
- package/dist/chunks/index-k6y18nx9.js.map +24 -0
- package/dist/chunks/index-n8jxmxeg.js +64 -0
- package/dist/chunks/index-n8jxmxeg.js.map +11 -0
- package/dist/conformance/api-keys/cases/bound.d.ts +3 -0
- package/dist/conformance/api-keys/cases/bound.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/expiry.d.ts +3 -0
- package/dist/conformance/api-keys/cases/expiry.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/index.d.ts +4 -0
- package/dist/conformance/api-keys/cases/index.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/insert.d.ts +3 -0
- package/dist/conformance/api-keys/cases/insert.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/outage.d.ts +3 -0
- package/dist/conformance/api-keys/cases/outage.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/revoke.d.ts +3 -0
- package/dist/conformance/api-keys/cases/revoke.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/touch.d.ts +3 -0
- package/dist/conformance/api-keys/cases/touch.d.ts.map +1 -0
- package/dist/conformance/api-keys/cases/user-bound.d.ts +3 -0
- package/dist/conformance/api-keys/cases/user-bound.d.ts.map +1 -0
- package/dist/conformance/api-keys/describe.d.ts +20 -0
- package/dist/conformance/api-keys/describe.d.ts.map +1 -0
- package/dist/conformance/api-keys/fixtures.d.ts +4 -0
- package/dist/conformance/api-keys/fixtures.d.ts.map +1 -0
- package/dist/conformance/api-keys/index.d.ts +18 -0
- package/dist/conformance/api-keys/index.d.ts.map +1 -0
- package/dist/conformance/api-keys/reference.d.ts +4 -0
- package/dist/conformance/api-keys/reference.d.ts.map +1 -0
- package/dist/conformance/api-keys/types.d.ts +42 -0
- package/dist/conformance/api-keys/types.d.ts.map +1 -0
- package/dist/conformance/assert.d.ts +40 -0
- package/dist/conformance/assert.d.ts.map +1 -0
- package/dist/conformance/cases/outage.d.ts +3 -0
- package/dist/conformance/cases/outage.d.ts.map +1 -0
- package/dist/conformance/cases/outage.passkeys.d.ts +12 -0
- package/dist/conformance/cases/outage.passkeys.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/deletion.d.ts +4 -0
- package/dist/conformance/cases/passkeys/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/index.d.ts +8 -0
- package/dist/conformance/cases/passkeys/index.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/inserts.d.ts +4 -0
- package/dist/conformance/cases/passkeys/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/reads.d.ts +4 -0
- package/dist/conformance/cases/passkeys/reads.d.ts.map +1 -0
- package/dist/conformance/cases/passkeys/uses.d.ts +4 -0
- package/dist/conformance/cases/passkeys/uses.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/deletion.d.ts +4 -0
- package/dist/conformance/cases/sessions/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/extension.d.ts +4 -0
- package/dist/conformance/cases/sessions/extension.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/index.d.ts +4 -0
- package/dist/conformance/cases/sessions/index.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/inserts.d.ts +4 -0
- package/dist/conformance/cases/sessions/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/list.d.ts +4 -0
- package/dist/conformance/cases/sessions/list.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/reads.d.ts +4 -0
- package/dist/conformance/cases/sessions/reads.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/reauthentication.d.ts +4 -0
- package/dist/conformance/cases/sessions/reauthentication.d.ts.map +1 -0
- package/dist/conformance/cases/sessions/revocation.d.ts +4 -0
- package/dist/conformance/cases/sessions/revocation.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/deletion.d.ts +4 -0
- package/dist/conformance/cases/social-links/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/index.d.ts +8 -0
- package/dist/conformance/cases/social-links/index.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/inserts.d.ts +4 -0
- package/dist/conformance/cases/social-links/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/social-links/reads.d.ts +4 -0
- package/dist/conformance/cases/social-links/reads.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/attempts.d.ts +7 -0
- package/dist/conformance/cases/tokens/attempts.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/change-email.d.ts +8 -0
- package/dist/conformance/cases/tokens/change-email.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/deletion.d.ts +4 -0
- package/dist/conformance/cases/tokens/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/index.d.ts +4 -0
- package/dist/conformance/cases/tokens/index.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/inserts.d.ts +7 -0
- package/dist/conformance/cases/tokens/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/kinds.d.ts +7 -0
- package/dist/conformance/cases/tokens/kinds.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/redemption.d.ts +7 -0
- package/dist/conformance/cases/tokens/redemption.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/social-flow.d.ts +8 -0
- package/dist/conformance/cases/tokens/social-flow.d.ts.map +1 -0
- package/dist/conformance/cases/tokens/spending.d.ts +7 -0
- package/dist/conformance/cases/tokens/spending.d.ts.map +1 -0
- package/dist/conformance/cases/users/avatar.d.ts +8 -0
- package/dist/conformance/cases/users/avatar.d.ts.map +1 -0
- package/dist/conformance/cases/users/batch.d.ts +8 -0
- package/dist/conformance/cases/users/batch.d.ts.map +1 -0
- package/dist/conformance/cases/users/deletion.d.ts +4 -0
- package/dist/conformance/cases/users/deletion.d.ts.map +1 -0
- package/dist/conformance/cases/users/index.d.ts +4 -0
- package/dist/conformance/cases/users/index.d.ts.map +1 -0
- package/dist/conformance/cases/users/inserts.d.ts +4 -0
- package/dist/conformance/cases/users/inserts.d.ts.map +1 -0
- package/dist/conformance/cases/users/listing.d.ts +4 -0
- package/dist/conformance/cases/users/listing.d.ts.map +1 -0
- package/dist/conformance/cases/users/patches.d.ts +7 -0
- package/dist/conformance/cases/users/patches.d.ts.map +1 -0
- package/dist/conformance/cases/users/reads.d.ts +7 -0
- package/dist/conformance/cases/users/reads.d.ts.map +1 -0
- package/dist/conformance/cases/users/second-factor.d.ts +16 -0
- package/dist/conformance/cases/users/second-factor.d.ts.map +1 -0
- package/dist/conformance/cases/users/versions.d.ts +7 -0
- package/dist/conformance/cases/users/versions.d.ts.map +1 -0
- package/dist/conformance/describe.d.ts +82 -0
- package/dist/conformance/describe.d.ts.map +1 -0
- package/dist/conformance/fixtures.d.ts +31 -0
- package/dist/conformance/fixtures.d.ts.map +1 -0
- package/dist/conformance/index.d.ts +46 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +4411 -0
- package/dist/conformance/index.js.map +86 -0
- package/dist/conformance/invitations/cases/actors.d.ts +3 -0
- package/dist/conformance/invitations/cases/actors.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/find-pending.d.ts +3 -0
- package/dist/conformance/invitations/cases/find-pending.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/imported.d.ts +3 -0
- package/dist/conformance/invitations/cases/imported.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/index.d.ts +4 -0
- package/dist/conformance/invitations/cases/index.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/insert.d.ts +3 -0
- package/dist/conformance/invitations/cases/insert.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list-lapsed.d.ts +3 -0
- package/dist/conformance/invitations/cases/list-lapsed.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list-status.d.ts +3 -0
- package/dist/conformance/invitations/cases/list-status.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/list.d.ts +3 -0
- package/dist/conformance/invitations/cases/list.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/outage.d.ts +3 -0
- package/dist/conformance/invitations/cases/outage.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/scope.d.ts +3 -0
- package/dist/conformance/invitations/cases/scope.d.ts.map +1 -0
- package/dist/conformance/invitations/cases/update.d.ts +3 -0
- package/dist/conformance/invitations/cases/update.d.ts.map +1 -0
- package/dist/conformance/invitations/describe.d.ts +20 -0
- package/dist/conformance/invitations/describe.d.ts.map +1 -0
- package/dist/conformance/invitations/fixtures.d.ts +4 -0
- package/dist/conformance/invitations/fixtures.d.ts.map +1 -0
- package/dist/conformance/invitations/index.d.ts +18 -0
- package/dist/conformance/invitations/index.d.ts.map +1 -0
- package/dist/conformance/invitations/reference.d.ts +4 -0
- package/dist/conformance/invitations/reference.d.ts.map +1 -0
- package/dist/conformance/invitations/types.d.ts +34 -0
- package/dist/conformance/invitations/types.d.ts.map +1 -0
- package/dist/conformance/reference.d.ts +13 -0
- package/dist/conformance/reference.d.ts.map +1 -0
- package/dist/conformance/relations/cases/deletion.d.ts +4 -0
- package/dist/conformance/relations/cases/deletion.d.ts.map +1 -0
- package/dist/conformance/relations/cases/holders.d.ts +9 -0
- package/dist/conformance/relations/cases/holders.d.ts.map +1 -0
- package/dist/conformance/relations/cases/index.d.ts +4 -0
- package/dist/conformance/relations/cases/index.d.ts.map +1 -0
- package/dist/conformance/relations/cases/outage.d.ts +3 -0
- package/dist/conformance/relations/cases/outage.d.ts.map +1 -0
- package/dist/conformance/relations/cases/reads.d.ts +8 -0
- package/dist/conformance/relations/cases/reads.d.ts.map +1 -0
- package/dist/conformance/relations/cases/traversal.d.ts +7 -0
- package/dist/conformance/relations/cases/traversal.d.ts.map +1 -0
- package/dist/conformance/relations/cases/writes.d.ts +4 -0
- package/dist/conformance/relations/cases/writes.d.ts.map +1 -0
- package/dist/conformance/relations/describe.d.ts +20 -0
- package/dist/conformance/relations/describe.d.ts.map +1 -0
- package/dist/conformance/relations/fixtures.d.ts +8 -0
- package/dist/conformance/relations/fixtures.d.ts.map +1 -0
- package/dist/conformance/relations/index.d.ts +18 -0
- package/dist/conformance/relations/index.d.ts.map +1 -0
- package/dist/conformance/relations/reference.d.ts +4 -0
- package/dist/conformance/relations/reference.d.ts.map +1 -0
- package/dist/conformance/relations/types.d.ts +34 -0
- package/dist/conformance/relations/types.d.ts.map +1 -0
- package/dist/conformance/types.d.ts +79 -0
- package/dist/conformance/types.d.ts.map +1 -0
- package/dist/errors/janus-error/base.d.ts +47 -0
- package/dist/errors/janus-error/base.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.credentials.d.ts +36 -0
- package/dist/errors/janus-error/codes.credentials.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.d.ts +23 -0
- package/dist/errors/janus-error/codes.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.invitations.d.ts +52 -0
- package/dist/errors/janus-error/codes.invitations.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.one-time.d.ts +63 -0
- package/dist/errors/janus-error/codes.one-time.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.records.d.ts +86 -0
- package/dist/errors/janus-error/codes.records.d.ts.map +1 -0
- package/dist/errors/janus-error/codes.social.d.ts +88 -0
- package/dist/errors/janus-error/codes.social.d.ts.map +1 -0
- package/dist/errors/janus-error/index.d.ts +17 -0
- package/dist/errors/janus-error/index.d.ts.map +1 -0
- package/dist/errors/janus-error/options.d.ts +105 -0
- package/dist/errors/janus-error/options.d.ts.map +1 -0
- package/dist/errors/janus-error/refusals.d.ts +151 -0
- package/dist/errors/janus-error/refusals.d.ts.map +1 -0
- package/dist/errors/janus-error/status.d.ts +21 -0
- package/dist/errors/janus-error/status.d.ts.map +1 -0
- package/dist/errors/janus-error/store.d.ts +36 -0
- package/dist/errors/janus-error/store.d.ts.map +1 -0
- package/dist/ids/derived.d.ts +25 -0
- package/dist/ids/derived.d.ts.map +1 -0
- package/dist/ids/id.d.ts +55 -0
- package/dist/ids/id.d.ts.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6933 -0
- package/dist/index.js.map +208 -0
- package/dist/pagination/cursor-page.d.ts +53 -0
- package/dist/pagination/cursor-page.d.ts.map +1 -0
- package/dist/permissions/bound-model.d.ts +10 -0
- package/dist/permissions/bound-model.d.ts.map +1 -0
- package/dist/permissions/can.d.ts +13 -0
- package/dist/permissions/can.d.ts.map +1 -0
- package/dist/permissions/engine.d.ts +49 -0
- package/dist/permissions/engine.d.ts.map +1 -0
- package/dist/permissions/holders.d.ts +12 -0
- package/dist/permissions/holders.d.ts.map +1 -0
- package/dist/permissions/index.d.ts +36 -0
- package/dist/permissions/index.d.ts.map +1 -0
- package/dist/permissions/index.js +924 -0
- package/dist/permissions/index.js.map +28 -0
- package/dist/permissions/input.d.ts +43 -0
- package/dist/permissions/input.d.ts.map +1 -0
- package/dist/permissions/list.d.ts +16 -0
- package/dist/permissions/list.d.ts.map +1 -0
- package/dist/permissions/model/can.d.ts +41 -0
- package/dist/permissions/model/can.d.ts.map +1 -0
- package/dist/permissions/model/config.d.ts +36 -0
- package/dist/permissions/model/config.d.ts.map +1 -0
- package/dist/permissions/model/constraint.d.ts +37 -0
- package/dist/permissions/model/constraint.d.ts.map +1 -0
- package/dist/permissions/model/ctx.d.ts +23 -0
- package/dist/permissions/model/ctx.d.ts.map +1 -0
- package/dist/permissions/model/define.d.ts +78 -0
- package/dist/permissions/model/define.d.ts.map +1 -0
- package/dist/permissions/model/from-field.d.ts +31 -0
- package/dist/permissions/model/from-field.d.ts.map +1 -0
- package/dist/permissions/model/grant.d.ts +81 -0
- package/dist/permissions/model/grant.d.ts.map +1 -0
- package/dist/permissions/model/list.d.ts +48 -0
- package/dist/permissions/model/list.d.ts.map +1 -0
- package/dist/permissions/model/names.d.ts +51 -0
- package/dist/permissions/model/names.d.ts.map +1 -0
- package/dist/permissions/model/permissions.d.ts +48 -0
- package/dist/permissions/model/permissions.d.ts.map +1 -0
- package/dist/permissions/model/refs.d.ts +36 -0
- package/dist/permissions/model/refs.d.ts.map +1 -0
- package/dist/permissions/model/refusal.d.ts +13 -0
- package/dist/permissions/model/refusal.d.ts.map +1 -0
- package/dist/permissions/model/unions.d.ts +3 -0
- package/dist/permissions/model/unions.d.ts.map +1 -0
- package/dist/permissions/model/when.d.ts +16 -0
- package/dist/permissions/model/when.d.ts.map +1 -0
- package/dist/permissions/port/holders.d.ts +38 -0
- package/dist/permissions/port/holders.d.ts.map +1 -0
- package/dist/permissions/port/memory.d.ts +17 -0
- package/dist/permissions/port/memory.d.ts.map +1 -0
- package/dist/permissions/port/types.d.ts +101 -0
- package/dist/permissions/port/types.d.ts.map +1 -0
- package/dist/permissions/replace.d.ts +25 -0
- package/dist/permissions/replace.d.ts.map +1 -0
- package/dist/permissions/resolve/declared-names.d.ts +24 -0
- package/dist/permissions/resolve/declared-names.d.ts.map +1 -0
- package/dist/permissions/resolve/refuse-data-beyond-root.d.ts +11 -0
- package/dist/permissions/resolve/refuse-data-beyond-root.d.ts.map +1 -0
- package/dist/permissions/resolve/refuse-loops.d.ts +10 -0
- package/dist/permissions/resolve/refuse-loops.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-model.d.ts +13 -0
- package/dist/permissions/resolve/resolve-model.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-relation.d.ts +9 -0
- package/dist/permissions/resolve/resolve-relation.d.ts.map +1 -0
- package/dist/permissions/resolve/resolve-rule.d.ts +12 -0
- package/dist/permissions/resolve/resolve-rule.d.ts.map +1 -0
- package/dist/permissions/resolve/resolved.d.ts +52 -0
- package/dist/permissions/resolve/resolved.d.ts.map +1 -0
- package/dist/permissions/resolve/step.d.ts +4 -0
- package/dist/permissions/resolve/step.d.ts.map +1 -0
- package/dist/permissions/reverse.d.ts +53 -0
- package/dist/permissions/reverse.d.ts.map +1 -0
- package/dist/permissions/walk.d.ts +29 -0
- package/dist/permissions/walk.d.ts.map +1 -0
- package/dist/stores/guard.d.ts +24 -0
- package/dist/stores/guard.d.ts.map +1 -0
- package/dist/stores/storable.d.ts +15 -0
- package/dist/stores/storable.d.ts.map +1 -0
- package/dist/subjects/notation.d.ts +39 -0
- package/dist/subjects/notation.d.ts.map +1 -0
- package/dist/subjects/subject.d.ts +128 -0
- package/dist/subjects/subject.d.ts.map +1 -0
- package/dist/testing/index.d.ts +12 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +26 -0
- package/dist/testing/index.js.map +10 -0
- package/dist/time/clock.d.ts +31 -0
- package/dist/time/clock.d.ts.map +1 -0
- package/dist/time/duration.d.ts +23 -0
- package/dist/time/duration.d.ts.map +1 -0
- package/docs/README.md +46 -0
- package/docs/guide/adapters.md +858 -0
- package/docs/guide/api-keys.md +316 -0
- package/docs/guide/avatars.md +334 -0
- package/docs/guide/devices.md +441 -0
- package/docs/guide/email-flows.md +880 -0
- package/docs/guide/errors.md +180 -0
- package/docs/guide/events.md +467 -0
- package/docs/guide/invitations.md +465 -0
- package/docs/guide/issuers.md +107 -0
- package/docs/guide/magic-link.md +580 -0
- package/docs/guide/migrating-invitations.md +142 -0
- package/docs/guide/passkeys.md +425 -0
- package/docs/guide/passwords.md +325 -0
- package/docs/guide/permissions.md +719 -0
- package/docs/guide/second-factor.md +1124 -0
- package/docs/guide/sessions.md +521 -0
- package/docs/guide/sign-in-code.md +631 -0
- package/docs/guide/social.md +639 -0
- package/docs/guide/step-up.md +262 -0
- package/docs/guide/users.md +557 -0
- package/docs/guide/vocabulary.md +316 -0
- package/docs/roadmap.md +101 -0
- package/docs/troubleshooting.md +3305 -0
- package/package.json +77 -5
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Migrating invitations
|
|
2
|
+
|
|
3
|
+
This page is for an application that already has invitations in another
|
|
4
|
+
system and wants them in Janus as history: who was invited, who joined, what
|
|
5
|
+
was revoked. It uses [`invitations.importHistory`](invitations.md#importing-history),
|
|
6
|
+
which copies records in without sending anything.
|
|
7
|
+
|
|
8
|
+
An imported record is **history, not a live invitation**. It has no code that
|
|
9
|
+
could ever match, so it cannot be previewed or accepted; it shows in `list`,
|
|
10
|
+
`get` and `count`. A live invitation that is still waiting is not imported: issue it
|
|
11
|
+
again with `issue`, which sends a new link.
|
|
12
|
+
|
|
13
|
+
## Mapping the old fields
|
|
14
|
+
|
|
15
|
+
| Old field | `importHistory` field | Notes |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| the old primary key | `key` | 1 to 100 characters, unique **within the scope**. Janus derives the id from the scope and the key. |
|
|
18
|
+
| organization | `scope` | Kept as given. |
|
|
19
|
+
| address | `email` | Normalised as `issue` does; one `@`. |
|
|
20
|
+
| invitee's name | `name` | 1 to 100 characters. |
|
|
21
|
+
| role | `role` | Opaque to Janus. |
|
|
22
|
+
| state | `status` | `accepted`, `revoked`, or `pending` (see below). |
|
|
23
|
+
| creation date | `createdAt` | A `Date`. It becomes the id's timestamp and orders the history. |
|
|
24
|
+
| accepted date | `acceptedAt` | Required when `accepted`. |
|
|
25
|
+
| user who accepted | `acceptedBy` | **A Janus user id**, or `null` when there is no such user. |
|
|
26
|
+
| revoked date | `revokedAt` | Required when `revoked`. |
|
|
27
|
+
| user who revoked | `revokedBy` | **A Janus user id**, or leave it out. |
|
|
28
|
+
| user who invited | `invitedBy` | **A Janus user id** or a user, or `null` for the system. |
|
|
29
|
+
| expiry date | `expiresAt` | Default: `createdAt` plus `invitations.lifetime`. |
|
|
30
|
+
| last change | `updatedAt` | Default: the accepted or revoked date, else `createdAt`. |
|
|
31
|
+
| language, reference | `locale`, `ref` | As for `issue`. |
|
|
32
|
+
| user type | `type` | One of `invitations.type`; required with several. |
|
|
33
|
+
|
|
34
|
+
**Three fields hold Janus user ids**, not your old ones: `acceptedBy`,
|
|
35
|
+
`revokedBy` and `invitedBy`. Import the users first, and map each old user id
|
|
36
|
+
to the Janus id, or pass `null` where the user is gone. An id that is not a
|
|
37
|
+
Janus id is refused as `invalid` on that field.
|
|
38
|
+
|
|
39
|
+
### Statuses
|
|
40
|
+
|
|
41
|
+
- `accepted` and `revoked` are imported as they are.
|
|
42
|
+
- `pending` whose `expiresAt` has passed is imported **as pending, lapsed**.
|
|
43
|
+
It is listed as pending, as `list` shows every lapsed invitation. A later
|
|
44
|
+
`issue` to that address revokes it, as it revokes a native lapsed one.
|
|
45
|
+
- `pending` whose `expiresAt` is still ahead is refused (`live-pending`): the
|
|
46
|
+
person may still follow the link in their inbox, and the import gives them
|
|
47
|
+
none. Issue it again.
|
|
48
|
+
- A `pending` record is also refused (`pending-held`) when the scope and
|
|
49
|
+
address already hold a pending invitation, since there is one per pair.
|
|
50
|
+
|
|
51
|
+
## Dry run first
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
const records = old.map((row) => ({
|
|
55
|
+
key: row.id,
|
|
56
|
+
scope: row.organizationId,
|
|
57
|
+
email: row.email,
|
|
58
|
+
name: row.name,
|
|
59
|
+
role: row.role,
|
|
60
|
+
status: row.state,
|
|
61
|
+
createdAt: row.createdAt,
|
|
62
|
+
...(row.state === 'accepted' && { acceptedAt: row.answeredAt, acceptedBy: userIds.get(row.userId) ?? null }),
|
|
63
|
+
...(row.state === 'revoked' && { revokedAt: row.answeredAt }),
|
|
64
|
+
}));
|
|
65
|
+
|
|
66
|
+
for (let from = 0; from < records.length; from += 1000) {
|
|
67
|
+
const report = await auth.invitations.importHistory(records.slice(from, from + 1000), { dryRun: true });
|
|
68
|
+
for (const item of report.items) {
|
|
69
|
+
if (item.outcome === 'refused') console.warn(item.key, item.reason, item.field);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
A call takes **at most 1000 records**: cut a bigger import into calls. With
|
|
75
|
+
`dryRun: true` nothing is written; the report says what would happen
|
|
76
|
+
(`inserted` means "would be inserted"). Fix the refusals in your data, run it
|
|
77
|
+
again, and when it is clean run the same loop without `dryRun`.
|
|
78
|
+
|
|
79
|
+
The report has one item per record, in order: `{ key, id, outcome, reason?, field? }`
|
|
80
|
+
with the totals `inserted`, `present` and `refused`. A reason names a shape
|
|
81
|
+
(`field: 'acceptedAt'`), never the value you passed. A call that is not an array
|
|
82
|
+
of at most 1000 records, or has bad options, throws a `TypeError`; a store
|
|
83
|
+
outage throws a `StoreFailure`, and what was written before it stays.
|
|
84
|
+
|
|
85
|
+
## Re-running
|
|
86
|
+
|
|
87
|
+
The import is **idempotent by (`scope`, `key`)**: the id is derived from both,
|
|
88
|
+
so running it again reports the records already there as `present` and writes
|
|
89
|
+
nothing. That makes an interrupted import safe to repeat, and lets you import
|
|
90
|
+
the rows that changed in the old system, one `key` at a time. A record that is
|
|
91
|
+
`present` is **never updated**: its second import does not carry a changed
|
|
92
|
+
status. Two runs at the same time may both report `inserted` for a record; one
|
|
93
|
+
write wins and the other finds it taken.
|
|
94
|
+
|
|
95
|
+
Two records with one scope and key in one call: the second is refused
|
|
96
|
+
(`duplicate-key`). The same scope and key already imported with another
|
|
97
|
+
`createdAt` is refused as `key-taken`; its `id` is the one in the store.
|
|
98
|
+
|
|
99
|
+
## What keeps the history
|
|
100
|
+
|
|
101
|
+
Imported records are old, so their `expiresAt` is long past. A store that
|
|
102
|
+
deletes expired invitations deletes them too.
|
|
103
|
+
|
|
104
|
+
- **MongoDB** (`@softistx/janus-mongo`): the `invitations` TTL index drops
|
|
105
|
+
every invitation 30 days after `expiresAt`. Imported records are older than
|
|
106
|
+
that, so **the next TTL pass, within a minute, drops them**. **Run the sync
|
|
107
|
+
first**, before the import, so that no pass sees the records:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
await syncMongoInvitations(db, { expiry: { keepAccepted: true, keepRevoked: true, keepLapsed: true } });
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`keepAccepted` keeps accepted records, `keepRevoked` revoked ones and
|
|
114
|
+
`keepLapsed` lapsed pending ones; an import sets all three. The index sees only the stored status, so a native
|
|
115
|
+
pending invitation that lapsed is kept too. See
|
|
116
|
+
[the sync page](https://github.com/softistx/nxgt-janus/blob/develop/packages/janus-mongo/docs/guide/sync.md#keeping-history).
|
|
117
|
+
- **Drizzle** (`@softistx/janus-drizzle`): nothing expires on its own, but
|
|
118
|
+
`deleteExpiredInvitations(before)` deletes **every status** whose `expiresAt`
|
|
119
|
+
is at or before `before`. Do not schedule it on a table holding history, or
|
|
120
|
+
call it with a `before` earlier than the oldest imported `expiresAt`, or
|
|
121
|
+
delete lapsed pending rows yourself with a statement that keeps the
|
|
122
|
+
`accepted` and `revoked` ones.
|
|
123
|
+
- **Your own store**: if it expires records by `expiresAt`, keep the imported
|
|
124
|
+
ones out of it, or keep the statuses you want as history.
|
|
125
|
+
|
|
126
|
+
## Traps
|
|
127
|
+
|
|
128
|
+
- **Nothing is sent and nothing is emitted.** No mail, no code, no
|
|
129
|
+
`invitation.*` event: a webhook or audit listener does not see the import.
|
|
130
|
+
- **Accepted records do not create users or memberships.** `acceptedBy` only
|
|
131
|
+
names a user; adding the member to the organization is yours.
|
|
132
|
+
- **`present` is not "unchanged".** A record already imported is left as it
|
|
133
|
+
was, even when the old row differs now.
|
|
134
|
+
- **The key is the identity.** Changing how you build `key` imports every
|
|
135
|
+
record a second time under new ids. And a record imported once with another
|
|
136
|
+
`createdAt` (the id carries it) is refused as `key-taken`, never imported
|
|
137
|
+
twice: keep `createdAt` stable, or change the key.
|
|
138
|
+
|
|
139
|
+
## See also
|
|
140
|
+
|
|
141
|
+
- [Invitations](invitations.md) — issuing, resending, revoking and accepting
|
|
142
|
+
- [Adapters](adapters.md) — what an invitation store must keep
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
# Passkeys: second factor, or first
|
|
2
|
+
|
|
3
|
+
A passkey is a WebAuthn credential kept by the user's device, password manager
|
|
4
|
+
or security key. In Janus it is a **second factor beside TOTP, never instead
|
|
5
|
+
of it**: a user may register a passkey only while their TOTP is active.
|
|
6
|
+
Optionally (`firstFactor: true`, which needs no `secondFactor` at all) it is the **first factor** too, for a
|
|
7
|
+
passwordless sign-in: see [below](#passkey-as-the-first-factor). Registering and managing passkeys, then answering a sign-in's second factor
|
|
8
|
+
and a step-up with one, are on this page.
|
|
9
|
+
|
|
10
|
+
Install the verifier beside the core, from npmjs: `bun add @softistx/janus-passkeys`
|
|
11
|
+
(see the [core's install section](../../README.md#install)).
|
|
12
|
+
|
|
13
|
+
The core does no WebAuthn. It makes and spends the challenge, checks the user
|
|
14
|
+
and the session, and stores the credential; a `PasskeyVerifier` reads the
|
|
15
|
+
browser's JSON. `@softistx/janus-passkeys` is one, on `@simplewebauthn/server`;
|
|
16
|
+
the port is documented in the [README](../../README.md#api).
|
|
17
|
+
|
|
18
|
+
## Wiring
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { simpleWebAuthnVerifier } from '@softistx/janus-passkeys';
|
|
22
|
+
|
|
23
|
+
const auth = janus({
|
|
24
|
+
user,
|
|
25
|
+
password: { login: 'email' },
|
|
26
|
+
store, // needs the passkeys slot: createMemoryStores(), or an adapter's
|
|
27
|
+
hasher,
|
|
28
|
+
secondFactor: { issuer: 'Clinic', keys }, // optional with firstFactor: true
|
|
29
|
+
passkeys: {
|
|
30
|
+
rpId: 'example.com',
|
|
31
|
+
rpName: 'Clinic',
|
|
32
|
+
origins: ['https://app.example.com'],
|
|
33
|
+
verifier: simpleWebAuthnVerifier(),
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
| Option | Default | |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| `rpId` | required | The domain credentials are scoped to: a lowercase host (`example.com`), no scheme, port or path. Changing it strands every registered passkey |
|
|
41
|
+
| `rpName` | required | The name the browser shows when it asks |
|
|
42
|
+
| `origins` | required, at least one | The origins a response may come from. Each is `https` (or `http://localhost`, `http://<name>.localhost` such as `http://tenant.app.localhost`, or `http://127.0.0.1`, on any port, for development; no other `http` host) and on `rpId`: the same host or a subdomain |
|
|
43
|
+
| `relatedOrigins` | none | Origins on **another host** than `rpId` (a second domain), accepted beside `origins` by registration and sign-in. Each is `https` (or the same local dev hosts as `origins`), with no path, on any host. See [Related origins](#related-origins) |
|
|
44
|
+
| `verifier` | required | A `PasskeyVerifier` |
|
|
45
|
+
| `userVerification` | `'preferred'` | `'required'` asks the authenticator to verify the user (PIN, biometrics) and the core refuses any response, at registration, sign-in or step-up, whose verifier reports `userVerified: false`; at sign-in and step-up the refusal counts as a wrong code (a spent attempt); `'discouraged'` does not |
|
|
46
|
+
| `freshWithin` | `'10m'` | How recently the session must have proved who it is to `register` or `remove` |
|
|
47
|
+
| `firstFactor` | `false` | `true` makes a passkey a first factor: [sign in with one alone](#passkey-as-the-first-factor). `secondFactor` is then optional: configure it only for a TOTP |
|
|
48
|
+
| `maxPerUser` | `10` | The passkeys one user may hold: a positive integer. `register` refuses the next with `PASSKEY_LIMIT` (409, `maxActive` carries the cap) |
|
|
49
|
+
|
|
50
|
+
### Related origins
|
|
51
|
+
|
|
52
|
+
A passkey is scoped to `rpId`, and `origins` only takes `rpId` or its
|
|
53
|
+
subdomains. To accept ceremonies from a page on **another domain** (a
|
|
54
|
+
customer's own domain, a second brand), list it in `relatedOrigins`
|
|
55
|
+
(WebAuthn Level 3 related origin requests):
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
passkeys: {
|
|
59
|
+
rpId: 'example.com',
|
|
60
|
+
rpName: 'Clinic',
|
|
61
|
+
origins: ['https://app.example.com'],
|
|
62
|
+
relatedOrigins: ['https://portal.customer.org'], // any host, https, no path
|
|
63
|
+
verifier: simpleWebAuthnVerifier(),
|
|
64
|
+
},
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The entries skip the on-`rpId` check, are validated as well-formed secure
|
|
68
|
+
origins (a path or a non-`https` origin is refused at wiring), and are added to
|
|
69
|
+
the origins the verifier accepts for registration and sign-in. `origins` keeps
|
|
70
|
+
its strict rule.
|
|
71
|
+
|
|
72
|
+
**Your application must also serve `/.well-known/webauthn`** on the `rpId` host
|
|
73
|
+
(`https://example.com/.well-known/webauthn`), a JSON document listing the same
|
|
74
|
+
origins: `{ "origins": ["https://portal.customer.org"] }`. The browser reads it
|
|
75
|
+
before it lets the other domain use `rpId`; janus does not serve it. Browsers
|
|
76
|
+
cap the number of distinct registrable domains in that document (five labels in
|
|
77
|
+
current implementations).
|
|
78
|
+
|
|
79
|
+
`tokens: { passkeyRegistration }` is how long a registration's challenge waits
|
|
80
|
+
(`'5m'` by default).
|
|
81
|
+
|
|
82
|
+
**The types refuse the configuration** without `secondFactor` (unless `firstFactor: true`) and over a store
|
|
83
|
+
whose type has no `passkeys` slot, on the `passkeys` key. A store typed as
|
|
84
|
+
`JanusStores`, where the slot is optional, passes the types and is refused at
|
|
85
|
+
wiring with a `TypeError` naming the slot; so is every option the types cannot
|
|
86
|
+
see (an `rpId` with a scheme, an origin off `rpId`, a verifier missing a method).
|
|
87
|
+
|
|
88
|
+
The calls below exist on a user type's API (`auth.passkeys` with one type,
|
|
89
|
+
`auth.staff.passkeys` with several).
|
|
90
|
+
|
|
91
|
+
## Registering
|
|
92
|
+
|
|
93
|
+
Registration is two calls: the options the browser needs, then what it answered.
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
// 1. The user asks to add a passkey.
|
|
97
|
+
const { options, challenge, expiresAt } = await auth.passkeys.registrationOptions(user);
|
|
98
|
+
// Send `options` to the page: navigator.credentials.create({ publicKey: options }).
|
|
99
|
+
// Keep `challenge` with the user (page state, a short-lived cookie).
|
|
100
|
+
|
|
101
|
+
// 2. The page sends the credential back.
|
|
102
|
+
const current = await auth.authenticate(request);
|
|
103
|
+
const passkey = await auth.passkeys.register(current, {
|
|
104
|
+
challenge,
|
|
105
|
+
response, // what navigator.credentials.create() resolved to, as JSON, as received
|
|
106
|
+
name: 'Laptop', // the user's, 1 to 100 characters once trimmed
|
|
107
|
+
});
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`registrationOptions` refuses a user whose TOTP is not active with
|
|
111
|
+
`SECOND_FACTOR_NOT_ENROLLED` (only with `firstFactor` off), and an inactive one with `USER_INACTIVE`. It
|
|
112
|
+
makes a challenge (32 random bytes, base64url), stores only its hash for
|
|
113
|
+
`tokens.passkeyRegistration`, and asks the verifier for the options with the
|
|
114
|
+
user's existing credentials excluded, so one authenticator is not registered
|
|
115
|
+
twice. The user handle is derived from the user's id, never the e-mail.
|
|
116
|
+
|
|
117
|
+
`register` takes the session (`Authenticated`, from `authenticate`), because
|
|
118
|
+
it is **fresh**: a session that proved who it is more than `freshWithin` ago
|
|
119
|
+
is `STEP_UP_REQUIRED`, and the usual [step-up](step-up.md) fixes it. Then, in this order:
|
|
120
|
+
|
|
121
|
+
1. the name is checked (`PASSKEY_INVALID`, `field: 'name'`) — **nothing is
|
|
122
|
+
spent** for a bad name;
|
|
123
|
+
2. the user's passkeys are counted: at `maxPerUser`, `PASSKEY_LIMIT`, **nothing
|
|
124
|
+
spent**;
|
|
125
|
+
3. the challenge is spent, once: unknown, used and lapsed are
|
|
126
|
+
`TOKEN_UNKNOWN`, `TOKEN_SPENT` and `TOKEN_EXPIRED`; another user's challenge is
|
|
127
|
+
unknown — **and spent**: the token is consumed before its owner is compared,
|
|
128
|
+
so a challenge presented by the wrong user is burnt (fail closed), never
|
|
129
|
+
left usable;
|
|
130
|
+
4. the user must still have an active TOTP;
|
|
131
|
+
5. the verifier checks the response. One that does not verify is
|
|
132
|
+
`PASSKEY_INVALID` with `reason`, **and the challenge stays spent** — ask for
|
|
133
|
+
new options. An unexpected failure of the verifier propagates as thrown;
|
|
134
|
+
6. the passkey is inserted. A credential already registered, by this user or
|
|
135
|
+
another, is `PASSKEY_TAKEN`; nothing is written over it;
|
|
136
|
+
7. the TOTP is checked again: if a `secondFactor.disable` landed meanwhile,
|
|
137
|
+
the passkey just inserted is deleted and the call is
|
|
138
|
+
`SECOND_FACTOR_NOT_ENROLLED`, with no event. If an `update` moved the
|
|
139
|
+
e-mail meanwhile, the passkey is deleted and the call is `EMAIL_UNVERIFIED`,
|
|
140
|
+
with no event. So is a passkey whose user's e-mail or verification date is
|
|
141
|
+
no longer what the call checked at its start (the e-mail was moved and
|
|
142
|
+
proved again between the check and the insert, so the first proof's wipe
|
|
143
|
+
ran before the insert). That fails closed: a `changeEmail.confirm`, or a
|
|
144
|
+
`verifyEmail` re-proof of the same address, landing in that instant
|
|
145
|
+
withdraws a legitimate passkey too, and the user registers again. The
|
|
146
|
+
count is read again too:
|
|
147
|
+
two registrations racing at `maxPerUser - 1` can both see the user over the
|
|
148
|
+
cap, and then **both** withdraw with `PASSKEY_LIMIT` (fail closed; the
|
|
149
|
+
user registers again);
|
|
150
|
+
8. `user.passkeyAdded` is emitted, carrying `passkey: { credentialId, name }`.
|
|
151
|
+
|
|
152
|
+
## Listing, renaming and removing
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
const passkeys = await auth.passkeys.list(user); // oldest first; [] for none
|
|
156
|
+
await auth.passkeys.rename(user, credentialId, 'Work laptop'); // true | false
|
|
157
|
+
await auth.passkeys.remove(current, credentialId); // true | false
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
A `Passkey` carries `credentialId`, `userId`, `name`, `transports`, `aaguid`,
|
|
161
|
+
`backupEligible`, `backedUp`, `createdAt` and `lastUsedAt`. **It never carries the public key or the counter.**
|
|
162
|
+
`rename` and `remove` answer `false` for a passkey that is not the user's or not there, and
|
|
163
|
+
change nothing — a request-supplied credential id tells nothing about whose it is.
|
|
164
|
+
`remove` is fresh, like `register`, and emits `user.passkeyRemoved` when it
|
|
165
|
+
deleted one. Deleting a user deletes their passkeys, and so does
|
|
166
|
+
**disabling their TOTP**: a passkey only stands beside an active TOTP, so
|
|
167
|
+
`secondFactor.disable` (and a first proof that removes an active TOTP) deletes
|
|
168
|
+
them all and emits one `user.passkeyRemoved` for each passkey it deleted. A
|
|
169
|
+
final sweep deletes whatever a registration inserted in the meantime, with no
|
|
170
|
+
event.
|
|
171
|
+
|
|
172
|
+
## Signing in with a passkey
|
|
173
|
+
|
|
174
|
+
`signIn` (and every first proof that ends at a second factor: a sign-in code, a
|
|
175
|
+
link, `signInProven`, social) answers `SecondFactorRequired`. It now says what
|
|
176
|
+
can answer it:
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
const result = await auth.signIn({ email, password });
|
|
180
|
+
if (result.status === 'secondFactor') {
|
|
181
|
+
result.challenge; // keep it with the visitor, as before
|
|
182
|
+
result.methods; // ['totp'] | ['totp', 'passkey']
|
|
183
|
+
result.passkeyOptions; // present exactly when methods has 'passkey'
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
`methods` is always there and always has `'totp'`; `'passkey'` and
|
|
188
|
+
`passkeyOptions` appear when `janus()` was given `passkeys` and the user holds
|
|
189
|
+
at least one. Existing callers that ignore them keep working. The page hands
|
|
190
|
+
`passkeyOptions` to `navigator.credentials.get({ publicKey })` and sends the
|
|
191
|
+
result back:
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
const signedIn = await auth.secondFactor.confirmPasskey(challenge, assertion, { device });
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
- **The WebAuthn challenge is derived, not stored**: an HMAC (SHA-256, base64url)
|
|
198
|
+
of the sign-in token's secret, with a key derived from the sealing keys for
|
|
199
|
+
this purpose alone. A step-up derives with another purpose, so an assertion
|
|
200
|
+
made for one never answers the other. Rotating the sealing keys between
|
|
201
|
+
`signIn` and the assertion refuses that one assertion.
|
|
202
|
+
- **The attempts are the challenge's five**, shared with `confirm` and
|
|
203
|
+
`recover`: a TOTP guess and a passkey assertion draw on the same count.
|
|
204
|
+
Anything the visitor can cause — a response that does not verify, a credential
|
|
205
|
+
that is unknown or another user's, a counter regression, a malformed body — is
|
|
206
|
+
`CODE_INVALID` with `attemptsLeft`; the fifth spends the challenge. An
|
|
207
|
+
unknown, spent or lapsed challenge is `TOKEN_UNKNOWN`, `TOKEN_SPENT`,
|
|
208
|
+
`TOKEN_EXPIRED`; a user whose TOTP was disabled meanwhile is
|
|
209
|
+
`SECOND_FACTOR_NOT_ENROLLED`.
|
|
210
|
+
- **The session** opens as after `confirm`: the sign-in count restarts, and a
|
|
211
|
+
`device` given again handles `newDevice` and `user.newDeviceSignedIn`.
|
|
212
|
+
The user record is not written (a passkey leaves the TOTP's `lastStep` alone).
|
|
213
|
+
- **The counter** follows one rule. A stored counter of `0`, or a received `0`,
|
|
214
|
+
is always accepted (an authenticator without a counter; a received `0` after
|
|
215
|
+
a counted history never lowers the stored one). A counter that did not move
|
|
216
|
+
forward (`new <= stored`, both non-zero) is refused as above **and** emits
|
|
217
|
+
`user.passkeyCloneSuspected` with `passkey: { credentialId, name }`; the
|
|
218
|
+
passkey stays active, so a user is not locked out by a false alarm. The
|
|
219
|
+
event fires **once per refused assertion**, with no deduplication: debounce
|
|
220
|
+
it in your listener before notifying the user. Your
|
|
221
|
+
listener decides: a notice, an alert, `passkeys.remove`. A verifier that
|
|
222
|
+
reports `counterRegression` itself is treated the same way.
|
|
223
|
+
- **On success** the passkey's `counter`, `backedUp` and `lastUsedAt` are
|
|
224
|
+
written, conditionally on the counter read: of two assertions on one counter,
|
|
225
|
+
only one passes.
|
|
226
|
+
|
|
227
|
+
## Passkey as the first factor
|
|
228
|
+
|
|
229
|
+
With `passkeys: { ..., firstFactor: true }` a
|
|
230
|
+
passkey signs the user in alone. What changes:
|
|
231
|
+
|
|
232
|
+
- `secondFactor` becomes optional. Its sealing keys seal the TOTP secret and
|
|
233
|
+
its recovery codes, so an application with passkeys only configures neither:
|
|
234
|
+
`janus({ …, passkeys: { …, firstFactor: true } })`. The `auth.passkeys` API
|
|
235
|
+
is then on the type as well. Add `secondFactor` later to offer a TOTP too.
|
|
236
|
+
- `registrationOptions` and `register` no longer need an active TOTP, and ask a
|
|
237
|
+
**discoverable** credential (`residentKey` and `userVerification` required)
|
|
238
|
+
through the verifier's optional `discoverable` input; `@softistx/janus-passkeys`
|
|
239
|
+
supports it, a verifier written before it registers credentials that cannot sign in.
|
|
240
|
+
- `update` refuses to move the e-mail of a user who holds a passkey
|
|
241
|
+
(`EMAIL_CHANGE_NEEDS_PROOF`, nothing written): the new address would be
|
|
242
|
+
unproved and its first proof would remove every passkey. Use `changeEmail`,
|
|
243
|
+
which proves the new address.
|
|
244
|
+
- Disabling a TOTP keeps the passkeys (and the sweep on activation is skipped).
|
|
245
|
+
`proveFirstEmail` still removes all of them.
|
|
246
|
+
- **A type with an e-mail registers a passkey only once the e-mail is
|
|
247
|
+
verified** (`EMAIL_UNVERIFIED` otherwise), beside a TOTP or as a first
|
|
248
|
+
factor. The first proof of the e-mail removes every passkey, so one
|
|
249
|
+
registered before it would vanish unannounced; and a passkey that signs in
|
|
250
|
+
alone must never belong to somebody who squatted an address: a password reset
|
|
251
|
+
or an e-mail proof by the real owner would not remove it. A reset replaces the
|
|
252
|
+
password and revokes the sessions; it leaves the owner's own passkeys, so
|
|
253
|
+
remove them (`passkeys.remove`) when an account is recovered after a
|
|
254
|
+
compromise.
|
|
255
|
+
- Turning `firstFactor` on later makes the passkeys registered beside a TOTP
|
|
256
|
+
first factors too, but only those the authenticator made discoverable (they
|
|
257
|
+
were registered with `residentKey: 'preferred'`); the others must be
|
|
258
|
+
registered again. An unverified address still loses passkeys stored before registration required a verified e-mail, at its first proof.
|
|
259
|
+
- The assertion must carry the **user handle** (the discoverable credential's
|
|
260
|
+
`userHandle`); a missing or different one is refused.
|
|
261
|
+
- `signInOptions` and `signIn` are on the type only when `firstFactor: true` is
|
|
262
|
+
written as a literal in the config; with a `boolean` variable they are absent
|
|
263
|
+
from the type and refuse at run time.
|
|
264
|
+
- With a literal `firstFactor: true`, the whole `auth.passkeys` surface
|
|
265
|
+
(registration, list, rename, remove, sign-in) is typed whatever the type's
|
|
266
|
+
login, including a passwordless type with no password.
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
// Anonymous: nothing says who the visitor is yet.
|
|
270
|
+
const { options, challenge, expiresAt } = await auth.passkeys.signInOptions();
|
|
271
|
+
// options -> navigator.credentials.get({ publicKey }); keep `challenge` with the visitor.
|
|
272
|
+
|
|
273
|
+
const { user, session, token } = await auth.passkeys.signIn(challenge, response, { device });
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
interface PasskeySignInChallenge {
|
|
278
|
+
options: Record<string, unknown>; // for navigator.credentials.get
|
|
279
|
+
challenge: string; // base64url, single use
|
|
280
|
+
expiresAt: Date;
|
|
281
|
+
}
|
|
282
|
+
signInOptions(): Promise<PasskeySignInChallenge>;
|
|
283
|
+
signIn(challenge: string, response: unknown, options?: SignInOptions): Promise<SignedIn<User>>;
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
`signIn` answers like a password sign-in (`session.authenticatedAt` is now, the
|
|
287
|
+
new-device report runs) and asks no TOTP code. It requires user verification.
|
|
288
|
+
The challenge reuses the `tokens.passkeyRegistration` lifetime and is spent on
|
|
289
|
+
the first try: a failed attempt needs a new `signInOptions`.
|
|
290
|
+
|
|
291
|
+
| Throws | When |
|
|
292
|
+
| --- | --- |
|
|
293
|
+
| `CredentialError` `CREDENTIALS_INVALID`, `reason: 'passkey'` | The assertion was refused: unknown credential, malformed response, a user handle that does not match, or a verification failure (origin, `rpId`, challenge, user not verified). One answer, so the response tells nothing |
|
|
294
|
+
| `TokenError` `TOKEN_UNKNOWN`, `TOKEN_SPENT`, `TOKEN_EXPIRED` | The challenge is missing, unknown, spent, lapsed, or a registration's |
|
|
295
|
+
| `UserError` `USER_INACTIVE`, `EMAIL_UNVERIFIED` | The user is inactive, or has an unverified e-mail when `requireVerifiedEmail` is set; checked only once the assertion verified |
|
|
296
|
+
| `UserError` `EMAIL_UNVERIFIED` | `registrationOptions` or `register` while the account's e-mail is not proved, whatever `requireVerifiedEmail` says: verify the e-mail first |
|
|
297
|
+
| `TypeError` naming `passkeys.firstFactor` | Called with `firstFactor` off; nothing is spent |
|
|
298
|
+
|
|
299
|
+
A counter regression is refused the same way and emits
|
|
300
|
+
`user.passkeyCloneSuspected`.
|
|
301
|
+
|
|
302
|
+
A Hono route:
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
import { CredentialError, TokenError } from '@softistx/janus';
|
|
306
|
+
|
|
307
|
+
app.get('/passkey/sign-in', async (c) => c.json(await auth.passkeys.signInOptions()));
|
|
308
|
+
app.post('/passkey/sign-in', async (c) => {
|
|
309
|
+
const { challenge, response } = await c.req.json();
|
|
310
|
+
try {
|
|
311
|
+
const { token } = await auth.passkeys.signIn(challenge, response);
|
|
312
|
+
return c.json({ token });
|
|
313
|
+
} catch (error) {
|
|
314
|
+
if (error instanceof CredentialError || error instanceof TokenError) return c.json({ error: 'invalid' }, 401);
|
|
315
|
+
throw error;
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
`signInOptions` is anonymous and stores a token per call: rate-limit it where requests enter.
|
|
321
|
+
|
|
322
|
+
## Counter policy
|
|
323
|
+
|
|
324
|
+
A stored or received counter of `0` is always accepted. Otherwise a counter that
|
|
325
|
+
did not move forward is refused and emits `user.passkeyCloneSuspected`; the
|
|
326
|
+
passkey stays active, and the stored counter is never lowered (it is the
|
|
327
|
+
maximum seen). Details in [signing in](#signing-in-with-a-passkey); see also the
|
|
328
|
+
[Traps](#traps).
|
|
329
|
+
|
|
330
|
+
## Stepping up with a passkey
|
|
331
|
+
|
|
332
|
+
```ts
|
|
333
|
+
const issued = await auth.stepUp.request(user, { via: 'passkey' });
|
|
334
|
+
// { via: 'passkey', challenge, options, expiresAt, user } — nothing is sent
|
|
335
|
+
// `options` → navigator.credentials.get({ publicKey }); keep `challenge`
|
|
336
|
+
const session = await auth.stepUp.confirmPasskey(request, issued.challenge, assertion);
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
It mirrors the other kinds: one live step-up per user, a session that is not
|
|
340
|
+
the challenge's user's is `TOKEN_UNKNOWN`, and the session presented is
|
|
341
|
+
stamped (`authenticatedAt` moves). Its token is marked as a passkey's: a code
|
|
342
|
+
sent to `stepUp.confirm` for it, or an assertion sent to `confirmPasskey` for an
|
|
343
|
+
app's or e-mailed challenge, is `TOKEN_UNKNOWN`. `stepUp.request(user)` without `via` is
|
|
344
|
+
unchanged — the app's code for a user with a second factor, an e-mailed code
|
|
345
|
+
otherwise. A user with no passkey is refused with `SECOND_FACTOR_NOT_ENROLLED`.
|
|
346
|
+
The challenge's five attempts and the counter rule are the sign-in's; the
|
|
347
|
+
per-user window the app's codes share is not applied to assertions, which
|
|
348
|
+
cannot be guessed. Like every step-up it exists on types with an e-mail.
|
|
349
|
+
|
|
350
|
+
Types: the request answers `StepUpByPasskey`; `stepUp.request(user, { via })`
|
|
351
|
+
and `stepUp.confirmPasskey` are the `StepUpPasskeyApi` addition, and
|
|
352
|
+
`secondFactor.confirmPasskey` is `PasskeySignInApi`'s; `methods` is a list of
|
|
353
|
+
`SecondFactorMethod` (`'totp' | 'passkey'`). They exist only when `janus()` is given
|
|
354
|
+
`passkeys`; without the block they are absent from the type, and a JavaScript
|
|
355
|
+
caller gets a `TypeError` naming `passkeys` before any attempt is counted.
|
|
356
|
+
|
|
357
|
+
## The store slot
|
|
358
|
+
|
|
359
|
+
Passkeys live in an optional fifth store slot, `passkeys`. Bring one:
|
|
360
|
+
|
|
361
|
+
| You use | The slot comes from |
|
|
362
|
+
| --- | --- |
|
|
363
|
+
| `createMemoryStores()` | Already there, for specs and local runs |
|
|
364
|
+
| `@softistx/janus-mongo` | `createMongoStores(db)` (typed with `passkeys` present, so it needs no cast); run `syncMongoAdapter(db)` first so the `passkeys` collection and its unique `credentialId` index exist |
|
|
365
|
+
| `@softistx/janus-drizzle` | Add `passkeys` to `defineJanusTables()` and migrate ([to 0.16](https://github.com/softistx/nxgt-janus/blob/develop/packages/janus-drizzle/docs/guide/migrations.md#to-016-passkeys-and-the-passkeyregistration-kind)) |
|
|
366
|
+
| `@softistx/janus-kit` | Wires whichever adapter you chose; it refuses to start on MongoDB until the collection exists |
|
|
367
|
+
|
|
368
|
+
An adapter of your own implements the slot and runs the `passkeys` group of
|
|
369
|
+
`describeJanusStores` from `@softistx/janus/conformance`.
|
|
370
|
+
|
|
371
|
+
## Mails and events
|
|
372
|
+
|
|
373
|
+
`janus()` sends nothing. It emits `user.passkeyAdded` and `user.passkeyRemoved`
|
|
374
|
+
(each with `passkey: { credentialId, name }`) and `user.passkeyCloneSuspected`.
|
|
375
|
+
[`@softistx/janus-mail`](https://github.com/softistx/nxgt-janus/blob/develop/packages/janus-mail/docs/guide/sending.md#passkeyaddedto-added-and-passkeyremovedto-removed)
|
|
376
|
+
has `passkeyAdded` and `passkeyRemoved` notices for the first two; the clone
|
|
377
|
+
alarm has no mail, so route it in your listener. Removing a user's TOTP emits
|
|
378
|
+
one `passkeyRemoved` per passkey, so debounce on `event.userId` if you mail.
|
|
379
|
+
|
|
380
|
+
## Over HTTP and GraphQL
|
|
381
|
+
|
|
382
|
+
- [`passkeyRoutes(auth)`](https://github.com/softistx/nxgt-janus/blob/develop/packages/janus-hono/docs/guide/routes.md#passkeys) of `@softistx/janus-hono`: the routes for all of the above.
|
|
383
|
+
- [`passkeyResolvers`](https://github.com/softistx/nxgt-janus/blob/develop/packages/janus-graphql/docs/guide/passkeys.md) of `@softistx/janus-graphql`: the SDL and resolvers.
|
|
384
|
+
|
|
385
|
+
## Testing with a fake verifier
|
|
386
|
+
|
|
387
|
+
The core never depends on the WebAuthn library, so a spec needs no browser:
|
|
388
|
+
|
|
389
|
+
```ts
|
|
390
|
+
const verifier: PasskeyVerifier = {
|
|
391
|
+
async registrationOptions(input) { return { challenge: input.challenge }; },
|
|
392
|
+
async verifyRegistration({ response, expectedChallenge }) {
|
|
393
|
+
const { challenge, credentialId } = response as { challenge: string; credentialId: string };
|
|
394
|
+
if (challenge !== expectedChallenge) return { ok: false, reason: 'challenge' };
|
|
395
|
+
return { ok: true, credentialId, publicKey: 'key', counter: 0, transports: ['internal'], aaguid: '', backupEligible: true, backedUp: false };
|
|
396
|
+
},
|
|
397
|
+
async authenticationOptions({ challenge }) { return { challenge }; },
|
|
398
|
+
async verifyAuthentication({ response, expectedChallenge, credential }) {
|
|
399
|
+
const { id, challenge, counter } = response as { id: string; challenge: string; counter: number };
|
|
400
|
+
if (id !== credential.credentialId || challenge !== expectedChallenge) return { ok: false, reason: 'challenge' };
|
|
401
|
+
return { ok: true, credentialId: id, counter, backedUp: false, userVerified: true };
|
|
402
|
+
},
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
const { challenge } = await auth.passkeys.registrationOptions(user);
|
|
406
|
+
await auth.passkeys.register(current, { challenge, response: { challenge, credentialId: 'c1' }, name: 'Test' });
|
|
407
|
+
|
|
408
|
+
// Sign-in: answer with the challenge of passkeyOptions.
|
|
409
|
+
const result = await auth.signIn({ email, password });
|
|
410
|
+
if (result.status === 'secondFactor' && result.passkeyOptions) {
|
|
411
|
+
const assertion = { id: 'c1', challenge: String(result.passkeyOptions.challenge), counter: 1 };
|
|
412
|
+
await auth.secondFactor.confirmPasskey(result.challenge, assertion);
|
|
413
|
+
}
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
## Traps
|
|
417
|
+
|
|
418
|
+
- **Disabling TOTP removes every passkey, unless `firstFactor` is on** (then they stay: they still sign the user in). A first proof of an e-mail (`proveFirstEmail`) removes all of them either way. Warn the user before they do.
|
|
419
|
+
- **Credential ids are scoped per store**: each `janus()` instance or partition has its own, so a passkey of one is unknown to another.
|
|
420
|
+
- **One attempt per registration challenge.** A response that does not verify spends it. A sign-in or
|
|
421
|
+
step-up challenge takes five, shared with the app's codes.
|
|
422
|
+
- **A counter regression refuses, it does not disable.** Handle `user.passkeyCloneSuspected`.
|
|
423
|
+
- **`rpId` is forever.** Credentials are scoped to it by the browser.
|
|
424
|
+
|
|
425
|
+
Related: [the second factor](second-factor.md), [step-up](step-up.md), [user events](events.md), [errors](errors.md).
|