@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,350 @@
|
|
|
1
|
+
import { HookDenied, LifecycleEventId, lifecycleEvent, lifecycleSnapshot } from "../hooks/models.mjs";
|
|
2
|
+
import { makeOperation, operationGroup } from "../operations/operation.mjs";
|
|
3
|
+
import { LifecycleHooks } from "../hooks/LifecycleHooks.mjs";
|
|
4
|
+
import { hasCommitScope } from "../hooks/commit.mjs";
|
|
5
|
+
import { ProofCapabilityUnsupported, ProofConfigurationError, ProofError, ProofInvalid, ProofUnavailable } from "./errors.mjs";
|
|
6
|
+
import { ProofCleanupResult, ProofContinuation, ProofContinuationId, ProofDeliveryId, ProofId, ProofPurpose, ProofReference, ProofRequestId, ProofRequestReceipt, ProofVersion } from "./models.mjs";
|
|
7
|
+
import { ProofPersistence } from "./ProofPersistence.mjs";
|
|
8
|
+
import { EmailProofDelivery } from "./EmailProofDelivery.mjs";
|
|
9
|
+
import { makeProofDispatch, readProofCommit } from "./dispatch.mjs";
|
|
10
|
+
import { validateProofPolicy } from "./policy.mjs";
|
|
11
|
+
import { makeProofCrypto, validateProofBinding } from "./crypto.mjs";
|
|
12
|
+
import { SmsProofDelivery } from "./SmsProofDelivery.mjs";
|
|
13
|
+
import { Context, DateTime, Effect, Layer, Redacted, Schema } from "effect";
|
|
14
|
+
//#region src/proofs/module.ts
|
|
15
|
+
const Locale = Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(64));
|
|
16
|
+
const Credential = Schema.RedactedFromValue(Schema.String.check(Schema.isMaxLength(4096)));
|
|
17
|
+
const noAmbient = Effect.fn("Proofs.noAmbient")(function* () {
|
|
18
|
+
if (yield* hasCommitScope) return yield* ProofCapabilityUnsupported.make({});
|
|
19
|
+
});
|
|
20
|
+
/** Snapshot owned configuration data without evaluating application codecs or validating it. */
|
|
21
|
+
const snapshotProofConfiguration = (input) => Object.freeze({
|
|
22
|
+
...input,
|
|
23
|
+
secret: Object.freeze({ ...input.secret }),
|
|
24
|
+
policy: Object.freeze({
|
|
25
|
+
...input.policy,
|
|
26
|
+
abuse: Object.freeze({
|
|
27
|
+
...input.policy?.abuse,
|
|
28
|
+
issues: Object.freeze({ ...input.policy?.abuse?.issues }),
|
|
29
|
+
attempts: Object.freeze({ ...input.policy?.abuse?.attempts }),
|
|
30
|
+
subjectIssues: Object.freeze({ ...input.policy?.abuse?.subjectIssues }),
|
|
31
|
+
subjectAttempts: Object.freeze({ ...input.policy?.abuse?.subjectAttempts }),
|
|
32
|
+
actionIssues: Object.freeze({ ...input.policy?.abuse?.actionIssues }),
|
|
33
|
+
actionAttempts: Object.freeze({ ...input.policy?.abuse?.actionAttempts })
|
|
34
|
+
})
|
|
35
|
+
}),
|
|
36
|
+
keys: input.keys === void 0 ? void 0 : Object.freeze({
|
|
37
|
+
...input.keys,
|
|
38
|
+
keys: Object.freeze((Array.isArray(input.keys?.keys) ? input.keys.keys : []).map((entry) => Object.freeze({ ...entry })))
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
/** Each module has one fixed purpose and a schema that makes required binding fields mandatory.
|
|
42
|
+
* Consumer codec extensions are not implicit authority: bind every extra relevant
|
|
43
|
+
* field into contextDigest. Canonical proof bytes include only the declared core binding.
|
|
44
|
+
*/
|
|
45
|
+
const makeProofModule = (moduleId, input) => {
|
|
46
|
+
const options = snapshotProofConfiguration(input);
|
|
47
|
+
const BindingCodec = options.binding;
|
|
48
|
+
const RequestInput = Schema.Struct({
|
|
49
|
+
requestId: ProofRequestId,
|
|
50
|
+
binding: BindingCodec,
|
|
51
|
+
locale: Locale,
|
|
52
|
+
eligible: Schema.Boolean
|
|
53
|
+
});
|
|
54
|
+
const ResendInput = Schema.Struct({
|
|
55
|
+
...RequestInput.fields,
|
|
56
|
+
supersedes: ProofId
|
|
57
|
+
});
|
|
58
|
+
const AttemptInput = Schema.Struct({
|
|
59
|
+
reference: ProofReference,
|
|
60
|
+
binding: BindingCodec,
|
|
61
|
+
credential: Credential
|
|
62
|
+
});
|
|
63
|
+
const CompleteInput = Schema.Struct({
|
|
64
|
+
continuationId: ProofContinuationId,
|
|
65
|
+
binding: BindingCodec,
|
|
66
|
+
credential: Credential
|
|
67
|
+
});
|
|
68
|
+
const Accepted = Schema.TaggedStruct("Accepted", { continuation: ProofContinuation });
|
|
69
|
+
const Proofs = Context.Service(`effect-auth/proofs/${moduleId}`);
|
|
70
|
+
const makeLayer = (deliveryKey, channel) => Layer.effect(Proofs, Effect.gen(function* () {
|
|
71
|
+
yield* Schema.decodeEffect(ProofPurpose)(options.purpose).pipe(Effect.mapError(() => ProofConfigurationError.make({ reason: "binding" })));
|
|
72
|
+
if (channel !== options.channel || !Schema.is(Schema.NonEmptyString.check(Schema.isMaxLength(256)))(moduleId) || !Schema.is(Schema.NonEmptyString.check(Schema.isMaxLength(128)))(options.template)) return yield* ProofConfigurationError.make({ reason: "delivery" });
|
|
73
|
+
const policy = yield* validateProofPolicy(options.policy);
|
|
74
|
+
const delivery = yield* deliveryKey;
|
|
75
|
+
if (policy.maximumDeliveryAttempts > 1 && delivery.vendor.idempotencyMillis < policy.lifetimeMillis) return yield* ProofConfigurationError.make({ reason: "delivery" });
|
|
76
|
+
const crypto = yield* makeProofCrypto(moduleId, options.purpose, options.secret, options.keys);
|
|
77
|
+
const store = yield* ProofPersistence;
|
|
78
|
+
const dispatchServices = Context.make(ProofPersistence, store).pipe(Context.add(deliveryKey, delivery));
|
|
79
|
+
const hooks = yield* LifecycleHooks;
|
|
80
|
+
const services = yield* Effect.context();
|
|
81
|
+
const bindingCodec = Schema.toCodecIso(BindingCodec);
|
|
82
|
+
const projectBinding = (value) => Schema.encodeEffect(bindingCodec)(value).pipe(Effect.flatMap(Schema.decodeEffect(bindingCodec)), Effect.provide(services), Effect.flatMap(validateProofBinding), Effect.mapError(() => ProofInvalid.make({})));
|
|
83
|
+
const eventFor = Effect.fn("Proofs.eventFor")(function* (action, binding) {
|
|
84
|
+
const snapshot = lifecycleSnapshot({
|
|
85
|
+
action,
|
|
86
|
+
operation: `${moduleId}/${action}`,
|
|
87
|
+
identifiers: [binding.identifier],
|
|
88
|
+
...binding._tag === "Identifier" ? {} : { subjectId: binding.revision.subjectId }
|
|
89
|
+
});
|
|
90
|
+
yield* hooks.before(snapshot);
|
|
91
|
+
return lifecycleEvent({
|
|
92
|
+
id: LifecycleEventId.make(Redacted.value(yield* crypto.generateOpaque())),
|
|
93
|
+
occurredAtMillis: DateTime.toEpochMillis(yield* DateTime.now),
|
|
94
|
+
snapshot
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
const planIssue = Effect.fn("Proofs.planIssue")(function* (request) {
|
|
98
|
+
const binding = yield* projectBinding(request.binding);
|
|
99
|
+
const eligible = yield* Schema.decodeEffect(Schema.Boolean)(request.eligible).pipe(Effect.mapError(() => ProofInvalid.make({})));
|
|
100
|
+
const supersedes = request.supersedes;
|
|
101
|
+
const locale = yield* Schema.decodeEffect(Locale)(request.locale).pipe(Effect.mapError(() => ProofInvalid.make({})));
|
|
102
|
+
const requestId = yield* Schema.decodeEffect(ProofRequestId)(request.requestId).pipe(Effect.mapError(() => ProofInvalid.make({})));
|
|
103
|
+
const fingerprint = yield* crypto.fingerprint(binding, {
|
|
104
|
+
channel: options.channel,
|
|
105
|
+
vendor: delivery.vendor.vendorId,
|
|
106
|
+
template: options.template,
|
|
107
|
+
locale
|
|
108
|
+
}, supersedes);
|
|
109
|
+
const proofId = ProofId.make(Redacted.value(yield* crypto.generateOpaque()));
|
|
110
|
+
const reference = {
|
|
111
|
+
proofId,
|
|
112
|
+
purpose: options.purpose,
|
|
113
|
+
keyId: crypto.activeKeyId
|
|
114
|
+
};
|
|
115
|
+
const before = yield* eventFor("proof-request", binding).pipe(Effect.result);
|
|
116
|
+
if (before._tag === "Failure" && (before.failure._tag !== "HookDenied" || before.failure.reason === "unavailable")) return yield* ProofUnavailable.make({});
|
|
117
|
+
const secret = yield* crypto.generate();
|
|
118
|
+
const verifier = yield* crypto.digest(proofId, binding, secret, crypto.activeKeyId);
|
|
119
|
+
if (verifier === void 0) return yield* ProofUnavailable.make({});
|
|
120
|
+
const issuedAtMillis = DateTime.toEpochMillis(yield* DateTime.now);
|
|
121
|
+
const record = {
|
|
122
|
+
moduleId,
|
|
123
|
+
purpose: options.purpose,
|
|
124
|
+
proofId,
|
|
125
|
+
requestId,
|
|
126
|
+
fingerprint,
|
|
127
|
+
deliveryId: ProofDeliveryId.make(proofId),
|
|
128
|
+
binding,
|
|
129
|
+
verifier,
|
|
130
|
+
issuedAtMillis,
|
|
131
|
+
expiresAtMillis: issuedAtMillis + policy.lifetimeMillis,
|
|
132
|
+
version: ProofVersion.make(Redacted.value(yield* crypto.generateOpaque()))
|
|
133
|
+
};
|
|
134
|
+
const message = {
|
|
135
|
+
deliveryId: record.deliveryId,
|
|
136
|
+
purpose: options.purpose,
|
|
137
|
+
reference,
|
|
138
|
+
recipient: binding.identifier,
|
|
139
|
+
secret,
|
|
140
|
+
format: crypto.format,
|
|
141
|
+
expiresAtMillis: record.expiresAtMillis,
|
|
142
|
+
template: options.template,
|
|
143
|
+
locale
|
|
144
|
+
};
|
|
145
|
+
return { commit: store.issue({
|
|
146
|
+
record,
|
|
147
|
+
policy,
|
|
148
|
+
eligible: eligible && before._tag === "Success",
|
|
149
|
+
supersedes
|
|
150
|
+
}, (decision, journal) => {
|
|
151
|
+
if (decision._tag !== "Issued") return journal.prepare({
|
|
152
|
+
receipt: decision.receipt,
|
|
153
|
+
dispatch: Effect.succeed("not-dispatched")
|
|
154
|
+
});
|
|
155
|
+
if (decision.record.proofId !== record.proofId || decision.record.verifier.digest !== record.verifier.digest || decision.record.verifier.keyId !== record.verifier.keyId || decision.record.version !== record.version || decision.record.fingerprint !== record.fingerprint) throw ProofUnavailable.make({});
|
|
156
|
+
if (before._tag !== "Success") throw ProofUnavailable.make({});
|
|
157
|
+
journal.stage(before.success);
|
|
158
|
+
const prepared = makeProofDispatch(deliveryKey, record, message, policy);
|
|
159
|
+
return journal.prepare(Object.freeze({
|
|
160
|
+
...prepared,
|
|
161
|
+
dispatch: prepared.dispatch.pipe(Effect.provide(dispatchServices))
|
|
162
|
+
}));
|
|
163
|
+
}) };
|
|
164
|
+
});
|
|
165
|
+
const planComplete = Effect.fn("Proofs.planComplete")(function* (request) {
|
|
166
|
+
const binding = yield* projectBinding(request.binding);
|
|
167
|
+
const event = yield* eventFor("proof-completion", binding);
|
|
168
|
+
const digest = yield* crypto.continuationDigest(request.continuationId, binding, request.credential);
|
|
169
|
+
if (digest === void 0) return yield* ProofInvalid.make({});
|
|
170
|
+
return Object.freeze({
|
|
171
|
+
input: Object.freeze({
|
|
172
|
+
moduleId,
|
|
173
|
+
purpose: options.purpose,
|
|
174
|
+
continuationId: request.continuationId,
|
|
175
|
+
continuationDigest: digest,
|
|
176
|
+
binding,
|
|
177
|
+
nowMillis: DateTime.toEpochMillis(yield* DateTime.now)
|
|
178
|
+
}),
|
|
179
|
+
prepare: (decision, journal, project) => {
|
|
180
|
+
const value = project(decision);
|
|
181
|
+
if (decision === "completed") journal.stage(event);
|
|
182
|
+
return journal.prepare(value);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
return Proofs.of({
|
|
187
|
+
planIssue,
|
|
188
|
+
prepareIssue: (request) => planIssue(request).pipe(Effect.flatMap((plan) => plan.commit)),
|
|
189
|
+
prepareAttempt: Effect.fn("Proofs.prepareAttempt")(function* (request) {
|
|
190
|
+
const binding = yield* projectBinding(request.binding);
|
|
191
|
+
const event = yield* eventFor("proof-verification", binding);
|
|
192
|
+
const candidate = request.reference.purpose === options.purpose ? yield* crypto.digest(request.reference.proofId, binding, request.credential, request.reference.keyId) : void 0;
|
|
193
|
+
const credential = yield* crypto.generateOpaque();
|
|
194
|
+
const continuationId = ProofContinuationId.make(Redacted.value(yield* crypto.generateOpaque()));
|
|
195
|
+
const continuationDigest = yield* crypto.continuationDigest(continuationId, binding, credential);
|
|
196
|
+
if (continuationDigest === void 0) return yield* ProofUnavailable.make({});
|
|
197
|
+
return yield* store.attempt({
|
|
198
|
+
moduleId,
|
|
199
|
+
purpose: options.purpose,
|
|
200
|
+
proofId: request.reference.proofId,
|
|
201
|
+
binding,
|
|
202
|
+
candidate,
|
|
203
|
+
continuationId,
|
|
204
|
+
continuationDigest,
|
|
205
|
+
nowMillis: DateTime.toEpochMillis(yield* DateTime.now),
|
|
206
|
+
policy
|
|
207
|
+
}, (decision, journal) => {
|
|
208
|
+
if (decision._tag === "Rejected") return journal.prepare({
|
|
209
|
+
value: decision,
|
|
210
|
+
credentialCommands: []
|
|
211
|
+
});
|
|
212
|
+
if (decision.continuation.continuationId !== continuationId || decision.continuation.purpose !== options.purpose) throw ProofUnavailable.make({});
|
|
213
|
+
journal.stage(event);
|
|
214
|
+
return journal.prepare({
|
|
215
|
+
value: decision,
|
|
216
|
+
credentialCommands: [{
|
|
217
|
+
_tag: "Issue",
|
|
218
|
+
slot: "proof-continuation",
|
|
219
|
+
credential,
|
|
220
|
+
expiresAtMillis: decision.continuation.expiresAtMillis
|
|
221
|
+
}]
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
}),
|
|
225
|
+
planComplete,
|
|
226
|
+
prepareComplete: (request) => planComplete(request).pipe(Effect.flatMap((plan) => store.complete(plan.input, (decision, journal) => plan.prepare(decision, journal, (value) => value)))),
|
|
227
|
+
cancel: Effect.fn("Proofs.cancel")(function* (input) {
|
|
228
|
+
const binding = yield* projectBinding(input);
|
|
229
|
+
return yield* store.cancel({
|
|
230
|
+
moduleId,
|
|
231
|
+
purpose: options.purpose,
|
|
232
|
+
binding,
|
|
233
|
+
nowMillis: DateTime.toEpochMillis(yield* DateTime.now)
|
|
234
|
+
}, (_, journal) => journal.prepare(void 0));
|
|
235
|
+
}),
|
|
236
|
+
cleanup: Effect.fn("Proofs.cleanup")(function* (limit) {
|
|
237
|
+
yield* Schema.decodeEffect(Schema.Int.check(Schema.isBetween({
|
|
238
|
+
minimum: 1,
|
|
239
|
+
maximum: 1e3
|
|
240
|
+
})))(limit).pipe(Effect.mapError(() => ProofInvalid.make({})));
|
|
241
|
+
return yield* store.cleanup({
|
|
242
|
+
moduleId,
|
|
243
|
+
nowMillis: DateTime.toEpochMillis(yield* DateTime.now),
|
|
244
|
+
limit
|
|
245
|
+
}, (decision, journal) => journal.prepare(decision));
|
|
246
|
+
})
|
|
247
|
+
});
|
|
248
|
+
}));
|
|
249
|
+
const emailLayer = makeLayer(EmailProofDelivery, "email");
|
|
250
|
+
const smsLayer = makeLayer(SmsProofDelivery, "sms");
|
|
251
|
+
const errors = Schema.Union([ProofError, HookDenied]);
|
|
252
|
+
const Request = makeOperation(`${moduleId}/request`, {
|
|
253
|
+
payload: RequestInput,
|
|
254
|
+
success: ProofRequestReceipt,
|
|
255
|
+
error: errors,
|
|
256
|
+
access: "system",
|
|
257
|
+
replay: "idempotent"
|
|
258
|
+
});
|
|
259
|
+
const Resend = makeOperation(`${moduleId}/resend`, {
|
|
260
|
+
payload: ResendInput,
|
|
261
|
+
success: ProofRequestReceipt,
|
|
262
|
+
error: errors,
|
|
263
|
+
access: "system",
|
|
264
|
+
replay: "idempotent"
|
|
265
|
+
});
|
|
266
|
+
const Attempt = makeOperation(`${moduleId}/attempt`, {
|
|
267
|
+
payload: AttemptInput,
|
|
268
|
+
success: Accepted,
|
|
269
|
+
error: errors,
|
|
270
|
+
access: "system",
|
|
271
|
+
replay: "single-use",
|
|
272
|
+
credentials: true
|
|
273
|
+
});
|
|
274
|
+
const Complete = makeOperation(`${moduleId}/complete`, {
|
|
275
|
+
payload: CompleteInput,
|
|
276
|
+
success: Schema.Void,
|
|
277
|
+
error: errors,
|
|
278
|
+
access: "system",
|
|
279
|
+
replay: "single-use",
|
|
280
|
+
credentials: true
|
|
281
|
+
});
|
|
282
|
+
const Cancel = makeOperation(`${moduleId}/cancel`, {
|
|
283
|
+
payload: Schema.Struct({ binding: BindingCodec }),
|
|
284
|
+
success: Schema.Void,
|
|
285
|
+
error: errors,
|
|
286
|
+
access: "system",
|
|
287
|
+
replay: "idempotent"
|
|
288
|
+
});
|
|
289
|
+
const Cleanup = makeOperation(`${moduleId}/cleanup`, {
|
|
290
|
+
payload: Schema.Struct({ limit: Schema.Int.check(Schema.isBetween({
|
|
291
|
+
minimum: 1,
|
|
292
|
+
maximum: 1e3
|
|
293
|
+
})) }),
|
|
294
|
+
success: ProofCleanupResult,
|
|
295
|
+
error: errors,
|
|
296
|
+
access: "system",
|
|
297
|
+
replay: "idempotent"
|
|
298
|
+
});
|
|
299
|
+
const requestHandler = Effect.fn("ProofOperation.request")(function* (input) {
|
|
300
|
+
yield* noAmbient();
|
|
301
|
+
const dispatch = yield* readProofCommit(yield* (yield* Proofs).prepareIssue(input));
|
|
302
|
+
yield* dispatch.dispatch;
|
|
303
|
+
return dispatch.receipt;
|
|
304
|
+
});
|
|
305
|
+
const handlersLayer = Layer.mergeAll(Request.handlerLayer(requestHandler), Resend.handlerLayer(requestHandler), Attempt.credentialHandlerLayer(Effect.fn("ProofOperation.attempt")(function* (input) {
|
|
306
|
+
yield* noAmbient();
|
|
307
|
+
const result = yield* readProofCommit(yield* (yield* Proofs).prepareAttempt(input));
|
|
308
|
+
if (result.value._tag === "Rejected") return yield* ProofInvalid.make({});
|
|
309
|
+
return {
|
|
310
|
+
value: result.value,
|
|
311
|
+
credentialCommands: result.credentialCommands
|
|
312
|
+
};
|
|
313
|
+
})), Complete.credentialHandlerLayer(Effect.fn("ProofOperation.complete")(function* (input) {
|
|
314
|
+
yield* noAmbient();
|
|
315
|
+
if ((yield* readProofCommit(yield* (yield* Proofs).prepareComplete(input))) === "rejected") return yield* ProofInvalid.make({});
|
|
316
|
+
return {
|
|
317
|
+
value: void 0,
|
|
318
|
+
credentialCommands: [{
|
|
319
|
+
_tag: "Clear",
|
|
320
|
+
slot: "proof-continuation"
|
|
321
|
+
}]
|
|
322
|
+
};
|
|
323
|
+
})), Cancel.handlerLayer(Effect.fn("ProofOperation.cancel")(function* (input) {
|
|
324
|
+
yield* noAmbient();
|
|
325
|
+
return yield* readProofCommit(yield* (yield* Proofs).cancel(input.binding));
|
|
326
|
+
})), Cleanup.handlerLayer(Effect.fn("ProofOperation.cleanup")(function* (input) {
|
|
327
|
+
yield* noAmbient();
|
|
328
|
+
return yield* readProofCommit(yield* (yield* Proofs).cleanup(input.limit));
|
|
329
|
+
})));
|
|
330
|
+
const operations = {
|
|
331
|
+
Request,
|
|
332
|
+
Resend,
|
|
333
|
+
Attempt,
|
|
334
|
+
Complete,
|
|
335
|
+
Cancel,
|
|
336
|
+
Cleanup
|
|
337
|
+
};
|
|
338
|
+
return Object.freeze({
|
|
339
|
+
Proofs,
|
|
340
|
+
emailLayer,
|
|
341
|
+
smsLayer,
|
|
342
|
+
handlersLayer,
|
|
343
|
+
operations,
|
|
344
|
+
group: operationGroup(...Object.values(operations))
|
|
345
|
+
});
|
|
346
|
+
};
|
|
347
|
+
//#endregion
|
|
348
|
+
export { makeProofModule, snapshotProofConfiguration };
|
|
349
|
+
|
|
350
|
+
//# sourceMappingURL=module.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.mjs","names":[],"sources":["../../src/proofs/module.ts"],"sourcesContent":["import { Context, DateTime, Effect, Layer, Redacted, Schema, type Types } from \"effect\";\n\nimport { hasCommitScope, type PreparedCommit } from \"../hooks/commit\";\nimport { LifecycleHooks } from \"../hooks/LifecycleHooks\";\nimport {\n HookDenied,\n LifecycleEventId,\n type LifecycleAction,\n lifecycleEvent,\n lifecycleSnapshot,\n} from \"../hooks/models\";\nimport type { AuthOperationResult } from \"../operations/credentials\";\nimport { makeOperation, operationGroup } from \"../operations/operation\";\nimport type { ProofCompletionPlan } from \"./completion\";\nimport {\n makeProofCrypto,\n type ProofKeyring,\n type ProofSecretPolicy,\n validateProofBinding,\n} from \"./crypto\";\nimport type { ProofDelivery } from \"./delivery\";\nimport {\n type PreparedProofDispatch,\n type ProofIssuePlan,\n makeProofDispatch,\n readProofCommit,\n} from \"./dispatch\";\nimport { EmailProofDelivery } from \"./EmailProofDelivery\";\nimport {\n ProofCapabilityUnsupported,\n ProofConfigurationError,\n ProofError,\n ProofInvalid,\n ProofUnavailable,\n} from \"./errors\";\nimport {\n type ProofCompletionDecision,\n type ProofBinding,\n ProofCleanupResult,\n ProofContinuation,\n ProofContinuationId,\n ProofDeliveryId,\n ProofId,\n ProofPurpose,\n ProofReference,\n ProofRequestId,\n ProofRequestReceipt,\n ProofVersion,\n} from \"./models\";\nimport { type ProofPolicy, validateProofPolicy } from \"./policy\";\nimport { ProofPersistence, type ProofRecord } from \"./ProofPersistence\";\nimport { SmsProofDelivery } from \"./SmsProofDelivery\";\n\nexport interface ProofModule<Id extends string, Binding> {\n readonly moduleId: Id;\n readonly _tag: \"effect-auth/ProofModule\";\n readonly binding: Types.Invariant<Binding>;\n}\n\nconst Locale = Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(64));\nconst Credential = Schema.RedactedFromValue(Schema.String.check(Schema.isMaxLength(4096)));\n\nconst noAmbient = Effect.fn(\"Proofs.noAmbient\")(function* () {\n if (yield* hasCommitScope) return yield* ProofCapabilityUnsupported.make({});\n});\n\n/** Snapshot owned configuration data without evaluating application codecs or validating it. */\nexport const snapshotProofConfiguration = <\n Configuration extends {\n readonly secret: ProofSecretPolicy;\n readonly policy: ProofPolicy;\n readonly keys?: ProofKeyring;\n },\n>(\n input: Configuration,\n) =>\n Object.freeze({\n ...input,\n secret: Object.freeze({ ...input.secret }),\n policy: Object.freeze({\n ...input.policy,\n abuse: Object.freeze({\n ...input.policy?.abuse,\n issues: Object.freeze({ ...input.policy?.abuse?.issues }),\n attempts: Object.freeze({ ...input.policy?.abuse?.attempts }),\n subjectIssues: Object.freeze({ ...input.policy?.abuse?.subjectIssues }),\n subjectAttempts: Object.freeze({ ...input.policy?.abuse?.subjectAttempts }),\n actionIssues: Object.freeze({ ...input.policy?.abuse?.actionIssues }),\n actionAttempts: Object.freeze({ ...input.policy?.abuse?.actionAttempts }),\n }),\n }),\n keys:\n input.keys === undefined\n ? undefined\n : Object.freeze({\n ...input.keys,\n keys: Object.freeze(\n (Array.isArray(input.keys?.keys) ? input.keys.keys : []).map((entry) =>\n Object.freeze({ ...entry }),\n ),\n ),\n }),\n });\n\n/** Each module has one fixed purpose and a schema that makes required binding fields mandatory.\n * Consumer codec extensions are not implicit authority: bind every extra relevant\n * field into contextDigest. Canonical proof bytes include only the declared core binding.\n */\nexport const makeProofModule = <\n const Id extends string,\n Binding extends Schema.Codec<ProofBinding, unknown, unknown, unknown>,\n>(\n moduleId: Id,\n input: {\n readonly purpose: ProofPurpose;\n readonly binding: Binding;\n readonly channel: \"email\" | \"sms\";\n readonly template: string;\n readonly secret: ProofSecretPolicy;\n readonly policy: ProofPolicy;\n readonly keys?: ProofKeyring;\n },\n) => {\n const options = snapshotProofConfiguration(input);\n\n const BindingCodec: Schema.Codec<\n Binding[\"Type\"],\n Binding[\"Encoded\"],\n Binding[\"DecodingServices\"],\n Binding[\"EncodingServices\"]\n > = options.binding;\n\n type BindingValue = Binding[\"Type\"];\n\n const RequestInput = Schema.Struct({\n requestId: ProofRequestId,\n binding: BindingCodec,\n locale: Locale,\n eligible: Schema.Boolean,\n });\n\n const ResendInput = Schema.Struct({ ...RequestInput.fields, supersedes: ProofId });\n\n const AttemptInput = Schema.Struct({\n reference: ProofReference,\n binding: BindingCodec,\n credential: Credential,\n });\n\n const CompleteInput = Schema.Struct({\n continuationId: ProofContinuationId,\n binding: BindingCodec,\n credential: Credential,\n });\n\n const Accepted = Schema.TaggedStruct(\"Accepted\", { continuation: ProofContinuation });\n\n type Accepted = typeof Accepted.Type;\n type IssueInput = typeof RequestInput.Type & { readonly supersedes?: ProofId };\n type PrivateAttempt =\n | AuthOperationResult<Accepted>\n | { readonly value: { readonly _tag: \"Rejected\" }; readonly credentialCommands: readonly [] };\n type Failure = ProofError | HookDenied;\n type Service = {\n readonly planIssue: (input: IssueInput) => Effect.Effect<ProofIssuePlan, Failure>;\n readonly prepareIssue: (\n input: IssueInput,\n ) => Effect.Effect<PreparedCommit<PreparedProofDispatch>, Failure>;\n readonly prepareAttempt: (\n input: typeof AttemptInput.Type,\n ) => Effect.Effect<PreparedCommit<PrivateAttempt>, Failure>;\n readonly planComplete: (\n input: typeof CompleteInput.Type,\n ) => Effect.Effect<ProofCompletionPlan, Failure>;\n readonly prepareComplete: (\n input: typeof CompleteInput.Type,\n ) => Effect.Effect<PreparedCommit<ProofCompletionDecision>, Failure>;\n readonly cancel: (binding: BindingValue) => Effect.Effect<PreparedCommit<void>, Failure>;\n readonly cleanup: (limit: number) => Effect.Effect<PreparedCommit<ProofCleanupResult>, Failure>;\n };\n\n const Proofs = Context.Service<ProofModule<Id, BindingValue>, Service>(\n `effect-auth/proofs/${moduleId}`,\n );\n\n const makeLayer = <DeliveryId>(\n deliveryKey: Context.Key<DeliveryId, ProofDelivery>,\n channel: \"email\" | \"sms\",\n ) =>\n Layer.effect(\n Proofs,\n Effect.gen(function* () {\n yield* Schema.decodeEffect(ProofPurpose)(options.purpose).pipe(\n Effect.mapError(() => ProofConfigurationError.make({ reason: \"binding\" })),\n );\n if (\n channel !== options.channel ||\n !Schema.is(Schema.NonEmptyString.check(Schema.isMaxLength(256)))(moduleId) ||\n !Schema.is(Schema.NonEmptyString.check(Schema.isMaxLength(128)))(options.template)\n )\n return yield* ProofConfigurationError.make({ reason: \"delivery\" });\n const policy = yield* validateProofPolicy(options.policy);\n const delivery = yield* deliveryKey;\n\n if (\n policy.maximumDeliveryAttempts > 1 &&\n delivery.vendor.idempotencyMillis < policy.lifetimeMillis\n )\n return yield* ProofConfigurationError.make({ reason: \"delivery\" });\n\n const crypto = yield* makeProofCrypto(\n moduleId,\n options.purpose,\n options.secret,\n options.keys,\n );\n\n const store = yield* ProofPersistence;\n\n // Bind only owned services; dispatch still observes its execution-time commit scope.\n const dispatchServices = Context.make(ProofPersistence, store).pipe(\n Context.add(deliveryKey, delivery),\n );\n\n const hooks = yield* LifecycleHooks;\n\n const services = yield* Effect.context<\n Binding[\"DecodingServices\"] | Binding[\"EncodingServices\"]\n >();\n\n const bindingCodec = Schema.toCodecIso(BindingCodec);\n\n const projectBinding = (value: BindingValue) =>\n Schema.encodeEffect(bindingCodec)(value).pipe(\n Effect.flatMap(Schema.decodeEffect(bindingCodec)),\n Effect.provide(services),\n Effect.flatMap(validateProofBinding),\n Effect.mapError(() => ProofInvalid.make({})),\n );\n\n const eventFor = Effect.fn(\"Proofs.eventFor\")(function* (\n action: LifecycleAction,\n binding: ProofBinding,\n ) {\n const snapshot = lifecycleSnapshot({\n action,\n operation: `${moduleId}/${action}`,\n identifiers: [binding.identifier],\n ...(binding._tag === \"Identifier\" ? {} : { subjectId: binding.revision.subjectId }),\n });\n\n yield* hooks.before(snapshot);\n\n return lifecycleEvent({\n id: LifecycleEventId.make(Redacted.value(yield* crypto.generateOpaque())),\n occurredAtMillis: DateTime.toEpochMillis(yield* DateTime.now),\n snapshot,\n });\n });\n\n const planIssue = Effect.fn(\"Proofs.planIssue\")(function* (request: IssueInput) {\n const binding = yield* projectBinding(request.binding);\n\n const eligible = yield* Schema.decodeEffect(Schema.Boolean)(request.eligible).pipe(\n Effect.mapError(() => ProofInvalid.make({})),\n );\n\n const supersedes = request.supersedes;\n\n const locale = yield* Schema.decodeEffect(Locale)(request.locale).pipe(\n Effect.mapError(() => ProofInvalid.make({})),\n );\n\n const requestId = yield* Schema.decodeEffect(ProofRequestId)(request.requestId).pipe(\n Effect.mapError(() => ProofInvalid.make({})),\n );\n\n const fingerprint = yield* crypto.fingerprint(\n binding,\n {\n channel: options.channel,\n vendor: delivery.vendor.vendorId,\n template: options.template,\n locale,\n },\n supersedes,\n );\n\n const proofId = ProofId.make(Redacted.value(yield* crypto.generateOpaque()));\n const reference = { proofId, purpose: options.purpose, keyId: crypto.activeKeyId };\n const before = yield* eventFor(\"proof-request\", binding).pipe(Effect.result);\n\n if (\n before._tag === \"Failure\" &&\n (before.failure._tag !== \"HookDenied\" || before.failure.reason === \"unavailable\")\n )\n return yield* ProofUnavailable.make({});\n const secret = yield* crypto.generate();\n const verifier = yield* crypto.digest(proofId, binding, secret, crypto.activeKeyId);\n\n if (verifier === undefined) return yield* ProofUnavailable.make({});\n const issuedAtMillis = DateTime.toEpochMillis(yield* DateTime.now);\n\n const record: ProofRecord = {\n moduleId,\n purpose: options.purpose,\n proofId,\n requestId,\n fingerprint,\n deliveryId: ProofDeliveryId.make(proofId),\n binding,\n verifier,\n issuedAtMillis,\n expiresAtMillis: issuedAtMillis + policy.lifetimeMillis,\n version: ProofVersion.make(Redacted.value(yield* crypto.generateOpaque())),\n };\n\n const message = {\n deliveryId: record.deliveryId,\n purpose: options.purpose,\n reference,\n recipient: binding.identifier,\n secret,\n format: crypto.format,\n expiresAtMillis: record.expiresAtMillis,\n template: options.template,\n locale,\n };\n\n return {\n commit: store.issue(\n { record, policy, eligible: eligible && before._tag === \"Success\", supersedes },\n (decision, journal) => {\n if (decision._tag !== \"Issued\")\n return journal.prepare({\n receipt: decision.receipt,\n dispatch: Effect.succeed(\"not-dispatched\" as const),\n });\n if (\n decision.record.proofId !== record.proofId ||\n decision.record.verifier.digest !== record.verifier.digest ||\n decision.record.verifier.keyId !== record.verifier.keyId ||\n decision.record.version !== record.version ||\n decision.record.fingerprint !== record.fingerprint\n )\n throw ProofUnavailable.make({});\n if (before._tag !== \"Success\") throw ProofUnavailable.make({});\n journal.stage(before.success);\n\n const prepared = makeProofDispatch(deliveryKey, record, message, policy);\n\n return journal.prepare(\n Object.freeze({\n ...prepared,\n dispatch: prepared.dispatch.pipe(Effect.provide(dispatchServices)),\n }),\n );\n },\n ),\n };\n });\n\n const planComplete = Effect.fn(\"Proofs.planComplete\")(function* (\n request: typeof CompleteInput.Type,\n ): Effect.fn.Return<ProofCompletionPlan, Failure> {\n const binding = yield* projectBinding(request.binding);\n const event = yield* eventFor(\"proof-completion\", binding);\n\n const digest = yield* crypto.continuationDigest(\n request.continuationId,\n binding,\n request.credential,\n );\n\n if (digest === undefined) return yield* ProofInvalid.make({});\n\n return Object.freeze({\n input: Object.freeze({\n moduleId,\n purpose: options.purpose,\n continuationId: request.continuationId,\n continuationDigest: digest,\n binding,\n nowMillis: DateTime.toEpochMillis(yield* DateTime.now),\n }),\n prepare: <A>(\n decision: ProofCompletionDecision,\n journal: import(\"../hooks/commit\").CommitJournal,\n project: (decision: ProofCompletionDecision) => A,\n ) => {\n const value = project(decision);\n\n if (decision === \"completed\") journal.stage(event);\n\n return journal.prepare(value);\n },\n });\n });\n\n return Proofs.of({\n planIssue,\n prepareIssue: (request) => planIssue(request).pipe(Effect.flatMap((plan) => plan.commit)),\n prepareAttempt: Effect.fn(\"Proofs.prepareAttempt\")(function* (request) {\n const binding = yield* projectBinding(request.binding);\n const event = yield* eventFor(\"proof-verification\", binding);\n\n const candidate =\n request.reference.purpose === options.purpose\n ? yield* crypto.digest(\n request.reference.proofId,\n binding,\n request.credential,\n request.reference.keyId,\n )\n : undefined;\n\n const credential = yield* crypto.generateOpaque();\n\n const continuationId = ProofContinuationId.make(\n Redacted.value(yield* crypto.generateOpaque()),\n );\n\n const continuationDigest = yield* crypto.continuationDigest(\n continuationId,\n binding,\n credential,\n );\n\n if (continuationDigest === undefined) return yield* ProofUnavailable.make({});\n\n return yield* store.attempt<PrivateAttempt>(\n {\n moduleId,\n purpose: options.purpose,\n proofId: request.reference.proofId,\n binding,\n candidate,\n continuationId,\n continuationDigest,\n nowMillis: DateTime.toEpochMillis(yield* DateTime.now),\n policy,\n },\n (decision, journal) => {\n if (decision._tag === \"Rejected\")\n return journal.prepare({ value: decision, credentialCommands: [] });\n if (\n decision.continuation.continuationId !== continuationId ||\n decision.continuation.purpose !== options.purpose\n )\n throw ProofUnavailable.make({});\n journal.stage(event);\n\n return journal.prepare({\n value: decision,\n credentialCommands: [\n {\n _tag: \"Issue\" as const,\n slot: \"proof-continuation\" as const,\n credential,\n expiresAtMillis: decision.continuation.expiresAtMillis,\n },\n ],\n });\n },\n );\n }),\n planComplete,\n prepareComplete: (request) =>\n planComplete(request).pipe(\n Effect.flatMap((plan) =>\n store.complete(plan.input, (decision, journal) =>\n plan.prepare(decision, journal, (value) => value),\n ),\n ),\n ),\n cancel: Effect.fn(\"Proofs.cancel\")(function* (input) {\n const binding = yield* projectBinding(input);\n\n return yield* store.cancel(\n {\n moduleId,\n purpose: options.purpose,\n binding,\n nowMillis: DateTime.toEpochMillis(yield* DateTime.now),\n },\n (_, journal) => journal.prepare(undefined),\n );\n }),\n cleanup: Effect.fn(\"Proofs.cleanup\")(function* (limit) {\n yield* Schema.decodeEffect(\n Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 1000 })),\n )(limit).pipe(Effect.mapError(() => ProofInvalid.make({})));\n\n return yield* store.cleanup(\n { moduleId, nowMillis: DateTime.toEpochMillis(yield* DateTime.now), limit },\n (decision, journal) => journal.prepare(decision),\n );\n }),\n });\n }),\n );\n\n const emailLayer = makeLayer(EmailProofDelivery, \"email\");\n const smsLayer = makeLayer(SmsProofDelivery, \"sms\");\n const errors = Schema.Union([ProofError, HookDenied]);\n\n const Request = makeOperation(`${moduleId}/request`, {\n payload: RequestInput,\n success: ProofRequestReceipt,\n error: errors,\n access: \"system\",\n replay: \"idempotent\",\n });\n\n const Resend = makeOperation(`${moduleId}/resend`, {\n payload: ResendInput,\n success: ProofRequestReceipt,\n error: errors,\n access: \"system\",\n replay: \"idempotent\",\n });\n\n const Attempt = makeOperation(`${moduleId}/attempt`, {\n payload: AttemptInput,\n success: Accepted,\n error: errors,\n access: \"system\",\n replay: \"single-use\",\n credentials: true,\n });\n\n const Complete = makeOperation(`${moduleId}/complete`, {\n payload: CompleteInput,\n success: Schema.Void,\n error: errors,\n access: \"system\",\n replay: \"single-use\",\n credentials: true,\n });\n\n const Cancel = makeOperation(`${moduleId}/cancel`, {\n payload: Schema.Struct({ binding: BindingCodec }),\n success: Schema.Void,\n error: errors,\n access: \"system\",\n replay: \"idempotent\",\n });\n\n const Cleanup = makeOperation(`${moduleId}/cleanup`, {\n payload: Schema.Struct({\n limit: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 1000 })),\n }),\n success: ProofCleanupResult,\n error: errors,\n access: \"system\",\n replay: \"idempotent\",\n });\n\n const requestHandler = Effect.fn(\"ProofOperation.request\")(function* (input: IssueInput) {\n yield* noAmbient();\n const dispatch = yield* readProofCommit(yield* (yield* Proofs).prepareIssue(input));\n\n yield* dispatch.dispatch;\n\n return dispatch.receipt;\n });\n\n const handlersLayer = Layer.mergeAll(\n Request.handlerLayer(requestHandler),\n Resend.handlerLayer(requestHandler),\n Attempt.credentialHandlerLayer(\n Effect.fn(\"ProofOperation.attempt\")(function* (input) {\n yield* noAmbient();\n const result = yield* readProofCommit(yield* (yield* Proofs).prepareAttempt(input));\n\n if (result.value._tag === \"Rejected\") return yield* ProofInvalid.make({});\n\n return { value: result.value, credentialCommands: result.credentialCommands };\n }),\n ),\n Complete.credentialHandlerLayer(\n Effect.fn(\"ProofOperation.complete\")(function* (input) {\n yield* noAmbient();\n const result = yield* readProofCommit(yield* (yield* Proofs).prepareComplete(input));\n\n if (result === \"rejected\") return yield* ProofInvalid.make({});\n\n return {\n value: undefined,\n credentialCommands: [{ _tag: \"Clear\" as const, slot: \"proof-continuation\" as const }],\n };\n }),\n ),\n Cancel.handlerLayer(\n Effect.fn(\"ProofOperation.cancel\")(function* (input) {\n yield* noAmbient();\n\n return yield* readProofCommit(yield* (yield* Proofs).cancel(input.binding));\n }),\n ),\n Cleanup.handlerLayer(\n Effect.fn(\"ProofOperation.cleanup\")(function* (input) {\n yield* noAmbient();\n\n return yield* readProofCommit(yield* (yield* Proofs).cleanup(input.limit));\n }),\n ),\n );\n\n const operations = { Request, Resend, Attempt, Complete, Cancel, Cleanup };\n\n return Object.freeze({\n Proofs,\n emailLayer,\n smsLayer,\n handlersLayer,\n operations,\n group: operationGroup(...Object.values(operations)),\n });\n};\n"],"mappings":";;;;;;;;;;;;;;AA2DA,MAAM,SAAS,OAAO,OAAO,MAAM,OAAO,YAAY,CAAC,GAAG,OAAO,YAAY,EAAE,CAAC;AAChF,MAAM,aAAa,OAAO,kBAAkB,OAAO,OAAO,MAAM,OAAO,YAAY,IAAI,CAAC,CAAC;AAEzF,MAAM,YAAY,OAAO,GAAG,kBAAkB,CAAC,CAAC,aAAa;CAC3D,IAAI,OAAO,gBAAgB,OAAO,OAAO,2BAA2B,KAAK,CAAC,CAAC;AAC7E,CAAC;;AAGD,MAAa,8BAOX,UAEA,OAAO,OAAO;CACZ,GAAG;CACH,QAAQ,OAAO,OAAO,EAAE,GAAG,MAAM,OAAO,CAAC;CACzC,QAAQ,OAAO,OAAO;EACpB,GAAG,MAAM;EACT,OAAO,OAAO,OAAO;GACnB,GAAG,MAAM,QAAQ;GACjB,QAAQ,OAAO,OAAO,EAAE,GAAG,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AG,wBAAwB,CAAC,CAAC,WAAW,OAAO;EACpD,OAAO,UAAU;EAEjB,OAAO,OAAO,gBAAgB,QAAQ,OAAO,OAAA,CAAQ,QAAQ,MAAM,KAAK,CAAC;CAC3E,CAAC,CACH,CACF;CAEA,MAAM,aAAa;EAAE;EAAS;EAAQ;EAAS;EAAU;EAAQ;CAAQ;CAEzE,OAAO,OAAO,OAAO;EACnB;EACA;EACA;EACA;EACA;EACA,OAAO,eAAe,GAAG,OAAO,OAAO,UAAU,CAAC;CACpD,CAAC;AACH"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { ProofConfigurationError } from "./errors.mjs";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
//#region src/proofs/policy.d.ts
|
|
4
|
+
declare const ProofBudget: Schema.Struct<{
|
|
5
|
+
readonly limit: Schema.Int;
|
|
6
|
+
readonly windowMillis: Schema.Int;
|
|
7
|
+
}>;
|
|
8
|
+
type ProofBudget = typeof ProofBudget.Type;
|
|
9
|
+
declare const ProofAbusePolicy: Schema.Struct<{
|
|
10
|
+
readonly issues: Schema.Struct<{
|
|
11
|
+
readonly limit: Schema.Int;
|
|
12
|
+
readonly windowMillis: Schema.Int;
|
|
13
|
+
}>;
|
|
14
|
+
readonly attempts: Schema.Struct<{
|
|
15
|
+
readonly limit: Schema.Int;
|
|
16
|
+
readonly windowMillis: Schema.Int;
|
|
17
|
+
}>;
|
|
18
|
+
/** These windows survive consumption, failure, and every resend/flow/request ID. */
|
|
19
|
+
readonly subjectIssues: Schema.Struct<{
|
|
20
|
+
readonly limit: Schema.Int;
|
|
21
|
+
readonly windowMillis: Schema.Int;
|
|
22
|
+
}>;
|
|
23
|
+
readonly subjectAttempts: Schema.Struct<{
|
|
24
|
+
readonly limit: Schema.Int;
|
|
25
|
+
readonly windowMillis: Schema.Int;
|
|
26
|
+
}>;
|
|
27
|
+
/** Global action limits also cover unknown subjects and rotating identifiers. */
|
|
28
|
+
readonly actionIssues: Schema.Struct<{
|
|
29
|
+
readonly limit: Schema.Int;
|
|
30
|
+
readonly windowMillis: Schema.Int;
|
|
31
|
+
}>;
|
|
32
|
+
readonly actionAttempts: Schema.Struct<{
|
|
33
|
+
readonly limit: Schema.Int;
|
|
34
|
+
readonly windowMillis: Schema.Int;
|
|
35
|
+
}>;
|
|
36
|
+
readonly resendCooldownMillis: Schema.Natural;
|
|
37
|
+
}>;
|
|
38
|
+
type ProofAbusePolicy = typeof ProofAbusePolicy.Type;
|
|
39
|
+
declare const ProofPolicy: Schema.Struct<{
|
|
40
|
+
readonly lifetimeMillis: Schema.Int;
|
|
41
|
+
readonly continuationLifetimeMillis: Schema.Int;
|
|
42
|
+
readonly maximumFailedAttempts: Schema.Int;
|
|
43
|
+
readonly maximumDeliveryAttempts: Schema.Int;
|
|
44
|
+
readonly deliveryClaimMillis: Schema.Int;
|
|
45
|
+
readonly deliveryRetryMillis: Schema.Int;
|
|
46
|
+
/** Retain request fingerprints and terminal generations through this retry horizon. */
|
|
47
|
+
readonly requestRetentionMillis: Schema.Int;
|
|
48
|
+
readonly abuse: Schema.Struct<{
|
|
49
|
+
readonly issues: Schema.Struct<{
|
|
50
|
+
readonly limit: Schema.Int;
|
|
51
|
+
readonly windowMillis: Schema.Int;
|
|
52
|
+
}>;
|
|
53
|
+
readonly attempts: Schema.Struct<{
|
|
54
|
+
readonly limit: Schema.Int;
|
|
55
|
+
readonly windowMillis: Schema.Int;
|
|
56
|
+
}>;
|
|
57
|
+
/** These windows survive consumption, failure, and every resend/flow/request ID. */
|
|
58
|
+
readonly subjectIssues: Schema.Struct<{
|
|
59
|
+
readonly limit: Schema.Int;
|
|
60
|
+
readonly windowMillis: Schema.Int;
|
|
61
|
+
}>;
|
|
62
|
+
readonly subjectAttempts: Schema.Struct<{
|
|
63
|
+
readonly limit: Schema.Int;
|
|
64
|
+
readonly windowMillis: Schema.Int;
|
|
65
|
+
}>;
|
|
66
|
+
/** Global action limits also cover unknown subjects and rotating identifiers. */
|
|
67
|
+
readonly actionIssues: Schema.Struct<{
|
|
68
|
+
readonly limit: Schema.Int;
|
|
69
|
+
readonly windowMillis: Schema.Int;
|
|
70
|
+
}>;
|
|
71
|
+
readonly actionAttempts: Schema.Struct<{
|
|
72
|
+
readonly limit: Schema.Int;
|
|
73
|
+
readonly windowMillis: Schema.Int;
|
|
74
|
+
}>;
|
|
75
|
+
readonly resendCooldownMillis: Schema.Natural;
|
|
76
|
+
}>;
|
|
77
|
+
}>;
|
|
78
|
+
type ProofPolicy = typeof ProofPolicy.Type;
|
|
79
|
+
declare const validateProofPolicy: (input: {
|
|
80
|
+
readonly lifetimeMillis: number;
|
|
81
|
+
readonly continuationLifetimeMillis: number;
|
|
82
|
+
readonly maximumFailedAttempts: number;
|
|
83
|
+
readonly maximumDeliveryAttempts: number;
|
|
84
|
+
readonly deliveryClaimMillis: number;
|
|
85
|
+
readonly deliveryRetryMillis: number;
|
|
86
|
+
readonly requestRetentionMillis: number;
|
|
87
|
+
readonly abuse: {
|
|
88
|
+
readonly issues: {
|
|
89
|
+
readonly limit: number;
|
|
90
|
+
readonly windowMillis: number;
|
|
91
|
+
};
|
|
92
|
+
readonly attempts: {
|
|
93
|
+
readonly limit: number;
|
|
94
|
+
readonly windowMillis: number;
|
|
95
|
+
};
|
|
96
|
+
readonly subjectIssues: {
|
|
97
|
+
readonly limit: number;
|
|
98
|
+
readonly windowMillis: number;
|
|
99
|
+
};
|
|
100
|
+
readonly subjectAttempts: {
|
|
101
|
+
readonly limit: number;
|
|
102
|
+
readonly windowMillis: number;
|
|
103
|
+
};
|
|
104
|
+
readonly actionIssues: {
|
|
105
|
+
readonly limit: number;
|
|
106
|
+
readonly windowMillis: number;
|
|
107
|
+
};
|
|
108
|
+
readonly actionAttempts: {
|
|
109
|
+
readonly limit: number;
|
|
110
|
+
readonly windowMillis: number;
|
|
111
|
+
};
|
|
112
|
+
readonly resendCooldownMillis: number;
|
|
113
|
+
};
|
|
114
|
+
}) => Effect.Effect<Readonly<{
|
|
115
|
+
lifetimeMillis: number;
|
|
116
|
+
continuationLifetimeMillis: number;
|
|
117
|
+
maximumFailedAttempts: number;
|
|
118
|
+
maximumDeliveryAttempts: number;
|
|
119
|
+
deliveryClaimMillis: number;
|
|
120
|
+
deliveryRetryMillis: number;
|
|
121
|
+
requestRetentionMillis: number;
|
|
122
|
+
abuse: Readonly<{
|
|
123
|
+
resendCooldownMillis: number;
|
|
124
|
+
issues: Readonly<{
|
|
125
|
+
readonly limit: number;
|
|
126
|
+
readonly windowMillis: number;
|
|
127
|
+
}>;
|
|
128
|
+
attempts: Readonly<{
|
|
129
|
+
readonly limit: number;
|
|
130
|
+
readonly windowMillis: number;
|
|
131
|
+
}>;
|
|
132
|
+
subjectIssues: Readonly<{
|
|
133
|
+
readonly limit: number;
|
|
134
|
+
readonly windowMillis: number;
|
|
135
|
+
}>;
|
|
136
|
+
subjectAttempts: Readonly<{
|
|
137
|
+
readonly limit: number;
|
|
138
|
+
readonly windowMillis: number;
|
|
139
|
+
}>;
|
|
140
|
+
actionIssues: Readonly<{
|
|
141
|
+
readonly limit: number;
|
|
142
|
+
readonly windowMillis: number;
|
|
143
|
+
}>;
|
|
144
|
+
actionAttempts: Readonly<{
|
|
145
|
+
readonly limit: number;
|
|
146
|
+
readonly windowMillis: number;
|
|
147
|
+
}>;
|
|
148
|
+
}>;
|
|
149
|
+
}>, ProofConfigurationError, never>;
|
|
150
|
+
//#endregion
|
|
151
|
+
export { ProofAbusePolicy, ProofBudget, ProofPolicy, validateProofPolicy };
|
|
152
|
+
//# sourceMappingURL=policy.d.mts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ProofConfigurationError } from "./errors.mjs";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
//#region src/proofs/policy.ts
|
|
4
|
+
const Positive = Schema.Int.check(Schema.isGreaterThan(0));
|
|
5
|
+
const Millis = Positive.check(Schema.isLessThanOrEqualTo(2592e6));
|
|
6
|
+
const ProofBudget = Schema.Struct({
|
|
7
|
+
limit: Positive.check(Schema.isLessThanOrEqualTo(1e6)),
|
|
8
|
+
windowMillis: Millis
|
|
9
|
+
});
|
|
10
|
+
const ProofAbusePolicy = Schema.Struct({
|
|
11
|
+
issues: ProofBudget,
|
|
12
|
+
attempts: ProofBudget,
|
|
13
|
+
/** These windows survive consumption, failure, and every resend/flow/request ID. */
|
|
14
|
+
subjectIssues: ProofBudget,
|
|
15
|
+
subjectAttempts: ProofBudget,
|
|
16
|
+
/** Global action limits also cover unknown subjects and rotating identifiers. */
|
|
17
|
+
actionIssues: ProofBudget,
|
|
18
|
+
actionAttempts: ProofBudget,
|
|
19
|
+
resendCooldownMillis: Schema.Natural
|
|
20
|
+
});
|
|
21
|
+
const ProofPolicy = Schema.Struct({
|
|
22
|
+
lifetimeMillis: Millis,
|
|
23
|
+
continuationLifetimeMillis: Millis,
|
|
24
|
+
maximumFailedAttempts: Positive.check(Schema.isLessThanOrEqualTo(100)),
|
|
25
|
+
maximumDeliveryAttempts: Positive.check(Schema.isLessThanOrEqualTo(5)),
|
|
26
|
+
deliveryClaimMillis: Millis,
|
|
27
|
+
deliveryRetryMillis: Millis,
|
|
28
|
+
/** Retain request fingerprints and terminal generations through this retry horizon. */
|
|
29
|
+
requestRetentionMillis: Millis,
|
|
30
|
+
abuse: ProofAbusePolicy
|
|
31
|
+
});
|
|
32
|
+
const validateProofPolicy = Effect.fn("validateProofPolicy")(function* (input) {
|
|
33
|
+
const policy = yield* Schema.decodeEffect(ProofPolicy)(input).pipe(Effect.mapError(() => ProofConfigurationError.make({ reason: "policy" })));
|
|
34
|
+
if (policy.requestRetentionMillis < Math.max(policy.lifetimeMillis, policy.continuationLifetimeMillis, policy.abuse.issues.windowMillis, policy.abuse.attempts.windowMillis, policy.abuse.subjectIssues.windowMillis, policy.abuse.subjectAttempts.windowMillis, policy.abuse.actionIssues.windowMillis, policy.abuse.actionAttempts.windowMillis) || policy.deliveryClaimMillis >= policy.lifetimeMillis || policy.abuse.resendCooldownMillis >= policy.lifetimeMillis) return yield* ProofConfigurationError.make({ reason: "policy" });
|
|
35
|
+
return Object.freeze({
|
|
36
|
+
...policy,
|
|
37
|
+
abuse: Object.freeze({
|
|
38
|
+
...policy.abuse,
|
|
39
|
+
issues: Object.freeze(policy.abuse.issues),
|
|
40
|
+
attempts: Object.freeze(policy.abuse.attempts),
|
|
41
|
+
subjectIssues: Object.freeze(policy.abuse.subjectIssues),
|
|
42
|
+
subjectAttempts: Object.freeze(policy.abuse.subjectAttempts),
|
|
43
|
+
actionIssues: Object.freeze(policy.abuse.actionIssues),
|
|
44
|
+
actionAttempts: Object.freeze(policy.abuse.actionAttempts)
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { ProofAbusePolicy, ProofBudget, ProofPolicy, validateProofPolicy };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=policy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.mjs","names":[],"sources":["../../src/proofs/policy.ts"],"sourcesContent":["import { Effect, Schema } from \"effect\";\n\nimport { ProofConfigurationError } from \"./errors\";\n\nconst Positive = Schema.Int.check(Schema.isGreaterThan(0));\nconst Millis = Positive.check(Schema.isLessThanOrEqualTo(2592000000));\n\nexport const ProofBudget = Schema.Struct({\n limit: Positive.check(Schema.isLessThanOrEqualTo(1000000)),\n windowMillis: Millis,\n});\n\nexport type ProofBudget = typeof ProofBudget.Type;\n\nexport const ProofAbusePolicy = Schema.Struct({\n issues: ProofBudget,\n attempts: ProofBudget,\n /** These windows survive consumption, failure, and every resend/flow/request ID. */\n subjectIssues: ProofBudget,\n subjectAttempts: ProofBudget,\n /** Global action limits also cover unknown subjects and rotating identifiers. */\n actionIssues: ProofBudget,\n actionAttempts: ProofBudget,\n resendCooldownMillis: Schema.Natural,\n});\n\nexport type ProofAbusePolicy = typeof ProofAbusePolicy.Type;\n\nexport const ProofPolicy = Schema.Struct({\n lifetimeMillis: Millis,\n continuationLifetimeMillis: Millis,\n maximumFailedAttempts: Positive.check(Schema.isLessThanOrEqualTo(100)),\n maximumDeliveryAttempts: Positive.check(Schema.isLessThanOrEqualTo(5)),\n deliveryClaimMillis: Millis,\n deliveryRetryMillis: Millis,\n /** Retain request fingerprints and terminal generations through this retry horizon. */\n requestRetentionMillis: Millis,\n abuse: ProofAbusePolicy,\n});\n\nexport type ProofPolicy = typeof ProofPolicy.Type;\n\nexport const validateProofPolicy = Effect.fn(\"validateProofPolicy\")(function* (input: ProofPolicy) {\n const policy = yield* Schema.decodeEffect(ProofPolicy)(input).pipe(\n Effect.mapError(() => ProofConfigurationError.make({ reason: \"policy\" })),\n );\n\n if (\n policy.requestRetentionMillis <\n Math.max(\n policy.lifetimeMillis,\n policy.continuationLifetimeMillis,\n policy.abuse.issues.windowMillis,\n policy.abuse.attempts.windowMillis,\n policy.abuse.subjectIssues.windowMillis,\n policy.abuse.subjectAttempts.windowMillis,\n policy.abuse.actionIssues.windowMillis,\n policy.abuse.actionAttempts.windowMillis,\n ) ||\n policy.deliveryClaimMillis >= policy.lifetimeMillis ||\n policy.abuse.resendCooldownMillis >= policy.lifetimeMillis\n )\n return yield* ProofConfigurationError.make({ reason: \"policy\" });\n\n return Object.freeze({\n ...policy,\n abuse: Object.freeze({\n ...policy.abuse,\n issues: Object.freeze(policy.abuse.issues),\n attempts: Object.freeze(policy.abuse.attempts),\n subjectIssues: Object.freeze(policy.abuse.subjectIssues),\n subjectAttempts: Object.freeze(policy.abuse.subjectAttempts),\n actionIssues: Object.freeze(policy.abuse.actionIssues),\n actionAttempts: Object.freeze(policy.abuse.actionAttempts),\n }),\n });\n});\n"],"mappings":";;;AAIA,MAAM,WAAW,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;AACzD,MAAM,SAAS,SAAS,MAAM,OAAO,oBAAoB,MAAU,CAAC;AAEpE,MAAa,cAAc,OAAO,OAAO;CACvC,OAAO,SAAS,MAAM,OAAO,oB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,OAAO,MAAM,YAAY;GACrD,gBAAgB,OAAO,OAAO,OAAO,MAAM,cAAc;EAC3D,CAAC;CACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SubjectId } from "../Schema.mjs";
|
|
2
|
+
import { AuthenticationEvidence, AuthenticationRequirement, AuthenticationRevision, PendingConsumption } from "./models.mjs";
|
|
3
|
+
import { PreparedCommit } from "../hooks/commit.mjs";
|
|
4
|
+
import { PrepareSessionCommit } from "./commit.mjs";
|
|
5
|
+
import { PendingAuthenticationInvalid, SessionUnavailable, StaleAuthentication } from "./errors.mjs";
|
|
6
|
+
import { Context, DateTime, Effect } from "effect";
|
|
7
|
+
//#region src/sessions/AuthenticationAuthority.d.ts
|
|
8
|
+
declare const AuthenticationAuthority_base: Context.ServiceClass<AuthenticationAuthority, "effect-auth/AuthenticationAuthority", {
|
|
9
|
+
/** Before verification, read active subject + these independently resolved credential IDs. */
|
|
10
|
+
readonly capture: (subjectId: SubjectId, credentialIds: ReadonlyArray<string>) => Effect.Effect<AuthenticationRevision, StaleAuthentication | SessionUnavailable>;
|
|
11
|
+
/** Reject unless the captured revision is still current; never refresh old evidence's revision. */
|
|
12
|
+
readonly requirements: (evidence: AuthenticationEvidence) => Effect.Effect<AuthenticationRequirement, StaleAuthentication | SessionUnavailable>;
|
|
13
|
+
/**
|
|
14
|
+
* Linearization point for fresh signed-session authentication. Check active
|
|
15
|
+
* subject, current factor policy/freshness, unexpired issuance, and exactly these revisions, consuming pending state in the same
|
|
16
|
+
* commit when provided. Re-read the clock at the conditional commit, never rely
|
|
17
|
+
* solely on the caller's pre-hook timestamp. Stateless verification and renewal never call this.
|
|
18
|
+
*/
|
|
19
|
+
readonly approve: <A>(input: {
|
|
20
|
+
readonly evidence: AuthenticationEvidence;
|
|
21
|
+
readonly now: DateTime.Utc;
|
|
22
|
+
readonly expiresAt: DateTime.Utc;
|
|
23
|
+
readonly absoluteExpiresAt: DateTime.Utc;
|
|
24
|
+
readonly pending?: PendingConsumption;
|
|
25
|
+
}, prepare: PrepareSessionCommit<void, A>) => Effect.Effect<PreparedCommit<A>, StaleAuthentication | PendingAuthenticationInvalid | SessionUnavailable>;
|
|
26
|
+
}>;
|
|
27
|
+
/** Subject status, factor policy, and revision are owned by the consumer's identity authority. */
|
|
28
|
+
declare class AuthenticationAuthority extends AuthenticationAuthority_base {}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { AuthenticationAuthority };
|
|
31
|
+
//# sourceMappingURL=AuthenticationAuthority.d.mts.map
|