@yielded/auth 0.1.0-beta.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 +18 -0
- package/dist/Atom.d.mts +5 -0
- package/dist/Atom.mjs +5 -0
- package/dist/Auth.d.mts +9 -0
- package/dist/Auth.mjs +7 -0
- package/dist/AuthContract.d.mts +4 -0
- package/dist/AuthContract.mjs +4 -0
- package/dist/AuthSession.d.mts +82 -0
- package/dist/AuthSession.mjs +138 -0
- package/dist/AuthSession.mjs.map +1 -0
- package/dist/AuthStore.d.mts +68 -0
- package/dist/AuthStore.mjs +194 -0
- package/dist/AuthStore.mjs.map +1 -0
- package/dist/AuthTokenCodec.d.mts +40 -0
- package/dist/AuthTokenCodec.mjs +104 -0
- package/dist/AuthTokenCodec.mjs.map +1 -0
- package/dist/Client.d.mts +2 -0
- package/dist/Client.mjs +2 -0
- package/dist/Cloudflare.d.mts +89 -0
- package/dist/Cloudflare.mjs +166 -0
- package/dist/Cloudflare.mjs.map +1 -0
- package/dist/Drizzle.d.mts +28 -0
- package/dist/Drizzle.mjs +27 -0
- package/dist/DrizzleD1.d.mts +935 -0
- package/dist/DrizzleD1.mjs +29 -0
- package/dist/DrizzleD1.mjs.map +1 -0
- package/dist/DrizzleLibsql.d.mts +2288 -0
- package/dist/DrizzleLibsql.mjs +85 -0
- package/dist/DrizzleLibsql.mjs.map +1 -0
- package/dist/DrizzleMysql2.d.mts +1809 -0
- package/dist/DrizzleMysql2.mjs +55 -0
- package/dist/DrizzleMysql2.mjs.map +1 -0
- package/dist/DrizzlePglite.d.mts +1808 -0
- package/dist/DrizzlePglite.mjs +45 -0
- package/dist/DrizzlePglite.mjs.map +1 -0
- package/dist/DrizzlePostgres.d.mts +1808 -0
- package/dist/DrizzlePostgres.mjs +45 -0
- package/dist/DrizzlePostgres.mjs.map +1 -0
- package/dist/DrizzleSqliteBun.d.mts +2287 -0
- package/dist/DrizzleSqliteBun.mjs +62 -0
- package/dist/DrizzleSqliteBun.mjs.map +1 -0
- package/dist/DrizzleSqliteDo.d.mts +2343 -0
- package/dist/DrizzleSqliteDo.mjs +105 -0
- package/dist/DrizzleSqliteDo.mjs.map +1 -0
- package/dist/DrizzleSqliteNode.d.mts +2287 -0
- package/dist/DrizzleSqliteNode.mjs +62 -0
- package/dist/DrizzleSqliteNode.mjs.map +1 -0
- package/dist/DrizzleSqliteWasm.d.mts +2287 -0
- package/dist/DrizzleSqliteWasm.mjs +62 -0
- package/dist/DrizzleSqliteWasm.mjs.map +1 -0
- package/dist/Email.d.mts +12 -0
- package/dist/Email.mjs +11 -0
- package/dist/EmailOtp.d.mts +42 -0
- package/dist/EmailOtp.mjs +120 -0
- package/dist/EmailOtp.mjs.map +1 -0
- package/dist/EmailOtpSender.d.mts +22 -0
- package/dist/EmailOtpSender.mjs +18 -0
- package/dist/EmailOtpSender.mjs.map +1 -0
- package/dist/Errors.d.mts +55 -0
- package/dist/Errors.mjs +31 -0
- package/dist/Errors.mjs.map +1 -0
- package/dist/GitHub.d.mts +5 -0
- package/dist/GitHub.mjs +4 -0
- package/dist/Hooks.d.mts +6 -0
- package/dist/Hooks.mjs +6 -0
- package/dist/Http.d.mts +12 -0
- package/dist/Http.mjs +12 -0
- package/dist/HttpServer.d.mts +103 -0
- package/dist/HttpServer.mjs +326 -0
- package/dist/HttpServer.mjs.map +1 -0
- package/dist/Identity.d.mts +9 -0
- package/dist/Identity.mjs +9 -0
- package/dist/IdentityResolver.d.mts +16 -0
- package/dist/IdentityResolver.mjs +12 -0
- package/dist/IdentityResolver.mjs.map +1 -0
- package/dist/OAuth.d.mts +36 -0
- package/dist/OAuth.mjs +35 -0
- package/dist/OpenIdClient.d.mts +3 -0
- package/dist/OpenIdClient.mjs +3 -0
- package/dist/OpenIdClientConnected.d.mts +4 -0
- package/dist/OpenIdClientConnected.mjs +3 -0
- package/dist/OperationHttp.d.mts +3 -0
- package/dist/OperationHttp.mjs +3 -0
- package/dist/OperationHttpClient.d.mts +2 -0
- package/dist/OperationHttpClient.mjs +2 -0
- package/dist/OperationHttpServer.d.mts +5 -0
- package/dist/OperationHttpServer.mjs +4 -0
- package/dist/Operations.d.mts +8 -0
- package/dist/Operations.mjs +8 -0
- package/dist/Passkey.d.mts +12 -0
- package/dist/Passkey.mjs +12 -0
- package/dist/PasskeyBrowser.d.mts +4 -0
- package/dist/PasskeyBrowser.mjs +4 -0
- package/dist/PasskeyContract.d.mts +641 -0
- package/dist/PasskeyContract.mjs +174 -0
- package/dist/PasskeyContract.mjs.map +1 -0
- package/dist/PasskeyPassword.d.mts +412 -0
- package/dist/PasskeyPassword.mjs +174 -0
- package/dist/PasskeyPassword.mjs.map +1 -0
- package/dist/PasskeySimpleWebAuthn.d.mts +3 -0
- package/dist/PasskeySimpleWebAuthn.mjs +3 -0
- package/dist/Password.d.mts +19 -0
- package/dist/Password.mjs +17 -0
- package/dist/PasswordAuth.d.mts +45 -0
- package/dist/PasswordAuth.mjs +79 -0
- package/dist/PasswordAuth.mjs.map +1 -0
- package/dist/PasswordCredentialStore.d.mts +46 -0
- package/dist/PasswordCredentialStore.mjs +62 -0
- package/dist/PasswordCredentialStore.mjs.map +1 -0
- package/dist/PasswordHasher.d.mts +31 -0
- package/dist/PasswordHasher.mjs +76 -0
- package/dist/PasswordHasher.mjs.map +1 -0
- package/dist/PhoneOtp.d.mts +11 -0
- package/dist/PhoneOtp.mjs +11 -0
- package/dist/Policy.d.mts +52 -0
- package/dist/Policy.mjs +36 -0
- package/dist/Policy.mjs.map +1 -0
- package/dist/Proofs.d.mts +14 -0
- package/dist/Proofs.mjs +13 -0
- package/dist/Rpc.d.mts +12 -0
- package/dist/Rpc.mjs +11 -0
- package/dist/Rpc.mjs.map +1 -0
- package/dist/Schema.d.mts +160 -0
- package/dist/Schema.mjs +141 -0
- package/dist/Schema.mjs.map +1 -0
- package/dist/SessionContract.d.mts +3 -0
- package/dist/SessionContract.mjs +3 -0
- package/dist/Sessions.d.mts +14 -0
- package/dist/Sessions.mjs +12 -0
- package/dist/Testing.d.mts +7 -0
- package/dist/Testing.mjs +7 -0
- package/dist/Totp.d.mts +8 -0
- package/dist/Totp.mjs +8 -0
- package/dist/TotpContract.d.mts +318 -0
- package/dist/TotpContract.mjs +119 -0
- package/dist/TotpContract.mjs.map +1 -0
- package/dist/WebCrypto.d.mts +28 -0
- package/dist/WebCrypto.mjs +42 -0
- package/dist/WebCrypto.mjs.map +1 -0
- package/dist/Workflows.d.mts +16 -0
- package/dist/Workflows.mjs +11 -0
- package/dist/Workflows.mjs.map +1 -0
- package/dist/atom/AuthAtomLifetime.d.mts +35 -0
- package/dist/atom/AuthAtomLifetime.mjs +50 -0
- package/dist/atom/AuthAtomLifetime.mjs.map +1 -0
- package/dist/atom/AuthAtomWorkflow.d.mts +17 -0
- package/dist/atom/AuthAtomWorkflow.mjs +9 -0
- package/dist/atom/AuthAtomWorkflow.mjs.map +1 -0
- package/dist/atom/client.d.mts +43 -0
- package/dist/atom/client.mjs +168 -0
- package/dist/atom/client.mjs.map +1 -0
- package/dist/atom/operations.d.mts +35 -0
- package/dist/atom/operations.mjs +58 -0
- package/dist/atom/operations.mjs.map +1 -0
- package/dist/atom/scoped-runtime.mjs +151 -0
- package/dist/atom/scoped-runtime.mjs.map +1 -0
- package/dist/auth/Auth.d.mts +7806 -0
- package/dist/auth/Auth.mjs +141 -0
- package/dist/auth/Auth.mjs.map +1 -0
- package/dist/auth/AuthConfigurationError.d.mts +10 -0
- package/dist/auth/AuthConfigurationError.mjs +14 -0
- package/dist/auth/AuthConfigurationError.mjs.map +1 -0
- package/dist/auth/AuthRequest.d.mts +21 -0
- package/dist/auth/AuthRequest.mjs +10 -0
- package/dist/auth/AuthRequest.mjs.map +1 -0
- package/dist/auth/AuthStrategy.d.mts +23 -0
- package/dist/auth/AuthStrategy.mjs +33 -0
- package/dist/auth/AuthStrategy.mjs.map +1 -0
- package/dist/auth/ConsumeDecision.d.mts +11 -0
- package/dist/auth/actions.d.mts +18 -0
- package/dist/auth/actions.mjs +70 -0
- package/dist/auth/actions.mjs.map +1 -0
- package/dist/auth/defaults.mjs +12 -0
- package/dist/auth/defaults.mjs.map +1 -0
- package/dist/auth/definition.d.mts +46 -0
- package/dist/auth/session.d.mts +27 -0
- package/dist/auth/session.mjs +56 -0
- package/dist/auth/session.mjs.map +1 -0
- package/dist/drizzle/D1BatchStatements.d.mts +11 -0
- package/dist/drizzle/D1BatchStatements.mjs +8 -0
- package/dist/drizzle/D1BatchStatements.mjs.map +1 -0
- package/dist/drizzle/PasswordPreparedPostconditions.mjs +12 -0
- package/dist/drizzle/PasswordPreparedPostconditions.mjs.map +1 -0
- package/dist/drizzle/SuppliedService.d.mts +10 -0
- package/dist/drizzle/d1-emails.d.mts +68 -0
- package/dist/drizzle/d1-emails.mjs +580 -0
- package/dist/drizzle/d1-emails.mjs.map +1 -0
- package/dist/drizzle/d1-generated-statement.mjs +79 -0
- package/dist/drizzle/d1-generated-statement.mjs.map +1 -0
- package/dist/drizzle/d1-identity.d.mts +33 -0
- package/dist/drizzle/d1-identity.mjs +120 -0
- package/dist/drizzle/d1-identity.mjs.map +1 -0
- package/dist/drizzle/d1-oauth.d.mts +316 -0
- package/dist/drizzle/d1-oauth.mjs +79 -0
- package/dist/drizzle/d1-oauth.mjs.map +1 -0
- package/dist/drizzle/d1-passkey.d.mts +52 -0
- package/dist/drizzle/d1-passkey.mjs +97 -0
- package/dist/drizzle/d1-passkey.mjs.map +1 -0
- package/dist/drizzle/d1-password-prepared.d.mts +27 -0
- package/dist/drizzle/d1-password-prepared.mjs +464 -0
- package/dist/drizzle/d1-password-prepared.mjs.map +1 -0
- package/dist/drizzle/d1-passwords.d.mts +96 -0
- package/dist/drizzle/d1-passwords.mjs +1008 -0
- package/dist/drizzle/d1-passwords.mjs.map +1 -0
- package/dist/drizzle/d1-phone.d.mts +29 -0
- package/dist/drizzle/d1-phone.mjs +33 -0
- package/dist/drizzle/d1-phone.mjs.map +1 -0
- package/dist/drizzle/d1-planning.d.mts +12 -0
- package/dist/drizzle/d1-planning.mjs +43 -0
- package/dist/drizzle/d1-planning.mjs.map +1 -0
- package/dist/drizzle/d1-proofs.d.mts +88 -0
- package/dist/drizzle/d1-proofs.mjs +833 -0
- package/dist/drizzle/d1-proofs.mjs.map +1 -0
- package/dist/drizzle/d1-sessions.d.mts +77 -0
- package/dist/drizzle/d1-sessions.mjs +970 -0
- package/dist/drizzle/d1-sessions.mjs.map +1 -0
- package/dist/drizzle/d1-totp.d.mts +27 -0
- package/dist/drizzle/d1-totp.mjs +28 -0
- package/dist/drizzle/d1-totp.mjs.map +1 -0
- package/dist/drizzle/email-model.d.mts +352 -0
- package/dist/drizzle/email-model.mjs +21 -0
- package/dist/drizzle/email-model.mjs.map +1 -0
- package/dist/drizzle/email-registration.d.mts +33 -0
- package/dist/drizzle/email-registration.mjs +238 -0
- package/dist/drizzle/email-registration.mjs.map +1 -0
- package/dist/drizzle/email-sql.d.mts +18 -0
- package/dist/drizzle/email-sql.mjs +473 -0
- package/dist/drizzle/email-sql.mjs.map +1 -0
- package/dist/drizzle/email-target.d.mts +28 -0
- package/dist/drizzle/email-target.mjs +75 -0
- package/dist/drizzle/email-target.mjs.map +1 -0
- package/dist/drizzle/model.d.mts +259 -0
- package/dist/drizzle/model.mjs +81 -0
- package/dist/drizzle/model.mjs.map +1 -0
- package/dist/drizzle/mysql-emails.d.mts +82 -0
- package/dist/drizzle/mysql-emails.mjs +38 -0
- package/dist/drizzle/mysql-emails.mjs.map +1 -0
- package/dist/drizzle/mysql-identity.d.mts +24 -0
- package/dist/drizzle/mysql-identity.mjs +95 -0
- package/dist/drizzle/mysql-identity.mjs.map +1 -0
- package/dist/drizzle/mysql-password-prepared.d.mts +32 -0
- package/dist/drizzle/mysql-password-prepared.mjs +16 -0
- package/dist/drizzle/mysql-password-prepared.mjs.map +1 -0
- package/dist/drizzle/mysql-passwords.d.mts +102 -0
- package/dist/drizzle/mysql-passwords.mjs +38 -0
- package/dist/drizzle/mysql-passwords.mjs.map +1 -0
- package/dist/drizzle/mysql-proofs.d.mts +83 -0
- package/dist/drizzle/mysql-proofs.mjs +23 -0
- package/dist/drizzle/mysql-proofs.mjs.map +1 -0
- package/dist/drizzle/mysql-sessions.d.mts +250 -0
- package/dist/drizzle/mysql-sessions.mjs +53 -0
- package/dist/drizzle/mysql-sessions.mjs.map +1 -0
- package/dist/drizzle/mysql.d.mts +73 -0
- package/dist/drizzle/mysql.mjs +221 -0
- package/dist/drizzle/mysql.mjs.map +1 -0
- package/dist/drizzle/oauth-accounts.mjs +361 -0
- package/dist/drizzle/oauth-accounts.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-access.mjs +210 -0
- package/dist/drizzle/oauth-connected-access.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-collection.mjs +202 -0
- package/dist/drizzle/oauth-connected-collection.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-custody.mjs +146 -0
- package/dist/drizzle/oauth-connected-custody.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-drivers.mjs +78 -0
- package/dist/drizzle/oauth-connected-drivers.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-flow.mjs +248 -0
- package/dist/drizzle/oauth-connected-flow.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-input.mjs +105 -0
- package/dist/drizzle/oauth-connected-input.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-maintenance.mjs +215 -0
- package/dist/drizzle/oauth-connected-maintenance.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-management.mjs +228 -0
- package/dist/drizzle/oauth-connected-management.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-model.d.mts +278 -0
- package/dist/drizzle/oauth-connected-model.mjs +22 -0
- package/dist/drizzle/oauth-connected-model.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-reference.d.mts +17 -0
- package/dist/drizzle/oauth-connected-reference.mjs +53 -0
- package/dist/drizzle/oauth-connected-reference.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-settlement.mjs +117 -0
- package/dist/drizzle/oauth-connected-settlement.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-state.d.mts +16 -0
- package/dist/drizzle/oauth-connected-state.mjs +422 -0
- package/dist/drizzle/oauth-connected-state.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-target.d.mts +114 -0
- package/dist/drizzle/oauth-connected-target.mjs +94 -0
- package/dist/drizzle/oauth-connected-target.mjs.map +1 -0
- package/dist/drizzle/oauth-drivers.mjs +53 -0
- package/dist/drizzle/oauth-drivers.mjs.map +1 -0
- package/dist/drizzle/oauth-flow.d.mts +7 -0
- package/dist/drizzle/oauth-flow.mjs +255 -0
- package/dist/drizzle/oauth-flow.mjs.map +1 -0
- package/dist/drizzle/oauth-input.mjs +130 -0
- package/dist/drizzle/oauth-input.mjs.map +1 -0
- package/dist/drizzle/oauth-model.d.mts +468 -0
- package/dist/drizzle/oauth-model.mjs +49 -0
- package/dist/drizzle/oauth-model.mjs.map +1 -0
- package/dist/drizzle/oauth-mysql.mjs +8 -0
- package/dist/drizzle/oauth-mysql.mjs.map +1 -0
- package/dist/drizzle/oauth-owner.d.mts +4 -0
- package/dist/drizzle/oauth-owner.mjs +10 -0
- package/dist/drizzle/oauth-owner.mjs.map +1 -0
- package/dist/drizzle/oauth-registration.d.mts +8 -0
- package/dist/drizzle/oauth-registration.mjs +375 -0
- package/dist/drizzle/oauth-registration.mjs.map +1 -0
- package/dist/drizzle/oauth-state.mjs +109 -0
- package/dist/drizzle/oauth-state.mjs.map +1 -0
- package/dist/drizzle/oauth-target.d.mts +125 -0
- package/dist/drizzle/oauth-target.mjs +252 -0
- package/dist/drizzle/oauth-target.mjs.map +1 -0
- package/dist/drizzle/passkey-admission.mjs +203 -0
- package/dist/drizzle/passkey-admission.mjs.map +1 -0
- package/dist/drizzle/passkey-credentials.mjs +239 -0
- package/dist/drizzle/passkey-credentials.mjs.map +1 -0
- package/dist/drizzle/passkey-drivers.mjs +34 -0
- package/dist/drizzle/passkey-drivers.mjs.map +1 -0
- package/dist/drizzle/passkey-enrollment.mjs +132 -0
- package/dist/drizzle/passkey-enrollment.mjs.map +1 -0
- package/dist/drizzle/passkey-flow.mjs +436 -0
- package/dist/drizzle/passkey-flow.mjs.map +1 -0
- package/dist/drizzle/passkey-management.mjs +225 -0
- package/dist/drizzle/passkey-management.mjs.map +1 -0
- package/dist/drizzle/passkey-model.d.mts +275 -0
- package/dist/drizzle/passkey-model.mjs +36 -0
- package/dist/drizzle/passkey-model.mjs.map +1 -0
- package/dist/drizzle/passkey-registration-ceremony-model.d.mts +50 -0
- package/dist/drizzle/passkey-registration-ceremony-model.mjs +18 -0
- package/dist/drizzle/passkey-registration-ceremony-model.mjs.map +1 -0
- package/dist/drizzle/passkey-registration-ceremony.mjs +124 -0
- package/dist/drizzle/passkey-registration-ceremony.mjs.map +1 -0
- package/dist/drizzle/passkey-registration-custody.mjs +51 -0
- package/dist/drizzle/passkey-registration-custody.mjs.map +1 -0
- package/dist/drizzle/passkey-registration-write.mjs +205 -0
- package/dist/drizzle/passkey-registration-write.mjs.map +1 -0
- package/dist/drizzle/passkey-state.d.mts +5 -0
- package/dist/drizzle/passkey-state.mjs +207 -0
- package/dist/drizzle/passkey-state.mjs.map +1 -0
- package/dist/drizzle/passkey-target.d.mts +16 -0
- package/dist/drizzle/passkey-target.mjs +174 -0
- package/dist/drizzle/passkey-target.mjs.map +1 -0
- package/dist/drizzle/passkey-write-drivers.mjs +33 -0
- package/dist/drizzle/passkey-write-drivers.mjs.map +1 -0
- package/dist/drizzle/passkey-write-model.d.mts +192 -0
- package/dist/drizzle/passkey-write-model.mjs +13 -0
- package/dist/drizzle/passkey-write-model.mjs.map +1 -0
- package/dist/drizzle/passkey-write-state.mjs +326 -0
- package/dist/drizzle/passkey-write-state.mjs.map +1 -0
- package/dist/drizzle/passkey-write-target.d.mts +14 -0
- package/dist/drizzle/passkey-write-target.mjs +185 -0
- package/dist/drizzle/passkey-write-target.mjs.map +1 -0
- package/dist/drizzle/password-model.d.mts +330 -0
- package/dist/drizzle/password-model.mjs +22 -0
- package/dist/drizzle/password-model.mjs.map +1 -0
- package/dist/drizzle/password-prepared-model.d.mts +93 -0
- package/dist/drizzle/password-prepared-model.mjs +11 -0
- package/dist/drizzle/password-prepared-model.mjs.map +1 -0
- package/dist/drizzle/password-prepared-sql.mjs +394 -0
- package/dist/drizzle/password-prepared-sql.mjs.map +1 -0
- package/dist/drizzle/password-prepared-state.mjs +107 -0
- package/dist/drizzle/password-prepared-state.mjs.map +1 -0
- package/dist/drizzle/password-prepared-target.d.mts +12 -0
- package/dist/drizzle/password-prepared-target.mjs +57 -0
- package/dist/drizzle/password-prepared-target.mjs.map +1 -0
- package/dist/drizzle/password-registration.d.mts +23 -0
- package/dist/drizzle/password-registration.mjs +136 -0
- package/dist/drizzle/password-registration.mjs.map +1 -0
- package/dist/drizzle/password-sql.d.mts +20 -0
- package/dist/drizzle/password-sql.mjs +702 -0
- package/dist/drizzle/password-sql.mjs.map +1 -0
- package/dist/drizzle/password-target.d.mts +25 -0
- package/dist/drizzle/password-target.mjs +63 -0
- package/dist/drizzle/password-target.mjs.map +1 -0
- package/dist/drizzle/pg-emails.d.mts +83 -0
- package/dist/drizzle/pg-emails.mjs +38 -0
- package/dist/drizzle/pg-emails.mjs.map +1 -0
- package/dist/drizzle/pg-password-prepared.d.mts +33 -0
- package/dist/drizzle/pg-password-prepared.mjs +16 -0
- package/dist/drizzle/pg-password-prepared.mjs.map +1 -0
- package/dist/drizzle/pg-passwords.d.mts +103 -0
- package/dist/drizzle/pg-passwords.mjs +38 -0
- package/dist/drizzle/pg-passwords.mjs.map +1 -0
- package/dist/drizzle/pg-proofs.d.mts +84 -0
- package/dist/drizzle/pg-proofs.mjs +22 -0
- package/dist/drizzle/pg-proofs.mjs.map +1 -0
- package/dist/drizzle/pg-sessions.d.mts +251 -0
- package/dist/drizzle/pg-sessions.mjs +53 -0
- package/dist/drizzle/pg-sessions.mjs.map +1 -0
- package/dist/drizzle/pg.d.mts +88 -0
- package/dist/drizzle/pg.mjs +294 -0
- package/dist/drizzle/pg.mjs.map +1 -0
- package/dist/drizzle/phone-model.d.mts +117 -0
- package/dist/drizzle/phone-model.mjs +39 -0
- package/dist/drizzle/phone-model.mjs.map +1 -0
- package/dist/drizzle/phone-state.mjs +426 -0
- package/dist/drizzle/phone-state.mjs.map +1 -0
- package/dist/drizzle/phone-target.d.mts +19 -0
- package/dist/drizzle/phone-target.mjs +171 -0
- package/dist/drizzle/phone-target.mjs.map +1 -0
- package/dist/drizzle/proof-model.d.mts +287 -0
- package/dist/drizzle/proof-model.mjs +17 -0
- package/dist/drizzle/proof-model.mjs.map +1 -0
- package/dist/drizzle/proof-sql.d.mts +16 -0
- package/dist/drizzle/proof-sql.mjs +618 -0
- package/dist/drizzle/proof-sql.mjs.map +1 -0
- package/dist/drizzle/proof-target.d.mts +17 -0
- package/dist/drizzle/proof-target.mjs +38 -0
- package/dist/drizzle/proof-target.mjs.map +1 -0
- package/dist/drizzle/session-model.d.mts +201 -0
- package/dist/drizzle/session-model.mjs +19 -0
- package/dist/drizzle/session-model.mjs.map +1 -0
- package/dist/drizzle/session-sql.mjs +732 -0
- package/dist/drizzle/session-sql.mjs.map +1 -0
- package/dist/drizzle/session-target.d.mts +37 -0
- package/dist/drizzle/session-target.mjs +47 -0
- package/dist/drizzle/session-target.mjs.map +1 -0
- package/dist/drizzle/sqlite-emails.mjs +45 -0
- package/dist/drizzle/sqlite-emails.mjs.map +1 -0
- package/dist/drizzle/sqlite-identity.mjs +92 -0
- package/dist/drizzle/sqlite-identity.mjs.map +1 -0
- package/dist/drizzle/sqlite-password-prepared.mjs +21 -0
- package/dist/drizzle/sqlite-password-prepared.mjs.map +1 -0
- package/dist/drizzle/sqlite-passwords.mjs +49 -0
- package/dist/drizzle/sqlite-passwords.mjs.map +1 -0
- package/dist/drizzle/sqlite-proofs.mjs +29 -0
- package/dist/drizzle/sqlite-proofs.mjs.map +1 -0
- package/dist/drizzle/sqlite-sessions.mjs +74 -0
- package/dist/drizzle/sqlite-sessions.mjs.map +1 -0
- package/dist/drizzle/sqlite.d.mts +81 -0
- package/dist/drizzle/sqlite.mjs +220 -0
- package/dist/drizzle/sqlite.mjs.map +1 -0
- package/dist/drizzle/standalone-guard.mjs +19 -0
- package/dist/drizzle/standalone-guard.mjs.map +1 -0
- package/dist/drizzle/step-up-model.d.mts +65 -0
- package/dist/drizzle/step-up-model.mjs +9 -0
- package/dist/drizzle/step-up-model.mjs.map +1 -0
- package/dist/drizzle/step-up-state.mjs +34 -0
- package/dist/drizzle/step-up-state.mjs.map +1 -0
- package/dist/drizzle/totp-model.d.mts +85 -0
- package/dist/drizzle/totp-model.mjs +13 -0
- package/dist/drizzle/totp-model.mjs.map +1 -0
- package/dist/drizzle/totp-state.d.mts +39 -0
- package/dist/drizzle/totp-state.mjs +288 -0
- package/dist/drizzle/totp-state.mjs.map +1 -0
- package/dist/drizzle/totp-target.d.mts +16 -0
- package/dist/drizzle/totp-target.mjs +83 -0
- package/dist/drizzle/totp-target.mjs.map +1 -0
- package/dist/drizzle/transaction-execution.d.mts +20 -0
- package/dist/drizzle/transaction-execution.mjs +111 -0
- package/dist/drizzle/transaction-execution.mjs.map +1 -0
- package/dist/drizzle/transaction-mysql.mjs +46 -0
- package/dist/drizzle/transaction-mysql.mjs.map +1 -0
- package/dist/drizzle/transaction-owner.d.mts +6 -0
- package/dist/drizzle/transaction-owner.mjs +252 -0
- package/dist/drizzle/transaction-owner.mjs.map +1 -0
- package/dist/email/EmailActionEvidence.d.mts +33 -0
- package/dist/email/EmailActionEvidence.mjs +15 -0
- package/dist/email/EmailActionEvidence.mjs.map +1 -0
- package/dist/email/EmailAddressPersistence.d.mts +63 -0
- package/dist/email/EmailAddressPersistence.mjs +19 -0
- package/dist/email/EmailAddressPersistence.mjs.map +1 -0
- package/dist/email/EmailIdentifierNotifier.d.mts +30 -0
- package/dist/email/EmailIdentifierNotifier.mjs +31 -0
- package/dist/email/EmailIdentifierNotifier.mjs.map +1 -0
- package/dist/email/EmailReturnTargets.d.mts +19 -0
- package/dist/email/EmailReturnTargets.mjs +29 -0
- package/dist/email/EmailReturnTargets.mjs.map +1 -0
- package/dist/email/EmailSignInTargets.d.mts +20 -0
- package/dist/email/EmailSignInTargets.mjs +12 -0
- package/dist/email/EmailSignInTargets.mjs.map +1 -0
- package/dist/email/addresses.d.mts +33 -0
- package/dist/email/addresses.mjs +404 -0
- package/dist/email/addresses.mjs.map +1 -0
- package/dist/email/definition.d.mts +10153 -0
- package/dist/email/definition.mjs +111 -0
- package/dist/email/definition.mjs.map +1 -0
- package/dist/email/errors.d.mts +15 -0
- package/dist/email/errors.mjs +11 -0
- package/dist/email/errors.mjs.map +1 -0
- package/dist/email/magicLink.d.mts +33 -0
- package/dist/email/magicLink.mjs +58 -0
- package/dist/email/magicLink.mjs.map +1 -0
- package/dist/email/models.d.mts +56 -0
- package/dist/email/models.mjs +31 -0
- package/dist/email/models.mjs.map +1 -0
- package/dist/email/module.d.mts +22296 -0
- package/dist/email/module.mjs +415 -0
- package/dist/email/module.mjs.map +1 -0
- package/dist/email/registration.d.mts +28 -0
- package/dist/email/registration.mjs +243 -0
- package/dist/email/registration.mjs.map +1 -0
- package/dist/email/snapshot.mjs +37 -0
- package/dist/email/snapshot.mjs.map +1 -0
- package/dist/hooks/LifecycleHooks.d.mts +34 -0
- package/dist/hooks/LifecycleHooks.mjs +74 -0
- package/dist/hooks/LifecycleHooks.mjs.map +1 -0
- package/dist/hooks/commit.d.mts +66 -0
- package/dist/hooks/commit.mjs +136 -0
- package/dist/hooks/commit.mjs.map +1 -0
- package/dist/hooks/models.d.mts +51 -0
- package/dist/hooks/models.mjs +87 -0
- package/dist/hooks/models.mjs.map +1 -0
- package/dist/hooks/plugins.d.mts +36 -0
- package/dist/hooks/plugins.mjs +60 -0
- package/dist/hooks/plugins.mjs.map +1 -0
- package/dist/hooks/transactions.d.mts +31 -0
- package/dist/hooks/transactions.mjs +38 -0
- package/dist/hooks/transactions.mjs.map +1 -0
- package/dist/http/auth-api.d.mts +9 -0
- package/dist/http/auth-api.mjs +13 -0
- package/dist/http/auth-api.mjs.map +1 -0
- package/dist/http/auth-contract.d.mts +84 -0
- package/dist/http/auth-contract.mjs +75 -0
- package/dist/http/auth-contract.mjs.map +1 -0
- package/dist/http/auth-http.d.mts +216 -0
- package/dist/http/auth-http.mjs +184 -0
- package/dist/http/auth-http.mjs.map +1 -0
- package/dist/http/endpoints/get-session.d.mts +8 -0
- package/dist/http/endpoints/get-session.mjs +12 -0
- package/dist/http/endpoints/get-session.mjs.map +1 -0
- package/dist/http/endpoints/password-sign-in.d.mts +8 -0
- package/dist/http/endpoints/password-sign-in.mjs +18 -0
- package/dist/http/endpoints/password-sign-in.mjs.map +1 -0
- package/dist/http/endpoints/request-email-otp.d.mts +8 -0
- package/dist/http/endpoints/request-email-otp.mjs +17 -0
- package/dist/http/endpoints/request-email-otp.mjs.map +1 -0
- package/dist/http/endpoints/set-password.d.mts +9 -0
- package/dist/http/endpoints/set-password.mjs +19 -0
- package/dist/http/endpoints/set-password.mjs.map +1 -0
- package/dist/http/endpoints/sign-out.d.mts +6 -0
- package/dist/http/endpoints/sign-out.mjs +7 -0
- package/dist/http/endpoints/sign-out.mjs.map +1 -0
- package/dist/http/endpoints/verify-email-otp.d.mts +9 -0
- package/dist/http/endpoints/verify-email-otp.mjs +18 -0
- package/dist/http/endpoints/verify-email-otp.mjs.map +1 -0
- package/dist/http/models.d.mts +49 -0
- package/dist/http/models.mjs +35 -0
- package/dist/http/models.mjs.map +1 -0
- package/dist/http/security.d.mts +91 -0
- package/dist/http/security.mjs +77 -0
- package/dist/http/security.mjs.map +1 -0
- package/dist/http/session-contract.d.mts +303 -0
- package/dist/http/session-contract.mjs +38 -0
- package/dist/http/session-contract.mjs.map +1 -0
- package/dist/http-operation/OperationHttpInvocation.d.mts +16 -0
- package/dist/http-operation/OperationHttpInvocation.mjs +11 -0
- package/dist/http-operation/OperationHttpInvocation.mjs.map +1 -0
- package/dist/http-operation/OperationHttpServerConfig.d.mts +18 -0
- package/dist/http-operation/OperationHttpServerConfig.mjs +72 -0
- package/dist/http-operation/OperationHttpServerConfig.mjs.map +1 -0
- package/dist/http-operation/auth-client.d.mts +75 -0
- package/dist/http-operation/auth-client.mjs +116 -0
- package/dist/http-operation/auth-client.mjs.map +1 -0
- package/dist/http-operation/client.d.mts +50 -0
- package/dist/http-operation/client.mjs +188 -0
- package/dist/http-operation/client.mjs.map +1 -0
- package/dist/http-operation/configuration-schema.mjs +19 -0
- package/dist/http-operation/configuration-schema.mjs.map +1 -0
- package/dist/http-operation/contract.d.mts +40 -0
- package/dist/http-operation/contract.mjs +37 -0
- package/dist/http-operation/contract.mjs.map +1 -0
- package/dist/http-operation/errors.d.mts +13 -0
- package/dist/http-operation/errors.mjs +31 -0
- package/dist/http-operation/errors.mjs.map +1 -0
- package/dist/http-operation/models.d.mts +32 -0
- package/dist/http-operation/models.mjs +14 -0
- package/dist/http-operation/models.mjs.map +1 -0
- package/dist/http-operation/private.mjs +35 -0
- package/dist/http-operation/private.mjs.map +1 -0
- package/dist/http-operation/security.mjs +58 -0
- package/dist/http-operation/security.mjs.map +1 -0
- package/dist/http-operation/server.d.mts +33 -0
- package/dist/http-operation/server.mjs +268 -0
- package/dist/http-operation/server.mjs.map +1 -0
- package/dist/identity/ExternalIdentityMutation.d.mts +15 -0
- package/dist/identity/ExternalIdentityMutation.mjs +11 -0
- package/dist/identity/ExternalIdentityMutation.mjs.map +1 -0
- package/dist/identity/IdentityMutation.d.mts +22 -0
- package/dist/identity/IdentityMutation.mjs +17 -0
- package/dist/identity/IdentityMutation.mjs.map +1 -0
- package/dist/identity/IdentityRepository.d.mts +20 -0
- package/dist/identity/IdentityRepository.mjs +11 -0
- package/dist/identity/IdentityRepository.mjs.map +1 -0
- package/dist/identity/SubjectLifecycle.d.mts +58 -0
- package/dist/identity/SubjectLifecycle.mjs +43 -0
- package/dist/identity/SubjectLifecycle.mjs.map +1 -0
- package/dist/identity/SubjectProvisioner.d.mts +37 -0
- package/dist/identity/SubjectProvisioner.mjs +20 -0
- package/dist/identity/SubjectProvisioner.mjs.map +1 -0
- package/dist/identity/codecs.d.mts +34 -0
- package/dist/identity/codecs.mjs +40 -0
- package/dist/identity/codecs.mjs.map +1 -0
- package/dist/identity/models.d.mts +62 -0
- package/dist/identity/models.mjs +51 -0
- package/dist/identity/models.mjs.map +1 -0
- package/dist/identity/operations.d.mts +118 -0
- package/dist/identity/operations.mjs +124 -0
- package/dist/identity/operations.mjs.map +1 -0
- package/dist/index.d.mts +23 -0
- package/dist/index.mjs +23 -0
- package/dist/internal/AuthStoreDecisions.d.mts +22 -0
- package/dist/internal/AuthStoreDecisions.mjs +8 -0
- package/dist/internal/AuthStoreDecisions.mjs.map +1 -0
- package/dist/internal/CurrentSession.d.mts +9 -0
- package/dist/internal/CurrentSession.mjs +8 -0
- package/dist/internal/CurrentSession.mjs.map +1 -0
- package/dist/internal/diagnostics.mjs +23 -0
- package/dist/internal/diagnostics.mjs.map +1 -0
- package/dist/oauth/GithubOAuthProvider.d.mts +43 -0
- package/dist/oauth/GithubOAuthProvider.mjs +66 -0
- package/dist/oauth/GithubOAuthProvider.mjs.map +1 -0
- package/dist/oauth/OAuth.d.mts +73 -0
- package/dist/oauth/OAuth.mjs +180 -0
- package/dist/oauth/OAuth.mjs.map +1 -0
- package/dist/oauth/OAuthAccountsPersistence.d.mts +109 -0
- package/dist/oauth/OAuthAccountsPersistence.mjs +12 -0
- package/dist/oauth/OAuthAccountsPersistence.mjs.map +1 -0
- package/dist/oauth/OAuthActionEvidence.d.mts +28 -0
- package/dist/oauth/OAuthActionEvidence.mjs +15 -0
- package/dist/oauth/OAuthActionEvidence.mjs.map +1 -0
- package/dist/oauth/OAuthConnectedActionEvidence.d.mts +22 -0
- package/dist/oauth/OAuthConnectedActionEvidence.mjs +9 -0
- package/dist/oauth/OAuthConnectedActionEvidence.mjs.map +1 -0
- package/dist/oauth/OAuthConnectedPersistence.d.mts +129 -0
- package/dist/oauth/OAuthConnectedPersistence.mjs +12 -0
- package/dist/oauth/OAuthConnectedPersistence.mjs.map +1 -0
- package/dist/oauth/OAuthConnectedProtocol.d.mts +41 -0
- package/dist/oauth/OAuthConnectedProtocol.mjs +13 -0
- package/dist/oauth/OAuthConnectedProtocol.mjs.map +1 -0
- package/dist/oauth/OAuthConnectedRevocations.d.mts +167 -0
- package/dist/oauth/OAuthConnectedRevocations.mjs +21 -0
- package/dist/oauth/OAuthConnectedRevocations.mjs.map +1 -0
- package/dist/oauth/OAuthConnectedTokenProtector.d.mts +24 -0
- package/dist/oauth/OAuthConnectedTokenProtector.mjs +153 -0
- package/dist/oauth/OAuthConnectedTokenProtector.mjs.map +1 -0
- package/dist/oauth/OAuthConnectedTransactionProtector.d.mts +23 -0
- package/dist/oauth/OAuthConnectedTransactionProtector.mjs +37 -0
- package/dist/oauth/OAuthConnectedTransactionProtector.mjs.map +1 -0
- package/dist/oauth/OAuthConnectedUseAuthority.d.mts +22 -0
- package/dist/oauth/OAuthConnectedUseAuthority.mjs +10 -0
- package/dist/oauth/OAuthConnectedUseAuthority.mjs.map +1 -0
- package/dist/oauth/OAuthConnectionStore.d.mts +33 -0
- package/dist/oauth/OAuthConnectionStore.mjs +38 -0
- package/dist/oauth/OAuthConnectionStore.mjs.map +1 -0
- package/dist/oauth/OAuthLinkTransactionProtector.d.mts +25 -0
- package/dist/oauth/OAuthLinkTransactionProtector.mjs +39 -0
- package/dist/oauth/OAuthLinkTransactionProtector.mjs.map +1 -0
- package/dist/oauth/OAuthProtocol.d.mts +33 -0
- package/dist/oauth/OAuthProtocol.mjs +16 -0
- package/dist/oauth/OAuthProtocol.mjs.map +1 -0
- package/dist/oauth/OAuthProvider.d.mts +70 -0
- package/dist/oauth/OAuthProvider.mjs +39 -0
- package/dist/oauth/OAuthProvider.mjs.map +1 -0
- package/dist/oauth/OAuthProviders.d.mts +27 -0
- package/dist/oauth/OAuthProviders.mjs +33 -0
- package/dist/oauth/OAuthProviders.mjs.map +1 -0
- package/dist/oauth/OAuthRegistrationIntents.d.mts +87 -0
- package/dist/oauth/OAuthRegistrationIntents.mjs +19 -0
- package/dist/oauth/OAuthRegistrationIntents.mjs.map +1 -0
- package/dist/oauth/OAuthReturnTargets.d.mts +15 -0
- package/dist/oauth/OAuthReturnTargets.mjs +24 -0
- package/dist/oauth/OAuthReturnTargets.mjs.map +1 -0
- package/dist/oauth/OAuthSignInPersistence.d.mts +68 -0
- package/dist/oauth/OAuthSignInPersistence.mjs +12 -0
- package/dist/oauth/OAuthSignInPersistence.mjs.map +1 -0
- package/dist/oauth/OAuthStateDecisions.d.mts +14 -0
- package/dist/oauth/OAuthStateDecisions.mjs +8 -0
- package/dist/oauth/OAuthStateDecisions.mjs.map +1 -0
- package/dist/oauth/OAuthStateStore.d.mts +35 -0
- package/dist/oauth/OAuthStateStore.mjs +64 -0
- package/dist/oauth/OAuthStateStore.mjs.map +1 -0
- package/dist/oauth/OAuthTransactionProtector.d.mts +26 -0
- package/dist/oauth/OAuthTransactionProtector.mjs +78 -0
- package/dist/oauth/OAuthTransactionProtector.mjs.map +1 -0
- package/dist/oauth/accounts.d.mts +29 -0
- package/dist/oauth/accounts.mjs +515 -0
- package/dist/oauth/accounts.mjs.map +1 -0
- package/dist/oauth/accountsModels.d.mts +463 -0
- package/dist/oauth/accountsModels.mjs +155 -0
- package/dist/oauth/accountsModels.mjs.map +1 -0
- package/dist/oauth/connected.d.mts +442 -0
- package/dist/oauth/connected.mjs +526 -0
- package/dist/oauth/connected.mjs.map +1 -0
- package/dist/oauth/connectedAccess.d.mts +20 -0
- package/dist/oauth/connectedAccess.mjs +279 -0
- package/dist/oauth/connectedAccess.mjs.map +1 -0
- package/dist/oauth/connectedMaintenance.d.mts +19 -0
- package/dist/oauth/connectedMaintenance.mjs +133 -0
- package/dist/oauth/connectedMaintenance.mjs.map +1 -0
- package/dist/oauth/connectedModels.d.mts +2023 -0
- package/dist/oauth/connectedModels.mjs +375 -0
- package/dist/oauth/connectedModels.mjs.map +1 -0
- package/dist/oauth/definition.d.mts +4396 -0
- package/dist/oauth/definition.mjs +120 -0
- package/dist/oauth/definition.mjs.map +1 -0
- package/dist/oauth/errors.d.mts +49 -0
- package/dist/oauth/errors.mjs +42 -0
- package/dist/oauth/errors.mjs.map +1 -0
- package/dist/oauth/github/identity.d.mts +8 -0
- package/dist/oauth/github/identity.mjs +24 -0
- package/dist/oauth/github/identity.mjs.map +1 -0
- package/dist/oauth/github/models.d.mts +34 -0
- package/dist/oauth/github/protocol.d.mts +54 -0
- package/dist/oauth/github/protocol.mjs +204 -0
- package/dist/oauth/github/protocol.mjs.map +1 -0
- package/dist/oauth/openid-client/ProviderRevocation.d.mts +4 -0
- package/dist/oauth/openid-client/ProviderRevocation.mjs +11 -0
- package/dist/oauth/openid-client/ProviderRevocation.mjs.map +1 -0
- package/dist/oauth/openid-client/compatibility.d.mts +1 -0
- package/dist/oauth/openid-client/compatibility.mjs +6 -0
- package/dist/oauth/openid-client/compatibility.mjs.map +1 -0
- package/dist/oauth/openid-client/configuration.mjs +305 -0
- package/dist/oauth/openid-client/configuration.mjs.map +1 -0
- package/dist/oauth/openid-client/connected/configuration.mjs +338 -0
- package/dist/oauth/openid-client/connected/configuration.mjs.map +1 -0
- package/dist/oauth/openid-client/connected/models.d.mts +42 -0
- package/dist/oauth/openid-client/connected/protocol.d.mts +16 -0
- package/dist/oauth/openid-client/connected/protocol.mjs +402 -0
- package/dist/oauth/openid-client/connected/protocol.mjs.map +1 -0
- package/dist/oauth/openid-client/models.d.mts +67 -0
- package/dist/oauth/openid-client/models.mjs +16 -0
- package/dist/oauth/openid-client/models.mjs.map +1 -0
- package/dist/oauth/openid-client/protocol.d.mts +27 -0
- package/dist/oauth/openid-client/protocol.mjs +218 -0
- package/dist/oauth/openid-client/protocol.mjs.map +1 -0
- package/dist/oauth/openid-client/transport.mjs +59 -0
- package/dist/oauth/openid-client/transport.mjs.map +1 -0
- package/dist/oauth/policy.d.mts +18 -0
- package/dist/oauth/policy.mjs +16 -0
- package/dist/oauth/policy.mjs.map +1 -0
- package/dist/oauth/registration.d.mts +24 -0
- package/dist/oauth/registration.mjs +177 -0
- package/dist/oauth/registration.mjs.map +1 -0
- package/dist/oauth/registrationModels.d.mts +152 -0
- package/dist/oauth/registrationModels.mjs +93 -0
- package/dist/oauth/registrationModels.mjs.map +1 -0
- package/dist/oauth/registrationSecrets.mjs +70 -0
- package/dist/oauth/registrationSecrets.mjs.map +1 -0
- package/dist/oauth/schema.d.mts +86 -0
- package/dist/oauth/schema.mjs +81 -0
- package/dist/oauth/schema.mjs.map +1 -0
- package/dist/oauth/signInErrors.d.mts +17 -0
- package/dist/oauth/signInErrors.mjs +16 -0
- package/dist/oauth/signInErrors.mjs.map +1 -0
- package/dist/oauth/signInModels.d.mts +343 -0
- package/dist/oauth/signInModels.mjs +181 -0
- package/dist/oauth/signInModels.mjs.map +1 -0
- package/dist/oauth/signInModule.d.mts +1546 -0
- package/dist/oauth/signInModule.mjs +430 -0
- package/dist/oauth/signInModule.mjs.map +1 -0
- package/dist/oauth/signInSnapshot.mjs +29 -0
- package/dist/oauth/signInSnapshot.mjs.map +1 -0
- package/dist/oauth/transactionEncryption.d.mts +14 -0
- package/dist/oauth/transactionEncryption.mjs +129 -0
- package/dist/oauth/transactionEncryption.mjs.map +1 -0
- package/dist/operations/RequestBindingConfig.d.mts +11 -0
- package/dist/operations/RequestBindingConfig.mjs +10 -0
- package/dist/operations/RequestBindingConfig.mjs.map +1 -0
- package/dist/operations/actions.d.mts +947 -0
- package/dist/operations/actions.mjs +148 -0
- package/dist/operations/actions.mjs.map +1 -0
- package/dist/operations/context.d.mts +63 -0
- package/dist/operations/context.mjs +55 -0
- package/dist/operations/context.mjs.map +1 -0
- package/dist/operations/credentials.d.mts +39 -0
- package/dist/operations/credentials.mjs +60 -0
- package/dist/operations/credentials.mjs.map +1 -0
- package/dist/operations/errors.d.mts +24 -0
- package/dist/operations/errors.mjs +31 -0
- package/dist/operations/errors.mjs.map +1 -0
- package/dist/operations/operation.d.mts +124 -0
- package/dist/operations/operation.mjs +220 -0
- package/dist/operations/operation.mjs.map +1 -0
- package/dist/operations/requestBinding.d.mts +46 -0
- package/dist/operations/requestBinding.mjs +130 -0
- package/dist/operations/requestBinding.mjs.map +1 -0
- package/dist/operations/requestBindingModels.d.mts +13 -0
- package/dist/operations/requestBindingModels.mjs +12 -0
- package/dist/operations/requestBindingModels.mjs.map +1 -0
- package/dist/operations/reveals.d.mts +28 -0
- package/dist/operations/reveals.mjs +88 -0
- package/dist/operations/reveals.mjs.map +1 -0
- package/dist/passkey/PasskeyActionEvidence.d.mts +22 -0
- package/dist/passkey/PasskeyActionEvidence.mjs +9 -0
- package/dist/passkey/PasskeyActionEvidence.mjs.map +1 -0
- package/dist/passkey/PasskeyCredentials.d.mts +16 -0
- package/dist/passkey/PasskeyCredentials.mjs +9 -0
- package/dist/passkey/PasskeyCredentials.mjs.map +1 -0
- package/dist/passkey/PasskeyEnrollmentContext.d.mts +22 -0
- package/dist/passkey/PasskeyEnrollmentContext.mjs +9 -0
- package/dist/passkey/PasskeyEnrollmentContext.mjs.map +1 -0
- package/dist/passkey/PasskeyManagementPersistence.d.mts +106 -0
- package/dist/passkey/PasskeyManagementPersistence.mjs +9 -0
- package/dist/passkey/PasskeyManagementPersistence.mjs.map +1 -0
- package/dist/passkey/PasskeyPersistence.d.mts +63 -0
- package/dist/passkey/PasskeyPersistence.mjs +10 -0
- package/dist/passkey/PasskeyPersistence.mjs.map +1 -0
- package/dist/passkey/PasskeyProtocol.d.mts +38 -0
- package/dist/passkey/PasskeyProtocol.mjs +11 -0
- package/dist/passkey/PasskeyProtocol.mjs.map +1 -0
- package/dist/passkey/actions.d.mts +50 -0
- package/dist/passkey/actions.mjs +376 -0
- package/dist/passkey/actions.mjs.map +1 -0
- package/dist/passkey/browser/PasskeyBrowser.d.mts +18 -0
- package/dist/passkey/browser/PasskeyBrowser.mjs +9 -0
- package/dist/passkey/browser/PasskeyBrowser.mjs.map +1 -0
- package/dist/passkey/browser/models.d.mts +38 -0
- package/dist/passkey/browser/models.mjs +41 -0
- package/dist/passkey/browser/models.mjs.map +1 -0
- package/dist/passkey/browser/simplewebauthn.d.mts +17 -0
- package/dist/passkey/browser/simplewebauthn.mjs +411 -0
- package/dist/passkey/browser/simplewebauthn.mjs.map +1 -0
- package/dist/passkey/definition.d.mts +5626 -0
- package/dist/passkey/definition.mjs +114 -0
- package/dist/passkey/definition.mjs.map +1 -0
- package/dist/passkey/errors.d.mts +20 -0
- package/dist/passkey/errors.mjs +20 -0
- package/dist/passkey/errors.mjs.map +1 -0
- package/dist/passkey/management.mjs +276 -0
- package/dist/passkey/management.mjs.map +1 -0
- package/dist/passkey/models.d.mts +1245 -0
- package/dist/passkey/models.mjs +301 -0
- package/dist/passkey/models.mjs.map +1 -0
- package/dist/passkey/module.d.mts +2132 -0
- package/dist/passkey/module.mjs +174 -0
- package/dist/passkey/module.mjs.map +1 -0
- package/dist/passkey/pending.mjs +99 -0
- package/dist/passkey/pending.mjs.map +1 -0
- package/dist/passkey/policy.d.mts +48 -0
- package/dist/passkey/policy.mjs +77 -0
- package/dist/passkey/policy.mjs.map +1 -0
- package/dist/passkey/registration.mjs +107 -0
- package/dist/passkey/registration.mjs.map +1 -0
- package/dist/passkey/simplewebauthn/configuration.mjs +45 -0
- package/dist/passkey/simplewebauthn/configuration.mjs.map +1 -0
- package/dist/passkey/simplewebauthn/models.d.mts +21 -0
- package/dist/passkey/simplewebauthn/models.mjs +8 -0
- package/dist/passkey/simplewebauthn/models.mjs.map +1 -0
- package/dist/passkey/simplewebauthn/protocol.d.mts +62 -0
- package/dist/passkey/simplewebauthn/protocol.mjs +402 -0
- package/dist/passkey/simplewebauthn/protocol.mjs.map +1 -0
- package/dist/passkey/snapshot.mjs +31 -0
- package/dist/passkey/snapshot.mjs.map +1 -0
- package/dist/passkey/stepUp.mjs +101 -0
- package/dist/passkey/stepUp.mjs.map +1 -0
- package/dist/password/CompromisedPasswords.d.mts +26 -0
- package/dist/password/CompromisedPasswords.mjs +23 -0
- package/dist/password/CompromisedPasswords.mjs.map +1 -0
- package/dist/password/NewPasswordCheck.d.mts +21 -0
- package/dist/password/NewPasswordCheck.mjs +39 -0
- package/dist/password/NewPasswordCheck.mjs.map +1 -0
- package/dist/password/PasswordHashing.d.mts +24 -0
- package/dist/password/PasswordHashing.mjs +96 -0
- package/dist/password/PasswordHashing.mjs.map +1 -0
- package/dist/password/PasswordKdfAdmission.d.mts +19 -0
- package/dist/password/PasswordKdfAdmission.mjs +25 -0
- package/dist/password/PasswordKdfAdmission.mjs.map +1 -0
- package/dist/password/configuration.d.mts +43 -0
- package/dist/password/configuration.mjs +64 -0
- package/dist/password/configuration.mjs.map +1 -0
- package/dist/password/defaults.mjs +13 -0
- package/dist/password/defaults.mjs.map +1 -0
- package/dist/password/encoding.mjs +64 -0
- package/dist/password/encoding.mjs.map +1 -0
- package/dist/password/errors.d.mts +28 -0
- package/dist/password/errors.mjs +25 -0
- package/dist/password/errors.mjs.map +1 -0
- package/dist/password/methods/PasswordActionEvidence.d.mts +38 -0
- package/dist/password/methods/PasswordActionEvidence.mjs +22 -0
- package/dist/password/methods/PasswordActionEvidence.mjs.map +1 -0
- package/dist/password/methods/PasswordPersistence.d.mts +102 -0
- package/dist/password/methods/PasswordPersistence.mjs +13 -0
- package/dist/password/methods/PasswordPersistence.mjs.map +1 -0
- package/dist/password/methods/PasswordPreparedPersistence.d.mts +111 -0
- package/dist/password/methods/contracts.d.mts +43 -0
- package/dist/password/methods/contracts.mjs +33 -0
- package/dist/password/methods/contracts.mjs.map +1 -0
- package/dist/password/methods/definition.d.mts +3813 -0
- package/dist/password/methods/definition.mjs +56 -0
- package/dist/password/methods/definition.mjs.map +1 -0
- package/dist/password/methods/errors.d.mts +15 -0
- package/dist/password/methods/errors.mjs +11 -0
- package/dist/password/methods/errors.mjs.map +1 -0
- package/dist/password/methods/models.d.mts +70 -0
- package/dist/password/methods/models.mjs +44 -0
- package/dist/password/methods/models.mjs.map +1 -0
- package/dist/password/methods/module.d.mts +3567 -0
- package/dist/password/methods/module.mjs +553 -0
- package/dist/password/methods/module.mjs.map +1 -0
- package/dist/password/methods/policy.d.mts +84 -0
- package/dist/password/methods/policy.mjs +80 -0
- package/dist/password/methods/policy.mjs.map +1 -0
- package/dist/password/methods/preparation.mjs +54 -0
- package/dist/password/methods/preparation.mjs.map +1 -0
- package/dist/password/methods/prepared.d.mts +53 -0
- package/dist/password/methods/prepared.mjs +610 -0
- package/dist/password/methods/prepared.mjs.map +1 -0
- package/dist/password/methods/preparedModels.d.mts +1295 -0
- package/dist/password/methods/preparedModels.mjs +278 -0
- package/dist/password/methods/preparedModels.mjs.map +1 -0
- package/dist/password/methods/signIn.d.mts +180 -0
- package/dist/password/methods/signIn.mjs +73 -0
- package/dist/password/methods/signIn.mjs.map +1 -0
- package/dist/password/methods/snapshot.mjs +38 -0
- package/dist/password/methods/snapshot.mjs.map +1 -0
- package/dist/password/methods/verification.mjs +138 -0
- package/dist/password/methods/verification.mjs.map +1 -0
- package/dist/password/models.d.mts +13 -0
- package/dist/password/models.mjs +12 -0
- package/dist/password/models.mjs.map +1 -0
- package/dist/password/policy.d.mts +33 -0
- package/dist/password/policy.mjs +37 -0
- package/dist/password/policy.mjs.map +1 -0
- package/dist/phone/PhoneActionEvidence.d.mts +23 -0
- package/dist/phone/PhoneActionEvidence.mjs +10 -0
- package/dist/phone/PhoneActionEvidence.mjs.map +1 -0
- package/dist/phone/PhoneAdmission.d.mts +29 -0
- package/dist/phone/PhoneAdmission.mjs +10 -0
- package/dist/phone/PhoneAdmission.mjs.map +1 -0
- package/dist/phone/PhoneDeliveryEligibility.d.mts +11 -0
- package/dist/phone/PhoneDeliveryEligibility.mjs +8 -0
- package/dist/phone/PhoneDeliveryEligibility.mjs.map +1 -0
- package/dist/phone/PhonePersistence.d.mts +33 -0
- package/dist/phone/PhonePersistence.mjs +10 -0
- package/dist/phone/PhonePersistence.mjs.map +1 -0
- package/dist/phone/PhoneRequestContext.d.mts +10 -0
- package/dist/phone/PhoneRequestContext.mjs +8 -0
- package/dist/phone/PhoneRequestContext.mjs.map +1 -0
- package/dist/phone/PhoneSignInTargets.d.mts +19 -0
- package/dist/phone/PhoneSignInTargets.mjs +13 -0
- package/dist/phone/PhoneSignInTargets.mjs.map +1 -0
- package/dist/phone/definition.d.mts +7190 -0
- package/dist/phone/definition.mjs +28 -0
- package/dist/phone/definition.mjs.map +1 -0
- package/dist/phone/failure.mjs +23 -0
- package/dist/phone/failure.mjs.map +1 -0
- package/dist/phone/lifecycle.mjs +427 -0
- package/dist/phone/lifecycle.mjs.map +1 -0
- package/dist/phone/lifecycleModels.d.mts +164 -0
- package/dist/phone/lifecycleModels.mjs +91 -0
- package/dist/phone/lifecycleModels.mjs.map +1 -0
- package/dist/phone/models.d.mts +41 -0
- package/dist/phone/models.mjs +29 -0
- package/dist/phone/models.mjs.map +1 -0
- package/dist/phone/module.d.mts +6027 -0
- package/dist/phone/module.mjs +293 -0
- package/dist/phone/module.mjs.map +1 -0
- package/dist/proofs/EmailProofDelivery.d.mts +13 -0
- package/dist/proofs/EmailProofDelivery.mjs +11 -0
- package/dist/proofs/EmailProofDelivery.mjs.map +1 -0
- package/dist/proofs/HostIngressLimiter.d.mts +20 -0
- package/dist/proofs/HostIngressLimiter.mjs +13 -0
- package/dist/proofs/HostIngressLimiter.mjs.map +1 -0
- package/dist/proofs/ProofPersistence.d.mts +140 -0
- package/dist/proofs/ProofPersistence.mjs +13 -0
- package/dist/proofs/ProofPersistence.mjs.map +1 -0
- package/dist/proofs/SmsProofDelivery.d.mts +13 -0
- package/dist/proofs/SmsProofDelivery.mjs +11 -0
- package/dist/proofs/SmsProofDelivery.mjs.map +1 -0
- package/dist/proofs/abuse.d.mts +15 -0
- package/dist/proofs/abuse.mjs +12 -0
- package/dist/proofs/abuse.mjs.map +1 -0
- package/dist/proofs/completion.d.mts +22 -0
- package/dist/proofs/crypto.d.mts +196 -0
- package/dist/proofs/crypto.mjs +189 -0
- package/dist/proofs/crypto.mjs.map +1 -0
- package/dist/proofs/definition.d.mts +335 -0
- package/dist/proofs/definition.mjs +10 -0
- package/dist/proofs/definition.mjs.map +1 -0
- package/dist/proofs/delivery.d.mts +30 -0
- package/dist/proofs/delivery.mjs +26 -0
- package/dist/proofs/delivery.mjs.map +1 -0
- package/dist/proofs/dispatch.d.mts +20 -0
- package/dist/proofs/dispatch.mjs +54 -0
- package/dist/proofs/dispatch.mjs.map +1 -0
- package/dist/proofs/errors.d.mts +21 -0
- package/dist/proofs/errors.mjs +25 -0
- package/dist/proofs/errors.mjs.map +1 -0
- package/dist/proofs/models.d.mts +141 -0
- package/dist/proofs/models.mjs +93 -0
- package/dist/proofs/models.mjs.map +1 -0
- package/dist/proofs/module.d.mts +344 -0
- package/dist/proofs/module.mjs +350 -0
- package/dist/proofs/module.mjs.map +1 -0
- package/dist/proofs/policy.d.mts +152 -0
- package/dist/proofs/policy.mjs +51 -0
- package/dist/proofs/policy.mjs.map +1 -0
- package/dist/sessions/AuthenticationAuthority.d.mts +31 -0
- package/dist/sessions/AuthenticationAuthority.mjs +8 -0
- package/dist/sessions/AuthenticationAuthority.mjs.map +1 -0
- package/dist/sessions/PendingAuthentication.d.mts +108 -0
- package/dist/sessions/PendingAuthentication.mjs +40 -0
- package/dist/sessions/PendingAuthentication.mjs.map +1 -0
- package/dist/sessions/SessionStepUpPersistence.d.mts +152 -0
- package/dist/sessions/SessionStepUpPersistence.mjs +63 -0
- package/dist/sessions/SessionStepUpPersistence.mjs.map +1 -0
- package/dist/sessions/assurance.d.mts +163 -0
- package/dist/sessions/assurance.mjs +95 -0
- package/dist/sessions/assurance.mjs.map +1 -0
- package/dist/sessions/commit.d.mts +13 -0
- package/dist/sessions/configuration.d.mts +46 -0
- package/dist/sessions/configuration.mjs +55 -0
- package/dist/sessions/configuration.mjs.map +1 -0
- package/dist/sessions/contract.d.mts +663 -0
- package/dist/sessions/contract.mjs +174 -0
- package/dist/sessions/contract.mjs.map +1 -0
- package/dist/sessions/crypto.d.mts +24 -0
- package/dist/sessions/crypto.mjs +106 -0
- package/dist/sessions/crypto.mjs.map +1 -0
- package/dist/sessions/definition.d.mts +11 -0
- package/dist/sessions/definition.mjs +10 -0
- package/dist/sessions/definition.mjs.map +1 -0
- package/dist/sessions/errors.d.mts +35 -0
- package/dist/sessions/errors.mjs +34 -0
- package/dist/sessions/errors.mjs.map +1 -0
- package/dist/sessions/invalidation.d.mts +23 -0
- package/dist/sessions/invalidation.mjs +33 -0
- package/dist/sessions/invalidation.mjs.map +1 -0
- package/dist/sessions/models.d.mts +143 -0
- package/dist/sessions/models.mjs +94 -0
- package/dist/sessions/models.mjs.map +1 -0
- package/dist/sessions/module.d.mts +1091 -0
- package/dist/sessions/module.mjs +943 -0
- package/dist/sessions/module.mjs.map +1 -0
- package/dist/sessions/persistence.d.mts +93 -0
- package/dist/sessions/policy.d.mts +80 -0
- package/dist/sessions/policy.mjs +66 -0
- package/dist/sessions/policy.mjs.map +1 -0
- package/dist/testing/conformance/AuthStore.d.mts +11 -0
- package/dist/testing/conformance/AuthStore.mjs +173 -0
- package/dist/testing/conformance/AuthStore.mjs.map +1 -0
- package/dist/testing/conformance/OAuthConnectionStore.d.mts +11 -0
- package/dist/testing/conformance/OAuthConnectionStore.mjs +102 -0
- package/dist/testing/conformance/OAuthConnectionStore.mjs.map +1 -0
- package/dist/testing/conformance/OAuthStateStore.d.mts +11 -0
- package/dist/testing/conformance/OAuthStateStore.mjs +45 -0
- package/dist/testing/conformance/OAuthStateStore.mjs.map +1 -0
- package/dist/testing/conformance/PasswordCredentialStore.d.mts +20 -0
- package/dist/testing/conformance/PasswordCredentialStore.mjs +103 -0
- package/dist/testing/conformance/PasswordCredentialStore.mjs.map +1 -0
- package/dist/testing/conformance/support.mjs +17 -0
- package/dist/testing/conformance/support.mjs.map +1 -0
- package/dist/testing/crypto.d.mts +11 -0
- package/dist/testing/crypto.mjs +41 -0
- package/dist/testing/crypto.mjs.map +1 -0
- package/dist/testing/keyring.d.mts +9 -0
- package/dist/testing/keyring.mjs +17 -0
- package/dist/testing/keyring.mjs.map +1 -0
- package/dist/totp/TotpActionEvidence.d.mts +18 -0
- package/dist/totp/TotpActionEvidence.mjs +8 -0
- package/dist/totp/TotpActionEvidence.mjs.map +1 -0
- package/dist/totp/TotpPersistence.d.mts +19 -0
- package/dist/totp/TotpPersistence.mjs +8 -0
- package/dist/totp/TotpPersistence.mjs.map +1 -0
- package/dist/totp/TotpSecretKeys.d.mts +15 -0
- package/dist/totp/TotpSecretKeys.mjs +8 -0
- package/dist/totp/TotpSecretKeys.mjs.map +1 -0
- package/dist/totp/crypto.mjs +96 -0
- package/dist/totp/crypto.mjs.map +1 -0
- package/dist/totp/definition.d.mts +764 -0
- package/dist/totp/definition.mjs +24 -0
- package/dist/totp/definition.mjs.map +1 -0
- package/dist/totp/errors.d.mts +16 -0
- package/dist/totp/errors.mjs +18 -0
- package/dist/totp/errors.mjs.map +1 -0
- package/dist/totp/models.d.mts +377 -0
- package/dist/totp/models.mjs +137 -0
- package/dist/totp/models.mjs.map +1 -0
- package/dist/totp/module.d.mts +737 -0
- package/dist/totp/module.mjs +355 -0
- package/dist/totp/module.mjs.map +1 -0
- package/package.json +1 -0
- package/src/Atom.ts +4 -0
- package/src/Auth.ts +16 -0
- package/src/AuthContract.ts +17 -0
- package/src/AuthSession.ts +298 -0
- package/src/AuthStore.ts +367 -0
- package/src/AuthTokenCodec.ts +226 -0
- package/src/Client.ts +9 -0
- package/src/Cloudflare.ts +345 -0
- package/src/Drizzle.ts +378 -0
- package/src/DrizzleD1.ts +136 -0
- package/src/DrizzleLibsql.ts +288 -0
- package/src/DrizzleMysql2.ts +184 -0
- package/src/DrizzlePglite.ts +160 -0
- package/src/DrizzlePostgres.ts +160 -0
- package/src/DrizzleSqliteBun.ts +244 -0
- package/src/DrizzleSqliteDo.ts +473 -0
- package/src/DrizzleSqliteNode.ts +245 -0
- package/src/DrizzleSqliteWasm.ts +245 -0
- package/src/Email.ts +55 -0
- package/src/EmailOtp.ts +250 -0
- package/src/EmailOtpSender.ts +28 -0
- package/src/Errors.ts +103 -0
- package/src/GitHub.ts +16 -0
- package/src/Hooks.ts +50 -0
- package/src/Http.ts +47 -0
- package/src/HttpServer.ts +742 -0
- package/src/Identity.ts +53 -0
- package/src/IdentityResolver.ts +18 -0
- package/src/OAuth.ts +242 -0
- package/src/OpenIdClient.ts +13 -0
- package/src/OpenIdClientConnected.ts +18 -0
- package/src/OperationHttp.ts +14 -0
- package/src/OperationHttpClient.ts +6 -0
- package/src/OperationHttpServer.ts +15 -0
- package/src/Operations.ts +69 -0
- package/src/Passkey.ts +81 -0
- package/src/PasskeyBrowser.ts +19 -0
- package/src/PasskeyContract.ts +212 -0
- package/src/PasskeyPassword.ts +319 -0
- package/src/PasskeySimpleWebAuthn.ts +6 -0
- package/src/Password.ts +113 -0
- package/src/PasswordAuth.ts +197 -0
- package/src/PasswordCredentialStore.ts +140 -0
- package/src/PasswordHasher.ts +147 -0
- package/src/PhoneOtp.ts +32 -0
- package/src/Policy.ts +95 -0
- package/src/Proofs.ts +71 -0
- package/src/Rpc.ts +15 -0
- package/src/Schema.ts +235 -0
- package/src/SessionContract.ts +2 -0
- package/src/Sessions.ts +105 -0
- package/src/Testing.ts +24 -0
- package/src/Totp.ts +28 -0
- package/src/TotpContract.ts +147 -0
- package/src/WebCrypto.ts +61 -0
- package/src/Workflows.ts +12 -0
- package/src/atom/AuthAtomLifetime.ts +87 -0
- package/src/atom/AuthAtomWorkflow.ts +27 -0
- package/src/atom/client.ts +364 -0
- package/src/atom/operations.ts +183 -0
- package/src/atom/scoped-runtime.ts +249 -0
- package/src/auth/Auth.ts +482 -0
- package/src/auth/AuthConfigurationError.ts +9 -0
- package/src/auth/AuthRequest.ts +21 -0
- package/src/auth/AuthStrategy.ts +116 -0
- package/src/auth/ConsumeDecision.ts +4 -0
- package/src/auth/actions.ts +220 -0
- package/src/auth/defaults.ts +23 -0
- package/src/auth/definition.ts +88 -0
- package/src/auth/session.ts +146 -0
- package/src/drizzle/D1BatchStatements.ts +10 -0
- package/src/drizzle/PasswordPreparedPostconditions.ts +30 -0
- package/src/drizzle/SuppliedService.ts +10 -0
- package/src/drizzle/d1-emails.ts +1808 -0
- package/src/drizzle/d1-generated-statement.ts +129 -0
- package/src/drizzle/d1-identity.ts +374 -0
- package/src/drizzle/d1-oauth.ts +338 -0
- package/src/drizzle/d1-passkey.ts +371 -0
- package/src/drizzle/d1-password-prepared.ts +1273 -0
- package/src/drizzle/d1-passwords.ts +2661 -0
- package/src/drizzle/d1-phone.ts +94 -0
- package/src/drizzle/d1-planning.ts +105 -0
- package/src/drizzle/d1-proofs.ts +2305 -0
- package/src/drizzle/d1-sessions.ts +2867 -0
- package/src/drizzle/d1-totp.ts +79 -0
- package/src/drizzle/email-model.ts +512 -0
- package/src/drizzle/email-registration.ts +696 -0
- package/src/drizzle/email-sql.ts +1468 -0
- package/src/drizzle/email-target.ts +243 -0
- package/src/drizzle/model.ts +492 -0
- package/src/drizzle/mysql-emails.ts +323 -0
- package/src/drizzle/mysql-identity.ts +323 -0
- package/src/drizzle/mysql-password-prepared.ts +206 -0
- package/src/drizzle/mysql-passwords.ts +341 -0
- package/src/drizzle/mysql-proofs.ts +183 -0
- package/src/drizzle/mysql-sessions.ts +742 -0
- package/src/drizzle/mysql.ts +686 -0
- package/src/drizzle/oauth-accounts.ts +801 -0
- package/src/drizzle/oauth-connected-access.ts +354 -0
- package/src/drizzle/oauth-connected-collection.ts +324 -0
- package/src/drizzle/oauth-connected-custody.ts +277 -0
- package/src/drizzle/oauth-connected-drivers.ts +463 -0
- package/src/drizzle/oauth-connected-flow.ts +439 -0
- package/src/drizzle/oauth-connected-input.ts +128 -0
- package/src/drizzle/oauth-connected-maintenance.ts +345 -0
- package/src/drizzle/oauth-connected-management.ts +365 -0
- package/src/drizzle/oauth-connected-model.ts +347 -0
- package/src/drizzle/oauth-connected-reference.ts +112 -0
- package/src/drizzle/oauth-connected-settlement.ts +226 -0
- package/src/drizzle/oauth-connected-state.ts +846 -0
- package/src/drizzle/oauth-connected-target.ts +264 -0
- package/src/drizzle/oauth-drivers.ts +567 -0
- package/src/drizzle/oauth-flow.ts +461 -0
- package/src/drizzle/oauth-input.ts +205 -0
- package/src/drizzle/oauth-model.ts +610 -0
- package/src/drizzle/oauth-mysql.ts +10 -0
- package/src/drizzle/oauth-owner.ts +29 -0
- package/src/drizzle/oauth-registration.ts +638 -0
- package/src/drizzle/oauth-state.ts +213 -0
- package/src/drizzle/oauth-target.ts +751 -0
- package/src/drizzle/passkey-admission.ts +333 -0
- package/src/drizzle/passkey-credentials.ts +465 -0
- package/src/drizzle/passkey-drivers.ts +385 -0
- package/src/drizzle/passkey-enrollment.ts +280 -0
- package/src/drizzle/passkey-flow.ts +983 -0
- package/src/drizzle/passkey-management.ts +369 -0
- package/src/drizzle/passkey-model.ts +350 -0
- package/src/drizzle/passkey-registration-ceremony-model.ts +69 -0
- package/src/drizzle/passkey-registration-ceremony.ts +254 -0
- package/src/drizzle/passkey-registration-custody.ts +82 -0
- package/src/drizzle/passkey-registration-write.ts +378 -0
- package/src/drizzle/passkey-state.ts +307 -0
- package/src/drizzle/passkey-target.ts +528 -0
- package/src/drizzle/passkey-write-drivers.ts +396 -0
- package/src/drizzle/passkey-write-model.ts +265 -0
- package/src/drizzle/passkey-write-state.ts +627 -0
- package/src/drizzle/passkey-write-target.ts +406 -0
- package/src/drizzle/password-model.ts +491 -0
- package/src/drizzle/password-prepared-model.ts +259 -0
- package/src/drizzle/password-prepared-sql.ts +1198 -0
- package/src/drizzle/password-prepared-state.ts +232 -0
- package/src/drizzle/password-prepared-target.ts +158 -0
- package/src/drizzle/password-registration.ts +372 -0
- package/src/drizzle/password-sql.ts +2082 -0
- package/src/drizzle/password-target.ts +223 -0
- package/src/drizzle/pg-emails.ts +323 -0
- package/src/drizzle/pg-password-prepared.ts +207 -0
- package/src/drizzle/pg-passwords.ts +340 -0
- package/src/drizzle/pg-proofs.ts +193 -0
- package/src/drizzle/pg-sessions.ts +751 -0
- package/src/drizzle/pg.ts +982 -0
- package/src/drizzle/phone-model.ts +185 -0
- package/src/drizzle/phone-state.ts +802 -0
- package/src/drizzle/phone-target.ts +471 -0
- package/src/drizzle/proof-model.ts +398 -0
- package/src/drizzle/proof-sql.ts +1912 -0
- package/src/drizzle/proof-target.ts +120 -0
- package/src/drizzle/session-model.ts +368 -0
- package/src/drizzle/session-sql.ts +2152 -0
- package/src/drizzle/session-target.ts +335 -0
- package/src/drizzle/sqlite-emails.ts +368 -0
- package/src/drizzle/sqlite-identity.ts +343 -0
- package/src/drizzle/sqlite-password-prepared.ts +262 -0
- package/src/drizzle/sqlite-passwords.ts +499 -0
- package/src/drizzle/sqlite-proofs.ts +204 -0
- package/src/drizzle/sqlite-sessions.ts +972 -0
- package/src/drizzle/sqlite.ts +704 -0
- package/src/drizzle/standalone-guard.ts +38 -0
- package/src/drizzle/step-up-model.ts +129 -0
- package/src/drizzle/step-up-state.ts +141 -0
- package/src/drizzle/totp-model.ts +91 -0
- package/src/drizzle/totp-state.ts +520 -0
- package/src/drizzle/totp-target.ts +304 -0
- package/src/drizzle/transaction-execution.ts +290 -0
- package/src/drizzle/transaction-mysql.ts +104 -0
- package/src/drizzle/transaction-owner.ts +570 -0
- package/src/email/EmailActionEvidence.ts +37 -0
- package/src/email/EmailAddressPersistence.ts +71 -0
- package/src/email/EmailIdentifierNotifier.ts +48 -0
- package/src/email/EmailReturnTargets.ts +50 -0
- package/src/email/EmailSignInTargets.ts +20 -0
- package/src/email/addresses.ts +630 -0
- package/src/email/definition.ts +309 -0
- package/src/email/errors.ts +23 -0
- package/src/email/magicLink.ts +84 -0
- package/src/email/models.ts +50 -0
- package/src/email/module.ts +664 -0
- package/src/email/registration.ts +415 -0
- package/src/email/snapshot.ts +51 -0
- package/src/hooks/LifecycleHooks.ts +136 -0
- package/src/hooks/commit.ts +271 -0
- package/src/hooks/models.ts +111 -0
- package/src/hooks/plugins.ts +87 -0
- package/src/hooks/transactions.ts +51 -0
- package/src/http/auth-api.ts +17 -0
- package/src/http/auth-contract.ts +148 -0
- package/src/http/auth-http.ts +467 -0
- package/src/http/endpoints/get-session.ts +9 -0
- package/src/http/endpoints/password-sign-in.ts +19 -0
- package/src/http/endpoints/request-email-otp.ts +10 -0
- package/src/http/endpoints/set-password.ts +18 -0
- package/src/http/endpoints/sign-out.ts +5 -0
- package/src/http/endpoints/verify-email-otp.ts +15 -0
- package/src/http/models.ts +80 -0
- package/src/http/security.ts +102 -0
- package/src/http/session-contract.ts +92 -0
- package/src/http-operation/OperationHttpInvocation.ts +39 -0
- package/src/http-operation/OperationHttpServerConfig.ts +124 -0
- package/src/http-operation/auth-client.ts +273 -0
- package/src/http-operation/client.ts +453 -0
- package/src/http-operation/configuration-schema.ts +19 -0
- package/src/http-operation/contract.ts +116 -0
- package/src/http-operation/errors.ts +38 -0
- package/src/http-operation/models.ts +42 -0
- package/src/http-operation/private.ts +50 -0
- package/src/http-operation/security.ts +93 -0
- package/src/http-operation/server.ts +544 -0
- package/src/identity/ExternalIdentityMutation.ts +18 -0
- package/src/identity/IdentityMutation.ts +41 -0
- package/src/identity/IdentityRepository.ts +37 -0
- package/src/identity/SubjectLifecycle.ts +80 -0
- package/src/identity/SubjectProvisioner.ts +40 -0
- package/src/identity/codecs.ts +54 -0
- package/src/identity/models.ts +82 -0
- package/src/identity/operations.ts +182 -0
- package/src/index.ts +23 -0
- package/src/internal/AuthStoreDecisions.ts +23 -0
- package/src/internal/CurrentSession.ts +8 -0
- package/src/internal/diagnostics.ts +71 -0
- package/src/oauth/GithubOAuthProvider.ts +106 -0
- package/src/oauth/OAuth.ts +436 -0
- package/src/oauth/OAuthAccountsPersistence.ts +142 -0
- package/src/oauth/OAuthActionEvidence.ts +31 -0
- package/src/oauth/OAuthConnectedActionEvidence.ts +28 -0
- package/src/oauth/OAuthConnectedPersistence.ts +163 -0
- package/src/oauth/OAuthConnectedProtocol.ts +54 -0
- package/src/oauth/OAuthConnectedRevocations.ts +48 -0
- package/src/oauth/OAuthConnectedTokenProtector.ts +240 -0
- package/src/oauth/OAuthConnectedTransactionProtector.ts +56 -0
- package/src/oauth/OAuthConnectedUseAuthority.ts +26 -0
- package/src/oauth/OAuthConnectionStore.ts +59 -0
- package/src/oauth/OAuthLinkTransactionProtector.ts +58 -0
- package/src/oauth/OAuthProtocol.ts +39 -0
- package/src/oauth/OAuthProvider.ts +126 -0
- package/src/oauth/OAuthProviders.ts +53 -0
- package/src/oauth/OAuthRegistrationIntents.ts +42 -0
- package/src/oauth/OAuthReturnTargets.ts +44 -0
- package/src/oauth/OAuthSignInPersistence.ts +91 -0
- package/src/oauth/OAuthStateDecisions.ts +16 -0
- package/src/oauth/OAuthStateStore.ts +102 -0
- package/src/oauth/OAuthTransactionProtector.ts +103 -0
- package/src/oauth/accounts.ts +987 -0
- package/src/oauth/accountsModels.ts +214 -0
- package/src/oauth/connected.ts +995 -0
- package/src/oauth/connectedAccess.ts +644 -0
- package/src/oauth/connectedMaintenance.ts +248 -0
- package/src/oauth/connectedModels.ts +495 -0
- package/src/oauth/definition.ts +414 -0
- package/src/oauth/errors.ts +78 -0
- package/src/oauth/github/identity.ts +26 -0
- package/src/oauth/github/models.ts +37 -0
- package/src/oauth/github/protocol.ts +329 -0
- package/src/oauth/openid-client/ProviderRevocation.ts +22 -0
- package/src/oauth/openid-client/compatibility.ts +47 -0
- package/src/oauth/openid-client/configuration.ts +472 -0
- package/src/oauth/openid-client/connected/configuration.ts +565 -0
- package/src/oauth/openid-client/connected/models.ts +58 -0
- package/src/oauth/openid-client/connected/protocol.ts +866 -0
- package/src/oauth/openid-client/models.ts +78 -0
- package/src/oauth/openid-client/protocol.ts +437 -0
- package/src/oauth/openid-client/transport.ts +67 -0
- package/src/oauth/policy.ts +26 -0
- package/src/oauth/registration.ts +410 -0
- package/src/oauth/registrationModels.ts +115 -0
- package/src/oauth/registrationSecrets.ts +127 -0
- package/src/oauth/schema.ts +102 -0
- package/src/oauth/signInErrors.ts +23 -0
- package/src/oauth/signInModels.ts +266 -0
- package/src/oauth/signInModule.ts +875 -0
- package/src/oauth/signInSnapshot.ts +37 -0
- package/src/oauth/transactionEncryption.ts +198 -0
- package/src/operations/RequestBindingConfig.ts +12 -0
- package/src/operations/actions.ts +342 -0
- package/src/operations/context.ts +130 -0
- package/src/operations/credentials.ts +121 -0
- package/src/operations/errors.ts +53 -0
- package/src/operations/operation.ts +740 -0
- package/src/operations/requestBinding.ts +237 -0
- package/src/operations/requestBindingModels.ts +18 -0
- package/src/operations/reveals.ts +147 -0
- package/src/passkey/PasskeyActionEvidence.ts +25 -0
- package/src/passkey/PasskeyCredentials.ts +16 -0
- package/src/passkey/PasskeyEnrollmentContext.ts +26 -0
- package/src/passkey/PasskeyManagementPersistence.ts +124 -0
- package/src/passkey/PasskeyPersistence.ts +85 -0
- package/src/passkey/PasskeyProtocol.ts +48 -0
- package/src/passkey/actions.ts +905 -0
- package/src/passkey/browser/PasskeyBrowser.ts +26 -0
- package/src/passkey/browser/models.ts +67 -0
- package/src/passkey/browser/simplewebauthn.ts +621 -0
- package/src/passkey/definition.ts +386 -0
- package/src/passkey/errors.ts +39 -0
- package/src/passkey/management.ts +552 -0
- package/src/passkey/models.ts +414 -0
- package/src/passkey/module.ts +367 -0
- package/src/passkey/pending.ts +203 -0
- package/src/passkey/policy.ts +88 -0
- package/src/passkey/registration.ts +251 -0
- package/src/passkey/simplewebauthn/configuration.ts +97 -0
- package/src/passkey/simplewebauthn/models.ts +9 -0
- package/src/passkey/simplewebauthn/protocol.ts +729 -0
- package/src/passkey/snapshot.ts +48 -0
- package/src/passkey/stepUp.ts +212 -0
- package/src/password/CompromisedPasswords.ts +36 -0
- package/src/password/NewPasswordCheck.ts +89 -0
- package/src/password/PasswordHashing.ts +209 -0
- package/src/password/PasswordKdfAdmission.ts +44 -0
- package/src/password/configuration.ts +52 -0
- package/src/password/defaults.ts +15 -0
- package/src/password/encoding.ts +137 -0
- package/src/password/errors.ts +43 -0
- package/src/password/methods/PasswordActionEvidence.ts +41 -0
- package/src/password/methods/PasswordPersistence.ts +128 -0
- package/src/password/methods/PasswordPreparedPersistence.ts +123 -0
- package/src/password/methods/contracts.ts +47 -0
- package/src/password/methods/definition.ts +199 -0
- package/src/password/methods/errors.ts +26 -0
- package/src/password/methods/models.ts +80 -0
- package/src/password/methods/module.ts +986 -0
- package/src/password/methods/policy.ts +68 -0
- package/src/password/methods/preparation.ts +73 -0
- package/src/password/methods/prepared.ts +1199 -0
- package/src/password/methods/preparedModels.ts +496 -0
- package/src/password/methods/signIn.ts +136 -0
- package/src/password/methods/snapshot.ts +53 -0
- package/src/password/methods/verification.ts +266 -0
- package/src/password/models.ts +15 -0
- package/src/password/policy.ts +41 -0
- package/src/phone/PhoneActionEvidence.ts +26 -0
- package/src/phone/PhoneAdmission.ts +29 -0
- package/src/phone/PhoneDeliveryEligibility.ts +9 -0
- package/src/phone/PhonePersistence.ts +43 -0
- package/src/phone/PhoneRequestContext.ts +7 -0
- package/src/phone/PhoneSignInTargets.ts +19 -0
- package/src/phone/definition.ts +87 -0
- package/src/phone/failure.ts +40 -0
- package/src/phone/lifecycle.ts +662 -0
- package/src/phone/lifecycleModels.ts +108 -0
- package/src/phone/models.ts +41 -0
- package/src/phone/module.ts +433 -0
- package/src/proofs/EmailProofDelivery.ts +19 -0
- package/src/proofs/HostIngressLimiter.ts +20 -0
- package/src/proofs/ProofPersistence.ts +172 -0
- package/src/proofs/SmsProofDelivery.ts +19 -0
- package/src/proofs/abuse.ts +23 -0
- package/src/proofs/completion.ts +23 -0
- package/src/proofs/crypto.ts +326 -0
- package/src/proofs/definition.ts +39 -0
- package/src/proofs/delivery.ts +73 -0
- package/src/proofs/dispatch.ts +99 -0
- package/src/proofs/errors.ts +46 -0
- package/src/proofs/models.ts +131 -0
- package/src/proofs/module.ts +620 -0
- package/src/proofs/policy.ts +77 -0
- package/src/sessions/AuthenticationAuthority.ts +51 -0
- package/src/sessions/PendingAuthentication.ts +121 -0
- package/src/sessions/SessionStepUpPersistence.ts +164 -0
- package/src/sessions/assurance.ts +192 -0
- package/src/sessions/commit.ts +13 -0
- package/src/sessions/configuration.ts +133 -0
- package/src/sessions/contract.ts +203 -0
- package/src/sessions/crypto.ts +181 -0
- package/src/sessions/definition.ts +25 -0
- package/src/sessions/errors.ts +68 -0
- package/src/sessions/invalidation.ts +46 -0
- package/src/sessions/models.ts +138 -0
- package/src/sessions/module.ts +1991 -0
- package/src/sessions/persistence.ts +135 -0
- package/src/sessions/policy.ts +103 -0
- package/src/testing/conformance/AuthStore.ts +314 -0
- package/src/testing/conformance/OAuthConnectionStore.ts +167 -0
- package/src/testing/conformance/OAuthStateStore.ts +105 -0
- package/src/testing/conformance/PasswordCredentialStore.ts +205 -0
- package/src/testing/conformance/support.ts +38 -0
- package/src/testing/crypto.ts +55 -0
- package/src/testing/keyring.ts +17 -0
- package/src/totp/TotpActionEvidence.ts +18 -0
- package/src/totp/TotpPersistence.ts +26 -0
- package/src/totp/TotpSecretKeys.ts +15 -0
- package/src/totp/crypto.ts +160 -0
- package/src/totp/definition.ts +78 -0
- package/src/totp/errors.ts +25 -0
- package/src/totp/models.ts +164 -0
- package/src/totp/module.ts +717 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HookDeliveryFailed } from "../hooks/models.mjs";
|
|
2
|
+
import { hookContribution } from "../hooks/LifecycleHooks.mjs";
|
|
3
|
+
import { Context, Effect } from "effect";
|
|
4
|
+
//#region src/email/EmailIdentifierNotifier.ts
|
|
5
|
+
/** Optional explicit notification capability. Vendor failure never rolls back an
|
|
6
|
+
* identifier change. Stable event IDs support consumer idempotency; direct hooks
|
|
7
|
+
* are best effort, not a durable outbox or an exactly-once delivery guarantee.
|
|
8
|
+
*/
|
|
9
|
+
var EmailIdentifierNotifier = class extends Context.Service()("effect-auth/EmailIdentifierNotifier") {};
|
|
10
|
+
const emailIdentifierNotifications = (moduleId) => {
|
|
11
|
+
const contribution = hookContribution(`email/${moduleId}/old-address-notification`);
|
|
12
|
+
const layer = contribution.layer({ after: Effect.fn("EmailIdentifierNotifier.after")(function* (event) {
|
|
13
|
+
if (event.snapshot.operation !== `${moduleId}/change-address` || event.snapshot.action !== "identifier-change") return;
|
|
14
|
+
const [oldIdentifier, newIdentifier] = event.snapshot.identifiers;
|
|
15
|
+
if (!oldIdentifier || !newIdentifier) return yield* HookDeliveryFailed.make({});
|
|
16
|
+
yield* (yield* EmailIdentifierNotifier).notify({
|
|
17
|
+
eventId: event.id,
|
|
18
|
+
oldIdentifier,
|
|
19
|
+
newIdentifier,
|
|
20
|
+
occurredAtMillis: event.occurredAtMillis
|
|
21
|
+
});
|
|
22
|
+
}) });
|
|
23
|
+
return Object.freeze({
|
|
24
|
+
contribution,
|
|
25
|
+
layer
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { EmailIdentifierNotifier, emailIdentifierNotifications };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=EmailIdentifierNotifier.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailIdentifierNotifier.mjs","names":[],"sources":["../../src/email/EmailIdentifierNotifier.ts"],"sourcesContent":["import { Context, Effect } from \"effect\";\n\nimport { hookContribution } from \"../hooks/LifecycleHooks\";\nimport { HookDeliveryFailed, type LifecycleEventId } from \"../hooks/models\";\nimport type { LoginIdentifier } from \"../identity/models\";\n\n/** Optional explicit notification capability. Vendor failure never rolls back an\n * identifier change. Stable event IDs support consumer idempotency; direct hooks\n * are best effort, not a durable outbox or an exactly-once delivery guarantee.\n */\nexport class EmailIdentifierNotifier extends Context.Service<\n EmailIdentifierNotifier,\n {\n readonly notify: (input: {\n readonly eventId: LifecycleEventId;\n readonly oldIdentifier: LoginIdentifier;\n readonly newIdentifier: LoginIdentifier;\n readonly occurredAtMillis: number;\n }) => Effect.Effect<void, HookDeliveryFailed>;\n }\n>()(\"effect-auth/EmailIdentifierNotifier\") {}\n\nexport const emailIdentifierNotifications = <const Id extends string>(moduleId: Id) => {\n const contribution = hookContribution(`email/${moduleId}/old-address-notification`);\n\n const layer = contribution.layer({\n after: Effect.fn(\"EmailIdentifierNotifier.after\")(function* (event) {\n if (\n event.snapshot.operation !== `${moduleId}/change-address` ||\n event.snapshot.action !== \"identifier-change\"\n )\n return;\n const [oldIdentifier, newIdentifier] = event.snapshot.identifiers;\n\n if (!oldIdentifier || !newIdentifier) return yield* HookDeliveryFailed.make({});\n const notifier = yield* EmailIdentifierNotifier;\n\n yield* notifier.notify({\n eventId: event.id,\n oldIdentifier,\n newIdentifier,\n occurredAtMillis: event.occurredAtMillis,\n });\n }),\n });\n\n return Object.freeze({ contribution, layer });\n};\n"],"mappings":";;;;;;;;AAUA,IAAa,0BAAb,cAA6C,QAAQ,QAUnD,CAAC,CAAC,qCAAqC,CAAC,CAAC,CAAC;AAE5C,MAAa,gCAAyD,aAAiB;CACrF,MAAM,eAAe,iBAAiB,SAAS,SAAS,0BAA0B;CAElF,MAAM,QAAQ,aAAa,MAAM,EAC/B,OAAO,OAAO,GAAG,+BAA+B,CAAC,CAAC,WAAW,OAAO;EAClE,IACE,MAAM,SAAS,cAAc,GAAG,SAAS,oBACzC,MAAM,SAAS,WAAW,qBAE1B;EACF,MAAM,CAAC,eAAe,iBAAiB,MAAM,SAAS;EAEtD,IAAI,CAAC,iBAAiB,CAAC,eAAe,OAAO,OAAO,mBAAmB,KAAK,CAAC,CAAC;EAG9E,QAAO,OAFiB,wBAAA,CAER,OAAO;GACrB,SAAS,MAAM;GACf;GACA;GACA,kBAAkB,MAAM;EAC1B,CAAC;CACH,CAAC,EACH,CAAC;CAED,OAAO,OAAO,OAAO;EAAE;EAAc;CAAM,CAAC;AAC9C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SafeReturnTarget } from "./models.mjs";
|
|
2
|
+
import { EmailConfigurationError, EmailRejected, EmailUnavailable } from "./errors.mjs";
|
|
3
|
+
import { Context, Effect, Layer } from "effect";
|
|
4
|
+
//#region src/email/EmailReturnTargets.d.ts
|
|
5
|
+
declare const EmailReturnTargets_base: Context.ServiceClass<EmailReturnTargets, "effect-auth/EmailReturnTargets", {
|
|
6
|
+
readonly resolve: (input: string) => Effect.Effect<SafeReturnTarget, EmailRejected | EmailUnavailable>;
|
|
7
|
+
}>;
|
|
8
|
+
/** Resolve before issuance and again before consumption. Never take a target from
|
|
9
|
+
* email/deep-link data. The core returns this canonical value; it never redirects.
|
|
10
|
+
*/
|
|
11
|
+
declare class EmailReturnTargets extends EmailReturnTargets_base {
|
|
12
|
+
/** Explicit exact application-route allowlist; no query, fragment, normalization
|
|
13
|
+
* or fallback to unvalidated input. Consumers may provide a stricter own Layer.
|
|
14
|
+
*/
|
|
15
|
+
static readonly exactRoutes: (routes: ReadonlyArray<string>) => Layer.Layer<EmailReturnTargets, EmailConfigurationError, never>;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { EmailReturnTargets };
|
|
19
|
+
//# sourceMappingURL=EmailReturnTargets.d.mts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EmailConfigurationError, EmailRejected } from "./errors.mjs";
|
|
2
|
+
import { SafeReturnTarget } from "./models.mjs";
|
|
3
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
|
+
//#region src/email/EmailReturnTargets.ts
|
|
5
|
+
/** Resolve before issuance and again before consumption. Never take a target from
|
|
6
|
+
* email/deep-link data. The core returns this canonical value; it never redirects.
|
|
7
|
+
*/
|
|
8
|
+
var EmailReturnTargets = class EmailReturnTargets extends Context.Service()("effect-auth/EmailReturnTargets") {
|
|
9
|
+
/** Explicit exact application-route allowlist; no query, fragment, normalization
|
|
10
|
+
* or fallback to unvalidated input. Consumers may provide a stricter own Layer.
|
|
11
|
+
*/
|
|
12
|
+
static exactRoutes = (routes) => {
|
|
13
|
+
const captured = [...routes];
|
|
14
|
+
return Layer.effect(this, Effect.gen(function* () {
|
|
15
|
+
const route = Schema.String.check(Schema.isMaxLength(2048), Schema.isPattern(/^\/(?!\/)[A-Za-z0-9/_-]*$/));
|
|
16
|
+
const checked = yield* Schema.decodeEffect(Schema.Array(route).check(Schema.isMinLength(1), Schema.isMaxLength(128)))(captured).pipe(Effect.mapError(() => EmailConfigurationError.make({})));
|
|
17
|
+
const allowed = new Set(checked);
|
|
18
|
+
return EmailReturnTargets.of({ resolve: Effect.fn("EmailReturnTargets.resolve")(function* (input) {
|
|
19
|
+
yield* Schema.decodeEffect(route)(input).pipe(Effect.mapError(() => EmailRejected.make({})));
|
|
20
|
+
if (!allowed.has(input)) return yield* EmailRejected.make({});
|
|
21
|
+
return SafeReturnTarget.make(input);
|
|
22
|
+
}) });
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { EmailReturnTargets };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=EmailReturnTargets.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailReturnTargets.mjs","names":[],"sources":["../../src/email/EmailReturnTargets.ts"],"sourcesContent":["import { Context, Effect, Layer, Schema } from \"effect\";\n\nimport { EmailConfigurationError, EmailRejected, type EmailUnavailable } from \"./errors\";\nimport { SafeReturnTarget } from \"./models\";\n\n/** Resolve before issuance and again before consumption. Never take a target from\n * email/deep-link data. The core returns this canonical value; it never redirects.\n */\nexport class EmailReturnTargets extends Context.Service<\n EmailReturnTargets,\n {\n readonly resolve: (\n input: string,\n ) => Effect.Effect<SafeReturnTarget, EmailRejected | EmailUnavailable>;\n }\n>()(\"effect-auth/EmailReturnTargets\") {\n /** Explicit exact application-route allowlist; no query, fragment, normalization\n * or fallback to unvalidated input. Consumers may provide a stricter own Layer.\n */\n static readonly exactRoutes = (routes: ReadonlyArray<string>) => {\n const captured = [...routes];\n\n return Layer.effect(\n this,\n Effect.gen(function* () {\n const route = Schema.String.check(\n Schema.isMaxLength(2048),\n Schema.isPattern(/^\\/(?!\\/)[A-Za-z0-9/_-]*$/),\n );\n\n const checked = yield* Schema.decodeEffect(\n Schema.Array(route).check(Schema.isMinLength(1), Schema.isMaxLength(128)),\n )(captured).pipe(Effect.mapError(() => EmailConfigurationError.make({})));\n\n const allowed = new Set(checked);\n\n return EmailReturnTargets.of({\n resolve: Effect.fn(\"EmailReturnTargets.resolve\")(function* (input) {\n yield* Schema.decodeEffect(route)(input).pipe(\n Effect.mapError(() => EmailRejected.make({})),\n );\n if (!allowed.has(input)) return yield* EmailRejected.make({});\n\n return SafeReturnTarget.make(input);\n }),\n });\n }),\n );\n };\n}\n"],"mappings":";;;;;;;AAQA,IAAa,qBAAb,MAAa,2BAA2B,QAAQ,QAO9C,CAAC,CAAC,gCAAgC,CAAC,CAAC;;;;CAIpC,OAAgB,eAAe,WAAkC;EAC/D,MAAM,WAAW,CAAC,GAAG,MAAM;EAE3B,OAAO,MAAM,OACX,MACA,OAAO,IAAI,aAAa;GACtB,MAAM,QAAQ,OAAO,OAAO,MAC1B,OAAO,YAAY,IAAI,GACvB,OAAO,UAAU,2BAA2B,CAC9C;GAEA,MAAM,UAAU,OAAO,OAAO,aAC5B,OAAO,MAAM,KAAK,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,GAAG,OAAO,YAAY,GAAG,CAAC,CAC1E,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,OAAO,eAAe,wBAAwB,KAAK,CAAC,CAAC,CAAC,CAAC;GAExE,MAAM,UAAU,IAAI,IAAI,OAAO;GAE/B,OAAO,mBAAmB,GAAG,EAC3B,SAAS,OAAO,GAAG,4BAA4B,CAAC,CAAC,WAAW,OAAO;IACjE,OAAO,OAAO,aAAa,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KACvC,OAAO,eAAe,cAAc,KAAK,CAAC,CAAC,CAAC,CAC9C;IACA,IAAI,CAAC,QAAQ,IAAI,KAAK,GAAG,OAAO,OAAO,cAAc,KAAK,CAAC,CAAC;IAE5D,OAAO,iBAAiB,KAAK,KAAK;GACpC,CAAC,EACH,CAAC;EACH,CAAC,CACH;CACF;AACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LoginIdentifier } from "../identity/models.mjs";
|
|
2
|
+
import { EmailCredentialSnapshot } from "./models.mjs";
|
|
3
|
+
import { EmailUnavailable } from "./errors.mjs";
|
|
4
|
+
import { Context, Effect, Option } from "effect";
|
|
5
|
+
//#region src/email/EmailSignInTargets.d.ts
|
|
6
|
+
declare const EmailSignInTargets_base: Context.ServiceClass<EmailSignInTargets, "effect-auth/EmailSignInTargets", {
|
|
7
|
+
readonly lookup: (input: {
|
|
8
|
+
readonly moduleId: string;
|
|
9
|
+
readonly identifier: LoginIdentifier;
|
|
10
|
+
}) => Effect.Effect<Option.Option<EmailCredentialSnapshot>, EmailUnavailable>;
|
|
11
|
+
}>;
|
|
12
|
+
/** Active subject + verified exact identifier + active configured email credential.
|
|
13
|
+
* Capture their SAME revisions before verification; absent/ineligible returns None.
|
|
14
|
+
* Every identifier change invalidating captured login bumps subject securityRevision
|
|
15
|
+
* atomically because AuthenticationRevision does not contain identifierRevision.
|
|
16
|
+
*/
|
|
17
|
+
declare class EmailSignInTargets extends EmailSignInTargets_base {}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { EmailSignInTargets };
|
|
20
|
+
//# sourceMappingURL=EmailSignInTargets.d.mts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Context } from "effect";
|
|
2
|
+
//#region src/email/EmailSignInTargets.ts
|
|
3
|
+
/** Active subject + verified exact identifier + active configured email credential.
|
|
4
|
+
* Capture their SAME revisions before verification; absent/ineligible returns None.
|
|
5
|
+
* Every identifier change invalidating captured login bumps subject securityRevision
|
|
6
|
+
* atomically because AuthenticationRevision does not contain identifierRevision.
|
|
7
|
+
*/
|
|
8
|
+
var EmailSignInTargets = class extends Context.Service()("effect-auth/EmailSignInTargets") {};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { EmailSignInTargets };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=EmailSignInTargets.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailSignInTargets.mjs","names":[],"sources":["../../src/email/EmailSignInTargets.ts"],"sourcesContent":["import { Context, type Effect, type Option } from \"effect\";\n\nimport type { LoginIdentifier } from \"../identity/models\";\nimport type { EmailUnavailable } from \"./errors\";\nimport type { EmailCredentialSnapshot } from \"./models\";\n\n/** Active subject + verified exact identifier + active configured email credential.\n * Capture their SAME revisions before verification; absent/ineligible returns None.\n * Every identifier change invalidating captured login bumps subject securityRevision\n * atomically because AuthenticationRevision does not contain identifierRevision.\n */\nexport class EmailSignInTargets extends Context.Service<\n EmailSignInTargets,\n {\n readonly lookup: (input: {\n readonly moduleId: string;\n readonly identifier: LoginIdentifier;\n }) => Effect.Effect<Option.Option<EmailCredentialSnapshot>, EmailUnavailable>;\n }\n>()(\"effect-auth/EmailSignInTargets\") {}\n"],"mappings":";;;;;;;AAWA,IAAa,qBAAb,cAAwC,QAAQ,QAQ9C,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "../operations/context.mjs";
|
|
2
|
+
import "../operations/credentials.mjs";
|
|
3
|
+
import "../operations/operation.mjs";
|
|
4
|
+
import "../identity/models.mjs";
|
|
5
|
+
import "../hooks/models.mjs";
|
|
6
|
+
import "../hooks/LifecycleHooks.mjs";
|
|
7
|
+
import "../hooks/commit.mjs";
|
|
8
|
+
import "../WebCrypto.mjs";
|
|
9
|
+
import "../operations/requestBinding.mjs";
|
|
10
|
+
import "../Operations.mjs";
|
|
11
|
+
import "../Auth.mjs";
|
|
12
|
+
import "../sessions/module.mjs";
|
|
13
|
+
import "./models.mjs";
|
|
14
|
+
import "../proofs/models.mjs";
|
|
15
|
+
import "../proofs/module.mjs";
|
|
16
|
+
import "../Proofs.mjs";
|
|
17
|
+
import "./errors.mjs";
|
|
18
|
+
import "./EmailActionEvidence.mjs";
|
|
19
|
+
import "./EmailAddressPersistence.mjs";
|
|
20
|
+
import { Context, Crypto, Effect, Layer, Schema } from "effect";
|
|
21
|
+
//#region src/email/addresses.d.ts
|
|
22
|
+
declare const Configuration: Schema.Struct<{
|
|
23
|
+
readonly maximumEvidenceAgeMillis: Schema.Int;
|
|
24
|
+
readonly requireImmediateInvalidation: Schema.Boolean;
|
|
25
|
+
}>;
|
|
26
|
+
type EmailAddressPolicy = typeof Configuration.Type;
|
|
27
|
+
interface AddressModule<Id extends string> {
|
|
28
|
+
readonly moduleId: Id;
|
|
29
|
+
readonly kind: "addresses";
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { AddressModule, EmailAddressPolicy };
|
|
33
|
+
//# sourceMappingURL=addresses.d.mts.map
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { Email, TokenDigest } from "../Schema.mjs";
|
|
2
|
+
import { LoginIdentifier } from "../identity/models.mjs";
|
|
3
|
+
import { HookDenied, LifecycleEventId, lifecycleEvent, lifecycleSnapshot } from "../hooks/models.mjs";
|
|
4
|
+
import { makeOperation, operationGroup } from "../operations/operation.mjs";
|
|
5
|
+
import { SessionInvalidationWindow, sessionInvalidationWindow } from "../sessions/invalidation.mjs";
|
|
6
|
+
import { AuthenticationFlowId } from "../sessions/models.mjs";
|
|
7
|
+
import { LifecycleHooks } from "../hooks/LifecycleHooks.mjs";
|
|
8
|
+
import { hasCommitScope } from "../hooks/commit.mjs";
|
|
9
|
+
import { assessAuthentication, snapshotAuthenticationEvidence } from "../sessions/assurance.mjs";
|
|
10
|
+
import { EmailAddressPersistence } from "./EmailAddressPersistence.mjs";
|
|
11
|
+
import { EmailActionRequired, EmailConfigurationError, EmailMethodUnsupported, EmailRejected, EmailUnavailable } from "./errors.mjs";
|
|
12
|
+
import { EmailActionChallenge, EmailCommandId } from "./models.mjs";
|
|
13
|
+
import { snapshotEmailCredential, snapshotEmailRequirement, snapshotEmailRevision } from "./snapshot.mjs";
|
|
14
|
+
import { ProofContinuation, ProofContinuationId, ProofId, ProofReference, ProofRequestId, ProofRequestReceipt } from "../proofs/models.mjs";
|
|
15
|
+
import { RequestBindingCredential, RequestBindingFlowId } from "../operations/requestBindingModels.mjs";
|
|
16
|
+
import { readProofCommit } from "../proofs/dispatch.mjs";
|
|
17
|
+
import { EmailActionEvidence } from "./EmailActionEvidence.mjs";
|
|
18
|
+
import { Context, Crypto, DateTime, Effect, Encoding, Layer, Schema } from "effect";
|
|
19
|
+
//#region src/email/addresses.ts
|
|
20
|
+
const BoundedId = Schema.NonEmptyString.check(Schema.isMaxLength(256));
|
|
21
|
+
const Secret = Schema.RedactedFromValue(Schema.String.check(Schema.isMaxLength(4096)));
|
|
22
|
+
const base = {
|
|
23
|
+
flowId: RequestBindingFlowId,
|
|
24
|
+
requestBinding: RequestBindingCredential,
|
|
25
|
+
commandId: EmailCommandId,
|
|
26
|
+
email: Schema.String.check(Schema.isMaxLength(320)).pipe(Schema.decodeTo(Email)),
|
|
27
|
+
sourceCredentialId: Schema.optionalKey(BoundedId),
|
|
28
|
+
actionProof: Schema.optionalKey(Secret)
|
|
29
|
+
};
|
|
30
|
+
Schema.Struct(base);
|
|
31
|
+
const RequestInput = Schema.Struct({
|
|
32
|
+
...base,
|
|
33
|
+
requestId: ProofRequestId,
|
|
34
|
+
locale: Schema.NonEmptyString.check(Schema.isMaxLength(64))
|
|
35
|
+
});
|
|
36
|
+
const ResendInput = Schema.Struct({
|
|
37
|
+
...RequestInput.fields,
|
|
38
|
+
supersedes: ProofId
|
|
39
|
+
});
|
|
40
|
+
const AttemptInput = Schema.Struct({
|
|
41
|
+
...base,
|
|
42
|
+
reference: ProofReference,
|
|
43
|
+
secret: Secret
|
|
44
|
+
});
|
|
45
|
+
const CompleteInput = Schema.Struct({
|
|
46
|
+
...base,
|
|
47
|
+
continuationId: ProofContinuationId,
|
|
48
|
+
credential: Secret
|
|
49
|
+
});
|
|
50
|
+
const ChangeRequest = Schema.Struct({
|
|
51
|
+
...RequestInput.fields,
|
|
52
|
+
sourceCredentialId: BoundedId
|
|
53
|
+
});
|
|
54
|
+
const ChangeResend = Schema.Struct({
|
|
55
|
+
...ResendInput.fields,
|
|
56
|
+
sourceCredentialId: BoundedId
|
|
57
|
+
});
|
|
58
|
+
const ChangeAttempt = Schema.Struct({
|
|
59
|
+
...AttemptInput.fields,
|
|
60
|
+
sourceCredentialId: BoundedId
|
|
61
|
+
});
|
|
62
|
+
const ChangeComplete = Schema.Struct({
|
|
63
|
+
...CompleteInput.fields,
|
|
64
|
+
sourceCredentialId: BoundedId
|
|
65
|
+
});
|
|
66
|
+
const Success = Schema.Struct({ invalidation: SessionInvalidationWindow });
|
|
67
|
+
const AttemptSuccess = Schema.Struct({ continuation: ProofContinuation });
|
|
68
|
+
const Failure = Schema.Union([
|
|
69
|
+
EmailRejected,
|
|
70
|
+
EmailUnavailable,
|
|
71
|
+
EmailActionRequired,
|
|
72
|
+
EmailMethodUnsupported,
|
|
73
|
+
HookDenied
|
|
74
|
+
]);
|
|
75
|
+
const tuple = Schema.fromJsonString(Schema.Array(Schema.String));
|
|
76
|
+
const noAmbient = Effect.fn("EmailAddresses.noAmbient")(function* () {
|
|
77
|
+
if (yield* hasCommitScope) return yield* EmailMethodUnsupported.make({});
|
|
78
|
+
});
|
|
79
|
+
const Configuration = Schema.Struct({
|
|
80
|
+
maximumEvidenceAgeMillis: Schema.Int.check(Schema.isBetween({
|
|
81
|
+
minimum: 1e3,
|
|
82
|
+
maximum: 3e5
|
|
83
|
+
})),
|
|
84
|
+
requireImmediateInvalidation: Schema.Boolean
|
|
85
|
+
});
|
|
86
|
+
const makeEmailAddresses = (moduleId, binding, verifyProof, changeProof, sessions, configuration) => {
|
|
87
|
+
const capturedPolicy = { ...configuration };
|
|
88
|
+
const Addresses = Context.Service(`effect-auth/email/${moduleId}/Addresses`);
|
|
89
|
+
const layer = Layer.effect(Addresses, Effect.gen(function* () {
|
|
90
|
+
const policy = yield* Schema.decodeEffect(Configuration)(capturedPolicy).pipe(Effect.mapError(() => EmailConfigurationError.make({})));
|
|
91
|
+
const binder = yield* binding.RequestBinding;
|
|
92
|
+
const persistence = yield* EmailAddressPersistence;
|
|
93
|
+
const actionAuthority = yield* EmailActionEvidence;
|
|
94
|
+
const verify = yield* verifyProof.Proofs;
|
|
95
|
+
const change = yield* changeProof.Proofs;
|
|
96
|
+
const strategy = yield* sessions.SessionStrategy;
|
|
97
|
+
const crypto = yield* Crypto.Crypto;
|
|
98
|
+
const hooks = yield* LifecycleHooks;
|
|
99
|
+
const digest = Effect.fn("EmailAddresses.digest")(function* (parts) {
|
|
100
|
+
const message = yield* Schema.encodeEffect(tuple)(parts);
|
|
101
|
+
return TokenDigest.make(Encoding.encodeBase64Url(yield* crypto.digest("SHA-256", new TextEncoder().encode(message))));
|
|
102
|
+
}, Effect.mapError(() => EmailUnavailable.make({})));
|
|
103
|
+
const bound = Effect.fn("EmailAddresses.binding")(function* (action, invocation, request) {
|
|
104
|
+
if (invocation._tag !== "Authenticated") return yield* EmailRejected.make({});
|
|
105
|
+
if (policy.requireImmediateInvalidation && strategy.capabilities.subjectInvalidation !== "immediate") return yield* EmailMethodUnsupported.make({});
|
|
106
|
+
if (action === "change-address" && request.sourceCredentialId === void 0) return yield* EmailRejected.make({});
|
|
107
|
+
const privateBinding = yield* binder.verify(request.flowId, request.requestBinding).pipe(Effect.mapError(() => EmailRejected.make({})));
|
|
108
|
+
const identifier = Object.freeze(LoginIdentifier.make({
|
|
109
|
+
namespace: "email",
|
|
110
|
+
value: request.email
|
|
111
|
+
}));
|
|
112
|
+
const current = yield* persistence.target({
|
|
113
|
+
moduleId,
|
|
114
|
+
subjectId: invocation.subjectId,
|
|
115
|
+
target: identifier,
|
|
116
|
+
sourceCredentialId: request.sourceCredentialId
|
|
117
|
+
});
|
|
118
|
+
const captured = Object.freeze({
|
|
119
|
+
revision: snapshotEmailRevision(current.revision),
|
|
120
|
+
eligible: current.eligible,
|
|
121
|
+
...current.source === void 0 ? {} : { source: yield* snapshotEmailCredential(current.source) }
|
|
122
|
+
});
|
|
123
|
+
if (captured.revision.subjectId !== invocation.subjectId || action === "change-address" && (captured.source === void 0 || captured.source.credentialId !== request.sourceCredentialId || captured.source.revision.subjectId !== invocation.subjectId || captured.source.revision.securityRevision !== captured.revision.securityRevision)) return yield* EmailRejected.make({});
|
|
124
|
+
const actionDigest = yield* digest([
|
|
125
|
+
"effect-auth/email-action/v1",
|
|
126
|
+
moduleId,
|
|
127
|
+
action,
|
|
128
|
+
request.commandId,
|
|
129
|
+
captured.revision.subjectId,
|
|
130
|
+
captured.revision.securityRevision,
|
|
131
|
+
captured.source?.credentialId ?? "",
|
|
132
|
+
captured.source?.identifier.value ?? "",
|
|
133
|
+
identifier.value,
|
|
134
|
+
...[...captured.revision.credentials].sort((a, b) => a.credentialId < b.credentialId ? -1 : a.credentialId > b.credentialId ? 1 : 0).flatMap((item) => [item.credentialId, item.revision])
|
|
135
|
+
]);
|
|
136
|
+
const decoded = EmailActionChallenge.make({
|
|
137
|
+
moduleId,
|
|
138
|
+
action,
|
|
139
|
+
commandId: request.commandId,
|
|
140
|
+
revision: captured.revision,
|
|
141
|
+
target: identifier,
|
|
142
|
+
...captured.source === void 0 ? {} : { sourceCredentialId: captured.source.credentialId },
|
|
143
|
+
bindingDigest: actionDigest
|
|
144
|
+
});
|
|
145
|
+
const challenge = Object.freeze({
|
|
146
|
+
...decoded,
|
|
147
|
+
revision: snapshotEmailRevision(decoded.revision),
|
|
148
|
+
target: Object.freeze(LoginIdentifier.make(decoded.target))
|
|
149
|
+
});
|
|
150
|
+
const contextDigest = yield* digest([
|
|
151
|
+
"effect-auth/email-address-proof/v1",
|
|
152
|
+
moduleId,
|
|
153
|
+
action,
|
|
154
|
+
request.flowId,
|
|
155
|
+
privateBinding.verifier,
|
|
156
|
+
actionDigest
|
|
157
|
+
]);
|
|
158
|
+
return {
|
|
159
|
+
captured,
|
|
160
|
+
identifier,
|
|
161
|
+
challenge,
|
|
162
|
+
binding: {
|
|
163
|
+
_tag: "IdentifierChange",
|
|
164
|
+
identifier,
|
|
165
|
+
revision: captured.revision,
|
|
166
|
+
flowId: request.flowId,
|
|
167
|
+
contextDigest
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
const authorize = Effect.fn("EmailAddresses.authorize")(function* (invocation, request, challenge) {
|
|
172
|
+
const grant = yield* actionAuthority.verify({
|
|
173
|
+
invocation,
|
|
174
|
+
challenge,
|
|
175
|
+
proof: request.actionProof
|
|
176
|
+
});
|
|
177
|
+
const raw = yield* snapshotAuthenticationEvidence(grant.evidence).pipe(Effect.mapError(() => EmailActionRequired.make({})));
|
|
178
|
+
const evidence = {
|
|
179
|
+
...raw,
|
|
180
|
+
revision: snapshotEmailRevision(raw.revision)
|
|
181
|
+
};
|
|
182
|
+
if (evidence.flowId !== AuthenticationFlowId.make(challenge.commandId) || evidence.bindingDigest !== challenge.bindingDigest || evidence.revision.subjectId !== challenge.revision.subjectId || evidence.revision.securityRevision !== challenge.revision.securityRevision || challenge.revision.credentials.some((expected) => !evidence.revision.credentials.some((actual) => expected.credentialId === actual.credentialId && expected.revision === actual.revision))) return yield* EmailActionRequired.make({});
|
|
183
|
+
const requirement = yield* snapshotEmailRequirement({
|
|
184
|
+
...grant.requirement,
|
|
185
|
+
maximumAgeMillis: Math.min(policy.maximumEvidenceAgeMillis, grant.requirement.maximumAgeMillis)
|
|
186
|
+
});
|
|
187
|
+
if (!(yield* assessAuthentication(evidence, requirement).pipe(Effect.mapError(() => EmailActionRequired.make({})))).satisfied) return yield* EmailActionRequired.make({});
|
|
188
|
+
return Object.freeze({
|
|
189
|
+
challenge,
|
|
190
|
+
evidence,
|
|
191
|
+
requirement
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
return Addresses.of({
|
|
195
|
+
request: Effect.fn("EmailAddresses.request")(function* (action, invocation, input, supersedes) {
|
|
196
|
+
yield* noAmbient();
|
|
197
|
+
const current = yield* bound(action, invocation, input);
|
|
198
|
+
yield* authorize(invocation, input, current.challenge);
|
|
199
|
+
const dispatch = yield* (action === "verify-address" ? verify : change).prepareIssue({
|
|
200
|
+
requestId: input.requestId,
|
|
201
|
+
binding: current.binding,
|
|
202
|
+
locale: input.locale,
|
|
203
|
+
eligible: current.captured.eligible,
|
|
204
|
+
...supersedes === void 0 ? {} : { supersedes }
|
|
205
|
+
}).pipe(Effect.flatMap(readProofCommit), Effect.mapError(() => EmailUnavailable.make({})));
|
|
206
|
+
yield* dispatch.dispatch.pipe(Effect.mapError(() => EmailUnavailable.make({})));
|
|
207
|
+
return dispatch.receipt;
|
|
208
|
+
}),
|
|
209
|
+
attempt: Effect.fn("EmailAddresses.attempt")(function* (action, invocation, input) {
|
|
210
|
+
yield* noAmbient();
|
|
211
|
+
const current = yield* bound(action, invocation, input);
|
|
212
|
+
const result = yield* (action === "verify-address" ? verify : change).prepareAttempt({
|
|
213
|
+
reference: input.reference,
|
|
214
|
+
credential: input.secret,
|
|
215
|
+
binding: current.binding
|
|
216
|
+
}).pipe(Effect.flatMap(readProofCommit), Effect.mapError(() => EmailRejected.make({})));
|
|
217
|
+
if (result.value._tag === "Rejected") return yield* EmailRejected.make({});
|
|
218
|
+
return {
|
|
219
|
+
value: { continuation: result.value.continuation },
|
|
220
|
+
credentialCommands: result.credentialCommands
|
|
221
|
+
};
|
|
222
|
+
}),
|
|
223
|
+
planComplete: Effect.fn("EmailAddresses.planComplete")(function* (action, invocation, input) {
|
|
224
|
+
yield* noAmbient();
|
|
225
|
+
const current = yield* bound(action, invocation, input);
|
|
226
|
+
const completion = yield* (action === "verify-address" ? verify : change).planComplete({
|
|
227
|
+
continuationId: input.continuationId,
|
|
228
|
+
credential: input.credential,
|
|
229
|
+
binding: current.binding
|
|
230
|
+
}).pipe(Effect.mapError(() => EmailRejected.make({})));
|
|
231
|
+
if (!(yield* persistence.checkCompletion(completion.input))) return yield* EmailRejected.make({});
|
|
232
|
+
const authorization = yield* authorize(invocation, input, current.challenge);
|
|
233
|
+
const invalidation = sessionInvalidationWindow("identifier-change", strategy.capabilities, strategy.policy);
|
|
234
|
+
const snapshot = lifecycleSnapshot({
|
|
235
|
+
action: "identifier-change",
|
|
236
|
+
operation: `${moduleId}/${action}`,
|
|
237
|
+
method: "email-code",
|
|
238
|
+
subjectId: current.captured.revision.subjectId,
|
|
239
|
+
identifiers: [...action === "change-address" && current.captured.source ? [current.captured.source.identifier] : [], current.identifier]
|
|
240
|
+
});
|
|
241
|
+
yield* hooks.before(snapshot);
|
|
242
|
+
const bytes = yield* crypto.randomBytes(32).pipe(Effect.mapError(() => EmailUnavailable.make({})));
|
|
243
|
+
const event = lifecycleEvent({
|
|
244
|
+
id: LifecycleEventId.make(Encoding.encodeBase64Url(bytes)),
|
|
245
|
+
occurredAtMillis: DateTime.toEpochMillis(yield* DateTime.now),
|
|
246
|
+
snapshot
|
|
247
|
+
});
|
|
248
|
+
const mutation = Object.freeze({
|
|
249
|
+
moduleId,
|
|
250
|
+
commandId: input.commandId,
|
|
251
|
+
target: current.identifier,
|
|
252
|
+
captured: current.captured,
|
|
253
|
+
authorization,
|
|
254
|
+
completion,
|
|
255
|
+
invalidation
|
|
256
|
+
});
|
|
257
|
+
const prepare = (decision, journal) => {
|
|
258
|
+
if (decision === "changed") journal.stage(event);
|
|
259
|
+
return journal.prepare({
|
|
260
|
+
value: decision === "changed" ? { invalidation } : { _tag: "Rejected" },
|
|
261
|
+
credentialCommands: decision === "changed" ? [
|
|
262
|
+
{
|
|
263
|
+
_tag: "Clear",
|
|
264
|
+
slot: "session"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
_tag: "Clear",
|
|
268
|
+
slot: "pending-proof"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
_tag: "Clear",
|
|
272
|
+
slot: "proof-continuation"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
_tag: "Clear",
|
|
276
|
+
slot: "request-binding"
|
|
277
|
+
}
|
|
278
|
+
] : []
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
const commit = Effect.gen(function* () {
|
|
282
|
+
const owner = yield* EmailAddressPersistence;
|
|
283
|
+
return yield* action === "verify-address" ? owner.verifyWithProof(mutation, prepare) : owner.changeWithProof(mutation, prepare);
|
|
284
|
+
});
|
|
285
|
+
return Object.freeze({ commit });
|
|
286
|
+
}),
|
|
287
|
+
cleanup: Effect.fn("EmailAddresses.cleanup")(function* (limit) {
|
|
288
|
+
yield* noAmbient();
|
|
289
|
+
yield* Schema.decodeEffect(Schema.Int.check(Schema.isBetween({
|
|
290
|
+
minimum: 1,
|
|
291
|
+
maximum: 1e3
|
|
292
|
+
})))(limit).pipe(Effect.mapError(() => EmailRejected.make({})));
|
|
293
|
+
return yield* (yield* persistence.cleanup({
|
|
294
|
+
moduleId,
|
|
295
|
+
limit
|
|
296
|
+
}, (value, journal) => journal.prepare(value))).read.pipe(Effect.mapError(() => EmailUnavailable.make({})));
|
|
297
|
+
})
|
|
298
|
+
});
|
|
299
|
+
}));
|
|
300
|
+
const makeOperations = (mode, schemas) => {
|
|
301
|
+
const action = mode === "verify" ? "verify-address" : "change-address";
|
|
302
|
+
const Request = makeOperation(`${moduleId}/address/${mode}/request`, {
|
|
303
|
+
payload: schemas.request,
|
|
304
|
+
success: ProofRequestReceipt,
|
|
305
|
+
error: Failure,
|
|
306
|
+
access: "authenticated",
|
|
307
|
+
exposure: "public",
|
|
308
|
+
replay: "idempotent"
|
|
309
|
+
});
|
|
310
|
+
const Resend = makeOperation(`${moduleId}/address/${mode}/resend`, {
|
|
311
|
+
payload: schemas.resend,
|
|
312
|
+
success: ProofRequestReceipt,
|
|
313
|
+
error: Failure,
|
|
314
|
+
access: "authenticated",
|
|
315
|
+
exposure: "public",
|
|
316
|
+
replay: "idempotent"
|
|
317
|
+
});
|
|
318
|
+
const Attempt = makeOperation(`${moduleId}/address/${mode}/attempt`, {
|
|
319
|
+
payload: schemas.attempt,
|
|
320
|
+
success: AttemptSuccess,
|
|
321
|
+
error: Failure,
|
|
322
|
+
access: "authenticated",
|
|
323
|
+
exposure: "public",
|
|
324
|
+
replay: "single-use",
|
|
325
|
+
credentials: true
|
|
326
|
+
});
|
|
327
|
+
const Complete = makeOperation(`${moduleId}/address/${mode}/complete`, {
|
|
328
|
+
payload: schemas.complete,
|
|
329
|
+
success: Success,
|
|
330
|
+
error: Failure,
|
|
331
|
+
access: "authenticated",
|
|
332
|
+
exposure: "public",
|
|
333
|
+
replay: "single-use",
|
|
334
|
+
credentials: true
|
|
335
|
+
});
|
|
336
|
+
const handlersLayer = Layer.mergeAll(Request.handlerLayer(Effect.fn("EmailAddresses.Request")(function* (input, invocation) {
|
|
337
|
+
return yield* (yield* Addresses).request(action, invocation, input);
|
|
338
|
+
})), Resend.handlerLayer(Effect.fn("EmailAddresses.Resend")(function* (input, invocation) {
|
|
339
|
+
return yield* (yield* Addresses).request(action, invocation, input, input.supersedes);
|
|
340
|
+
})), Attempt.credentialHandlerLayer(Effect.fn("EmailAddresses.Attempt")(function* (input, invocation) {
|
|
341
|
+
return yield* (yield* Addresses).attempt(action, invocation, input);
|
|
342
|
+
})), Complete.credentialHandlerLayer(Effect.fn("EmailAddresses.Complete")(function* (input, invocation) {
|
|
343
|
+
const result = yield* (yield* (yield* (yield* Addresses).planComplete(action, invocation, input)).commit).read.pipe(Effect.mapError(() => EmailUnavailable.make({})));
|
|
344
|
+
if (!("invalidation" in result.value)) return yield* EmailRejected.make({});
|
|
345
|
+
return {
|
|
346
|
+
value: result.value,
|
|
347
|
+
credentialCommands: result.credentialCommands
|
|
348
|
+
};
|
|
349
|
+
})));
|
|
350
|
+
return Object.freeze({
|
|
351
|
+
operations: {
|
|
352
|
+
Request,
|
|
353
|
+
Resend,
|
|
354
|
+
Attempt,
|
|
355
|
+
Complete
|
|
356
|
+
},
|
|
357
|
+
handlersLayer,
|
|
358
|
+
group: operationGroup(Request, Resend, Attempt, Complete)
|
|
359
|
+
});
|
|
360
|
+
};
|
|
361
|
+
const verify = makeOperations("verify", {
|
|
362
|
+
request: RequestInput,
|
|
363
|
+
resend: ResendInput,
|
|
364
|
+
attempt: AttemptInput,
|
|
365
|
+
complete: CompleteInput
|
|
366
|
+
});
|
|
367
|
+
const change = makeOperations("change", {
|
|
368
|
+
request: ChangeRequest,
|
|
369
|
+
resend: ChangeResend,
|
|
370
|
+
attempt: ChangeAttempt,
|
|
371
|
+
complete: ChangeComplete
|
|
372
|
+
});
|
|
373
|
+
const Cleanup = makeOperation(`${moduleId}/address/cleanup`, {
|
|
374
|
+
payload: Schema.Struct({ limit: Schema.Int.check(Schema.isBetween({
|
|
375
|
+
minimum: 1,
|
|
376
|
+
maximum: 1e3
|
|
377
|
+
})) }),
|
|
378
|
+
success: Schema.Struct({
|
|
379
|
+
removed: Schema.Natural,
|
|
380
|
+
hasMore: Schema.Boolean
|
|
381
|
+
}),
|
|
382
|
+
error: Failure,
|
|
383
|
+
access: "system",
|
|
384
|
+
exposure: "internal",
|
|
385
|
+
replay: "idempotent"
|
|
386
|
+
});
|
|
387
|
+
const cleanupLayer = Cleanup.handlerLayer(Effect.fn("EmailAddresses.Cleanup")(function* (input) {
|
|
388
|
+
return yield* (yield* Addresses).cleanup(input.limit);
|
|
389
|
+
}));
|
|
390
|
+
return Object.freeze({
|
|
391
|
+
Addresses,
|
|
392
|
+
layer,
|
|
393
|
+
verify,
|
|
394
|
+
change,
|
|
395
|
+
Cleanup,
|
|
396
|
+
cleanupLayer,
|
|
397
|
+
verifyProof,
|
|
398
|
+
changeProof
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
//#endregion
|
|
402
|
+
export { makeEmailAddresses };
|
|
403
|
+
|
|
404
|
+
//# sourceMappingURL=addresses.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addresses.mjs","names":[],"sources":["../../src/email/addresses.ts"],"sourcesContent":["import { Context, Crypto, DateTime, Effect, Encoding, Layer, Schema } from \"effect\";\n\nimport { hasCommitScope, type PreparedCommit } from \"../hooks/commit\";\nimport { LifecycleHooks } from \"../hooks/LifecycleHooks\";\nimport { HookDenied, LifecycleEventId, lifecycleEvent, lifecycleSnapshot } from \"../hooks/models\";\nimport { LoginIdentifier } from \"../identity/models\";\nimport type { AuthInvocation } from \"../operations/context\";\nimport type { AuthOperationResult } from \"../operations/credentials\";\nimport { makeOperation, operationGroup } from \"../operations/operation\";\nimport type { makeRequestBinding } from \"../operations/requestBinding\";\nimport { RequestBindingCredential, RequestBindingFlowId } from \"../operations/requestBinding\";\nimport { readProofCommit } from \"../proofs/dispatch\";\nimport type { ProofBinding } from \"../proofs/models\";\nimport {\n ProofContinuation,\n ProofContinuationId,\n ProofId,\n ProofReference,\n ProofRequestId,\n ProofRequestReceipt,\n} from \"../proofs/models\";\nimport type { makeProofModule } from \"../proofs/module\";\nimport { Email, TokenDigest } from \"../Schema\";\nimport { assessAuthentication, snapshotAuthenticationEvidence } from \"../sessions/assurance\";\nimport { SessionInvalidationWindow, sessionInvalidationWindow } from \"../sessions/invalidation\";\nimport { AuthenticationFlowId } from \"../sessions/models\";\nimport type { makeSessionModule } from \"../sessions/module\";\nimport { EmailActionEvidence, type EmailActionAuthorization } from \"./EmailActionEvidence\";\nimport { EmailAddressPersistence, type EmailAddressTarget } from \"./EmailAddressPersistence\";\nimport {\n EmailActionRequired,\n EmailConfigurationError,\n EmailMethodUnsupported,\n EmailRejected,\n EmailUnavailable,\n} from \"./errors\";\nimport { EmailActionChallenge, EmailCommandId, type EmailAction } from \"./models\";\nimport {\n snapshotEmailCredential,\n snapshotEmailRequirement,\n snapshotEmailRevision,\n} from \"./snapshot\";\n\nconst BoundedId = Schema.NonEmptyString.check(Schema.isMaxLength(256));\nconst Secret = Schema.RedactedFromValue(Schema.String.check(Schema.isMaxLength(4096)));\n\nconst base = {\n flowId: RequestBindingFlowId,\n requestBinding: RequestBindingCredential,\n commandId: EmailCommandId,\n email: Schema.String.check(Schema.isMaxLength(320)).pipe(Schema.decodeTo(Email)),\n sourceCredentialId: Schema.optionalKey(BoundedId),\n actionProof: Schema.optionalKey(Secret),\n};\n\nconst BindingInput = Schema.Struct(base);\n\nconst RequestInput = Schema.Struct({\n ...base,\n requestId: ProofRequestId,\n locale: Schema.NonEmptyString.check(Schema.isMaxLength(64)),\n});\n\nconst ResendInput = Schema.Struct({ ...RequestInput.fields, supersedes: ProofId });\nconst AttemptInput = Schema.Struct({ ...base, reference: ProofReference, secret: Secret });\n\nconst CompleteInput = Schema.Struct({\n ...base,\n continuationId: ProofContinuationId,\n credential: Secret,\n});\n\nconst ChangeRequest = Schema.Struct({ ...RequestInput.fields, sourceCredentialId: BoundedId });\nconst ChangeResend = Schema.Struct({ ...ResendInput.fields, sourceCredentialId: BoundedId });\nconst ChangeAttempt = Schema.Struct({ ...AttemptInput.fields, sourceCredentialId: BoundedId });\nconst ChangeComplete = Schema.Struct({ ...CompleteInput.fields, sourceCredentialId: BoundedId });\nconst Success = Schema.Struct({ invalidation: SessionInvalidationWindow });\nconst AttemptSuccess = Schema.Struct({ continuation: ProofContinuation });\n\nconst Failure = Schema.Union([\n EmailRejected,\n EmailUnavailable,\n EmailActionRequired,\n EmailMethodUnsupported,\n HookDenied,\n]);\n\ntype Failure = typeof Failure.Type;\nconst tuple = Schema.fromJsonString(Schema.Array(Schema.String));\n\nconst noAmbient = Effect.fn(\"EmailAddresses.noAmbient\")(function* () {\n if (yield* hasCommitScope) return yield* EmailMethodUnsupported.make({});\n});\n\nconst Configuration = Schema.Struct({\n maximumEvidenceAgeMillis: Schema.Int.check(Schema.isBetween({ minimum: 1000, maximum: 300_000 })),\n requireImmediateInvalidation: Schema.Boolean,\n});\n\nexport type EmailAddressPolicy = typeof Configuration.Type;\n\nexport interface AddressModule<Id extends string> {\n readonly moduleId: Id;\n readonly kind: \"addresses\";\n}\n\nexport const makeEmailAddresses = <\n const Id extends string,\n const VerifyId extends string,\n const ChangeId extends string,\n const SessionId extends string,\n Claims extends Schema.Codec<unknown, unknown, unknown, unknown>,\n>(\n moduleId: Id,\n binding: ReturnType<typeof makeRequestBinding<Id, \"email-entry\">>,\n verifyProof: ReturnType<typeof makeProofModule<VerifyId, typeof ProofBinding>>,\n changeProof: ReturnType<typeof makeProofModule<ChangeId, typeof ProofBinding>>,\n sessions: ReturnType<typeof makeSessionModule<SessionId, Claims>>,\n configuration: EmailAddressPolicy,\n) => {\n const capturedPolicy = { ...configuration };\n\n type Result = AuthOperationResult<typeof Success.Type | { readonly _tag: \"Rejected\" }>;\n type Plan = {\n readonly commit: Effect.Effect<\n PreparedCommit<Result>,\n EmailUnavailable,\n EmailAddressPersistence\n >;\n };\n\n const Addresses = Context.Service<\n AddressModule<Id>,\n {\n readonly request: (\n action: EmailAction,\n invocation: AuthInvocation,\n input: typeof RequestInput.Type,\n supersedes?: ProofId,\n ) => Effect.Effect<ProofRequestReceipt, Failure>;\n readonly attempt: (\n action: EmailAction,\n invocation: AuthInvocation,\n input: typeof AttemptInput.Type,\n ) => Effect.Effect<AuthOperationResult<typeof AttemptSuccess.Type>, Failure>;\n readonly planComplete: (\n action: EmailAction,\n invocation: AuthInvocation,\n input: typeof CompleteInput.Type,\n ) => Effect.Effect<Plan, Failure>;\n readonly cleanup: (\n limit: number,\n ) => Effect.Effect<{ readonly removed: number; readonly hasMore: boolean }, Failure>;\n }\n >(`effect-auth/email/${moduleId}/Addresses`);\n\n const layer = Layer.effect(\n Addresses,\n Effect.gen(function* () {\n const policy = yield* Schema.decodeEffect(Configuration)(capturedPolicy).pipe(\n Effect.mapError(() => EmailConfigurationError.make({})),\n );\n\n const binder = yield* binding.RequestBinding;\n const persistence = yield* EmailAddressPersistence;\n const actionAuthority = yield* EmailActionEvidence;\n const verify = yield* verifyProof.Proofs;\n const change = yield* changeProof.Proofs;\n const strategy = yield* sessions.SessionStrategy;\n const crypto = yield* Crypto.Crypto;\n const hooks = yield* LifecycleHooks;\n\n const digest = Effect.fn(\"EmailAddresses.digest\")(\n function* (parts: ReadonlyArray<string>) {\n const message = yield* Schema.encodeEffect(tuple)(parts);\n\n return TokenDigest.make(\n Encoding.encodeBase64Url(\n yield* crypto.digest(\"SHA-256\", new TextEncoder().encode(message)),\n ),\n );\n },\n Effect.mapError(() => EmailUnavailable.make({})),\n );\n\n const bound = Effect.fn(\"EmailAddresses.binding\")(function* (\n action: EmailAction,\n invocation: AuthInvocation,\n request: typeof BindingInput.Type,\n ) {\n if (invocation._tag !== \"Authenticated\") return yield* EmailRejected.make({});\n if (\n policy.requireImmediateInvalidation &&\n strategy.capabilities.subjectInvalidation !== \"immediate\"\n )\n return yield* EmailMethodUnsupported.make({});\n if (action === \"change-address\" && request.sourceCredentialId === undefined)\n return yield* EmailRejected.make({});\n\n const privateBinding = yield* binder\n .verify(request.flowId, request.requestBinding)\n .pipe(Effect.mapError(() => EmailRejected.make({})));\n\n const identifier = Object.freeze(\n LoginIdentifier.make({ namespace: \"email\", value: request.email }),\n );\n\n const current = yield* persistence.target({\n moduleId,\n subjectId: invocation.subjectId,\n target: identifier,\n sourceCredentialId: request.sourceCredentialId,\n });\n\n const captured: EmailAddressTarget = Object.freeze({\n revision: snapshotEmailRevision(current.revision),\n eligible: current.eligible,\n ...(current.source === undefined\n ? {}\n : { source: yield* snapshotEmailCredential(current.source) }),\n });\n\n if (\n captured.revision.subjectId !== invocation.subjectId ||\n (action === \"change-address\" &&\n (captured.source === undefined ||\n captured.source.credentialId !== request.sourceCredentialId ||\n captured.source.revision.subjectId !== invocation.subjectId ||\n captured.source.revision.securityRevision !== captured.revision.securityRevision))\n )\n return yield* EmailRejected.make({});\n\n const actionDigest = yield* digest([\n \"effect-auth/email-action/v1\",\n moduleId,\n action,\n request.commandId,\n captured.revision.subjectId,\n captured.revision.securityRevision,\n captured.source?.credentialId ?? \"\",\n captured.source?.identifier.value ?? \"\",\n identifier.value,\n ...[...captured.revision.credentials]\n .sort((a, b) =>\n a.credentialId < b.credentialId ? -1 : a.credentialId > b.credentialId ? 1 : 0,\n )\n .flatMap((item) => [item.credentialId, item.revision]),\n ]);\n\n const decoded = EmailActionChallenge.make({\n moduleId,\n action,\n commandId: request.commandId,\n revision: captured.revision,\n target: identifier,\n ...(captured.source === undefined\n ? {}\n : { sourceCredentialId: captured.source.credentialId }),\n bindingDigest: actionDigest,\n });\n\n const challenge = Object.freeze({\n ...decoded,\n revision: snapshotEmailRevision(decoded.revision),\n target: Object.freeze(LoginIdentifier.make(decoded.target)),\n });\n\n const contextDigest = yield* digest([\n \"effect-auth/email-address-proof/v1\",\n moduleId,\n action,\n request.flowId,\n privateBinding.verifier,\n actionDigest,\n ]);\n\n const proofBinding: ProofBinding = {\n _tag: \"IdentifierChange\",\n identifier,\n revision: captured.revision,\n flowId: request.flowId,\n contextDigest,\n };\n\n return { captured, identifier, challenge, binding: proofBinding };\n });\n\n const authorize = Effect.fn(\"EmailAddresses.authorize\")(function* (\n invocation: AuthInvocation,\n request: typeof BindingInput.Type,\n challenge: EmailActionChallenge,\n ) {\n const grant = yield* actionAuthority.verify({\n invocation,\n challenge,\n proof: request.actionProof,\n });\n\n const raw = yield* snapshotAuthenticationEvidence(grant.evidence).pipe(\n Effect.mapError(() => EmailActionRequired.make({})),\n );\n\n const evidence = { ...raw, revision: snapshotEmailRevision(raw.revision) };\n\n if (\n evidence.flowId !== AuthenticationFlowId.make(challenge.commandId) ||\n evidence.bindingDigest !== challenge.bindingDigest ||\n evidence.revision.subjectId !== challenge.revision.subjectId ||\n evidence.revision.securityRevision !== challenge.revision.securityRevision ||\n challenge.revision.credentials.some(\n (expected) =>\n !evidence.revision.credentials.some(\n (actual) =>\n expected.credentialId === actual.credentialId &&\n expected.revision === actual.revision,\n ),\n )\n )\n return yield* EmailActionRequired.make({});\n\n const requirement = yield* snapshotEmailRequirement({\n ...grant.requirement,\n maximumAgeMillis: Math.min(\n policy.maximumEvidenceAgeMillis,\n grant.requirement.maximumAgeMillis,\n ),\n });\n\n if (\n !(yield* assessAuthentication(evidence, requirement).pipe(\n Effect.mapError(() => EmailActionRequired.make({})),\n )).satisfied\n )\n return yield* EmailActionRequired.make({});\n\n return Object.freeze({\n challenge,\n evidence,\n requirement,\n }) satisfies EmailActionAuthorization;\n });\n\n return Addresses.of({\n request: Effect.fn(\"EmailAddresses.request\")(\n function* (action, invocation, input, supersedes) {\n yield* noAmbient();\n const current = yield* bound(action, invocation, input);\n\n yield* authorize(invocation, input, current.challenge);\n const proofs = action === \"verify-address\" ? verify : change;\n\n const dispatch = yield* proofs\n .prepareIssue({\n requestId: input.requestId,\n binding: current.binding,\n locale: input.locale,\n eligible: current.captured.eligible,\n ...(supersedes === undefined ? {} : { supersedes }),\n })\n .pipe(\n Effect.flatMap(readProofCommit),\n Effect.mapError(() => EmailUnavailable.make({})),\n );\n\n yield* dispatch.dispatch.pipe(Effect.mapError(() => EmailUnavailable.make({})));\n\n return dispatch.receipt;\n },\n ),\n attempt: Effect.fn(\"EmailAddresses.attempt\")(function* (action, invocation, input) {\n yield* noAmbient();\n const current = yield* bound(action, invocation, input);\n const proofs = action === \"verify-address\" ? verify : change;\n\n const result = yield* proofs\n .prepareAttempt({\n reference: input.reference,\n credential: input.secret,\n binding: current.binding,\n })\n .pipe(\n Effect.flatMap(readProofCommit),\n Effect.mapError(() => EmailRejected.make({})),\n );\n\n if (result.value._tag === \"Rejected\") return yield* EmailRejected.make({});\n\n return {\n value: { continuation: result.value.continuation },\n credentialCommands: result.credentialCommands,\n };\n }),\n planComplete: Effect.fn(\"EmailAddresses.planComplete\")(\n function* (action, invocation, input) {\n yield* noAmbient();\n const current = yield* bound(action, invocation, input);\n const proofs = action === \"verify-address\" ? verify : change;\n\n const completion = yield* proofs\n .planComplete({\n continuationId: input.continuationId,\n credential: input.credential,\n binding: current.binding,\n })\n .pipe(Effect.mapError(() => EmailRejected.make({})));\n\n if (!(yield* persistence.checkCompletion(completion.input)))\n return yield* EmailRejected.make({});\n const authorization = yield* authorize(invocation, input, current.challenge);\n\n const invalidation = sessionInvalidationWindow(\n \"identifier-change\",\n strategy.capabilities,\n strategy.policy,\n );\n\n const snapshot = lifecycleSnapshot({\n action: \"identifier-change\",\n operation: `${moduleId}/${action}`,\n method: \"email-code\",\n subjectId: current.captured.revision.subjectId,\n identifiers: [\n ...(action === \"change-address\" && current.captured.source\n ? [current.captured.source.identifier]\n : []),\n current.identifier,\n ],\n });\n\n yield* hooks.before(snapshot);\n\n const bytes = yield* crypto\n .randomBytes(32)\n .pipe(Effect.mapError(() => EmailUnavailable.make({})));\n\n const event = lifecycleEvent({\n id: LifecycleEventId.make(Encoding.encodeBase64Url(bytes)),\n occurredAtMillis: DateTime.toEpochMillis(yield* DateTime.now),\n snapshot,\n });\n\n const mutation = Object.freeze({\n moduleId,\n commandId: input.commandId,\n target: current.identifier,\n captured: current.captured,\n authorization,\n completion,\n invalidation,\n });\n\n const prepare = (\n decision: \"changed\" | \"rejected\",\n journal: Parameters<\n Parameters<EmailAddressPersistence[\"Service\"][\"changeWithProof\"]>[1]\n >[1],\n ) => {\n if (decision === \"changed\") journal.stage(event);\n\n return journal.prepare<Result>({\n value: decision === \"changed\" ? { invalidation } : { _tag: \"Rejected\" },\n credentialCommands:\n decision === \"changed\"\n ? [\n { _tag: \"Clear\", slot: \"session\" },\n { _tag: \"Clear\", slot: \"pending-proof\" },\n { _tag: \"Clear\", slot: \"proof-continuation\" },\n { _tag: \"Clear\", slot: \"request-binding\" },\n ]\n : [],\n });\n };\n\n const commit = Effect.gen(function* () {\n const owner = yield* EmailAddressPersistence;\n\n return yield* action === \"verify-address\"\n ? owner.verifyWithProof(mutation, prepare)\n : owner.changeWithProof(mutation, prepare);\n });\n\n return Object.freeze({ commit });\n },\n ),\n cleanup: Effect.fn(\"EmailAddresses.cleanup\")(function* (limit) {\n yield* noAmbient();\n yield* Schema.decodeEffect(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 1000 })),\n )(limit).pipe(Effect.mapError(() => EmailRejected.make({})));\n\n const receipt = yield* persistence.cleanup({ moduleId, limit }, (value, journal) =>\n journal.prepare(value),\n );\n\n return yield* receipt.read.pipe(Effect.mapError(() => EmailUnavailable.make({})));\n }),\n });\n }),\n );\n\n const makeOperations = <\n const Mode extends \"verify\" | \"change\",\n const Schemas extends {\n readonly request: typeof RequestInput | typeof ChangeRequest;\n readonly resend: typeof ResendInput | typeof ChangeResend;\n readonly attempt: typeof AttemptInput | typeof ChangeAttempt;\n readonly complete: typeof CompleteInput | typeof ChangeComplete;\n },\n >(\n mode: Mode,\n schemas: Schemas,\n ) => {\n const action = mode === \"verify\" ? \"verify-address\" : \"change-address\";\n\n const Request = makeOperation(`${moduleId}/address/${mode}/request`, {\n payload: schemas.request,\n success: ProofRequestReceipt,\n error: Failure,\n access: \"authenticated\",\n exposure: \"public\",\n replay: \"idempotent\",\n });\n\n const Resend = makeOperation(`${moduleId}/address/${mode}/resend`, {\n payload: schemas.resend,\n success: ProofRequestReceipt,\n error: Failure,\n access: \"authenticated\",\n exposure: \"public\",\n replay: \"idempotent\",\n });\n\n const Attempt = makeOperation(`${moduleId}/address/${mode}/attempt`, {\n payload: schemas.attempt,\n success: AttemptSuccess,\n error: Failure,\n access: \"authenticated\",\n exposure: \"public\",\n replay: \"single-use\",\n credentials: true,\n });\n\n const Complete = makeOperation(`${moduleId}/address/${mode}/complete`, {\n payload: schemas.complete,\n success: Success,\n error: Failure,\n access: \"authenticated\",\n exposure: \"public\",\n replay: \"single-use\",\n credentials: true,\n });\n\n const handlersLayer = Layer.mergeAll(\n Request.handlerLayer(\n Effect.fn(\"EmailAddresses.Request\")(function* (input, invocation) {\n return yield* (yield* Addresses).request(action, invocation, input);\n }),\n ),\n Resend.handlerLayer(\n Effect.fn(\"EmailAddresses.Resend\")(function* (input, invocation) {\n return yield* (yield* Addresses).request(action, invocation, input, input.supersedes);\n }),\n ),\n Attempt.credentialHandlerLayer(\n Effect.fn(\"EmailAddresses.Attempt\")(function* (input, invocation) {\n return yield* (yield* Addresses).attempt(action, invocation, input);\n }),\n ),\n Complete.credentialHandlerLayer(\n Effect.fn(\"EmailAddresses.Complete\")(function* (input, invocation) {\n const plan = yield* (yield* Addresses).planComplete(action, invocation, input);\n const receipt = yield* plan.commit;\n const result = yield* receipt.read.pipe(Effect.mapError(() => EmailUnavailable.make({})));\n\n if (!(\"invalidation\" in result.value)) return yield* EmailRejected.make({});\n\n return { value: result.value, credentialCommands: result.credentialCommands };\n }),\n ),\n );\n\n return Object.freeze({\n operations: { Request, Resend, Attempt, Complete },\n handlersLayer,\n group: operationGroup(Request, Resend, Attempt, Complete),\n });\n };\n\n const verify = makeOperations(\"verify\", {\n request: RequestInput,\n resend: ResendInput,\n attempt: AttemptInput,\n complete: CompleteInput,\n });\n\n const change = makeOperations(\"change\", {\n request: ChangeRequest,\n resend: ChangeResend,\n attempt: ChangeAttempt,\n complete: ChangeComplete,\n });\n\n const Cleanup = makeOperation(`${moduleId}/address/cleanup`, {\n payload: Schema.Struct({\n limit: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 1000 })),\n }),\n success: Schema.Struct({ removed: Schema.Natural, hasMore: Schema.Boolean }),\n error: Failure,\n access: \"system\",\n exposure: \"internal\",\n replay: \"idempotent\",\n });\n\n const cleanupLayer = Cleanup.handlerLayer(\n Effect.fn(\"EmailAddresses.Cleanup\")(function* (input) {\n return yield* (yield* Addresses).cleanup(input.limit);\n }),\n );\n\n return Object.freeze({\n Addresses,\n layer,\n verify,\n change,\n Cleanup,\n cleanupLayer,\n verifyProof,\n changeProof,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2CA,MAAM,YAAY,OAAO,eAAe,MAAM,OAAO,YAAY,GAAG,CAAC;AACrE,MAAM,SAAS,OAAO,kBAAkB,OAAO,OAAO,MAAM,OAAO,YAAY,IAAI,CAAC,CAAC;AAErF,MAAM,OAAO;CACX,QAAQ;CACR,gBAAgB;CAChB,WAAW;CACX,OAAO,OAAO,OAAO,MAAM,OAAO,YAAY,GAAG,CAAC,CAAC,CAAC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