@softistx/janus 0.0.0-stage → 0.74.0
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 +2929 -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 +72 -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 +142 -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 +23 -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 +201 -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-7h34nqrm.js +732 -0
- package/dist/chunks/index-7h34nqrm.js.map +24 -0
- package/dist/chunks/index-ftz0ne6j.js +127 -0
- package/dist/chunks/index-ftz0ne6j.js.map +11 -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 +4442 -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 +6948 -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 +861 -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 +648 -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 +102 -0
- package/docs/troubleshooting.md +3318 -0
- package/package.json +77 -5
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passkeys (WebAuthn credentials): a credential's record, and the store that
|
|
3
|
+
* holds them.
|
|
4
|
+
*
|
|
5
|
+
* Part of the store port; the rules every implementation keeps are in
|
|
6
|
+
* `./index`. **An optional slot of `JanusStores`** (`stores.passkeys`): only
|
|
7
|
+
* an application that enables passkeys needs it.
|
|
8
|
+
*/
|
|
9
|
+
import type { Id } from '../../../ids/id';
|
|
10
|
+
/**
|
|
11
|
+
* One WebAuthn credential registered by one user.
|
|
12
|
+
*
|
|
13
|
+
* `credentialId` is the key: the authenticator's identifier, base64url,
|
|
14
|
+
* written verbatim and compared byte for byte — **case-sensitive**, never
|
|
15
|
+
* normalised. `publicKey` is the COSE key, base64url, and must round-trip
|
|
16
|
+
* byte for byte: a re-encoded key no longer verifies a signature.
|
|
17
|
+
*/
|
|
18
|
+
export interface PasskeyRecord {
|
|
19
|
+
/** The authenticator's credential id, base64url. The unique key. */
|
|
20
|
+
readonly credentialId: string;
|
|
21
|
+
readonly userId: Id;
|
|
22
|
+
/** The credential's public key, COSE-encoded, base64url. */
|
|
23
|
+
readonly publicKey: string;
|
|
24
|
+
/** The signature counter last accepted. `0` for an authenticator without one. */
|
|
25
|
+
readonly counter: number;
|
|
26
|
+
/** The transports the authenticator reported at registration (`'usb'`, `'internal'`). */
|
|
27
|
+
readonly transports: readonly string[];
|
|
28
|
+
/** The authenticator model's AAGUID, kept for display. */
|
|
29
|
+
readonly aaguid: string;
|
|
30
|
+
/** Whether the credential may be synced (the BE flag). */
|
|
31
|
+
readonly backupEligible: boolean;
|
|
32
|
+
/** Whether it is currently synced (the BS flag). */
|
|
33
|
+
readonly backedUp: boolean;
|
|
34
|
+
/** The name the user gave it. */
|
|
35
|
+
readonly name: string;
|
|
36
|
+
readonly createdAt: Date;
|
|
37
|
+
/** When it last signed in, or `null` if it never has. */
|
|
38
|
+
readonly lastUsedAt: Date | null;
|
|
39
|
+
}
|
|
40
|
+
/** What a successful use changes on a passkey. */
|
|
41
|
+
export interface PasskeyUse {
|
|
42
|
+
readonly counter: number;
|
|
43
|
+
readonly backedUp: boolean;
|
|
44
|
+
readonly lastUsedAt: Date;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Passkeys. Every method is atomic on its own, and `null`, `false`, `0` and
|
|
48
|
+
* `[]` are answers: only a failure throws (`StoreFailure`).
|
|
49
|
+
*/
|
|
50
|
+
export interface PasskeyStore {
|
|
51
|
+
/**
|
|
52
|
+
* Stores a passkey **if its `credentialId` is not held yet**, and answers
|
|
53
|
+
* the record the store holds for it: this one when it was written, the
|
|
54
|
+
* holder's when another got there first — in which case nothing is written.
|
|
55
|
+
*
|
|
56
|
+
* **One atomic insert-if-absent on a unique key, never a read followed by a
|
|
57
|
+
* write.** The core compares the answer's `userId` with its own to learn
|
|
58
|
+
* whether it won.
|
|
59
|
+
*/
|
|
60
|
+
insertPasskey(record: PasskeyRecord): Promise<PasskeyRecord>;
|
|
61
|
+
/** The passkey of this credential id, verbatim, or `null`. */
|
|
62
|
+
findPasskey(credentialId: string): Promise<PasskeyRecord | null>;
|
|
63
|
+
/**
|
|
64
|
+
* One user's passkeys, in no promised order. A user without passkeys has an
|
|
65
|
+
* empty list, never `null`.
|
|
66
|
+
*/
|
|
67
|
+
listUserPasskeys(userId: Id): Promise<readonly PasskeyRecord[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Records one use of a passkey **if it belongs to `userId` and its stored
|
|
70
|
+
* counter is still `ifCounter`**: one conditional write that sets
|
|
71
|
+
* `counter`, `backedUp` and `lastUsedAt`, and answers the updated record.
|
|
72
|
+
* `null` when there is no such passkey, it belongs to another user, or its
|
|
73
|
+
* counter is no longer `ifCounter` — nothing is written then. Two
|
|
74
|
+
* concurrent uses that read the same counter cannot both pass.
|
|
75
|
+
*/
|
|
76
|
+
recordPasskeyUse(userId: Id, credentialId: string, use: PasskeyUse, ifCounter: number): Promise<PasskeyRecord | null>;
|
|
77
|
+
/**
|
|
78
|
+
* Renames a passkey **if it belongs to `userId`**. `true` when it was
|
|
79
|
+
* renamed; `false` when there is none, or it belongs to another user.
|
|
80
|
+
*/
|
|
81
|
+
renamePasskey(userId: Id, credentialId: string, name: string): Promise<boolean>;
|
|
82
|
+
/**
|
|
83
|
+
* Deletes a passkey **if it belongs to `userId`**: one conditional delete.
|
|
84
|
+
* `true` when this call deleted it; `false` when there is none, or it
|
|
85
|
+
* belongs to another user — which is left untouched.
|
|
86
|
+
*/
|
|
87
|
+
deletePasskey(userId: Id, credentialId: string): Promise<boolean>;
|
|
88
|
+
/**
|
|
89
|
+
* Deletes every passkey of one user and answers how many. `0` is an
|
|
90
|
+
* answer, not a failure. What deleting a user calls.
|
|
91
|
+
*/
|
|
92
|
+
deleteUserPasskeys(userId: Id): Promise<number>;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=passkeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passkeys.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/passkeys.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC7B,oEAAoE;IACpE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;IACpB,4DAA4D;IAC5D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yFAAyF;IACzF,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;CACjC;AAED,kDAAkD;AAClD,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;;;;;OAQG;IACH,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAE7D,8DAA8D;IAC9D,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAEjE;;;OAGG;IACH,gBAAgB,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;IAEhE;;;;;;;OAOG;IACH,gBAAgB,CACf,MAAM,EAAE,EAAE,EACV,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAEjC;;;OAGG;IACH,aAAa,CACZ,MAAM,EAAE,EAAE,EACV,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,GACV,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpB;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAElE;;;OAGG;IACH,kBAAkB,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChD"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sessions store: a session's record, and the port a store implements for
|
|
3
|
+
* them.
|
|
4
|
+
*
|
|
5
|
+
* Part of the store port; the rules every implementation keeps are in
|
|
6
|
+
* `./index`.
|
|
7
|
+
*/
|
|
8
|
+
import type { Id } from '../../../ids/id';
|
|
9
|
+
/** A session's id: a UUIDv7 minted by the core, as a user's is. */
|
|
10
|
+
export type SessionId = string;
|
|
11
|
+
/**
|
|
12
|
+
* A session, as a store holds it.
|
|
13
|
+
*
|
|
14
|
+
* **No secret is stored, ever.** The core mints 32 random bytes, hands the store
|
|
15
|
+
* `sha256(secret)` as `tokenHash`, and gives the plain secret to the
|
|
16
|
+
* application once. A dump of the store cannot be replayed.
|
|
17
|
+
*/
|
|
18
|
+
export interface SessionRecord {
|
|
19
|
+
readonly id: SessionId;
|
|
20
|
+
/** `sha256` of the session token, hex. Unique across the store. */
|
|
21
|
+
readonly tokenHash: string;
|
|
22
|
+
readonly userId: Id;
|
|
23
|
+
/**
|
|
24
|
+
* When credentials were last presented — at the sign-in, or since by a
|
|
25
|
+
* step-up on this session — not when the session was last extended.
|
|
26
|
+
*/
|
|
27
|
+
readonly authenticatedAt: Date;
|
|
28
|
+
readonly expiresAt: Date;
|
|
29
|
+
/** `null` while the session stands. */
|
|
30
|
+
readonly revokedAt: Date | null;
|
|
31
|
+
readonly createdAt: Date;
|
|
32
|
+
/**
|
|
33
|
+
* What the sign-in said of the client — a user agent, a device name — for a
|
|
34
|
+
* list of sessions to show. Absent on a session opened without one, and on
|
|
35
|
+
* a record written before this field existed. Not a credential, and never
|
|
36
|
+
* trusted.
|
|
37
|
+
*/
|
|
38
|
+
readonly device?: string;
|
|
39
|
+
/**
|
|
40
|
+
* When the session was last used: set when it opens, and moved each time
|
|
41
|
+
* `authenticate` extends it, so a busy session is written at most once per
|
|
42
|
+
* `renewAfter`. Absent on a record written before this field existed.
|
|
43
|
+
*/
|
|
44
|
+
readonly lastUsedAt?: Date;
|
|
45
|
+
/**
|
|
46
|
+
* The RFC 8176 authentication methods proved so far (`pwd`, `hwk`, `user`,
|
|
47
|
+
* `otp`, `mfa`, `fed`…): those of the sign-in, extended by each step-up on
|
|
48
|
+
* this session. Absent on a record written before this field existed,
|
|
49
|
+
* which reads as `[]`. `authenticatedAt` is the time of the last proof.
|
|
50
|
+
*/
|
|
51
|
+
readonly amr?: readonly string[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Sessions. Derived state: losing them all signs everybody out, which recovers.
|
|
55
|
+
*
|
|
56
|
+
* **Expiry is the core's decision, not the store's.** A store may still hold a
|
|
57
|
+
* lapsed session or may already have dropped it — a TTL index is an
|
|
58
|
+
* optimisation, and this interface treats it as one. A read answers a present
|
|
59
|
+
* record **verbatim**, lapsed or revoked, and may answer `null` once its expiry
|
|
60
|
+
* has passed. What it must never do is answer a record it has *changed*.
|
|
61
|
+
*/
|
|
62
|
+
export interface SessionStore {
|
|
63
|
+
/**
|
|
64
|
+
* Stores a new session. Idempotent under retry: when a session with this id
|
|
65
|
+
* exists, it writes nothing.
|
|
66
|
+
*/
|
|
67
|
+
insertSession(record: SessionRecord): Promise<void>;
|
|
68
|
+
/** The session whose token hashes to this, verbatim, or `null`. */
|
|
69
|
+
findSessionByTokenHash(tokenHash: string): Promise<SessionRecord | null>;
|
|
70
|
+
/**
|
|
71
|
+
* Moves `expiresAt`, **only while the session is not revoked**, and answers
|
|
72
|
+
* the record as written.
|
|
73
|
+
*
|
|
74
|
+
* `null` when there is no such session or it has been revoked — an extension
|
|
75
|
+
* racing a revocation must never bring the session back. Whether it is
|
|
76
|
+
* *allowed* to be extended yet is the core's decision, made before the call.
|
|
77
|
+
*
|
|
78
|
+
* When `lastUsedAt` is given it is written in the same step; `device` and
|
|
79
|
+
* every other field stay as they were.
|
|
80
|
+
*/
|
|
81
|
+
extendSession(id: SessionId, expiresAt: Date, lastUsedAt?: Date): Promise<SessionRecord | null>;
|
|
82
|
+
/**
|
|
83
|
+
* Moves `authenticatedAt` to `at`, **only while the session is not
|
|
84
|
+
* revoked**, and answers the record as written: what a step-up calls once
|
|
85
|
+
* the user proved again, on this session, who they are. `expiresAt` and
|
|
86
|
+
* every other field stay as they were.
|
|
87
|
+
*
|
|
88
|
+
* `null` when there is no such session or it has been revoked — a
|
|
89
|
+
* confirmation racing a revocation must never bring the session back.
|
|
90
|
+
* Whether the session may be confirmed — standing, not lapsed — is the
|
|
91
|
+
* core's decision, made before the call.
|
|
92
|
+
*
|
|
93
|
+
* When `amr` is given it **replaces** the session's `amr` in the same step
|
|
94
|
+
* (the core passes the union of what the session held and what was just
|
|
95
|
+
* proved); without it `amr` stays as it was.
|
|
96
|
+
*/
|
|
97
|
+
reauthenticateSession(id: SessionId, at: Date, amr?: readonly string[]): Promise<SessionRecord | null>;
|
|
98
|
+
/**
|
|
99
|
+
* Revokes one session. `true` when the session exists — revoked by this call
|
|
100
|
+
* or already — and `false` when there is none.
|
|
101
|
+
*
|
|
102
|
+
* A session already revoked keeps its first `revokedAt`.
|
|
103
|
+
*/
|
|
104
|
+
revokeSession(id: SessionId, at: Date): Promise<boolean>;
|
|
105
|
+
/**
|
|
106
|
+
* Revokes every standing session of one user, except `except` when given —
|
|
107
|
+
* "sign out everywhere else". When `issuedBefore` is given, only the
|
|
108
|
+
* sessions whose `createdAt` is strictly earlier are revoked, so a session
|
|
109
|
+
* opened since that instant stands. Answers how many this call revoked; `0`
|
|
110
|
+
* is an answer, not a failure.
|
|
111
|
+
*/
|
|
112
|
+
revokeUserSessions(userId: Id, at: Date, except?: SessionId, issuedBefore?: Date): Promise<number>;
|
|
113
|
+
/**
|
|
114
|
+
* Deletes every session of one user — standing, revoked or lapsed — and
|
|
115
|
+
* answers how many. `0` is an answer, not a failure. What deleting a user
|
|
116
|
+
* calls: a revoked session still names who held it. A lapsed session the
|
|
117
|
+
* store already dropped is not there to count.
|
|
118
|
+
*/
|
|
119
|
+
deleteUserSessions(userId: Id): Promise<number>;
|
|
120
|
+
/**
|
|
121
|
+
* **Optional capability.** The standing sessions of one user: not revoked,
|
|
122
|
+
* and whose `expiresAt` is after `now`. Any order; the core sorts. `[]` for
|
|
123
|
+
* a user with none. Served by an index on the user — it runs for an admin
|
|
124
|
+
* screen, not on the request path.
|
|
125
|
+
*
|
|
126
|
+
* A store without it still serves everything else; `auth.sessions.list` and
|
|
127
|
+
* `auth.sessions.revoke` throw `UNSUPPORTED`, naming this method and the
|
|
128
|
+
* `sessions` slot.
|
|
129
|
+
*/
|
|
130
|
+
listUserSessions?(userId: Id, now: Date): Promise<readonly SessionRecord[]>;
|
|
131
|
+
/**
|
|
132
|
+
* **Optional capability.** Deletes every session whose `expiresAt` is at or
|
|
133
|
+
* before `before`, and answers how many.
|
|
134
|
+
*
|
|
135
|
+
* A store with its own expiry — a TTL index, a key TTL — does not implement
|
|
136
|
+
* it. The core reads its presence rather than assuming it, and
|
|
137
|
+
* `collectExpired()` throws `UNSUPPORTED`, naming this method and the
|
|
138
|
+
* `sessions` slot, when it is absent.
|
|
139
|
+
*/
|
|
140
|
+
deleteExpiredSessions?(before: Date): Promise<number>;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=sessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/sessions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAE1C,mEAAmE;AACnE,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,uCAAuC;IACvC,QAAQ,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC5B;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD,mEAAmE;IACnE,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAEzE;;;;;;;;;;OAUG;IACH,aAAa,CACZ,EAAE,EAAE,SAAS,EACb,SAAS,EAAE,IAAI,EACf,UAAU,CAAC,EAAE,IAAI,GACf,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAEjC;;;;;;;;;;;;;;OAcG;IACH,qBAAqB,CACpB,EAAE,EAAE,SAAS,EACb,EAAE,EAAE,IAAI,EACR,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,GACrB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAEjC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzD;;;;;;OAMG;IACH,kBAAkB,CACjB,MAAM,EAAE,EAAE,EACV,EAAE,EAAE,IAAI,EACR,MAAM,CAAC,EAAE,SAAS,EAClB,YAAY,CAAC,EAAE,IAAI,GACjB,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhD;;;;;;;;;OASG;IACH,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;IAE5E;;;;;;;;OAQG;IACH,qBAAqB,CAAC,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACtD"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linked social accounts: a link's record, and the store that holds them.
|
|
3
|
+
*
|
|
4
|
+
* Part of the store port; the rules every implementation keeps are in
|
|
5
|
+
* `./index`. **An optional slot of `JanusStores`** (`stores.socialLinks`):
|
|
6
|
+
* only an application that configures social sign-in needs it, and `janus()`
|
|
7
|
+
* refuses to start when a user type has `social` and the slot is absent.
|
|
8
|
+
*/
|
|
9
|
+
import type { Id } from '../../../ids/id';
|
|
10
|
+
/**
|
|
11
|
+
* One external account linked to one user.
|
|
12
|
+
*
|
|
13
|
+
* `(provider, accountId)` is the key: the provider's own, stable identifier of
|
|
14
|
+
* the account, written verbatim and compared byte for byte — **case-sensitive**,
|
|
15
|
+
* never normalised. `email` is what the provider reported when the link was
|
|
16
|
+
* made, kept for display; it is not an identifier and may be `null`.
|
|
17
|
+
*/
|
|
18
|
+
export interface SocialLinkRecord {
|
|
19
|
+
/** The application's name for the provider (`'google'`). */
|
|
20
|
+
readonly provider: string;
|
|
21
|
+
/** The provider's identifier of the account: its `sub`, a numeric id. */
|
|
22
|
+
readonly accountId: string;
|
|
23
|
+
readonly userId: Id;
|
|
24
|
+
/** The e-mail the provider reported at link time, or `null`. */
|
|
25
|
+
readonly email: string | null;
|
|
26
|
+
readonly createdAt: Date;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Social links. Every method is atomic on its own, and `null`, `false`, `0`
|
|
30
|
+
* and `[]` are answers: only a failure throws (`StoreFailure`).
|
|
31
|
+
*/
|
|
32
|
+
export interface SocialLinkStore {
|
|
33
|
+
/**
|
|
34
|
+
* Stores a link **if the pair `(provider, accountId)` is not linked yet**,
|
|
35
|
+
* and answers the record the store holds for that pair: this one when it
|
|
36
|
+
* was written, the holder's when another user (or this one, earlier) got
|
|
37
|
+
* there first — in which case nothing is written.
|
|
38
|
+
*
|
|
39
|
+
* **One atomic insert-if-absent on a unique key, never a read followed by a
|
|
40
|
+
* write**: twenty concurrent calls for one pair leave one stored record and
|
|
41
|
+
* all answer it. The core compares the answer's `userId` with its own to
|
|
42
|
+
* learn whether it won.
|
|
43
|
+
*/
|
|
44
|
+
insertSocialLink(record: SocialLinkRecord): Promise<SocialLinkRecord>;
|
|
45
|
+
/** The link of this pair, verbatim, or `null`. */
|
|
46
|
+
findSocialLink(provider: string, accountId: string): Promise<SocialLinkRecord | null>;
|
|
47
|
+
/**
|
|
48
|
+
* One user's links, in no promised order. A user without links has an empty
|
|
49
|
+
* list, never `null`.
|
|
50
|
+
*/
|
|
51
|
+
listUserSocialLinks(userId: Id): Promise<readonly SocialLinkRecord[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Deletes the link of this pair **if it belongs to `userId`**: one
|
|
54
|
+
* conditional delete. `true` when this call deleted it; `false` when there
|
|
55
|
+
* is none, or it belongs to another user — which is left untouched.
|
|
56
|
+
*/
|
|
57
|
+
deleteSocialLink(userId: Id, provider: string, accountId: string): Promise<boolean>;
|
|
58
|
+
/**
|
|
59
|
+
* **Optional.** How many links go through one provider, in the partition
|
|
60
|
+
* the store is bound to: `0` for none. What `auth.social.countLinks`
|
|
61
|
+
* calls; an application uses it to refuse deleting a provider users still
|
|
62
|
+
* sign in through. A store that omits it still compiles, and that call
|
|
63
|
+
* then throws.
|
|
64
|
+
*/
|
|
65
|
+
countSocialLinks?(provider: string): Promise<number>;
|
|
66
|
+
/**
|
|
67
|
+
* Deletes every link of one user and answers how many. `0` is an answer,
|
|
68
|
+
* not a failure. What deleting a user calls.
|
|
69
|
+
*/
|
|
70
|
+
deleteUserSocialLinks(userId: Id): Promise<number>;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=social-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social-links.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/social-links.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAChC,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;IACpB,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEtE,kDAAkD;IAClD,cAAc,CACb,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAEpC;;;OAGG;IACH,mBAAmB,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CAAC;IAEtE;;;;OAIG;IACH,gBAAgB,CACf,MAAM,EAAE,EAAE,EACV,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpB;;;;;;OAMG;IACH,gBAAgB,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAErD;;;OAGG;IACH,qBAAqB,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The three stores together: what `janus()` takes, and what `assertStores`
|
|
3
|
+
* reports about them.
|
|
4
|
+
*
|
|
5
|
+
* Part of the store port; the rules every implementation keeps are in
|
|
6
|
+
* `./index`.
|
|
7
|
+
*/
|
|
8
|
+
import type { PasskeyStore } from './passkeys';
|
|
9
|
+
import type { SessionStore } from './sessions';
|
|
10
|
+
import type { SocialLinkStore } from './social-links';
|
|
11
|
+
import type { TokenStore } from './tokens';
|
|
12
|
+
import type { UserStore } from './users';
|
|
13
|
+
/**
|
|
14
|
+
* The stores `janus()` takes: three required, and two optional slots, `socialLinks` and `passkeys`.
|
|
15
|
+
*
|
|
16
|
+
* Each slot may come from a different adapter. That is the point of the seam:
|
|
17
|
+
* `@softistx/janus-redis` can serve `sessions` and `tokens` while
|
|
18
|
+
* `@softistx/janus-mongo` serves `users`.
|
|
19
|
+
*/
|
|
20
|
+
export interface JanusStores {
|
|
21
|
+
readonly users: UserStore;
|
|
22
|
+
readonly sessions: SessionStore;
|
|
23
|
+
readonly tokens: TokenStore;
|
|
24
|
+
/**
|
|
25
|
+
* **Optional.** The linked social accounts, needed only by an application
|
|
26
|
+
* that configures `social` on a user type: `janus()` throws a `TypeError`
|
|
27
|
+
* naming the type when it does and this slot is absent.
|
|
28
|
+
*/
|
|
29
|
+
readonly socialLinks?: SocialLinkStore;
|
|
30
|
+
/**
|
|
31
|
+
* **Optional.** The WebAuthn credentials (passkeys) of the users, needed
|
|
32
|
+
* only by an application that enables passkeys.
|
|
33
|
+
*/
|
|
34
|
+
readonly passkeys?: PasskeyStore;
|
|
35
|
+
}
|
|
36
|
+
/** What `assertStores` found beyond the required methods. */
|
|
37
|
+
export interface StoreCapabilities {
|
|
38
|
+
/** Whether `sessions.deleteExpiredSessions` is implemented. */
|
|
39
|
+
readonly collectExpired: boolean;
|
|
40
|
+
/** Whether `tokens.deleteExpiredTokens` is implemented. */
|
|
41
|
+
readonly collectExpiredTokens: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether `users.findUsers` is implemented: `findMany` answers in one query
|
|
44
|
+
* when it is, and with `findUser`, a few ids at a time, when it is not.
|
|
45
|
+
*/
|
|
46
|
+
readonly findUsers: boolean;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=stores.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stores.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/stores.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;CACjC;AAED,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,2DAA2D;IAC3D,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one-time tokens store: what a token is for, its record, and the port a
|
|
3
|
+
* store implements for them.
|
|
4
|
+
*
|
|
5
|
+
* Part of the store port; the rules every implementation keeps are in
|
|
6
|
+
* `./index`.
|
|
7
|
+
*/
|
|
8
|
+
import type { Id } from '../../../ids/id';
|
|
9
|
+
/**
|
|
10
|
+
* What a one-time token is for. A token redeemed for another purpose is
|
|
11
|
+
* unknown.
|
|
12
|
+
*
|
|
13
|
+
* - `verifyEmail`, `resetPassword`: a link sent by e-mail.
|
|
14
|
+
* - `secondFactor`: the challenge a sign-in answers when the user has a second
|
|
15
|
+
* factor, redeemed with a code from their app — and the count of a user's
|
|
16
|
+
* attempts at `regenerateRecoveryCodes`, a token of this kind whose secret
|
|
17
|
+
* nobody is given, never redeemed, only counted.
|
|
18
|
+
* - `signInCode`: a code sent by e-mail to sign in without a password.
|
|
19
|
+
* - `magicLink`: a link sent by e-mail to sign in without a password. A kind
|
|
20
|
+
* of its own, so a sign-in code's challenge — which the visitor holds —
|
|
21
|
+
* never signs anyone in as a link, nor a link's token as a challenge.
|
|
22
|
+
* - `stepUp`: a signed-in user's confirmation of a sensitive action — a code
|
|
23
|
+
* sent by e-mail, or, with an active second factor, a code from their app.
|
|
24
|
+
* A kind of its own, so a sign-in code never confirms an action nor an
|
|
25
|
+
* action's code signs anyone in.
|
|
26
|
+
* - `changeEmail`: a link sent by e-mail to a user's new address, to confirm
|
|
27
|
+
* it. A kind of its own, so a verification link — which proves the address
|
|
28
|
+
* the user already holds — never changes an address, nor this one verifies
|
|
29
|
+
* the current one.
|
|
30
|
+
* - `socialFlow`: the state of one social sign-in or link in progress, held
|
|
31
|
+
* between the redirect to the provider and its callback. Its secret is in
|
|
32
|
+
* the flow cookie; `address` is `''` and `codeHash` is the keyed hash that
|
|
33
|
+
* binds the cookie's contents. A kind of its own, so no e-mailed token
|
|
34
|
+
* completes a social flow nor a flow's secret redeems as an e-mailed one.
|
|
35
|
+
* - `passkeyRegistration`: the challenge of one passkey registration in
|
|
36
|
+
* progress. A kind of its own, so no other token completes a registration.
|
|
37
|
+
*/
|
|
38
|
+
export type TokenKind = 'verifyEmail' | 'resetPassword' | 'secondFactor' | 'signInCode' | 'magicLink' | 'stepUp' | 'changeEmail' | 'socialFlow' | 'passkeyRegistration';
|
|
39
|
+
/** A one-time token, as a store holds it: its hash, never its secret. */
|
|
40
|
+
export interface TokenRecord {
|
|
41
|
+
/** `sha256` of the token's secret, hex. Unique across the store. */
|
|
42
|
+
readonly tokenHash: string;
|
|
43
|
+
readonly kind: TokenKind;
|
|
44
|
+
readonly userId: Id;
|
|
45
|
+
/**
|
|
46
|
+
* The e-mail the token was sent to — the one a verification marks
|
|
47
|
+
* verified; for `changeEmail`, the new address the user will hold.
|
|
48
|
+
*/
|
|
49
|
+
readonly address: string;
|
|
50
|
+
/**
|
|
51
|
+
* For a second-factor challenge, the RFC 8176 methods the first factor
|
|
52
|
+
* proved, for the session to open with. Optional and additive: a store
|
|
53
|
+
* that does not keep it loses only those methods, and the session then
|
|
54
|
+
* opens with the second factor's own. A store that keeps it answers it
|
|
55
|
+
* as written, and omits it when none were given.
|
|
56
|
+
*/
|
|
57
|
+
readonly amr?: readonly string[];
|
|
58
|
+
/**
|
|
59
|
+
* For a token redeemed with an e-mailed code — `signInCode`, and a
|
|
60
|
+
* `stepUp` sent by e-mail — the code's hash, keyed
|
|
61
|
+
* by the token's secret, so the tokens alone do not reveal it. For
|
|
62
|
+
* `changeEmail`, the address it replaces, keyed by the secret the same way.
|
|
63
|
+
* `null` for every other kind: the core writes it so, and a store keeps what it is
|
|
64
|
+
* given.
|
|
65
|
+
*/
|
|
66
|
+
readonly codeHash: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* How many codes were tried against it: `0` at insertion, and one more on
|
|
69
|
+
* every {@link TokenStore.countAttempt}. What bounds the attempts at a
|
|
70
|
+
* six-digit code.
|
|
71
|
+
*/
|
|
72
|
+
readonly attempts: number;
|
|
73
|
+
readonly expiresAt: Date;
|
|
74
|
+
/** `null` until spent. Once set, never changes. */
|
|
75
|
+
readonly spentAt: Date | null;
|
|
76
|
+
readonly createdAt: Date;
|
|
77
|
+
}
|
|
78
|
+
/** One-time tokens. Ephemeral by construction. */
|
|
79
|
+
export interface TokenStore {
|
|
80
|
+
/**
|
|
81
|
+
* Stores a new token. Idempotent under retry: when a token with this hash
|
|
82
|
+
* exists, it writes nothing.
|
|
83
|
+
*/
|
|
84
|
+
insertToken(record: TokenRecord): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* **The most important method on this port.** Spends the token and answers
|
|
87
|
+
* it **as it was before this call**.
|
|
88
|
+
*
|
|
89
|
+
* - `spentAt: null` in the answer means *this call* spent it. Exactly one
|
|
90
|
+
* call ever sees that.
|
|
91
|
+
* - `spentAt` set means it was already spent, and nothing was written.
|
|
92
|
+
* - `null` means no token of this `kind` has this hash — including one the
|
|
93
|
+
* store has already dropped. A token of the other kind is not touched.
|
|
94
|
+
* - **`userId`, when given, is part of the match**: a token issued to
|
|
95
|
+
* another user is answered `null` and **not spent**, in the same
|
|
96
|
+
* conditional write, so a race cannot spend a token the caller does not
|
|
97
|
+
* own. Left out, any user's token matches.
|
|
98
|
+
*
|
|
99
|
+
* **One conditional write, never a read followed by a write.** A reset token
|
|
100
|
+
* two concurrent requests both redeem is an account takeover: twenty
|
|
101
|
+
* concurrent calls must produce exactly one answer with `spentAt: null`, and
|
|
102
|
+
* the conformance suite runs exactly that. In MongoDB this is one
|
|
103
|
+
* `findOneAndUpdate` returning the document *before* the update.
|
|
104
|
+
*
|
|
105
|
+
* A lapsed token is spent all the same. Comparing `expiresAt` is the core's
|
|
106
|
+
* job, after the call, so a lapsed token can never be retried.
|
|
107
|
+
*/
|
|
108
|
+
consumeToken(tokenHash: string, kind: TokenKind, at: Date, userId?: Id): Promise<TokenRecord | null>;
|
|
109
|
+
/**
|
|
110
|
+
* Counts one attempt at a code against a token, and answers the token **as
|
|
111
|
+
* it is after this call**.
|
|
112
|
+
*
|
|
113
|
+
* - An **unspent** token of this `kind` has `attempts` one higher, and is
|
|
114
|
+
* answered with it. Twenty concurrent calls answer twenty distinct
|
|
115
|
+
* counts: one conditional write, never a read followed by a write — a
|
|
116
|
+
* count two guesses both read is a guess for free.
|
|
117
|
+
* - A **spent** token is answered as it is, and nothing is written. A
|
|
118
|
+
* store keeps a spent token, answered as spent, until its `expiresAt`:
|
|
119
|
+
* dropping it sooner would start a count over.
|
|
120
|
+
* - `null` means no token of this `kind` has this hash.
|
|
121
|
+
*
|
|
122
|
+
* A **lapsed** token is counted all the same, or answered `null` by a store
|
|
123
|
+
* that already dropped it — as for `consumeToken`, comparing `expiresAt` is
|
|
124
|
+
* the core's job, after the call.
|
|
125
|
+
*
|
|
126
|
+
* Whether the count is past the limit, and whether the code matches, is the
|
|
127
|
+
* core's decision, after the call; spending the token is `consumeToken`.
|
|
128
|
+
*/
|
|
129
|
+
countAttempt(tokenHash: string, kind: TokenKind): Promise<TokenRecord | null>;
|
|
130
|
+
/**
|
|
131
|
+
* Spends every **unspent** token of one user and one `kind` at `at` —
|
|
132
|
+
* but the one whose hash is `except`, when given — and answers how many
|
|
133
|
+
* it spent. What issuing a sign-in code calls, sparing the code it just
|
|
134
|
+
* issued, so only the last code sent works — and so for a sign-in link,
|
|
135
|
+
* a reset link and a step-up; and what writing a password calls, so no reset link and no
|
|
136
|
+
* second-factor challenge opened with the old one survives.
|
|
137
|
+
*
|
|
138
|
+
* - A spent token keeps its `spentAt`: it never changes once set.
|
|
139
|
+
* - A token of another `kind`, or of another user, is not touched.
|
|
140
|
+
* - An expired token is spent all the same, or not counted by a store that
|
|
141
|
+
* already dropped it.
|
|
142
|
+
* - `0` for a user with none: an absence, not a failure.
|
|
143
|
+
*
|
|
144
|
+
* Each token is spent by a conditional write, as `consumeToken` spends
|
|
145
|
+
* one: a token `consumeToken` spends at the same moment is counted by
|
|
146
|
+
* exactly one of the two calls.
|
|
147
|
+
*/
|
|
148
|
+
spendUserTokens(userId: Id, kind: TokenKind, at: Date, except?: string): Promise<number>;
|
|
149
|
+
/**
|
|
150
|
+
* Deletes every token of one user, spent or not, and answers how many.
|
|
151
|
+
* What deleting a user calls: a token holds the e-mail it was sent to, which
|
|
152
|
+
* must not outlive the user until its expiry.
|
|
153
|
+
*/
|
|
154
|
+
deleteUserTokens(userId: Id): Promise<number>;
|
|
155
|
+
/**
|
|
156
|
+
* **Optional capability.** Deletes every token — spent or not, of any kind
|
|
157
|
+
* and any user — whose `expiresAt` is at or before `before`, and answers how
|
|
158
|
+
* many. Never one whose `expiresAt` is later, spent or not: a spent token is
|
|
159
|
+
* kept until it lapses, or a count would start over.
|
|
160
|
+
*
|
|
161
|
+
* What collects the sign-in and mail throttles' counts, which are ordinary
|
|
162
|
+
* tokens under a keyed-hash user id that `deleteUserTokens` never reaches.
|
|
163
|
+
* A store with its own expiry — a TTL index, a key TTL — does not implement
|
|
164
|
+
* it; `collectExpired()` reads its presence.
|
|
165
|
+
*/
|
|
166
|
+
deleteExpiredTokens?(before: Date): Promise<number>;
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,SAAS,GAClB,aAAa,GACb,eAAe,GACf,cAAc,GACd,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,qBAAqB,CAAC;AAEzB,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CACzB;AAED,kDAAkD;AAClD,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,YAAY,CACX,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,SAAS,EACf,EAAE,EAAE,IAAI,EACR,MAAM,CAAC,EAAE,EAAE,GACT,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAE/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAE9E;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,CACd,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,SAAS,EACf,EAAE,EAAE,IAAI,EACR,MAAM,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;OAIG;IACH,gBAAgB,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9C;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACpD"}
|