@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,32 @@
|
|
|
1
|
+
import { CredentialSlot } from "../operations/credentials.mjs";
|
|
2
|
+
import { OperationHttpError } from "./errors.mjs";
|
|
3
|
+
import { Effect, Redacted } from "effect";
|
|
4
|
+
//#region src/http-operation/models.d.ts
|
|
5
|
+
type HttpCredentials = Readonly<Partial<Record<CredentialSlot, Redacted.Redacted<string>>>>;
|
|
6
|
+
interface OperationCookie {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly path: string;
|
|
9
|
+
readonly secure: boolean;
|
|
10
|
+
readonly sameSite: "lax" | "strict" | "none";
|
|
11
|
+
readonly domain?: string;
|
|
12
|
+
}
|
|
13
|
+
interface OperationHttpConfiguration {
|
|
14
|
+
readonly cookies: Readonly<Record<CredentialSlot, OperationCookie>>;
|
|
15
|
+
readonly trustedOrigins: ReadonlyArray<string>;
|
|
16
|
+
readonly csrfHeader: string;
|
|
17
|
+
readonly csrfValue: string;
|
|
18
|
+
readonly maximumBodyBytes: number;
|
|
19
|
+
readonly maximumUrlBytes: number;
|
|
20
|
+
/** The host decides its public origin. Forwarded headers have no authority by default. */
|
|
21
|
+
readonly publicOrigin: string | ((request: Request) => Effect.Effect<string, OperationHttpError>);
|
|
22
|
+
readonly native?: {
|
|
23
|
+
readonly modeHeader: string;
|
|
24
|
+
readonly requestHeaders: Readonly<Record<CredentialSlot, string>>;
|
|
25
|
+
readonly responseHeaders: Readonly<Record<CredentialSlot, string>>;
|
|
26
|
+
/** Explicit host admission; absence of Origin alone is not native authorization. */
|
|
27
|
+
readonly authorize: (request: Request) => Effect.Effect<void, OperationHttpError>;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { HttpCredentials, OperationCookie, OperationHttpConfiguration };
|
|
32
|
+
//# sourceMappingURL=models.d.mts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/http-operation/models.ts
|
|
2
|
+
const credentialSlots = [
|
|
3
|
+
"session",
|
|
4
|
+
"pending-proof",
|
|
5
|
+
"proof-continuation",
|
|
6
|
+
"registration",
|
|
7
|
+
"request-binding",
|
|
8
|
+
"session-step-up",
|
|
9
|
+
"password-intent"
|
|
10
|
+
];
|
|
11
|
+
//#endregion
|
|
12
|
+
export { credentialSlots };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=models.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.mjs","names":[],"sources":["../../src/http-operation/models.ts"],"sourcesContent":["import type { Effect, Redacted } from \"effect\";\n\nimport type { CredentialSlot } from \"../operations/credentials\";\nimport type { OperationHttpError } from \"./errors\";\n\nexport const credentialSlots = [\n \"session\",\n \"pending-proof\",\n \"proof-continuation\",\n \"registration\",\n \"request-binding\",\n \"session-step-up\",\n \"password-intent\",\n] as const;\n\nexport type HttpCredentials = Readonly<Partial<Record<CredentialSlot, Redacted.Redacted<string>>>>;\n\nexport interface OperationCookie {\n readonly name: string;\n readonly path: string;\n readonly secure: boolean;\n readonly sameSite: \"lax\" | \"strict\" | \"none\";\n readonly domain?: string;\n}\n\nexport interface OperationHttpConfiguration {\n readonly cookies: Readonly<Record<CredentialSlot, OperationCookie>>;\n readonly trustedOrigins: ReadonlyArray<string>;\n readonly csrfHeader: string;\n readonly csrfValue: string;\n readonly maximumBodyBytes: number;\n readonly maximumUrlBytes: number;\n /** The host decides its public origin. Forwarded headers have no authority by default. */\n readonly publicOrigin: string | ((request: Request) => Effect.Effect<string, OperationHttpError>);\n readonly native?: {\n readonly modeHeader: string;\n readonly requestHeaders: Readonly<Record<CredentialSlot, string>>;\n readonly responseHeaders: Readonly<Record<CredentialSlot, string>>;\n /** Explicit host admission; absence of Origin alone is not native authorization. */\n readonly authorize: (request: Request) => Effect.Effect<void, OperationHttpError>;\n };\n}\n"],"mappings":";AAKA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AuthRevealCommand } from "../operations/reveals.mjs";
|
|
2
|
+
import { credentialSlots } from "./models.mjs";
|
|
3
|
+
import { Redacted, Schema } from "effect";
|
|
4
|
+
//#region src/http-operation/private.ts
|
|
5
|
+
const CredentialWire = Schema.Union([Schema.TaggedStruct("Clear", {}), Schema.TaggedStruct("Issue", {
|
|
6
|
+
credential: Schema.NonEmptyString.check(Schema.isMaxLength(16384)),
|
|
7
|
+
expiresAtMillis: Schema.Int
|
|
8
|
+
})]);
|
|
9
|
+
const RevealWire = Schema.Struct({
|
|
10
|
+
kind: Schema.Literals(["totp-enrollment", "recovery-codes"]),
|
|
11
|
+
revealId: Schema.NonEmptyString,
|
|
12
|
+
expiresAtMillis: Schema.Int,
|
|
13
|
+
payload: Schema.Json
|
|
14
|
+
});
|
|
15
|
+
const credentialWire = (command) => command._tag === "Clear" ? { _tag: "Clear" } : {
|
|
16
|
+
_tag: "Issue",
|
|
17
|
+
credential: Redacted.value(command.credential),
|
|
18
|
+
expiresAtMillis: command.expiresAtMillis
|
|
19
|
+
};
|
|
20
|
+
const revealWire = (command) => ({
|
|
21
|
+
kind: command.kind,
|
|
22
|
+
revealId: command.revealId,
|
|
23
|
+
expiresAtMillis: command.expiresAtMillis,
|
|
24
|
+
payload: command.kind === "totp-enrollment" ? { ...Redacted.value(command.payload) } : [...Redacted.value(command.payload)]
|
|
25
|
+
});
|
|
26
|
+
const decodeRevealWire = (value) => {
|
|
27
|
+
return Schema.decodeUnknownSync(AuthRevealCommand)({
|
|
28
|
+
...value,
|
|
29
|
+
payload: Redacted.make(value.payload)
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { CredentialWire, RevealWire, credentialSlots, credentialWire, decodeRevealWire, revealWire };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=private.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private.mjs","names":[],"sources":["../../src/http-operation/private.ts"],"sourcesContent":["import { Redacted, Schema } from \"effect\";\n\nimport type { AuthCredentialCommand } from \"../operations/credentials\";\nimport { AuthRevealCommand, type AuthRevealKind } from \"../operations/reveals\";\nimport { credentialSlots } from \"./models\";\n\nexport const CredentialWire = Schema.Union([\n Schema.TaggedStruct(\"Clear\", {}),\n Schema.TaggedStruct(\"Issue\", {\n credential: Schema.NonEmptyString.check(Schema.isMaxLength(16384)),\n expiresAtMillis: Schema.Int,\n }),\n]);\n\nexport const RevealWire = Schema.Struct({\n kind: Schema.Literals([\"totp-enrollment\", \"recovery-codes\"]),\n revealId: Schema.NonEmptyString,\n expiresAtMillis: Schema.Int,\n payload: Schema.Json,\n});\n\nexport const credentialWire = (command: AuthCredentialCommand) =>\n command._tag === \"Clear\"\n ? { _tag: \"Clear\" as const }\n : {\n _tag: \"Issue\" as const,\n credential: Redacted.value(command.credential),\n expiresAtMillis: command.expiresAtMillis,\n };\n\nexport const revealWire = (command: AuthRevealCommand): typeof RevealWire.Type => ({\n kind: command.kind,\n revealId: command.revealId,\n expiresAtMillis: command.expiresAtMillis,\n payload:\n command.kind === \"totp-enrollment\"\n ? { ...Redacted.value(command.payload) }\n : [...Redacted.value(command.payload)],\n});\n\nexport const decodeRevealWire = (value: typeof RevealWire.Type): AuthRevealCommand => {\n // oxlint-disable-next-line no-restricted-properties -- raw private transport payload is validated before constructing the redacted boundary.\n return Schema.decodeUnknownSync(AuthRevealCommand)({\n ...value,\n payload: Redacted.make(value.payload),\n });\n};\n\nexport type PrivateKinds = ReadonlyArray<AuthRevealKind>;\nexport { credentialSlots };\n"],"mappings":";;;;AAMA,MAAa,iBAAiB,OAAO,MAAM,CACzC,OAAO,aAAa,SAAS,CAAC,CAAC,GAC/B,OAAO,aAAa,SAAS;CAC3B,YAAY,OAAO,eAAe,MAAM,OAAO,YAAY,KAAK,CAAC;CACjE,iBAAiB,OAAO;AAC1B,CAAC,CACH,CAAC;AAED,MAAa,aAAa,OAAO,OAAO;CACtC,MAAM,OAAO,SAAS,CAAC,mBAAmB,gBAAgB,CAAC;CAC3D,UAAU,OAAO;CACjB,iBAAiB,OAAO;CACxB,SAAS,OAAO;AAClB,CAAC;AAED,MAAa,kBAAkB,YAC7B,QAAQ,SAAS,UACb,EAAE,MAAM,QAAiB,IACzB;CACE,MAAM;CACN,YAAY,SAAS,MAAM,QAAQ,UAAU;CAC7C,iBAAiB,QAAQ;AAC3B;AAEN,MAAa,cAAc,aAAwD;CACjF,MAAM,QAAQ;CACd,UAAU,QAAQ;CAClB,iBAAiB,QAAQ;CACzB,SACE,QAAQ,SAAS,oBACb,EAAE,GAAG,SAAS,MAAM,QAAQ,OAAO,EAAE,IACrC,CAAC,GAAG,SAAS,MAAM,QAAQ,OAAO,CAAC;AAC3C;AAEA,MAAa,oBAAoB,UAAqD;CAEpF,OAAO,OAAO,kBAAkB,iBAAiB,CAAC,CAAC;EACjD,GAAG;EACH,SAAS,SAAS,KAAK,MAAM,OAAO;CACtC,CAAC;AACH"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { OperationHttpError } from "./errors.mjs";
|
|
2
|
+
import { credentialSlots } from "./models.mjs";
|
|
3
|
+
import { origin } from "./configuration-schema.mjs";
|
|
4
|
+
import { OperationHttpServerConfig } from "./OperationHttpServerConfig.mjs";
|
|
5
|
+
import { Effect, Redacted, Schema } from "effect";
|
|
6
|
+
import { Cookies } from "effect/unstable/http";
|
|
7
|
+
//#region src/http-operation/security.ts
|
|
8
|
+
/** Browser mutation admission is independent of body encoding. */
|
|
9
|
+
const mutationSecurity = Effect.fn("OperationHttp.mutationSecurity")(function* (request) {
|
|
10
|
+
const config = yield* OperationHttpServerConfig;
|
|
11
|
+
const requestOrigin = request.headers.get("origin");
|
|
12
|
+
if ([
|
|
13
|
+
"GET",
|
|
14
|
+
"HEAD",
|
|
15
|
+
"OPTIONS"
|
|
16
|
+
].includes(request.method) || requestOrigin === null || !config.trustedOrigins.includes(requestOrigin)) return yield* OperationHttpError.make({ reason: "origin" });
|
|
17
|
+
if (request.headers.get(config.csrfHeader) !== config.csrfValue) return yield* OperationHttpError.make({ reason: "csrf" });
|
|
18
|
+
});
|
|
19
|
+
const requestSecurity = Effect.fn("OperationHttp.requestSecurity")(function* (request, kind) {
|
|
20
|
+
const config = yield* OperationHttpServerConfig;
|
|
21
|
+
const publicOrigin = typeof config.publicOrigin === "string" ? config.publicOrigin : yield* config.publicOrigin(request);
|
|
22
|
+
if (!Schema.is(origin)(publicOrigin)) return yield* OperationHttpError.make({ reason: "origin" });
|
|
23
|
+
const requestOrigin = request.headers.get("origin");
|
|
24
|
+
const native = config.native !== void 0 && request.headers.get(config.native.modeHeader) === "native";
|
|
25
|
+
if (native) {
|
|
26
|
+
if (kind === "callback" || requestOrigin !== null || request.headers.has("sec-fetch-mode") || request.headers.has("cookie")) return yield* OperationHttpError.make({ reason: "origin" });
|
|
27
|
+
yield* config.native.authorize(request);
|
|
28
|
+
} else if (kind === "operation") {
|
|
29
|
+
yield* mutationSecurity(request);
|
|
30
|
+
if (request.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase() !== "application/json") return yield* OperationHttpError.make({ reason: "csrf" });
|
|
31
|
+
}
|
|
32
|
+
if (kind === "read" && requestOrigin !== null && !config.trustedOrigins.includes(requestOrigin)) return yield* OperationHttpError.make({ reason: "origin" });
|
|
33
|
+
const rawCookie = request.headers.get("cookie") ?? "";
|
|
34
|
+
if (rawCookie.length > 65536) return yield* OperationHttpError.make({ reason: "too-large" });
|
|
35
|
+
const parsed = Cookies.parseHeader(rawCookie);
|
|
36
|
+
const credentials = {};
|
|
37
|
+
for (const slot of credentialSlots) {
|
|
38
|
+
const configured = config.cookies[slot];
|
|
39
|
+
if (rawCookie.split(";").filter((part) => part.trim().split("=", 1)[0] === configured.name).length > 1) return yield* OperationHttpError.make({ reason: "credentials" });
|
|
40
|
+
const header = config.native === void 0 ? null : request.headers.get(config.native.requestHeaders[slot]);
|
|
41
|
+
if (!native && header !== null) return yield* OperationHttpError.make({ reason: "credentials" });
|
|
42
|
+
const value = native ? header : parsed[configured.name];
|
|
43
|
+
if (value !== null && value !== void 0) {
|
|
44
|
+
if (value.length === 0 || value.length > 16384 || /[\r\n]/.test(value)) return yield* OperationHttpError.make({ reason: "credentials" });
|
|
45
|
+
credentials[slot] = Redacted.make(value);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
native,
|
|
50
|
+
credentials: Object.freeze(credentials),
|
|
51
|
+
publicOrigin,
|
|
52
|
+
requestOrigin
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
//#endregion
|
|
56
|
+
export { mutationSecurity, requestSecurity };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=security.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.mjs","names":[],"sources":["../../src/http-operation/security.ts"],"sourcesContent":["import { Effect, Redacted, Schema } from \"effect\";\nimport { Cookies } from \"effect/unstable/http\";\n\nimport type { CredentialSlot } from \"../operations/credentials\";\nimport { origin } from \"./configuration-schema\";\nimport { OperationHttpError } from \"./errors\";\nimport { credentialSlots } from \"./models\";\nimport { OperationHttpServerConfig } from \"./OperationHttpServerConfig\";\n\n/** Browser mutation admission is independent of body encoding. */\nexport const mutationSecurity = Effect.fn(\"OperationHttp.mutationSecurity\")(function* (\n request: Request,\n) {\n const config = yield* OperationHttpServerConfig;\n const requestOrigin = request.headers.get(\"origin\");\n\n if (\n [\"GET\", \"HEAD\", \"OPTIONS\"].includes(request.method) ||\n requestOrigin === null ||\n !config.trustedOrigins.includes(requestOrigin)\n )\n return yield* OperationHttpError.make({ reason: \"origin\" });\n if (request.headers.get(config.csrfHeader) !== config.csrfValue)\n return yield* OperationHttpError.make({ reason: \"csrf\" });\n});\n\nexport const requestSecurity = Effect.fn(\"OperationHttp.requestSecurity\")(function* (\n request: Request,\n kind: \"operation\" | \"callback\" | \"read\" | \"request\",\n) {\n const config = yield* OperationHttpServerConfig;\n\n const publicOrigin =\n typeof config.publicOrigin === \"string\"\n ? config.publicOrigin\n : yield* config.publicOrigin(request);\n\n if (!Schema.is(origin)(publicOrigin)) return yield* OperationHttpError.make({ reason: \"origin\" });\n const requestOrigin = request.headers.get(\"origin\");\n\n const native =\n config.native !== undefined && request.headers.get(config.native.modeHeader) === \"native\";\n\n if (native) {\n if (\n kind === \"callback\" ||\n requestOrigin !== null ||\n request.headers.has(\"sec-fetch-mode\") ||\n request.headers.has(\"cookie\")\n )\n return yield* OperationHttpError.make({ reason: \"origin\" });\n yield* config.native!.authorize(request);\n } else if (kind === \"operation\") {\n yield* mutationSecurity(request);\n if (\n request.headers.get(\"content-type\")?.split(\";\")[0]?.trim().toLowerCase() !==\n \"application/json\"\n )\n return yield* OperationHttpError.make({ reason: \"csrf\" });\n }\n if (kind === \"read\" && requestOrigin !== null && !config.trustedOrigins.includes(requestOrigin))\n return yield* OperationHttpError.make({ reason: \"origin\" });\n const rawCookie = request.headers.get(\"cookie\") ?? \"\";\n\n if (rawCookie.length > 65536) return yield* OperationHttpError.make({ reason: \"too-large\" });\n const parsed = Cookies.parseHeader(rawCookie);\n const credentials: Partial<Record<CredentialSlot, Redacted.Redacted<string>>> = {};\n\n for (const slot of credentialSlots) {\n const configured = config.cookies[slot];\n\n const cookies = rawCookie\n .split(\";\")\n .filter((part) => part.trim().split(\"=\", 1)[0] === configured.name);\n\n if (cookies.length > 1) return yield* OperationHttpError.make({ reason: \"credentials\" });\n\n const header =\n config.native === undefined ? null : request.headers.get(config.native.requestHeaders[slot]);\n\n if (!native && header !== null)\n return yield* OperationHttpError.make({ reason: \"credentials\" });\n const value = native ? header : parsed[configured.name];\n\n if (value !== null && value !== undefined) {\n if (value.length === 0 || value.length > 16384 || /[\\r\\n]/.test(value))\n return yield* OperationHttpError.make({ reason: \"credentials\" });\n credentials[slot] = Redacted.make(value);\n }\n }\n\n return { native, credentials: Object.freeze(credentials), publicOrigin, requestOrigin };\n});\n"],"mappings":";;;;;;;;AAUA,MAAa,mBAAmB,OAAO,GAAG,gCAAgC,CAAC,CAAC,WAC1E,SACA;CACA,MAAM,SAAS,OAAO;CACtB,MAAM,gBAAgB,QAAQ,QAAQ,IAAI,QAAQ;CAElD,IACE;EAAC;EAAO;EAAQ;CAAS,CAAC,CAAC,SAAS,QAAQ,MAAM,KAClD,kBAAkB,QAClB,CAAC,OAAO,eAAe,SAAS,aAAa,GAE7C,OAAO,OAAO,mBAAmB,KAAK,EAAE,QAAQ,SAAS,CAAC;CAC5D,IAAI,QAAQ,QAAQ,IAAI,OAAO,UAAU,MAAM,OAAO,WACpD,OAAO,OAAO,mBAAmB,KAAK,EAAE,QAAQ,OAAO,CAAC;AAC5D,CAAC;AAED,MAAa,kBAAkB,OAAO,GAAG,+BA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;EAMlC,IAJgB,UACb,MAAM,GAAG,CAAC,CACV,QAAQ,SAAS,KAAK,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,OAAO,WAAW,IAEtD,CAAC,CAAC,SAAS,GAAG,OAAO,OAAO,mBAAmB,KAAK,EAAE,QAAQ,cAAc,CAAC;EAEvF,MAAM,SACJ,OAAO,WAAW,KAAA,IAAY,OAAO,QAAQ,QAAQ,IAAI,OAAO,OAAO,eAAe,KAAK;EAE7F,IAAI,CAAC,UAAU,WAAW,MACxB,OAAO,OAAO,mBAAmB,KAAK,EAAE,QAAQ,cAAc,CAAC;EACjE,MAAM,QAAQ,SAAS,SAAS,OAAO,WAAW;EAElD,IAAI,UAAU,QAAQ,UAAU,KAAA,GAAW;GACzC,IAAI,MAAM,WAAW,KAAK,MAAM,SAAS,SAAS,SAAS,KAAK,KAAK,GACnE,OAAO,OAAO,mBAAmB,KAAK,EAAE,QAAQ,cAAc,CAAC;GACjE,YAAY,QAAQ,SAAS,KAAK,KAAK;EACzC;CACF;CAEA,OAAO;EAAE;EAAQ,aAAa,OAAO,OAAO,WAAW;EAAG;EAAc;CAAc;AACxF,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AuthCredentialCommandCollector, AuthRevealCommandCollectorService } from "../operations/credentials.mjs";
|
|
2
|
+
import { AnyRoute } from "./contract.mjs";
|
|
3
|
+
import { OperationHttpConfigurationError, OperationHttpError } from "./errors.mjs";
|
|
4
|
+
import { HttpCredentials } from "./models.mjs";
|
|
5
|
+
import { AuthRequest } from "../auth/AuthRequest.mjs";
|
|
6
|
+
import { OperationHttpInvocation } from "./OperationHttpInvocation.mjs";
|
|
7
|
+
import { OperationHttpServerConfig } from "./OperationHttpServerConfig.mjs";
|
|
8
|
+
import { Effect, Scope } from "effect";
|
|
9
|
+
//#region src/http-operation/server.d.ts
|
|
10
|
+
interface OAuthHttpCallback {
|
|
11
|
+
readonly route: AnyRoute;
|
|
12
|
+
readonly path: string;
|
|
13
|
+
readonly provider: string;
|
|
14
|
+
readonly callbackId: string;
|
|
15
|
+
/** Resolve the original public flow ID from application-owned callback custody.
|
|
16
|
+
* The operation independently authenticates its state and private request binder. */
|
|
17
|
+
readonly flowId: (request: Request, credentials: HttpCredentials) => Effect.Effect<string, OperationHttpError>;
|
|
18
|
+
readonly allowedRedirectOrigins: ReadonlyArray<string>;
|
|
19
|
+
readonly allowedQueryParameters?: ReadonlyArray<string>;
|
|
20
|
+
}
|
|
21
|
+
declare const oauthCallback: <R extends AnyRoute>(route: R, options: Omit<OAuthHttpCallback, "route">) => OAuthHttpCallback & {
|
|
22
|
+
readonly route: R;
|
|
23
|
+
};
|
|
24
|
+
declare const make: <const Routes extends Readonly<Record<string, AnyRoute>>, const Callbacks extends ReadonlyArray<OAuthHttpCallback> = readonly []>(contract: {
|
|
25
|
+
readonly routes: Routes;
|
|
26
|
+
}, options?: {
|
|
27
|
+
readonly callbacks?: Callbacks;
|
|
28
|
+
}) => Effect.Effect<{
|
|
29
|
+
handle: (request: Request) => Effect.Effect<Response, never, never>;
|
|
30
|
+
}, OperationHttpConfigurationError, OperationHttpInvocation | OperationHttpServerConfig | Exclude<(Routes[keyof Routes] | Callbacks[number]["route"])["operation"]["rpc"]["errorSchema"]["EncodingServices"], AuthCredentialCommandCollector | AuthRequest | AuthRevealCommandCollectorService | Scope.Scope> | Exclude<(Routes[keyof Routes] | Callbacks[number]["route"])["operation"]["rpc"]["successSchema"]["EncodingServices"], AuthCredentialCommandCollector | AuthRequest | AuthRevealCommandCollectorService | Scope.Scope> | Exclude<Effect.Services<ReturnType<(Routes[keyof Routes] | Callbacks[number]["route"])["operation"]["invokeUnknown"]>>, AuthCredentialCommandCollector | AuthRequest | AuthRevealCommandCollectorService | Scope.Scope>>;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { OAuthHttpCallback, make, oauthCallback };
|
|
33
|
+
//# sourceMappingURL=server.d.mts.map
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { HookDenied } from "../hooks/models.mjs";
|
|
2
|
+
import { reportAuthFailure } from "../internal/diagnostics.mjs";
|
|
3
|
+
import { AuthCredentialCommandCollector, AuthRevealCommandCollectorService } from "../operations/credentials.mjs";
|
|
4
|
+
import { AuthRequest } from "../auth/AuthRequest.mjs";
|
|
5
|
+
import { OperationHttpConfigurationError, OperationHttpError } from "./errors.mjs";
|
|
6
|
+
import { CredentialWire, RevealWire, credentialWire, revealWire } from "./private.mjs";
|
|
7
|
+
import { HttpRequestBody } from "./contract.mjs";
|
|
8
|
+
import { OperationHttpInvocation } from "./OperationHttpInvocation.mjs";
|
|
9
|
+
import { OperationHttpServerConfig } from "./OperationHttpServerConfig.mjs";
|
|
10
|
+
import { requestSecurity } from "./security.mjs";
|
|
11
|
+
import { Cause, Context, DateTime, Duration, Effect, Redacted, Schema, SchemaAST, Scope } from "effect";
|
|
12
|
+
import { Cookies } from "effect/unstable/http";
|
|
13
|
+
//#region src/http-operation/server.ts
|
|
14
|
+
const responseSchema = Schema.Union([
|
|
15
|
+
Schema.TaggedStruct("Success", {
|
|
16
|
+
value: Schema.optionalKey(Schema.Json),
|
|
17
|
+
private: Schema.optionalKey(Schema.Array(RevealWire))
|
|
18
|
+
}),
|
|
19
|
+
Schema.TaggedStruct("Failure", { error: Schema.Json }),
|
|
20
|
+
Schema.TaggedStruct("TransportFailure", { reason: Schema.String })
|
|
21
|
+
]);
|
|
22
|
+
const encodeResponse = Schema.encodeEffect(Schema.fromJsonString(responseSchema));
|
|
23
|
+
const encodeCredential = Schema.encodeSync(Schema.fromJsonString(CredentialWire));
|
|
24
|
+
const oauthCallback = (route, options) => {
|
|
25
|
+
if (!options.path.startsWith("/") || options.path.includes("?") || !Object.values(route.credentials).includes("request-binding") || route.operation.replay !== "single-use") throw OperationHttpConfigurationError.make({ reason: "callback" });
|
|
26
|
+
return Object.freeze({
|
|
27
|
+
...options,
|
|
28
|
+
route,
|
|
29
|
+
allowedRedirectOrigins: Object.freeze([...options.allowedRedirectOrigins]),
|
|
30
|
+
...options.allowedQueryParameters === void 0 ? {} : { allowedQueryParameters: Object.freeze([...options.allowedQueryParameters]) }
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const boundedText = Effect.fn("OperationHttp.boundedText")(function* (request, maximum) {
|
|
34
|
+
return yield* Effect.tryPromise({
|
|
35
|
+
try: async (signal) => {
|
|
36
|
+
if (request.body === null) return "";
|
|
37
|
+
const reader = request.body.getReader();
|
|
38
|
+
const chunks = [];
|
|
39
|
+
let bytes = 0;
|
|
40
|
+
const abort = () => {
|
|
41
|
+
reader.cancel();
|
|
42
|
+
};
|
|
43
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
44
|
+
try {
|
|
45
|
+
while (true) {
|
|
46
|
+
const next = await reader.read();
|
|
47
|
+
if (next.done) break;
|
|
48
|
+
bytes += next.value.byteLength;
|
|
49
|
+
if (bytes > maximum) {
|
|
50
|
+
await reader.cancel();
|
|
51
|
+
throw OperationHttpError.make({ reason: "too-large" });
|
|
52
|
+
}
|
|
53
|
+
chunks.push(next.value);
|
|
54
|
+
}
|
|
55
|
+
const output = new Uint8Array(bytes);
|
|
56
|
+
let offset = 0;
|
|
57
|
+
for (const chunk of chunks) {
|
|
58
|
+
output.set(chunk, offset);
|
|
59
|
+
offset += chunk.byteLength;
|
|
60
|
+
}
|
|
61
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(output);
|
|
62
|
+
} finally {
|
|
63
|
+
signal.removeEventListener("abort", abort);
|
|
64
|
+
reader.releaseLock();
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
catch: (error) => Schema.is(OperationHttpError)(error) ? error : OperationHttpError.make({ reason: "request" })
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
const baseHeaders = () => new Headers({
|
|
71
|
+
"content-type": "application/json; charset=utf-8",
|
|
72
|
+
"cache-control": "no-store",
|
|
73
|
+
pragma: "no-cache",
|
|
74
|
+
"referrer-policy": "no-referrer",
|
|
75
|
+
"x-content-type-options": "nosniff",
|
|
76
|
+
"content-security-policy": "default-src 'none'; frame-ancestors 'none'",
|
|
77
|
+
vary: "Origin"
|
|
78
|
+
});
|
|
79
|
+
const failResponse = (error) => Effect.map(encodeResponse({
|
|
80
|
+
_tag: "TransportFailure",
|
|
81
|
+
reason: error.reason
|
|
82
|
+
}), (body) => new Response(body, {
|
|
83
|
+
status: error.reason === "not-found" ? 404 : error.reason === "method" ? 405 : error.reason === "too-large" ? 413 : error.reason === "unavailable" ? 503 : error.reason === "origin" || error.reason === "csrf" ? 403 : 400,
|
|
84
|
+
headers: baseHeaders()
|
|
85
|
+
})).pipe(Effect.orDie);
|
|
86
|
+
const callbackPayload = Effect.fn("OperationHttp.callbackPayload")(function* (callback, request, credentials, url) {
|
|
87
|
+
const allowed = /* @__PURE__ */ new Set([
|
|
88
|
+
"state",
|
|
89
|
+
"code",
|
|
90
|
+
"error",
|
|
91
|
+
"error_description",
|
|
92
|
+
"error_uri",
|
|
93
|
+
"iss",
|
|
94
|
+
...callback.allowedQueryParameters ?? []
|
|
95
|
+
]);
|
|
96
|
+
const seen = /* @__PURE__ */ new Set();
|
|
97
|
+
for (const [name, value] of url.searchParams) {
|
|
98
|
+
if (!allowed.has(name) || seen.has(name) || value.length > 4096) return yield* OperationHttpError.make({ reason: "request" });
|
|
99
|
+
seen.add(name);
|
|
100
|
+
}
|
|
101
|
+
const state = url.searchParams.get("state");
|
|
102
|
+
const code = url.searchParams.get("code");
|
|
103
|
+
const error = url.searchParams.get("error");
|
|
104
|
+
if (state === null || state.length === 0 || state.length > 2048 || code === null === (error === null)) return yield* OperationHttpError.make({ reason: "request" });
|
|
105
|
+
const issuer = url.searchParams.get("iss");
|
|
106
|
+
const response = code === null ? {
|
|
107
|
+
_tag: "Error",
|
|
108
|
+
state,
|
|
109
|
+
error: error === "access_denied" ? "access-denied" : "rejected",
|
|
110
|
+
...issuer === null ? {} : { issuer }
|
|
111
|
+
} : {
|
|
112
|
+
_tag: "Code",
|
|
113
|
+
state,
|
|
114
|
+
code,
|
|
115
|
+
...issuer === null ? {} : { issuer }
|
|
116
|
+
};
|
|
117
|
+
return {
|
|
118
|
+
flowId: yield* callback.flowId(request, credentials),
|
|
119
|
+
provider: callback.provider,
|
|
120
|
+
callbackId: callback.callbackId,
|
|
121
|
+
response
|
|
122
|
+
};
|
|
123
|
+
});
|
|
124
|
+
const inject = (route, input, credentials) => Effect.try({
|
|
125
|
+
try: () => {
|
|
126
|
+
const fields = Object.entries(route.credentials);
|
|
127
|
+
if (fields.length === 0) return input;
|
|
128
|
+
const output = { ...Schema.decodeUnknownSync(Schema.Record(Schema.String, Schema.Unknown))(input) };
|
|
129
|
+
for (const [field, slot] of fields) {
|
|
130
|
+
if (Object.hasOwn(output, field)) throw new Error();
|
|
131
|
+
const credential = credentials[slot];
|
|
132
|
+
if (credential === void 0) throw new Error();
|
|
133
|
+
output[field] = Redacted.value(credential);
|
|
134
|
+
}
|
|
135
|
+
return output;
|
|
136
|
+
},
|
|
137
|
+
catch: () => OperationHttpError.make({ reason: "credentials" })
|
|
138
|
+
});
|
|
139
|
+
const applyCommands = Effect.fn("OperationHttp.applyCommands")(function* (headers, commands, config, native) {
|
|
140
|
+
const now = DateTime.toEpochMillis(yield* DateTime.now);
|
|
141
|
+
for (const command of commands) if (native) headers.set(config.native.responseHeaders[command.slot], encodeCredential(credentialWire(command)));
|
|
142
|
+
else {
|
|
143
|
+
const cookie = config.cookies[command.slot];
|
|
144
|
+
const value = command._tag === "Issue" ? Redacted.value(command.credential) : "";
|
|
145
|
+
const maxAge = command._tag === "Issue" ? Math.max(0, command.expiresAtMillis - now) : 0;
|
|
146
|
+
headers.append("set-cookie", Cookies.serializeCookie(Cookies.makeCookieUnsafe(cookie.name, value, {
|
|
147
|
+
path: cookie.path,
|
|
148
|
+
secure: cookie.secure,
|
|
149
|
+
sameSite: cookie.sameSite,
|
|
150
|
+
httpOnly: true,
|
|
151
|
+
...cookie.domain === void 0 ? {} : { domain: cookie.domain },
|
|
152
|
+
maxAge: Duration.millis(maxAge)
|
|
153
|
+
})));
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
const make = (contract, options) => Effect.gen(function* () {
|
|
157
|
+
const services = yield* Effect.context();
|
|
158
|
+
const config = yield* OperationHttpServerConfig;
|
|
159
|
+
const invocation = yield* OperationHttpInvocation;
|
|
160
|
+
for (const route of Object.values(contract.routes)) if (route.method === "GET" && (route.operation.replay !== "read-only" || route.operation.credentials || route.reveals.length > 0 || route.operation.reveals.length > 0 || Object.keys(route.credentials).length > 0 || !(SchemaAST.isVoid(Schema.toEncoded(route.operation.rpc.payloadSchema).ast) || SchemaAST.isUndefined(Schema.toEncoded(route.operation.rpc.payloadSchema).ast)))) return yield* OperationHttpConfigurationError.make({ reason: "route" });
|
|
161
|
+
const routes = new Map(Object.values(contract.routes).map((route) => [route.path, route]));
|
|
162
|
+
const callbacks = /* @__PURE__ */ new Map();
|
|
163
|
+
for (const callback of options?.callbacks ?? []) {
|
|
164
|
+
if (callbacks.has(callback.path) || routes.has(callback.path)) return yield* OperationHttpConfigurationError.make({ reason: "duplicate-route" });
|
|
165
|
+
callbacks.set(callback.path, callback);
|
|
166
|
+
}
|
|
167
|
+
return { handle: Effect.fn("OperationHttp.handle")(function* (request) {
|
|
168
|
+
if (new TextEncoder().encode(request.url).byteLength > config.maximumUrlBytes) return yield* OperationHttpError.make({ reason: "too-large" });
|
|
169
|
+
const url = yield* Effect.try({
|
|
170
|
+
try: () => new URL(request.url),
|
|
171
|
+
catch: () => OperationHttpError.make({ reason: "request" })
|
|
172
|
+
});
|
|
173
|
+
const callback = callbacks.get(url.pathname);
|
|
174
|
+
const route = callback?.route ?? routes.get(url.pathname);
|
|
175
|
+
if (route === void 0) return yield* OperationHttpError.make({ reason: "not-found" });
|
|
176
|
+
if (request.method === "OPTIONS" && callback === void 0) {
|
|
177
|
+
const origin = request.headers.get("origin");
|
|
178
|
+
const requestedHeaders = (request.headers.get("access-control-request-headers") ?? "").toLowerCase().split(",").map((header) => header.trim()).filter(Boolean);
|
|
179
|
+
if (origin === null || !config.trustedOrigins.includes(origin)) return yield* OperationHttpError.make({ reason: "origin" });
|
|
180
|
+
if (url.search !== "" || request.headers.get("access-control-request-method") !== route.method || requestedHeaders.some((header) => header !== "content-type" && header !== config.csrfHeader)) return yield* OperationHttpError.make({ reason: "csrf" });
|
|
181
|
+
const headers = baseHeaders();
|
|
182
|
+
headers.set("access-control-allow-origin", origin);
|
|
183
|
+
headers.set("access-control-allow-credentials", "true");
|
|
184
|
+
headers.set("access-control-allow-methods", route.method);
|
|
185
|
+
headers.set("access-control-allow-headers", `content-type, ${config.csrfHeader}`);
|
|
186
|
+
headers.set("vary", "Origin, Access-Control-Request-Method, Access-Control-Request-Headers");
|
|
187
|
+
return new Response(null, {
|
|
188
|
+
status: 204,
|
|
189
|
+
headers
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
if (request.method !== (callback === void 0 ? route.method : "GET")) return yield* OperationHttpError.make({ reason: "method" });
|
|
193
|
+
if (callback === void 0 && url.search !== "") return yield* OperationHttpError.make({ reason: "request" });
|
|
194
|
+
const security = yield* requestSecurity(request, callback === void 0 ? route.method === "GET" ? "read" : "operation" : "callback");
|
|
195
|
+
const raw = callback === void 0 && route.method === "GET" ? void 0 : callback === void 0 ? (yield* Schema.decodeEffect(Schema.fromJsonString(HttpRequestBody))(yield* boundedText(request, config.maximumBodyBytes)).pipe(Effect.mapError(() => OperationHttpError.make({ reason: "request" })))).payload : yield* callbackPayload(callback, request, security.credentials, url);
|
|
196
|
+
const payload = yield* inject(route, raw, security.credentials);
|
|
197
|
+
const trusted = yield* invocation.resolve(request, security.credentials);
|
|
198
|
+
const commands = [];
|
|
199
|
+
const reveals = [];
|
|
200
|
+
const sink = (values) => Effect.sync(() => {
|
|
201
|
+
commands.push(...values);
|
|
202
|
+
});
|
|
203
|
+
const collector = {
|
|
204
|
+
supportedKinds: route.reveals,
|
|
205
|
+
accept: (values) => Effect.sync(() => {
|
|
206
|
+
reveals.push(...values);
|
|
207
|
+
})
|
|
208
|
+
};
|
|
209
|
+
const invoke = route.operation.invokeUnknown;
|
|
210
|
+
const call = invoke(trusted, payload);
|
|
211
|
+
const successSchema = route.operation.rpc.successSchema;
|
|
212
|
+
const errorSchema = route.operation.rpc.errorSchema;
|
|
213
|
+
const requestScope = yield* Effect.scope;
|
|
214
|
+
const requestServices = services.pipe(Context.add(Scope.Scope, requestScope), Context.add(AuthRequest, {
|
|
215
|
+
invocation: trusted,
|
|
216
|
+
...invocation.request === void 0 ? {} : { resolveInvocation: invocation.request(request, security.credentials) },
|
|
217
|
+
credentials: security.credentials,
|
|
218
|
+
beforeMutation: route.method === "GET" ? HookDenied.make({ reason: "policy" }) : Effect.void,
|
|
219
|
+
credentialCommandSink: sink,
|
|
220
|
+
revealCommandCollector: collector
|
|
221
|
+
}), Context.add(AuthCredentialCommandCollector, sink), Context.add(AuthRevealCommandCollectorService, collector));
|
|
222
|
+
const resolved = yield* Effect.result(call.pipe(Effect.provide(requestServices)));
|
|
223
|
+
const headers = baseHeaders();
|
|
224
|
+
if (security.requestOrigin !== null && config.trustedOrigins.includes(security.requestOrigin)) {
|
|
225
|
+
headers.set("access-control-allow-origin", security.requestOrigin);
|
|
226
|
+
headers.set("access-control-allow-credentials", "true");
|
|
227
|
+
}
|
|
228
|
+
if (resolved._tag === "Failure") {
|
|
229
|
+
const encoded = yield* Schema.encodeEffect(errorSchema)(resolved.failure).pipe(Effect.provide(requestServices), Effect.mapError(() => OperationHttpError.make({ reason: "response" })));
|
|
230
|
+
const error = yield* Schema.decodeUnknownEffect(Schema.Json)(encoded).pipe(Effect.mapError(() => OperationHttpError.make({ reason: "response" })));
|
|
231
|
+
return new Response(yield* encodeResponse({
|
|
232
|
+
_tag: "Failure",
|
|
233
|
+
error
|
|
234
|
+
}).pipe(Effect.orDie), {
|
|
235
|
+
status: 400,
|
|
236
|
+
headers
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
const encoded = yield* Schema.encodeEffect(successSchema)(resolved.success).pipe(Effect.provide(requestServices), Effect.mapError(() => OperationHttpError.make({ reason: "response" })));
|
|
240
|
+
const value = encoded === void 0 ? void 0 : yield* Schema.decodeUnknownEffect(Schema.Json)(encoded).pipe(Effect.mapError(() => OperationHttpError.make({ reason: "response" })));
|
|
241
|
+
yield* applyCommands(headers, commands, config, security.native);
|
|
242
|
+
if (callback !== void 0) {
|
|
243
|
+
const target = yield* Schema.decodeUnknownEffect(Schema.Struct({ returnTarget: Schema.String.check(Schema.isMaxLength(2048)) }))(encoded).pipe(Effect.mapError(() => OperationHttpError.make({ reason: "response" })));
|
|
244
|
+
const destination = yield* Effect.try({
|
|
245
|
+
try: () => new URL(target.returnTarget, security.publicOrigin),
|
|
246
|
+
catch: () => OperationHttpError.make({ reason: "response" })
|
|
247
|
+
});
|
|
248
|
+
if (destination.origin !== security.publicOrigin && !callback.allowedRedirectOrigins.includes(destination.origin) || !["https:", "http:"].includes(destination.protocol) || destination.username !== "" || destination.password !== "") return yield* OperationHttpError.make({ reason: "response" });
|
|
249
|
+
headers.set("location", destination.href);
|
|
250
|
+
return new Response(null, {
|
|
251
|
+
status: 303,
|
|
252
|
+
headers
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
return new Response(yield* encodeResponse({
|
|
256
|
+
_tag: "Success",
|
|
257
|
+
...value === void 0 ? {} : { value },
|
|
258
|
+
...reveals.length === 0 ? {} : { private: reveals.map(revealWire) }
|
|
259
|
+
}).pipe(Effect.orDie), {
|
|
260
|
+
status: 200,
|
|
261
|
+
headers
|
|
262
|
+
});
|
|
263
|
+
}, Effect.scoped, Effect.catch((error) => failResponse(Schema.is(OperationHttpError)(error) ? error : OperationHttpError.make({ reason: "unavailable" }))), Effect.catchCause((cause) => Cause.hasDies(cause) ? reportAuthFailure("http", cause).pipe(Effect.andThen(failResponse(OperationHttpError.make({ reason: "unavailable" })))) : Effect.failCause(cause)), Effect.provideService(OperationHttpServerConfig, config)) };
|
|
264
|
+
});
|
|
265
|
+
//#endregion
|
|
266
|
+
export { make, oauthCallback };
|
|
267
|
+
|
|
268
|
+
//# sourceMappingURL=server.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.mjs","names":[],"sources":["../../src/http-operation/server.ts"],"sourcesContent":["import {\n Cause,\n Context,\n DateTime,\n Duration,\n Effect,\n Redacted,\n Schema,\n SchemaAST,\n Scope,\n} from \"effect\";\nimport { Cookies } from \"effect/unstable/http\";\n\nimport { AuthRequest } from \"../auth/AuthRequest\";\nimport { HookDenied } from \"../hooks/models\";\nimport { reportAuthFailure } from \"../internal/diagnostics\";\nimport type { AuthInvocation } from \"../operations/context\";\nimport {\n AuthCredentialCommandCollector,\n AuthRevealCommandCollectorService,\n type AuthCredentialCommand,\n} from \"../operations/credentials\";\nimport type { AuthRevealCommand } from \"../operations/reveals\";\nimport {\n type AnyRoute,\n HttpRequestBody,\n type RouteRequirements,\n type RouteSuccess,\n type RouteFailure,\n} from \"./contract\";\nimport { OperationHttpConfigurationError, OperationHttpError } from \"./errors\";\nimport type { HttpCredentials, OperationHttpConfiguration } from \"./models\";\nimport { OperationHttpInvocation } from \"./OperationHttpInvocation\";\nimport { OperationHttpServerConfig } from \"./OperationHttpServerConfig\";\nimport { CredentialWire, RevealWire, credentialWire, revealWire } from \"./private\";\nimport { requestSecurity } from \"./security\";\n\nconst responseSchema = Schema.Union([\n Schema.TaggedStruct(\"Success\", {\n value: Schema.optionalKey(Schema.Json),\n private: Schema.optionalKey(Schema.Array(RevealWire)),\n }),\n Schema.TaggedStruct(\"Failure\", { error: Schema.Json }),\n Schema.TaggedStruct(\"TransportFailure\", { reason: Schema.String }),\n]);\n\nconst encodeResponse = Schema.encodeEffect(Schema.fromJsonString(responseSchema));\nconst encodeCredential = Schema.encodeSync(Schema.fromJsonString(CredentialWire));\n\nexport interface OAuthHttpCallback {\n readonly route: AnyRoute;\n readonly path: string;\n readonly provider: string;\n readonly callbackId: string;\n /** Resolve the original public flow ID from application-owned callback custody.\n * The operation independently authenticates its state and private request binder. */\n readonly flowId: (\n request: Request,\n credentials: HttpCredentials,\n ) => Effect.Effect<string, OperationHttpError>;\n readonly allowedRedirectOrigins: ReadonlyArray<string>;\n readonly allowedQueryParameters?: ReadonlyArray<string>;\n}\n\nexport const oauthCallback = <R extends AnyRoute>(\n route: R,\n options: Omit<OAuthHttpCallback, \"route\">,\n): OAuthHttpCallback & { readonly route: R } => {\n if (\n !options.path.startsWith(\"/\") ||\n options.path.includes(\"?\") ||\n !Object.values(route.credentials).includes(\"request-binding\") ||\n route.operation.replay !== \"single-use\"\n )\n throw OperationHttpConfigurationError.make({ reason: \"callback\" });\n\n return Object.freeze({\n ...options,\n route,\n allowedRedirectOrigins: Object.freeze([...options.allowedRedirectOrigins]),\n ...(options.allowedQueryParameters === undefined\n ? {}\n : { allowedQueryParameters: Object.freeze([...options.allowedQueryParameters]) }),\n });\n};\n\nconst boundedText = Effect.fn(\"OperationHttp.boundedText\")(function* (\n request: Request,\n maximum: number,\n) {\n return yield* Effect.tryPromise({\n try: async (signal) => {\n if (request.body === null) return \"\";\n const reader = request.body.getReader();\n const chunks: Uint8Array[] = [];\n let bytes = 0;\n\n const abort = () => {\n void reader.cancel();\n };\n\n signal.addEventListener(\"abort\", abort, { once: true });\n try {\n while (true) {\n const next = await reader.read();\n\n if (next.done) break;\n bytes += next.value.byteLength;\n if (bytes > maximum) {\n await reader.cancel();\n throw OperationHttpError.make({ reason: \"too-large\" });\n }\n chunks.push(next.value);\n }\n const output = new Uint8Array(bytes);\n let offset = 0;\n\n for (const chunk of chunks) {\n output.set(chunk, offset);\n offset += chunk.byteLength;\n }\n\n return new TextDecoder(\"utf-8\", { fatal: true }).decode(output);\n } finally {\n signal.removeEventListener(\"abort\", abort);\n reader.releaseLock();\n }\n },\n catch: (error) =>\n Schema.is(OperationHttpError)(error) ? error : OperationHttpError.make({ reason: \"request\" }),\n });\n});\n\nconst baseHeaders = () =>\n new Headers({\n \"content-type\": \"application/json; charset=utf-8\",\n \"cache-control\": \"no-store\",\n pragma: \"no-cache\",\n \"referrer-policy\": \"no-referrer\",\n \"x-content-type-options\": \"nosniff\",\n \"content-security-policy\": \"default-src 'none'; frame-ancestors 'none'\",\n vary: \"Origin\",\n });\n\nconst failResponse = (error: OperationHttpError) =>\n Effect.map(\n encodeResponse({ _tag: \"TransportFailure\", reason: error.reason }),\n (body) =>\n new Response(body, {\n status:\n error.reason === \"not-found\"\n ? 404\n : error.reason === \"method\"\n ? 405\n : error.reason === \"too-large\"\n ? 413\n : error.reason === \"unavailable\"\n ? 503\n : error.reason === \"origin\" || error.reason === \"csrf\"\n ? 403\n : 400,\n headers: baseHeaders(),\n }),\n ).pipe(Effect.orDie);\n\nconst callbackPayload = Effect.fn(\"OperationHttp.callbackPayload\")(function* (\n callback: OAuthHttpCallback,\n request: Request,\n credentials: HttpCredentials,\n url: URL,\n) {\n const allowed = new Set([\n \"state\",\n \"code\",\n \"error\",\n \"error_description\",\n \"error_uri\",\n \"iss\",\n ...(callback.allowedQueryParameters ?? []),\n ]);\n\n const seen = new Set<string>();\n\n for (const [name, value] of url.searchParams) {\n if (!allowed.has(name) || seen.has(name) || value.length > 4096)\n return yield* OperationHttpError.make({ reason: \"request\" });\n seen.add(name);\n }\n const state = url.searchParams.get(\"state\");\n const code = url.searchParams.get(\"code\");\n const error = url.searchParams.get(\"error\");\n\n if (\n state === null ||\n state.length === 0 ||\n state.length > 2048 ||\n (code === null) === (error === null)\n )\n return yield* OperationHttpError.make({ reason: \"request\" });\n const issuer = url.searchParams.get(\"iss\");\n\n const response =\n code === null\n ? {\n _tag: \"Error\",\n state,\n error: error === \"access_denied\" ? \"access-denied\" : \"rejected\",\n ...(issuer === null ? {} : { issuer }),\n }\n : { _tag: \"Code\", state, code, ...(issuer === null ? {} : { issuer }) };\n\n return {\n flowId: yield* callback.flowId(request, credentials),\n provider: callback.provider,\n callbackId: callback.callbackId,\n response,\n };\n});\n\nconst inject = (route: AnyRoute, input: unknown, credentials: HttpCredentials) =>\n Effect.try({\n try: () => {\n const fields = Object.entries(route.credentials);\n\n if (fields.length === 0) return input;\n\n const output = {\n // oxlint-disable-next-line no-restricted-properties -- untyped HTTP payload must be a record before injecting private fields.\n ...Schema.decodeUnknownSync(Schema.Record(Schema.String, Schema.Unknown))(input),\n };\n\n for (const [field, slot] of fields) {\n if (Object.hasOwn(output, field)) throw new Error();\n const credential = credentials[slot];\n\n if (credential === undefined) throw new Error();\n output[field] = Redacted.value(credential);\n }\n\n return output;\n },\n catch: () => OperationHttpError.make({ reason: \"credentials\" }),\n });\n\nconst applyCommands = Effect.fn(\"OperationHttp.applyCommands\")(function* (\n headers: Headers,\n commands: ReadonlyArray<AuthCredentialCommand>,\n config: OperationHttpConfiguration,\n native: boolean,\n) {\n const now = DateTime.toEpochMillis(yield* DateTime.now);\n\n for (const command of commands) {\n if (native) {\n headers.set(\n config.native!.responseHeaders[command.slot],\n encodeCredential(credentialWire(command)),\n );\n } else {\n const cookie = config.cookies[command.slot];\n const value = command._tag === \"Issue\" ? Redacted.value(command.credential) : \"\";\n const maxAge = command._tag === \"Issue\" ? Math.max(0, command.expiresAtMillis - now) : 0;\n\n headers.append(\n \"set-cookie\",\n Cookies.serializeCookie(\n Cookies.makeCookieUnsafe(cookie.name, value, {\n path: cookie.path,\n secure: cookie.secure,\n sameSite: cookie.sameSite,\n httpOnly: true,\n ...(cookie.domain === undefined ? {} : { domain: cookie.domain }),\n maxAge: Duration.millis(maxAge),\n }),\n ),\n );\n }\n }\n});\n\nexport const make = <\n const Routes extends Readonly<Record<string, AnyRoute>>,\n const Callbacks extends ReadonlyArray<OAuthHttpCallback> = readonly [],\n>(\n contract: { readonly routes: Routes },\n options?: { readonly callbacks?: Callbacks },\n) =>\n Effect.gen(function* () {\n type DispatchRoute = Routes[keyof Routes] | Callbacks[number][\"route\"];\n type Requirements = Exclude<\n RouteRequirements<DispatchRoute>,\n AuthRequest | AuthCredentialCommandCollector | AuthRevealCommandCollectorService | Scope.Scope\n >;\n const services = yield* Effect.context<Requirements>();\n const config = yield* OperationHttpServerConfig;\n const invocation = yield* OperationHttpInvocation;\n\n for (const route of Object.values(contract.routes)) {\n if (\n route.method === \"GET\" &&\n (route.operation.replay !== \"read-only\" ||\n route.operation.credentials ||\n route.reveals.length > 0 ||\n route.operation.reveals.length > 0 ||\n Object.keys(route.credentials).length > 0 ||\n !(\n SchemaAST.isVoid(Schema.toEncoded(route.operation.rpc.payloadSchema).ast) ||\n SchemaAST.isUndefined(Schema.toEncoded(route.operation.rpc.payloadSchema).ast)\n ))\n )\n return yield* OperationHttpConfigurationError.make({ reason: \"route\" });\n }\n const routes = new Map(Object.values(contract.routes).map((route) => [route.path, route]));\n const callbacks = new Map<string, OAuthHttpCallback>();\n\n for (const callback of options?.callbacks ?? []) {\n if (callbacks.has(callback.path) || routes.has(callback.path))\n return yield* OperationHttpConfigurationError.make({ reason: \"duplicate-route\" });\n callbacks.set(callback.path, callback);\n }\n\n const handle = Effect.fn(\"OperationHttp.handle\")(\n function* (request: Request) {\n if (new TextEncoder().encode(request.url).byteLength > config.maximumUrlBytes)\n return yield* OperationHttpError.make({ reason: \"too-large\" });\n\n const url = yield* Effect.try({\n try: () => new URL(request.url),\n catch: () => OperationHttpError.make({ reason: \"request\" }),\n });\n\n const callback = callbacks.get(url.pathname);\n const route = callback?.route ?? routes.get(url.pathname);\n\n if (route === undefined) return yield* OperationHttpError.make({ reason: \"not-found\" });\n if (request.method === \"OPTIONS\" && callback === undefined) {\n const origin = request.headers.get(\"origin\");\n\n const requestedHeaders = (request.headers.get(\"access-control-request-headers\") ?? \"\")\n .toLowerCase()\n .split(\",\")\n .map((header) => header.trim())\n .filter(Boolean);\n\n if (origin === null || !config.trustedOrigins.includes(origin))\n return yield* OperationHttpError.make({ reason: \"origin\" });\n if (\n url.search !== \"\" ||\n request.headers.get(\"access-control-request-method\") !== route.method ||\n requestedHeaders.some(\n (header) => header !== \"content-type\" && header !== config.csrfHeader,\n )\n )\n return yield* OperationHttpError.make({ reason: \"csrf\" });\n const headers = baseHeaders();\n\n headers.set(\"access-control-allow-origin\", origin);\n headers.set(\"access-control-allow-credentials\", \"true\");\n headers.set(\"access-control-allow-methods\", route.method);\n headers.set(\"access-control-allow-headers\", `content-type, ${config.csrfHeader}`);\n headers.set(\n \"vary\",\n \"Origin, Access-Control-Request-Method, Access-Control-Request-Headers\",\n );\n\n return new Response(null, { status: 204, headers });\n }\n if (request.method !== (callback === undefined ? route.method : \"GET\"))\n return yield* OperationHttpError.make({ reason: \"method\" });\n if (callback === undefined && url.search !== \"\")\n return yield* OperationHttpError.make({ reason: \"request\" });\n\n const security = yield* requestSecurity(\n request,\n callback === undefined ? (route.method === \"GET\" ? \"read\" : \"operation\") : \"callback\",\n );\n\n const raw =\n callback === undefined && route.method === \"GET\"\n ? undefined\n : callback === undefined\n ? (yield* Schema.decodeEffect(Schema.fromJsonString(HttpRequestBody))(\n yield* boundedText(request, config.maximumBodyBytes),\n ).pipe(Effect.mapError(() => OperationHttpError.make({ reason: \"request\" }))))\n .payload\n : yield* callbackPayload(callback, request, security.credentials, url);\n\n const payload = yield* inject(route, raw, security.credentials);\n const trusted = yield* invocation.resolve(request, security.credentials);\n const commands: AuthCredentialCommand[] = [];\n const reveals: AuthRevealCommand[] = [];\n\n const sink = (values: ReadonlyArray<AuthCredentialCommand>) =>\n Effect.sync(() => {\n commands.push(...values);\n });\n\n const collector = {\n supportedKinds: route.reveals,\n accept: (values: ReadonlyArray<AuthRevealCommand>) =>\n Effect.sync(() => {\n reveals.push(...values);\n }),\n };\n\n // The selected table entry couples its handler and codecs. The maker's\n // generic requirements retain every concrete entry before this dispatch.\n const invoke = route.operation.invokeUnknown as (\n invocation: AuthInvocation,\n input: unknown,\n ) => Effect.Effect<RouteSuccess<DispatchRoute>, RouteFailure<DispatchRoute>, Requirements>;\n\n const call = invoke(trusted, payload);\n\n const successSchema = route.operation.rpc.successSchema as Schema.Codec<\n RouteSuccess<DispatchRoute>,\n unknown,\n unknown,\n Requirements\n >;\n\n const errorSchema = route.operation.rpc.errorSchema as Schema.Codec<\n RouteFailure<DispatchRoute>,\n unknown,\n unknown,\n Requirements\n >;\n\n // Context captures retain all runtime entries, regardless of their static\n // requirement type. Replace request-owned services before every invocation\n // and wire projection so ambient collectors can never receive secrets.\n const requestScope = yield* Effect.scope;\n\n const requestServices = services.pipe(\n Context.add(Scope.Scope, requestScope),\n Context.add(AuthRequest, {\n invocation: trusted,\n ...(invocation.request === undefined\n ? {}\n : { resolveInvocation: invocation.request(request, security.credentials) }),\n credentials: security.credentials,\n beforeMutation:\n route.method === \"GET\" ? HookDenied.make({ reason: \"policy\" }) : Effect.void,\n credentialCommandSink: sink,\n revealCommandCollector: collector,\n }),\n Context.add(AuthCredentialCommandCollector, sink),\n Context.add(AuthRevealCommandCollectorService, collector),\n );\n\n const resolved = yield* Effect.result(call.pipe(Effect.provide(requestServices)));\n const headers = baseHeaders();\n\n if (\n security.requestOrigin !== null &&\n config.trustedOrigins.includes(security.requestOrigin)\n ) {\n headers.set(\"access-control-allow-origin\", security.requestOrigin);\n headers.set(\"access-control-allow-credentials\", \"true\");\n }\n if (resolved._tag === \"Failure\") {\n const encoded = yield* Schema.encodeEffect(errorSchema)(resolved.failure).pipe(\n Effect.provide(requestServices),\n Effect.mapError(() => OperationHttpError.make({ reason: \"response\" })),\n );\n\n // oxlint-disable-next-line no-restricted-properties -- an encoded operation error enters the JSON transport boundary.\n const error = yield* Schema.decodeUnknownEffect(Schema.Json)(encoded).pipe(\n Effect.mapError(() => OperationHttpError.make({ reason: \"response\" })),\n );\n\n return new Response(\n yield* encodeResponse({ _tag: \"Failure\", error }).pipe(Effect.orDie),\n { status: 400, headers },\n );\n }\n\n const encoded = yield* Schema.encodeEffect(successSchema)(resolved.success).pipe(\n Effect.provide(requestServices),\n Effect.mapError(() => OperationHttpError.make({ reason: \"response\" })),\n );\n\n const value =\n encoded === undefined\n ? undefined\n : // oxlint-disable-next-line no-restricted-properties -- schema-encoded success enters the JSON boundary.\n yield* Schema.decodeUnknownEffect(Schema.Json)(encoded).pipe(\n Effect.mapError(() => OperationHttpError.make({ reason: \"response\" })),\n );\n\n yield* applyCommands(headers, commands, config, security.native);\n if (callback !== undefined) {\n // oxlint-disable-next-line no-restricted-properties -- only the core-approved return target is projected from the callback result.\n const target = yield* Schema.decodeUnknownEffect(\n Schema.Struct({ returnTarget: Schema.String.check(Schema.isMaxLength(2048)) }),\n )(encoded).pipe(Effect.mapError(() => OperationHttpError.make({ reason: \"response\" })));\n\n const destination = yield* Effect.try({\n try: () => new URL(target.returnTarget, security.publicOrigin),\n catch: () => OperationHttpError.make({ reason: \"response\" }),\n });\n\n if (\n (destination.origin !== security.publicOrigin &&\n !callback.allowedRedirectOrigins.includes(destination.origin)) ||\n ![\"https:\", \"http:\"].includes(destination.protocol) ||\n destination.username !== \"\" ||\n destination.password !== \"\"\n )\n return yield* OperationHttpError.make({ reason: \"response\" });\n headers.set(\"location\", destination.href);\n\n return new Response(null, { status: 303, headers });\n }\n\n return new Response(\n yield* encodeResponse({\n _tag: \"Success\",\n ...(value === undefined ? {} : { value }),\n ...(reveals.length === 0 ? {} : { private: reveals.map(revealWire) }),\n }).pipe(Effect.orDie),\n { status: 200, headers },\n );\n },\n Effect.scoped,\n Effect.catch((error) =>\n failResponse(\n Schema.is(OperationHttpError)(error)\n ? error\n : OperationHttpError.make({ reason: \"unavailable\" }),\n ),\n ),\n Effect.catchCause((cause) =>\n Cause.hasDies(cause)\n ? reportAuthFailure(\"http\", cause).pipe(\n Effect.andThen(failResponse(OperationHttpError.make({ reason: \"unavailable\" }))),\n )\n : Effect.failCause(cause),\n ),\n Effect.provideService(OperationHttpServerConfig, config),\n );\n\n return { handle };\n });\n"],"mappings":";;;;;;;;;;;;;AAqCA,MAAM,iBAAiB,OAAO,MAAM;CAClC,OAAO,aAAa,WAAW;EAC7B,OAAO,OAAO,YAAY,OAAO,IAAI;EACrC,SA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SubjectId } from "../Schema.mjs";
|
|
2
|
+
import { ExternalIdentity, IdentityConflict, IdentityUnavailable } from "./models.mjs";
|
|
3
|
+
import { Context, Effect } from "effect";
|
|
4
|
+
//#region src/identity/ExternalIdentityMutation.d.ts
|
|
5
|
+
declare const ExternalIdentityMutation_base: Context.ServiceClass<ExternalIdentityMutation, "effect-auth/ExternalIdentityMutation", {
|
|
6
|
+
readonly bind: (subjectId: SubjectId, identity: ExternalIdentity) => Effect.Effect<void, IdentityConflict | IdentityUnavailable>;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* Binds a provider subject to an application subject. The authoritative store
|
|
10
|
+
* enforces uniqueness of the full provider, issuer and external-subject tuple.
|
|
11
|
+
*/
|
|
12
|
+
declare class ExternalIdentityMutation extends ExternalIdentityMutation_base {}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ExternalIdentityMutation };
|
|
15
|
+
//# sourceMappingURL=ExternalIdentityMutation.d.mts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Context } from "effect";
|
|
2
|
+
//#region src/identity/ExternalIdentityMutation.ts
|
|
3
|
+
/**
|
|
4
|
+
* Binds a provider subject to an application subject. The authoritative store
|
|
5
|
+
* enforces uniqueness of the full provider, issuer and external-subject tuple.
|
|
6
|
+
*/
|
|
7
|
+
var ExternalIdentityMutation = class extends Context.Service()("effect-auth/ExternalIdentityMutation") {};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ExternalIdentityMutation };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=ExternalIdentityMutation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalIdentityMutation.mjs","names":[],"sources":["../../src/identity/ExternalIdentityMutation.ts"],"sourcesContent":["import { Context, type Effect } from \"effect\";\n\nimport type { SubjectId } from \"../Schema\";\nimport type { ExternalIdentity, IdentityConflict, IdentityUnavailable } from \"./models\";\n\n/**\n * Binds a provider subject to an application subject. The authoritative store\n * enforces uniqueness of the full provider, issuer and external-subject tuple.\n */\nexport class ExternalIdentityMutation extends Context.Service<\n ExternalIdentityMutation,\n {\n readonly bind: (\n subjectId: SubjectId,\n identity: ExternalIdentity,\n ) => Effect.Effect<void, IdentityConflict | IdentityUnavailable>;\n }\n>()(\"effect-auth/ExternalIdentityMutation\") {}\n"],"mappings":";;;;;;AASA,IAAa,2BAAb,cAA8C,QAAQ,QAQpD,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SubjectId } from "../Schema.mjs";
|
|
2
|
+
import { CredentialId, IdentityConflict, IdentityUnavailable, LastSignInMethod, LoginIdentifier, SubjectInactive } from "./models.mjs";
|
|
3
|
+
import { Context, Effect } from "effect";
|
|
4
|
+
//#region src/identity/IdentityMutation.d.ts
|
|
5
|
+
declare const IdentityMutation_base: Context.ServiceClass<IdentityMutation, "effect-auth/IdentityMutation", {
|
|
6
|
+
readonly removeIdentifier: (subjectId: SubjectId, identifier: LoginIdentifier) => Effect.Effect<void, IdentityConflict | LastSignInMethod | SubjectInactive | IdentityUnavailable>;
|
|
7
|
+
readonly removeCredential: (subjectId: SubjectId, credentialId: CredentialId) => Effect.Effect<void, IdentityConflict | LastSignInMethod | SubjectInactive | IdentityUnavailable>;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Narrow removal capability. The authoritative adapter checks active status,
|
|
11
|
+
* ownership and the remaining usable sign-in methods in the SAME atomic write.
|
|
12
|
+
* A read/count followed by deletion is insufficient under concurrent removals.
|
|
13
|
+
* Removing a credential also removes its retained secrets and dependent proofs.
|
|
14
|
+
* Identifier removal/rebinding/verification changes that invalidate captured login
|
|
15
|
+
* authority MUST atomically bump subject securityRevision. AuthenticationRevision
|
|
16
|
+
* deliberately has no identifier-binding revision: deleting dependent proofs alone
|
|
17
|
+
* cannot invalidate password evidence already captured before verification.
|
|
18
|
+
*/
|
|
19
|
+
declare class IdentityMutation extends IdentityMutation_base {}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { IdentityMutation };
|
|
22
|
+
//# sourceMappingURL=IdentityMutation.d.mts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Context } from "effect";
|
|
2
|
+
//#region src/identity/IdentityMutation.ts
|
|
3
|
+
/**
|
|
4
|
+
* Narrow removal capability. The authoritative adapter checks active status,
|
|
5
|
+
* ownership and the remaining usable sign-in methods in the SAME atomic write.
|
|
6
|
+
* A read/count followed by deletion is insufficient under concurrent removals.
|
|
7
|
+
* Removing a credential also removes its retained secrets and dependent proofs.
|
|
8
|
+
* Identifier removal/rebinding/verification changes that invalidate captured login
|
|
9
|
+
* authority MUST atomically bump subject securityRevision. AuthenticationRevision
|
|
10
|
+
* deliberately has no identifier-binding revision: deleting dependent proofs alone
|
|
11
|
+
* cannot invalidate password evidence already captured before verification.
|
|
12
|
+
*/
|
|
13
|
+
var IdentityMutation = class extends Context.Service()("effect-auth/IdentityMutation") {};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { IdentityMutation };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=IdentityMutation.mjs.map
|