@yielded/auth-persistence 0.1.0-beta.25 → 0.1.0-beta.26
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/README.md +6 -8
- package/dist/Adapter.d.mts +47 -33
- package/dist/Adapter.mjs +36 -23
- package/dist/OAuthPersistence.d.mts +35 -51
- package/dist/OAuthPersistence.mjs +60 -68
- package/dist/OAuthPersistence.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/internal/browser-login.d.mts +1 -1
- package/dist/internal/browser-login.mjs +29 -9
- package/dist/internal/browser-login.mjs.map +1 -1
- package/dist/internal/configuration.d.mts +13 -8
- package/dist/internal/configuration.mjs.map +1 -1
- package/dist/internal/crypto.d.mts +1 -0
- package/dist/internal/crypto.mjs +1 -1
- package/dist/internal/d1-planning.mjs +8 -0
- package/dist/internal/d1-planning.mjs.map +1 -0
- package/dist/internal/email-native-state.mjs +135 -0
- package/dist/internal/email-native-state.mjs.map +1 -0
- package/dist/internal/email-native.d.mts +17 -0
- package/dist/internal/email-native.mjs +245 -0
- package/dist/internal/email-native.mjs.map +1 -0
- package/dist/internal/email-policy.mjs +92 -0
- package/dist/internal/email-policy.mjs.map +1 -0
- package/dist/internal/email-registration-native.d.mts +38 -0
- package/dist/internal/email-registration-native.mjs +171 -0
- package/dist/internal/email-registration-native.mjs.map +1 -0
- package/dist/internal/models/email-model.d.mts +40 -104
- package/dist/internal/models/email-model.mjs +3 -5
- package/dist/internal/models/email-model.mjs.map +1 -1
- package/dist/internal/models/oauth-connected-model.d.mts +44 -213
- package/dist/internal/models/oauth-connected-model.mjs +6 -14
- package/dist/internal/models/oauth-connected-model.mjs.map +1 -1
- package/dist/internal/models/oauth-model.d.mts +95 -244
- package/dist/internal/models/oauth-model.mjs +28 -22
- package/dist/internal/models/oauth-model.mjs.map +1 -1
- package/dist/internal/models/passkey-model.d.mts +11 -147
- package/dist/internal/models/passkey-model.mjs +5 -24
- package/dist/internal/models/passkey-model.mjs.map +1 -1
- package/dist/internal/models/passkey-registration-ceremony-model.d.mts +5 -39
- package/dist/internal/models/passkey-write-model.d.mts +17 -75
- package/dist/internal/models/passkey-write-model.mjs +1 -7
- package/dist/internal/models/passkey-write-model.mjs.map +1 -1
- package/dist/internal/models/password-model.d.mts +14 -81
- package/dist/internal/models/password-model.mjs +1 -4
- package/dist/internal/models/password-model.mjs.map +1 -1
- package/dist/internal/models/phone-model.d.mts +86 -0
- package/dist/internal/models/phone-model.mjs +10 -0
- package/dist/internal/models/phone-model.mjs.map +1 -0
- package/dist/internal/models/proof-model.d.mts +43 -272
- package/dist/internal/models/proof-model.mjs +2 -10
- package/dist/internal/models/proof-model.mjs.map +1 -1
- package/dist/internal/models/session-model.d.mts +74 -93
- package/dist/internal/models/session-model.mjs +3 -11
- package/dist/internal/models/session-model.mjs.map +1 -1
- package/dist/internal/models/step-up-model.d.mts +12 -50
- package/dist/internal/models/step-up-model.mjs +2 -4
- package/dist/internal/models/step-up-model.mjs.map +1 -1
- package/dist/internal/models/totp-model.d.mts +76 -0
- package/dist/internal/models/totp-model.mjs +10 -0
- package/dist/internal/models/totp-model.mjs.map +1 -0
- package/dist/internal/native-sql-table.d.mts +21 -4
- package/dist/internal/native-sql-table.mjs +9 -5
- package/dist/internal/native-sql-table.mjs.map +1 -1
- package/dist/internal/oauth/native-accounts.d.mts +17 -0
- package/dist/internal/oauth/native-accounts.mjs +290 -0
- package/dist/internal/oauth/native-accounts.mjs.map +1 -0
- package/dist/internal/oauth/native-connected-state.d.mts +11 -0
- package/dist/internal/oauth/native-connected-state.mjs +146 -0
- package/dist/internal/oauth/native-connected-state.mjs.map +1 -0
- package/dist/internal/oauth/native-connected.d.mts +15 -0
- package/dist/internal/oauth/native-connected.mjs +462 -0
- package/dist/internal/oauth/native-connected.mjs.map +1 -0
- package/dist/internal/oauth/native-flow.mjs +138 -0
- package/dist/internal/oauth/native-flow.mjs.map +1 -0
- package/dist/internal/oauth/native-layers.d.mts +24 -0
- package/dist/internal/oauth/native-layers.mjs +13 -0
- package/dist/internal/oauth/native-layers.mjs.map +1 -0
- package/dist/internal/oauth/native-mutation.mjs +122 -0
- package/dist/internal/oauth/native-mutation.mjs.map +1 -0
- package/dist/internal/oauth/native-registration.d.mts +24 -0
- package/dist/internal/oauth/native-registration.mjs +328 -0
- package/dist/internal/oauth/native-registration.mjs.map +1 -0
- package/dist/internal/oauth/native-revocations.d.mts +17 -0
- package/dist/internal/oauth/native-revocations.mjs +106 -0
- package/dist/internal/oauth/native-revocations.mjs.map +1 -0
- package/dist/internal/oauth/native-sign-in.d.mts +17 -0
- package/dist/internal/oauth/native-sign-in.mjs +50 -0
- package/dist/internal/oauth/native-sign-in.mjs.map +1 -0
- package/dist/internal/oauth/native-state.d.mts +10 -0
- package/dist/internal/oauth/native-state.mjs +214 -0
- package/dist/internal/oauth/native-state.mjs.map +1 -0
- package/dist/internal/oauth/state.d.mts +10 -0
- package/dist/internal/oauth/state.mjs +3 -27
- package/dist/internal/oauth/state.mjs.map +1 -1
- package/dist/internal/passkey-actions.mjs +55 -0
- package/dist/internal/passkey-actions.mjs.map +1 -0
- package/dist/internal/passkey-inputs.mjs +73 -0
- package/dist/internal/passkey-inputs.mjs.map +1 -0
- package/dist/internal/passkey-managed.mjs +224 -0
- package/dist/internal/passkey-managed.mjs.map +1 -0
- package/dist/internal/passkey-native-ceremony.d.mts +35 -0
- package/dist/internal/passkey-native-ceremony.mjs +38 -0
- package/dist/internal/passkey-native-ceremony.mjs.map +1 -0
- package/dist/internal/passkey-native-flow.mjs +91 -0
- package/dist/internal/passkey-native-flow.mjs.map +1 -0
- package/dist/internal/passkey-native-registration.d.mts +10 -0
- package/dist/internal/passkey-native-registration.mjs +114 -0
- package/dist/internal/passkey-native-registration.mjs.map +1 -0
- package/dist/internal/passkey-native-state.d.mts +15 -0
- package/dist/internal/passkey-native-state.mjs +186 -0
- package/dist/internal/passkey-native-state.mjs.map +1 -0
- package/dist/internal/passkey-native-write.d.mts +82 -0
- package/dist/internal/passkey-native-write.mjs +330 -0
- package/dist/internal/passkey-native-write.mjs.map +1 -0
- package/dist/internal/passkey-native.d.mts +835 -0
- package/dist/internal/passkey-native.mjs +175 -0
- package/dist/internal/passkey-native.mjs.map +1 -0
- package/dist/internal/passkey-policy.mjs +115 -0
- package/dist/internal/passkey-policy.mjs.map +1 -0
- package/dist/internal/password-credentials.mjs +38 -9
- package/dist/internal/password-credentials.mjs.map +1 -1
- package/dist/internal/password-native.d.mts +14 -0
- package/dist/internal/password-native.mjs +292 -0
- package/dist/internal/password-native.mjs.map +1 -0
- package/dist/internal/password-policy.mjs +93 -0
- package/dist/internal/password-policy.mjs.map +1 -0
- package/dist/internal/password-registration-native.d.mts +22 -0
- package/dist/internal/password-registration-native.mjs +142 -0
- package/dist/internal/password-registration-native.mjs.map +1 -0
- package/dist/internal/persistence.d.mts +6 -19
- package/dist/internal/persistence.mjs +199 -166
- package/dist/internal/persistence.mjs.map +1 -1
- package/dist/internal/phone-composed.mjs +79 -0
- package/dist/internal/phone-composed.mjs.map +1 -0
- package/dist/internal/phone-native.d.mts +15 -0
- package/dist/internal/phone-native.mjs +354 -0
- package/dist/internal/phone-native.mjs.map +1 -0
- package/dist/internal/proof-native.d.mts +15 -0
- package/dist/internal/proof-native.mjs +289 -0
- package/dist/internal/proof-native.mjs.map +1 -0
- package/dist/internal/registration.mjs +50 -60
- package/dist/internal/registration.mjs.map +1 -1
- package/dist/internal/session-native-authority.d.mts +15 -0
- package/dist/internal/session-native-authority.mjs +91 -0
- package/dist/internal/session-native-authority.mjs.map +1 -0
- package/dist/internal/session-native-cleanup.d.mts +14 -0
- package/dist/internal/session-native-cleanup.mjs +48 -0
- package/dist/internal/session-native-cleanup.mjs.map +1 -0
- package/dist/internal/session-native-login.d.mts +15 -0
- package/dist/internal/session-native-login.mjs +87 -0
- package/dist/internal/session-native-login.mjs.map +1 -0
- package/dist/internal/session-native-pending-read.mjs +42 -0
- package/dist/internal/session-native-pending-read.mjs.map +1 -0
- package/dist/internal/session-native-pending.mjs +134 -0
- package/dist/internal/session-native-pending.mjs.map +1 -0
- package/dist/internal/session-native-record.mjs +79 -0
- package/dist/internal/session-native-record.mjs.map +1 -0
- package/dist/internal/session-native-state.mjs +130 -0
- package/dist/internal/session-native-state.mjs.map +1 -0
- package/dist/internal/session-native-stateful.d.mts +16 -0
- package/dist/internal/session-native-stateful.mjs +225 -0
- package/dist/internal/session-native-stateful.mjs.map +1 -0
- package/dist/internal/session-native-step-up.d.mts +15 -0
- package/dist/internal/session-native-step-up.mjs +212 -0
- package/dist/internal/session-native-step-up.mjs.map +1 -0
- package/dist/internal/session-native-validity.d.mts +15 -0
- package/dist/internal/session-native-validity.mjs +97 -0
- package/dist/internal/session-native-validity.mjs.map +1 -0
- package/dist/internal/session-policy.mjs +29 -0
- package/dist/internal/session-policy.mjs.map +1 -0
- package/dist/internal/sql-authority.d.mts +16 -0
- package/dist/internal/sql-authority.mjs +32 -0
- package/dist/internal/sql-authority.mjs.map +1 -0
- package/dist/internal/sql-change.mjs +21 -0
- package/dist/internal/sql-change.mjs.map +1 -0
- package/dist/internal/sql-cleanup.mjs +35 -0
- package/dist/internal/sql-cleanup.mjs.map +1 -0
- package/dist/internal/sql-commit.d.mts +72 -0
- package/dist/internal/sql-commit.mjs +176 -0
- package/dist/internal/sql-commit.mjs.map +1 -0
- package/dist/internal/sql-expression.d.mts +17 -0
- package/dist/internal/sql-expression.mjs +49 -0
- package/dist/internal/sql-expression.mjs.map +1 -0
- package/dist/internal/sql-oauth-connected-model.d.mts +7 -23
- package/dist/internal/sql-oauth-model.d.mts +27 -52
- package/dist/internal/sql-oauth-model.mjs +3 -4
- package/dist/internal/sql-oauth-model.mjs.map +1 -1
- package/dist/internal/sql-persistence.mjs +5 -9
- package/dist/internal/sql-persistence.mjs.map +1 -1
- package/dist/internal/sql-storage-validation.mjs +1 -2
- package/dist/internal/sql-storage-validation.mjs.map +1 -1
- package/dist/internal/sql-table.d.mts +3 -16
- package/dist/internal/sql-table.mjs +21 -42
- package/dist/internal/sql-table.mjs.map +1 -1
- package/dist/internal/standalone.mjs +2 -3
- package/dist/internal/standalone.mjs.map +1 -1
- package/dist/internal/step-up-state.mjs +5 -8
- package/dist/internal/step-up-state.mjs.map +1 -1
- package/dist/internal/storage-clock.mjs +44 -0
- package/dist/internal/storage-clock.mjs.map +1 -0
- package/dist/internal/storage-mapping.d.mts +11 -8
- package/dist/internal/storage-mapping.mjs +88 -302
- package/dist/internal/storage-mapping.mjs.map +1 -1
- package/dist/internal/storage-plans.mjs +15 -73
- package/dist/internal/storage-plans.mjs.map +1 -1
- package/dist/internal/storage-tables.d.mts +37 -520
- package/dist/internal/storage-tables.mjs +31 -211
- package/dist/internal/storage-tables.mjs.map +1 -1
- package/dist/internal/storage-validation.d.mts +1 -6
- package/dist/internal/storage-validation.mjs +1 -42
- package/dist/internal/storage-validation.mjs.map +1 -1
- package/dist/internal/table-model.d.mts +21 -0
- package/dist/internal/totp-native.d.mts +15 -0
- package/dist/internal/totp-native.mjs +401 -0
- package/dist/internal/totp-native.mjs.map +1 -0
- package/package.json +1 -1
- package/src/Adapter.ts +143 -199
- package/src/OAuthPersistence.ts +128 -271
- package/src/index.ts +1 -1
- package/src/internal/browser-login.ts +54 -24
- package/src/internal/configuration.ts +16 -31
- package/src/internal/d1-planning.ts +7 -0
- package/src/internal/email-native-state.ts +247 -0
- package/src/internal/email-native.ts +514 -0
- package/src/internal/email-policy.ts +235 -0
- package/src/internal/email-registration-native.ts +386 -0
- package/src/internal/models/email-model.ts +76 -214
- package/src/internal/models/oauth-connected-model.ts +50 -288
- package/src/internal/models/oauth-model.ts +147 -368
- package/src/internal/models/passkey-model.ts +11 -208
- package/src/internal/models/passkey-registration-ceremony-model.ts +6 -60
- package/src/internal/models/passkey-write-model.ts +14 -95
- package/src/internal/models/password-model.ts +26 -147
- package/src/internal/models/phone-model.ts +110 -0
- package/src/internal/models/proof-model.ts +48 -404
- package/src/internal/models/session-model.ts +102 -200
- package/src/internal/models/step-up-model.ts +17 -96
- package/src/internal/models/totp-model.ts +82 -0
- package/src/internal/native-sql-table.ts +32 -11
- package/src/internal/oauth/native-accounts.ts +576 -0
- package/src/internal/oauth/native-connected-state.ts +288 -0
- package/src/internal/oauth/native-connected.ts +888 -0
- package/src/internal/oauth/native-flow.ts +253 -0
- package/src/internal/oauth/native-layers.ts +83 -0
- package/src/internal/oauth/native-mutation.ts +222 -0
- package/src/internal/oauth/native-registration.ts +545 -0
- package/src/internal/oauth/native-revocations.ts +190 -0
- package/src/internal/oauth/native-sign-in.ts +111 -0
- package/src/internal/oauth/native-state.ts +346 -0
- package/src/internal/oauth/state.ts +2 -70
- package/src/internal/passkey-actions.ts +70 -0
- package/src/internal/passkey-inputs.ts +56 -0
- package/src/internal/passkey-managed.ts +360 -0
- package/src/internal/passkey-native-ceremony.ts +66 -0
- package/src/internal/passkey-native-flow.ts +140 -0
- package/src/internal/passkey-native-registration.ts +221 -0
- package/src/internal/passkey-native-state.ts +335 -0
- package/src/internal/passkey-native-write.ts +611 -0
- package/src/internal/passkey-native.ts +372 -0
- package/src/internal/passkey-policy.ts +246 -0
- package/src/internal/password-credentials.ts +52 -10
- package/src/internal/password-native.ts +571 -0
- package/src/internal/password-policy.ts +307 -0
- package/src/internal/password-registration-native.ts +322 -0
- package/src/internal/persistence.ts +336 -290
- package/src/internal/phone-composed.ts +86 -0
- package/src/internal/phone-native.ts +659 -0
- package/src/internal/proof-native.ts +448 -0
- package/src/internal/registration.ts +96 -143
- package/src/internal/session-native-authority.ts +247 -0
- package/src/internal/session-native-cleanup.ts +65 -0
- package/src/internal/session-native-login.ts +205 -0
- package/src/internal/session-native-pending-read.ts +68 -0
- package/src/internal/session-native-pending.ts +223 -0
- package/src/internal/session-native-record.ts +141 -0
- package/src/internal/session-native-state.ts +259 -0
- package/src/internal/session-native-stateful.ts +512 -0
- package/src/internal/session-native-step-up.ts +450 -0
- package/src/internal/session-native-validity.ts +208 -0
- package/src/internal/session-policy.ts +59 -0
- package/src/internal/sql-authority.ts +56 -0
- package/src/internal/sql-change.ts +38 -0
- package/src/internal/sql-cleanup.ts +56 -0
- package/src/internal/sql-commit.ts +435 -0
- package/src/internal/sql-expression.ts +94 -0
- package/src/internal/sql-metadata.ts +100 -0
- package/src/internal/sql-oauth-connected-model.ts +6 -95
- package/src/internal/sql-oauth-model.ts +31 -134
- package/src/internal/sql-persistence.ts +2 -6
- package/src/internal/sql-storage-validation.ts +1 -2
- package/src/internal/sql-table.ts +19 -52
- package/src/internal/standalone.ts +2 -11
- package/src/internal/step-up-state.ts +4 -17
- package/src/internal/storage-clock.ts +58 -0
- package/src/internal/storage-mapping.ts +125 -340
- package/src/internal/storage-plans.ts +14 -80
- package/src/internal/storage-tables.ts +28 -212
- package/src/internal/storage-validation.ts +0 -58
- package/src/internal/table-model.ts +24 -0
- package/src/internal/totp-native.ts +701 -0
- package/dist/internal/PasswordPreparedPostconditions.d.mts +0 -22
- package/dist/internal/PasswordPreparedPostconditions.mjs +0 -12
- package/dist/internal/PasswordPreparedPostconditions.mjs.map +0 -1
- package/dist/internal/authority-snapshot.mjs +0 -53
- package/dist/internal/authority-snapshot.mjs.map +0 -1
- package/dist/internal/email-kernel.d.mts +0 -276
- package/dist/internal/email-kernel.mjs +0 -497
- package/dist/internal/email-kernel.mjs.map +0 -1
- package/dist/internal/models/passkey-registration-ceremony-model.mjs +0 -18
- package/dist/internal/models/passkey-registration-ceremony-model.mjs.map +0 -1
- package/dist/internal/oauth/accounts.d.mts +0 -8
- package/dist/internal/oauth/accounts.mjs +0 -379
- package/dist/internal/oauth/accounts.mjs.map +0 -1
- package/dist/internal/oauth/connected-access.d.mts +0 -9
- package/dist/internal/oauth/connected-access.mjs +0 -229
- package/dist/internal/oauth/connected-access.mjs.map +0 -1
- package/dist/internal/oauth/connected-collection.d.mts +0 -7
- package/dist/internal/oauth/connected-collection.mjs +0 -214
- package/dist/internal/oauth/connected-collection.mjs.map +0 -1
- package/dist/internal/oauth/connected-custody.d.mts +0 -6
- package/dist/internal/oauth/connected-custody.mjs +0 -165
- package/dist/internal/oauth/connected-custody.mjs.map +0 -1
- package/dist/internal/oauth/connected-flow.d.mts +0 -7
- package/dist/internal/oauth/connected-flow.mjs +0 -324
- package/dist/internal/oauth/connected-flow.mjs.map +0 -1
- package/dist/internal/oauth/connected-input.mjs +0 -122
- package/dist/internal/oauth/connected-input.mjs.map +0 -1
- package/dist/internal/oauth/connected-keys.d.mts +0 -2
- package/dist/internal/oauth/connected-keys.mjs +0 -22
- package/dist/internal/oauth/connected-keys.mjs.map +0 -1
- package/dist/internal/oauth/connected-maintenance.d.mts +0 -9
- package/dist/internal/oauth/connected-maintenance.mjs +0 -226
- package/dist/internal/oauth/connected-maintenance.mjs.map +0 -1
- package/dist/internal/oauth/connected-management.d.mts +0 -9
- package/dist/internal/oauth/connected-management.mjs +0 -243
- package/dist/internal/oauth/connected-management.mjs.map +0 -1
- package/dist/internal/oauth/connected-reference.mjs +0 -63
- package/dist/internal/oauth/connected-reference.mjs.map +0 -1
- package/dist/internal/oauth/connected-settlement.d.mts +0 -8
- package/dist/internal/oauth/connected-settlement.mjs +0 -141
- package/dist/internal/oauth/connected-settlement.mjs.map +0 -1
- package/dist/internal/oauth/connected-sign-in.d.mts +0 -10
- package/dist/internal/oauth/connected-sign-in.mjs +0 -281
- package/dist/internal/oauth/connected-sign-in.mjs.map +0 -1
- package/dist/internal/oauth/connected-state.d.mts +0 -14
- package/dist/internal/oauth/connected-state.mjs +0 -469
- package/dist/internal/oauth/connected-state.mjs.map +0 -1
- package/dist/internal/oauth/connected-target.d.mts +0 -21
- package/dist/internal/oauth/connected-target.mjs +0 -117
- package/dist/internal/oauth/connected-target.mjs.map +0 -1
- package/dist/internal/oauth/flow.d.mts +0 -5
- package/dist/internal/oauth/flow.mjs +0 -279
- package/dist/internal/oauth/flow.mjs.map +0 -1
- package/dist/internal/oauth/input.mjs +0 -127
- package/dist/internal/oauth/input.mjs.map +0 -1
- package/dist/internal/oauth/owner.d.mts +0 -10
- package/dist/internal/oauth/owner.mjs +0 -10
- package/dist/internal/oauth/owner.mjs.map +0 -1
- package/dist/internal/oauth/query-compiler.d.mts +0 -7
- package/dist/internal/oauth/query-compiler.mjs +0 -9
- package/dist/internal/oauth/query-compiler.mjs.map +0 -1
- package/dist/internal/oauth/registration.d.mts +0 -7
- package/dist/internal/oauth/registration.mjs +0 -393
- package/dist/internal/oauth/registration.mjs.map +0 -1
- package/dist/internal/oauth/target.d.mts +0 -31
- package/dist/internal/oauth/target.mjs +0 -273
- package/dist/internal/oauth/target.mjs.map +0 -1
- package/dist/internal/oauth-kernel.d.mts +0 -1423
- package/dist/internal/oauth-kernel.mjs +0 -187
- package/dist/internal/oauth-kernel.mjs.map +0 -1
- package/dist/internal/passkey/admission.d.mts +0 -6
- package/dist/internal/passkey/admission.mjs +0 -220
- package/dist/internal/passkey/admission.mjs.map +0 -1
- package/dist/internal/passkey/credentials.d.mts +0 -14
- package/dist/internal/passkey/credentials.mjs +0 -249
- package/dist/internal/passkey/credentials.mjs.map +0 -1
- package/dist/internal/passkey/enrollment.mjs +0 -138
- package/dist/internal/passkey/enrollment.mjs.map +0 -1
- package/dist/internal/passkey/flow.d.mts +0 -21
- package/dist/internal/passkey/flow.mjs +0 -452
- package/dist/internal/passkey/flow.mjs.map +0 -1
- package/dist/internal/passkey/management.mjs +0 -231
- package/dist/internal/passkey/management.mjs.map +0 -1
- package/dist/internal/passkey/registration-ceremony.d.mts +0 -9
- package/dist/internal/passkey/registration-ceremony.mjs +0 -129
- package/dist/internal/passkey/registration-ceremony.mjs.map +0 -1
- package/dist/internal/passkey/registration-custody.d.mts +0 -2
- package/dist/internal/passkey/registration-custody.mjs +0 -52
- package/dist/internal/passkey/registration-custody.mjs.map +0 -1
- package/dist/internal/passkey/registration-write.mjs +0 -211
- package/dist/internal/passkey/registration-write.mjs.map +0 -1
- package/dist/internal/passkey/state.d.mts +0 -10
- package/dist/internal/passkey/state.mjs +0 -234
- package/dist/internal/passkey/state.mjs.map +0 -1
- package/dist/internal/passkey/target.d.mts +0 -20
- package/dist/internal/passkey/target.mjs +0 -200
- package/dist/internal/passkey/target.mjs.map +0 -1
- package/dist/internal/passkey/write-state.d.mts +0 -17
- package/dist/internal/passkey/write-state.mjs +0 -354
- package/dist/internal/passkey/write-state.mjs.map +0 -1
- package/dist/internal/passkey/write-target.mjs +0 -192
- package/dist/internal/passkey/write-target.mjs.map +0 -1
- package/dist/internal/passkey-kernel.d.mts +0 -6045
- package/dist/internal/passkey-kernel.mjs +0 -49
- package/dist/internal/passkey-kernel.mjs.map +0 -1
- package/dist/internal/passkeys.d.mts +0 -7
- package/dist/internal/passkeys.mjs +0 -387
- package/dist/internal/passkeys.mjs.map +0 -1
- package/dist/internal/password-credentials.d.mts +0 -11
- package/dist/internal/password-kernel.d.mts +0 -278
- package/dist/internal/password-kernel.mjs +0 -508
- package/dist/internal/password-kernel.mjs.map +0 -1
- package/dist/internal/phone-kernel.d.mts +0 -162
- package/dist/internal/phone-kernel.mjs +0 -437
- package/dist/internal/phone-kernel.mjs.map +0 -1
- package/dist/internal/proof-kernel.d.mts +0 -94
- package/dist/internal/proof-kernel.mjs +0 -624
- package/dist/internal/proof-kernel.mjs.map +0 -1
- package/dist/internal/query-operations.d.mts +0 -68
- package/dist/internal/session-kernel.d.mts +0 -62
- package/dist/internal/session-kernel.mjs +0 -820
- package/dist/internal/session-kernel.mjs.map +0 -1
- package/dist/internal/sql-oauth-connected-model.mjs +0 -7
- package/dist/internal/sql-oauth-connected-model.mjs.map +0 -1
- package/dist/internal/sql-query.d.mts +0 -12
- package/dist/internal/sql-query.mjs +0 -206
- package/dist/internal/sql-query.mjs.map +0 -1
- package/dist/internal/step-up-state.d.mts +0 -49
- package/dist/internal/transaction-execution-kernel.d.mts +0 -37
- package/dist/internal/transaction-execution-kernel.mjs +0 -120
- package/dist/internal/transaction-execution-kernel.mjs.map +0 -1
- package/dist/internal/transaction-kernel.d.mts +0 -81
- package/dist/internal/transaction-kernel.mjs +0 -264
- package/dist/internal/transaction-kernel.mjs.map +0 -1
- package/src/internal/PasswordPreparedPostconditions.ts +0 -30
- package/src/internal/authority-snapshot.ts +0 -91
- package/src/internal/email-kernel.ts +0 -1556
- package/src/internal/oauth/accounts.ts +0 -839
- package/src/internal/oauth/connected-access.ts +0 -388
- package/src/internal/oauth/connected-collection.ts +0 -345
- package/src/internal/oauth/connected-custody.ts +0 -308
- package/src/internal/oauth/connected-flow.ts +0 -562
- package/src/internal/oauth/connected-input.ts +0 -147
- package/src/internal/oauth/connected-keys.ts +0 -31
- package/src/internal/oauth/connected-maintenance.ts +0 -379
- package/src/internal/oauth/connected-management.ts +0 -391
- package/src/internal/oauth/connected-reference.ts +0 -135
- package/src/internal/oauth/connected-settlement.ts +0 -278
- package/src/internal/oauth/connected-sign-in.ts +0 -472
- package/src/internal/oauth/connected-state.ts +0 -924
- package/src/internal/oauth/connected-target.ts +0 -307
- package/src/internal/oauth/flow.ts +0 -505
- package/src/internal/oauth/input.ts +0 -201
- package/src/internal/oauth/owner.ts +0 -22
- package/src/internal/oauth/query-compiler.ts +0 -15
- package/src/internal/oauth/registration.ts +0 -676
- package/src/internal/oauth/target.ts +0 -803
- package/src/internal/oauth-kernel.ts +0 -294
- package/src/internal/passkey/admission.ts +0 -368
- package/src/internal/passkey/credentials.ts +0 -511
- package/src/internal/passkey/enrollment.ts +0 -326
- package/src/internal/passkey/flow.ts +0 -1062
- package/src/internal/passkey/management.ts +0 -426
- package/src/internal/passkey/registration-ceremony.ts +0 -283
- package/src/internal/passkey/registration-custody.ts +0 -91
- package/src/internal/passkey/registration-write.ts +0 -426
- package/src/internal/passkey/state.ts +0 -351
- package/src/internal/passkey/target.ts +0 -598
- package/src/internal/passkey/write-state.ts +0 -692
- package/src/internal/passkey/write-target.ts +0 -450
- package/src/internal/passkey-kernel.ts +0 -112
- package/src/internal/passkeys.ts +0 -652
- package/src/internal/password-kernel.ts +0 -1523
- package/src/internal/phone-kernel.ts +0 -872
- package/src/internal/proof-kernel.ts +0 -1992
- package/src/internal/query-operations.ts +0 -91
- package/src/internal/session-kernel.ts +0 -2406
- package/src/internal/sql-query.ts +0 -304
- package/src/internal/transaction-execution-kernel.ts +0 -335
- package/src/internal/transaction-kernel.ts +0 -603
|
@@ -1,839 +0,0 @@
|
|
|
1
|
-
/* oxlint-disable no-explicit-any -- compiler table shapes are erased; domain codecs and error channels remain typed. */
|
|
2
|
-
import {
|
|
3
|
-
OAuthAccountRevision,
|
|
4
|
-
OAuthActionAuthorization,
|
|
5
|
-
OAuthLinkAccess,
|
|
6
|
-
OAuthLinkClaim,
|
|
7
|
-
OAuthLinkPendingFlow,
|
|
8
|
-
OAuthLinkTransactionContext,
|
|
9
|
-
OAuthUnlinked,
|
|
10
|
-
OAuthCredentialSnapshot,
|
|
11
|
-
snapshotOAuthSync,
|
|
12
|
-
} from "@yielded/auth/OAuth";
|
|
13
|
-
import {
|
|
14
|
-
SessionInvalidationWindow,
|
|
15
|
-
AuthenticationRequirement,
|
|
16
|
-
SecurityRevision,
|
|
17
|
-
} from "@yielded/auth/Sessions";
|
|
18
|
-
import { DateTime, Effect, Context, Layer } from "effect";
|
|
19
|
-
|
|
20
|
-
import type { SubjectIdCodec } from "../models/common";
|
|
21
|
-
import type { OAuthReferenceGuardDescriptor, OAuthEligibilityFact } from "../models/oauth-model";
|
|
22
|
-
import { OAuthFlow } from "./flow";
|
|
23
|
-
import { CurrentOAuthTransaction } from "./owner";
|
|
24
|
-
import { OAuthQueryCompiler } from "./query-compiler";
|
|
25
|
-
import { OAuthRegistration } from "./registration";
|
|
26
|
-
import {
|
|
27
|
-
invariant,
|
|
28
|
-
oauthIdentityKey,
|
|
29
|
-
sameRevision,
|
|
30
|
-
satisfies,
|
|
31
|
-
storage,
|
|
32
|
-
validAction,
|
|
33
|
-
} from "./state";
|
|
34
|
-
|
|
35
|
-
const make = Effect.gen(function* () {
|
|
36
|
-
const operations = yield* OAuthQueryCompiler;
|
|
37
|
-
const flow = yield* OAuthFlow;
|
|
38
|
-
const registration = yield* OAuthRegistration;
|
|
39
|
-
|
|
40
|
-
const { eq, sql } = operations;
|
|
41
|
-
|
|
42
|
-
const {
|
|
43
|
-
claimFlow,
|
|
44
|
-
credentialStorage,
|
|
45
|
-
currentSubject,
|
|
46
|
-
exactClaim,
|
|
47
|
-
issueFlow,
|
|
48
|
-
linkStorage,
|
|
49
|
-
matchesAccess,
|
|
50
|
-
readFlow,
|
|
51
|
-
terminalFlow,
|
|
52
|
-
} = flow;
|
|
53
|
-
|
|
54
|
-
const { both, col, copiedRow, equal } = operations;
|
|
55
|
-
const { acquireTuple, readTuple } = registration;
|
|
56
|
-
|
|
57
|
-
const contextStorage = storage(OAuthLinkTransactionContext);
|
|
58
|
-
|
|
59
|
-
const unlinkedStorage = storage(OAuthUnlinked);
|
|
60
|
-
|
|
61
|
-
const accountCurrent = (mapping: any, subjectId: OAuthAccountRevision["subjectId"]) =>
|
|
62
|
-
Effect.gen(function* () {
|
|
63
|
-
const native = yield* (mapping.subjectId as SubjectIdCodec<unknown>).toNative(subjectId);
|
|
64
|
-
|
|
65
|
-
return yield* currentSubject(mapping, native);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
const authorization = (
|
|
69
|
-
mapping: any,
|
|
70
|
-
current: any,
|
|
71
|
-
auth: OAuthActionAuthorization,
|
|
72
|
-
action: OAuthActionAuthorization["challenge"]["action"],
|
|
73
|
-
flowId: string,
|
|
74
|
-
commandId: string,
|
|
75
|
-
intent: string,
|
|
76
|
-
maximumAge: number,
|
|
77
|
-
) =>
|
|
78
|
-
Effect.flatMap(CurrentOAuthTransaction, (owner) =>
|
|
79
|
-
Effect.gen(function* () {
|
|
80
|
-
const now = yield* owner.now(mapping.clock);
|
|
81
|
-
|
|
82
|
-
const currentRequirement = snapshotOAuthSync(
|
|
83
|
-
AuthenticationRequirement,
|
|
84
|
-
mapping.subject.decodeActionRequirement(copiedRow(current.row), action),
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
const accepted = yield* validAction(
|
|
88
|
-
auth,
|
|
89
|
-
{
|
|
90
|
-
moduleId: auth.challenge.moduleId,
|
|
91
|
-
action,
|
|
92
|
-
flowId,
|
|
93
|
-
commandId,
|
|
94
|
-
revision: current.revision,
|
|
95
|
-
intent,
|
|
96
|
-
},
|
|
97
|
-
currentRequirement,
|
|
98
|
-
now,
|
|
99
|
-
maximumAge,
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
if (!accepted) return false;
|
|
103
|
-
|
|
104
|
-
const age = Math.min(
|
|
105
|
-
maximumAge,
|
|
106
|
-
auth.requirement.maximumAgeMillis,
|
|
107
|
-
currentRequirement.maximumAgeMillis,
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
const fresh = auth.evidence.proofs.filter(
|
|
111
|
-
(proof) => now - DateTime.toEpochMillis(proof.verifiedAt) < age,
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
invariant(fresh.length > 0);
|
|
115
|
-
|
|
116
|
-
const deadline = Math.min(
|
|
117
|
-
...fresh.map((proof) => DateTime.toEpochMillis(proof.verifiedAt) + age),
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
owner.postconditions.push(
|
|
121
|
-
sql`${mapping.clock.engineNowMillis} >= ${now} and ${mapping.clock.engineNowMillis} < ${deadline}`,
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
return true;
|
|
125
|
-
}),
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
const currentLink = (mapping: any, flow: typeof OAuthLinkPendingFlow.Type) =>
|
|
129
|
-
Effect.gen(function* () {
|
|
130
|
-
const current = yield* accountCurrent(mapping, flow.context.revision.subjectId);
|
|
131
|
-
|
|
132
|
-
return current !== undefined && sameRevision(current.revision, flow.context.revision)
|
|
133
|
-
? current
|
|
134
|
-
: undefined;
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
const issueLink = (mapping: any, input: any) =>
|
|
138
|
-
Effect.gen(function* () {
|
|
139
|
-
const flow = snapshotOAuthSync(OAuthLinkPendingFlow, input.flow),
|
|
140
|
-
c = flow.context;
|
|
141
|
-
|
|
142
|
-
const current = yield* currentLink(mapping, flow);
|
|
143
|
-
const auth = snapshotOAuthSync(OAuthActionAuthorization, input.authorization);
|
|
144
|
-
|
|
145
|
-
if (
|
|
146
|
-
current === undefined ||
|
|
147
|
-
auth.challenge.moduleId !== c.moduleId ||
|
|
148
|
-
!(yield* authorization(
|
|
149
|
-
mapping,
|
|
150
|
-
current,
|
|
151
|
-
auth,
|
|
152
|
-
"link-begin",
|
|
153
|
-
c.flowId,
|
|
154
|
-
c.commandId,
|
|
155
|
-
contextStorage.encode(c),
|
|
156
|
-
c.maximumEvidenceAgeMillis,
|
|
157
|
-
))
|
|
158
|
-
)
|
|
159
|
-
return { _tag: "Rejected" } as const;
|
|
160
|
-
|
|
161
|
-
return yield* issueFlow(mapping, flow, "link");
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
const preflightLink = (mapping: any, original: typeof OAuthLinkAccess.Type) =>
|
|
165
|
-
Effect.flatMap(CurrentOAuthTransaction, (owner) =>
|
|
166
|
-
Effect.gen(function* () {
|
|
167
|
-
const input = snapshotOAuthSync(OAuthLinkAccess, original);
|
|
168
|
-
// The authenticated subject is known before discovering/locking any flow.
|
|
169
|
-
const current = yield* accountCurrent(mapping, input.subjectId);
|
|
170
|
-
const found = yield* readFlow(mapping, input, "link");
|
|
171
|
-
const now = yield* owner.now(mapping.clock);
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
current === undefined ||
|
|
175
|
-
found.flow === undefined ||
|
|
176
|
-
found.row?.[mapping.flow.state] !== "Pending" ||
|
|
177
|
-
!matchesAccess(found.flow, input)
|
|
178
|
-
)
|
|
179
|
-
return undefined;
|
|
180
|
-
|
|
181
|
-
const flow = snapshotOAuthSync(OAuthLinkPendingFlow, found.flow as never),
|
|
182
|
-
c = flow.context;
|
|
183
|
-
|
|
184
|
-
if (
|
|
185
|
-
c.revision.subjectId !== input.subjectId ||
|
|
186
|
-
!sameRevision(current.revision, c.revision) ||
|
|
187
|
-
now < c.issuedAtMillis ||
|
|
188
|
-
now >= c.expiresAtMillis
|
|
189
|
-
)
|
|
190
|
-
return undefined;
|
|
191
|
-
owner.postconditions.push(
|
|
192
|
-
sql`${mapping.clock.engineNowMillis} >= ${c.issuedAtMillis} and ${mapping.clock.engineNowMillis} < ${c.expiresAtMillis}`,
|
|
193
|
-
);
|
|
194
|
-
|
|
195
|
-
return { current, flow, row: found.row };
|
|
196
|
-
}),
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
const claimLink = (mapping: any, input: any) =>
|
|
200
|
-
Effect.gen(function* () {
|
|
201
|
-
const found = yield* preflightLink(mapping, input.access);
|
|
202
|
-
const flow = snapshotOAuthSync(OAuthLinkPendingFlow, input.flow);
|
|
203
|
-
|
|
204
|
-
const auth = snapshotOAuthSync(OAuthActionAuthorization, input.authorization),
|
|
205
|
-
c = flow.context;
|
|
206
|
-
|
|
207
|
-
if (
|
|
208
|
-
found === undefined ||
|
|
209
|
-
linkStorage.encode(found.flow) !== linkStorage.encode(flow) ||
|
|
210
|
-
auth.challenge.moduleId !== c.moduleId ||
|
|
211
|
-
!(yield* authorization(
|
|
212
|
-
mapping,
|
|
213
|
-
found.current,
|
|
214
|
-
auth,
|
|
215
|
-
"link-complete",
|
|
216
|
-
c.flowId,
|
|
217
|
-
c.commandId,
|
|
218
|
-
contextStorage.encode(c),
|
|
219
|
-
c.maximumEvidenceAgeMillis,
|
|
220
|
-
))
|
|
221
|
-
)
|
|
222
|
-
return { _tag: "Rejected" } as const;
|
|
223
|
-
const claim = yield* claimFlow(mapping, { row: found.row!, flow }, input.claimId);
|
|
224
|
-
|
|
225
|
-
return claim === undefined
|
|
226
|
-
? ({ _tag: "Rejected" } as const)
|
|
227
|
-
: ({ _tag: "Claimed", claim } as const);
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
const checkInvalidation = (mapping: any, original: SessionInvalidationWindow) => {
|
|
231
|
-
const value = snapshotOAuthSync(SessionInvalidationWindow, original);
|
|
232
|
-
|
|
233
|
-
invariant(
|
|
234
|
-
value.trigger === "credential-change" &&
|
|
235
|
-
value.oldAuthenticationEvidence === "rejected" &&
|
|
236
|
-
(mapping.sessionInvalidation === "same-authority-immediate"
|
|
237
|
-
? (value.existingSessions === "immediate" && value.maximumExposureMillis === 0) ||
|
|
238
|
-
(value.existingSessions === "cache-expiry" && value.maximumExposureMillis > 0)
|
|
239
|
-
: value.existingSessions === "original-absolute-expiry"),
|
|
240
|
-
);
|
|
241
|
-
|
|
242
|
-
return value;
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
const advance = (mapping: any, current: any, removed?: string) =>
|
|
246
|
-
Effect.flatMap(CurrentOAuthTransaction, (owner) =>
|
|
247
|
-
Effect.gen(function* () {
|
|
248
|
-
const revision = mapping.subject.nextSecurityRevision(current.revision.securityRevision);
|
|
249
|
-
|
|
250
|
-
invariant(
|
|
251
|
-
typeof revision === "string" &&
|
|
252
|
-
revision.length > 0 &&
|
|
253
|
-
revision.length <= 256 &&
|
|
254
|
-
revision !== current.revision.securityRevision,
|
|
255
|
-
);
|
|
256
|
-
const subject = mapping.subject;
|
|
257
|
-
|
|
258
|
-
yield* owner.update(
|
|
259
|
-
subject.table,
|
|
260
|
-
{ [subject.id]: current.nativeId },
|
|
261
|
-
{ [subject.securityRevision]: revision },
|
|
262
|
-
);
|
|
263
|
-
for (const cleanup of mapping.cleanup) {
|
|
264
|
-
const condition = both(
|
|
265
|
-
eq(col(cleanup.table, cleanup.subjectId), current.nativeId),
|
|
266
|
-
cleanup.condition({
|
|
267
|
-
subjectId: current.nativeId,
|
|
268
|
-
revision: snapshotOAuthSync(OAuthAccountRevision, current.revision),
|
|
269
|
-
...(removed === undefined ? {} : { removedCredentialId: removed }),
|
|
270
|
-
}),
|
|
271
|
-
);
|
|
272
|
-
|
|
273
|
-
yield* owner.write(owner.database.delete(cleanup.table).where(condition));
|
|
274
|
-
owner.postconditions.push(
|
|
275
|
-
sql`not exists(select 1 from ${cleanup.table} where ${condition})`,
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
return SecurityRevision.make(revision);
|
|
280
|
-
}),
|
|
281
|
-
);
|
|
282
|
-
|
|
283
|
-
const settleLink = (
|
|
284
|
-
mapping: any,
|
|
285
|
-
input: any,
|
|
286
|
-
allocated: { readonly credentialId: string; readonly revision: SecurityRevision },
|
|
287
|
-
) =>
|
|
288
|
-
Effect.flatMap(CurrentOAuthTransaction, (owner) =>
|
|
289
|
-
Effect.gen(function* () {
|
|
290
|
-
const claim = snapshotOAuthSync(OAuthLinkClaim, input.claim),
|
|
291
|
-
flow = claim.flow,
|
|
292
|
-
c = flow.context;
|
|
293
|
-
|
|
294
|
-
const current = yield* currentLink(mapping, flow);
|
|
295
|
-
|
|
296
|
-
// Known subject is always locked before tuple/flow; even a rejected outcome
|
|
297
|
-
// settles its exact original claim without adopting a newer revision.
|
|
298
|
-
const identity =
|
|
299
|
-
input.outcome._tag === "Verified" ? input.outcome.identity.identity : undefined;
|
|
300
|
-
|
|
301
|
-
if (identity !== undefined)
|
|
302
|
-
invariant(identity.provider === c.provider && identity.issuer === c.issuer);
|
|
303
|
-
|
|
304
|
-
const tuple =
|
|
305
|
-
identity !== undefined && current !== undefined
|
|
306
|
-
? yield* readTuple(mapping.ownership, identity)
|
|
307
|
-
: undefined;
|
|
308
|
-
|
|
309
|
-
const exact = yield* exactClaim(mapping, claim, "link");
|
|
310
|
-
|
|
311
|
-
if (exact === undefined) return { _tag: "Rejected" } as const;
|
|
312
|
-
let decision: any = { _tag: input.outcome._tag };
|
|
313
|
-
|
|
314
|
-
if (input.outcome._tag === "Verified") {
|
|
315
|
-
decision = { _tag: "Rejected" };
|
|
316
|
-
const auth = snapshotOAuthSync(OAuthActionAuthorization, input.authorization);
|
|
317
|
-
|
|
318
|
-
if (
|
|
319
|
-
current !== undefined &&
|
|
320
|
-
tuple !== undefined &&
|
|
321
|
-
auth.challenge.moduleId === c.moduleId &&
|
|
322
|
-
(yield* authorization(
|
|
323
|
-
mapping,
|
|
324
|
-
current,
|
|
325
|
-
auth,
|
|
326
|
-
"link-complete",
|
|
327
|
-
c.flowId,
|
|
328
|
-
c.commandId,
|
|
329
|
-
contextStorage.encode(c),
|
|
330
|
-
c.maximumEvidenceAgeMillis,
|
|
331
|
-
))
|
|
332
|
-
) {
|
|
333
|
-
const t = mapping.ownership.tuple,
|
|
334
|
-
cr = mapping.credential,
|
|
335
|
-
a = mapping.authority;
|
|
336
|
-
|
|
337
|
-
const login = yield* owner.read(
|
|
338
|
-
cr.table,
|
|
339
|
-
eq(col(cr.table, cr.identityKey), tuple.key),
|
|
340
|
-
{
|
|
341
|
-
limit: 1,
|
|
342
|
-
},
|
|
343
|
-
);
|
|
344
|
-
|
|
345
|
-
const previous = login.rows[0];
|
|
346
|
-
|
|
347
|
-
if (
|
|
348
|
-
tuple.row[t.state] === "Reserved" ||
|
|
349
|
-
(tuple.row[t.state] === "Owned" &&
|
|
350
|
-
!mapping.subjectId.equals(tuple.row[t.subjectId], current.nativeId)) ||
|
|
351
|
-
(previous !== undefined &&
|
|
352
|
-
(previous[cr.moduleId] !== c.moduleId ||
|
|
353
|
-
!mapping.subjectId.equals(previous[cr.subjectId], current.nativeId) ||
|
|
354
|
-
!cr.isActiveStatus(previous[cr.status])))
|
|
355
|
-
)
|
|
356
|
-
decision = { _tag: "Conflict" };
|
|
357
|
-
else if (previous !== undefined) {
|
|
358
|
-
const shared = current.revision.credentials.find(
|
|
359
|
-
(item: any) => item.credentialId === previous[cr.credentialId],
|
|
360
|
-
);
|
|
361
|
-
|
|
362
|
-
if (
|
|
363
|
-
tuple.row[t.state] !== "Owned" ||
|
|
364
|
-
shared?.revision !== previous[cr.credentialRevision] ||
|
|
365
|
-
!(yield* owner.check(
|
|
366
|
-
sql`exists(select 1 from ${cr.table} where ${both(eq(col(cr.table, cr.identityKey), tuple.key), cr.activeCondition)})`,
|
|
367
|
-
))
|
|
368
|
-
)
|
|
369
|
-
decision = { _tag: "Conflict" };
|
|
370
|
-
else
|
|
371
|
-
decision = {
|
|
372
|
-
_tag: "Linked",
|
|
373
|
-
changed: false,
|
|
374
|
-
credential: snapshotOAuthSync(OAuthCredentialSnapshot, {
|
|
375
|
-
moduleId: c.moduleId,
|
|
376
|
-
identity,
|
|
377
|
-
credentialId: previous[cr.credentialId],
|
|
378
|
-
credentialRevision: previous[cr.credentialRevision],
|
|
379
|
-
revision: current.revision,
|
|
380
|
-
}),
|
|
381
|
-
};
|
|
382
|
-
} else {
|
|
383
|
-
checkInvalidation(mapping, input.invalidation);
|
|
384
|
-
|
|
385
|
-
const values = {
|
|
386
|
-
...cr.encodeInsert({
|
|
387
|
-
moduleId: c.moduleId,
|
|
388
|
-
subjectId: current.nativeId,
|
|
389
|
-
identityKey: tuple.key,
|
|
390
|
-
credentialId: allocated.credentialId,
|
|
391
|
-
credentialRevision: allocated.revision,
|
|
392
|
-
}),
|
|
393
|
-
[cr.moduleId]: c.moduleId,
|
|
394
|
-
[cr.subjectId]: current.nativeId,
|
|
395
|
-
[cr.identityKey]: tuple.key,
|
|
396
|
-
[cr.credentialId]: allocated.credentialId,
|
|
397
|
-
[cr.credentialRevision]: allocated.revision,
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
invariant(cr.isActiveStatus(values[cr.status]));
|
|
401
|
-
|
|
402
|
-
const inserted = yield* owner.insert(cr.table, values, {
|
|
403
|
-
[cr.credentialId]: allocated.credentialId,
|
|
404
|
-
});
|
|
405
|
-
|
|
406
|
-
login.rows = inserted.rows;
|
|
407
|
-
|
|
408
|
-
const sharedValues = {
|
|
409
|
-
...a.encodeInsert({
|
|
410
|
-
subjectId: current.nativeId,
|
|
411
|
-
credentialId: allocated.credentialId,
|
|
412
|
-
revision: allocated.revision,
|
|
413
|
-
}),
|
|
414
|
-
[a.subjectId]: current.nativeId,
|
|
415
|
-
[a.credentialId]: allocated.credentialId,
|
|
416
|
-
[a.revision]: allocated.revision,
|
|
417
|
-
};
|
|
418
|
-
|
|
419
|
-
invariant(a.isActiveStatus(sharedValues[a.status]));
|
|
420
|
-
|
|
421
|
-
const shared = yield* owner.insert(a.table, sharedValues, {
|
|
422
|
-
[a.subjectId]: current.nativeId,
|
|
423
|
-
[a.credentialId]: allocated.credentialId,
|
|
424
|
-
});
|
|
425
|
-
|
|
426
|
-
current.authorities.rows = [...current.authorities.rows, ...shared.rows];
|
|
427
|
-
owner.postconditions.push(
|
|
428
|
-
sql`exists(select 1 from ${cr.table} where ${both(
|
|
429
|
-
eq(col(cr.table, cr.credentialId), allocated.credentialId),
|
|
430
|
-
cr.activeCondition,
|
|
431
|
-
)})`,
|
|
432
|
-
sql`exists(select 1 from ${a.table} where ${both(
|
|
433
|
-
eq(col(a.table, a.subjectId), current.nativeId),
|
|
434
|
-
eq(col(a.table, a.credentialId), allocated.credentialId),
|
|
435
|
-
a.activeCondition,
|
|
436
|
-
)})`,
|
|
437
|
-
);
|
|
438
|
-
if (tuple.row[t.state] === "Unowned")
|
|
439
|
-
yield* acquireTuple(mapping.ownership, identity, tuple.key, current.nativeId);
|
|
440
|
-
const next = yield* advance(mapping, current);
|
|
441
|
-
|
|
442
|
-
const revision = snapshotOAuthSync(OAuthAccountRevision, {
|
|
443
|
-
...current.revision,
|
|
444
|
-
securityRevision: next,
|
|
445
|
-
credentials: [
|
|
446
|
-
...current.revision.credentials,
|
|
447
|
-
{ credentialId: allocated.credentialId, revision: allocated.revision },
|
|
448
|
-
],
|
|
449
|
-
});
|
|
450
|
-
|
|
451
|
-
decision = {
|
|
452
|
-
_tag: "Linked",
|
|
453
|
-
changed: true,
|
|
454
|
-
credential: snapshotOAuthSync(OAuthCredentialSnapshot, {
|
|
455
|
-
moduleId: c.moduleId,
|
|
456
|
-
identity,
|
|
457
|
-
credentialId: allocated.credentialId,
|
|
458
|
-
credentialRevision: allocated.revision as never,
|
|
459
|
-
revision,
|
|
460
|
-
}),
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
yield* terminalFlow(mapping, flow, decision._tag);
|
|
466
|
-
|
|
467
|
-
return decision;
|
|
468
|
-
}),
|
|
469
|
-
);
|
|
470
|
-
|
|
471
|
-
const targetCredential = (mapping: any, moduleId: string, credentialId: string, current: any) =>
|
|
472
|
-
Effect.flatMap(CurrentOAuthTransaction, (owner) =>
|
|
473
|
-
Effect.gen(function* () {
|
|
474
|
-
const cr = mapping.credential;
|
|
475
|
-
|
|
476
|
-
const found = yield* owner.read(
|
|
477
|
-
cr.table,
|
|
478
|
-
eq(col(cr.table, cr.credentialId), credentialId),
|
|
479
|
-
{
|
|
480
|
-
limit: 1,
|
|
481
|
-
},
|
|
482
|
-
);
|
|
483
|
-
|
|
484
|
-
const row = found.rows[0];
|
|
485
|
-
|
|
486
|
-
if (
|
|
487
|
-
row === undefined ||
|
|
488
|
-
row[cr.moduleId] !== moduleId ||
|
|
489
|
-
!mapping.subjectId.equals(row[cr.subjectId], current.nativeId) ||
|
|
490
|
-
!cr.isActiveStatus(row[cr.status])
|
|
491
|
-
)
|
|
492
|
-
return undefined;
|
|
493
|
-
const t = mapping.ownership.tuple;
|
|
494
|
-
|
|
495
|
-
const tuple = yield* owner.read(
|
|
496
|
-
t.table,
|
|
497
|
-
eq(col(t.table, t.identityKey), row[cr.identityKey]),
|
|
498
|
-
{
|
|
499
|
-
limit: 1,
|
|
500
|
-
},
|
|
501
|
-
);
|
|
502
|
-
|
|
503
|
-
const ownership = tuple.rows[0];
|
|
504
|
-
|
|
505
|
-
if (
|
|
506
|
-
ownership === undefined ||
|
|
507
|
-
ownership[t.state] !== "Owned" ||
|
|
508
|
-
!mapping.subjectId.equals(ownership[t.subjectId], current.nativeId)
|
|
509
|
-
)
|
|
510
|
-
return undefined;
|
|
511
|
-
|
|
512
|
-
const identity = {
|
|
513
|
-
provider: ownership[t.provider],
|
|
514
|
-
issuer: ownership[t.issuer],
|
|
515
|
-
subject: ownership[t.externalSubject],
|
|
516
|
-
};
|
|
517
|
-
|
|
518
|
-
invariant((yield* oauthIdentityKey(identity)) === row[cr.identityKey]);
|
|
519
|
-
|
|
520
|
-
const shared = current.revision.credentials.find(
|
|
521
|
-
(item: any) => item.credentialId === credentialId,
|
|
522
|
-
);
|
|
523
|
-
|
|
524
|
-
if (
|
|
525
|
-
shared?.revision !== row[cr.credentialRevision] ||
|
|
526
|
-
!(yield* owner.check(
|
|
527
|
-
sql`exists(select 1 from ${cr.table} where ${both(eq(col(cr.table, cr.credentialId), credentialId), cr.activeCondition)})`,
|
|
528
|
-
))
|
|
529
|
-
)
|
|
530
|
-
return undefined;
|
|
531
|
-
|
|
532
|
-
return snapshotOAuthSync(OAuthCredentialSnapshot, {
|
|
533
|
-
moduleId: moduleId as never,
|
|
534
|
-
identity,
|
|
535
|
-
credentialId,
|
|
536
|
-
credentialRevision: row[cr.credentialRevision],
|
|
537
|
-
revision: current.revision,
|
|
538
|
-
});
|
|
539
|
-
}),
|
|
540
|
-
);
|
|
541
|
-
|
|
542
|
-
const unlinkCommand = (mapping: any, moduleId: string, commandId: string) =>
|
|
543
|
-
Effect.flatMap(CurrentOAuthTransaction, (owner) =>
|
|
544
|
-
owner.read(
|
|
545
|
-
mapping.command.table,
|
|
546
|
-
equal(mapping.command.table, {
|
|
547
|
-
[mapping.command.moduleId]: moduleId,
|
|
548
|
-
[mapping.command.commandId]: commandId,
|
|
549
|
-
}),
|
|
550
|
-
{ limit: 1 },
|
|
551
|
-
),
|
|
552
|
-
);
|
|
553
|
-
|
|
554
|
-
const inspectUnlink = (mapping: any, input: any) =>
|
|
555
|
-
Effect.flatMap(CurrentOAuthTransaction, (owner) =>
|
|
556
|
-
Effect.gen(function* () {
|
|
557
|
-
const current = yield* accountCurrent(mapping, input.subjectId);
|
|
558
|
-
|
|
559
|
-
if (current === undefined) return { _tag: "Rejected" } as const;
|
|
560
|
-
|
|
561
|
-
const command = yield* unlinkCommand(mapping, input.moduleId, input.commandId),
|
|
562
|
-
r = mapping.command;
|
|
563
|
-
|
|
564
|
-
const old = command.rows[0];
|
|
565
|
-
|
|
566
|
-
if (old !== undefined) {
|
|
567
|
-
const intent = credentialStorage.decode(old[r.intentSnapshot]);
|
|
568
|
-
|
|
569
|
-
if (
|
|
570
|
-
intent.moduleId !== input.moduleId ||
|
|
571
|
-
intent.revision.subjectId !== input.subjectId ||
|
|
572
|
-
intent.credentialId !== input.credentialId ||
|
|
573
|
-
!mapping.subjectId.equals(old[r.subjectId], current.nativeId) ||
|
|
574
|
-
old[r.credentialId] !== input.credentialId
|
|
575
|
-
)
|
|
576
|
-
return { _tag: "Conflict" } as const;
|
|
577
|
-
const metadata = mapping.metadata.condition(current.nativeId);
|
|
578
|
-
|
|
579
|
-
if (!(yield* owner.check(metadata))) return { _tag: "Rejected" } as const;
|
|
580
|
-
owner.postconditions.push(metadata);
|
|
581
|
-
|
|
582
|
-
return { _tag: "Replay", result: unlinkedStorage.decode(old[r.decision]) } as const;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
const credential = yield* targetCredential(
|
|
586
|
-
mapping,
|
|
587
|
-
input.moduleId,
|
|
588
|
-
input.credentialId,
|
|
589
|
-
current,
|
|
590
|
-
);
|
|
591
|
-
|
|
592
|
-
return credential === undefined
|
|
593
|
-
? ({ _tag: "Rejected" } as const)
|
|
594
|
-
: ({ _tag: "Target", credential } as const);
|
|
595
|
-
}),
|
|
596
|
-
);
|
|
597
|
-
|
|
598
|
-
const remainingEligibility = (mapping: any, current: any, removed: string) =>
|
|
599
|
-
Effect.flatMap(CurrentOAuthTransaction, (owner) =>
|
|
600
|
-
Effect.gen(function* () {
|
|
601
|
-
invariant(mapping.eligibility.length > 0 && mapping.eligibility.length <= 32);
|
|
602
|
-
const facts = new Map<string, OAuthEligibilityFact>();
|
|
603
|
-
|
|
604
|
-
const revisions = new Map(
|
|
605
|
-
current.revision.credentials.map((item: any) => [item.credentialId, item.revision]),
|
|
606
|
-
);
|
|
607
|
-
|
|
608
|
-
for (const descriptor of mapping.eligibility) {
|
|
609
|
-
const observed = yield* owner.read(
|
|
610
|
-
descriptor.table,
|
|
611
|
-
both(
|
|
612
|
-
eq(col(descriptor.table, descriptor.subjectId), current.nativeId),
|
|
613
|
-
descriptor.condition(current.nativeId),
|
|
614
|
-
),
|
|
615
|
-
{ orderBy: col(descriptor.table, descriptor.credentialId) },
|
|
616
|
-
);
|
|
617
|
-
|
|
618
|
-
for (const row of observed.rows) {
|
|
619
|
-
const fact = descriptor.decode(copiedRow(row)) as OAuthEligibilityFact | undefined;
|
|
620
|
-
|
|
621
|
-
if (fact === undefined || fact.credentialId === removed) continue;
|
|
622
|
-
invariant(
|
|
623
|
-
fact.credentialId === row[descriptor.credentialId] &&
|
|
624
|
-
fact.revision === row[descriptor.revision] &&
|
|
625
|
-
revisions.get(fact.credentialId) === fact.revision &&
|
|
626
|
-
fact.factors.length <= 8 &&
|
|
627
|
-
fact.factors.every((factor) =>
|
|
628
|
-
["knowledge", "possession", "inherence"].includes(factor),
|
|
629
|
-
),
|
|
630
|
-
);
|
|
631
|
-
invariant(
|
|
632
|
-
typeof fact.usablePrimary === "boolean" &&
|
|
633
|
-
typeof fact.userVerified === "boolean" &&
|
|
634
|
-
typeof fact.phishingResistant === "boolean",
|
|
635
|
-
);
|
|
636
|
-
|
|
637
|
-
const normalized = {
|
|
638
|
-
credentialId: fact.credentialId,
|
|
639
|
-
revision: fact.revision,
|
|
640
|
-
usablePrimary: fact.usablePrimary,
|
|
641
|
-
factors: [...new Set(fact.factors)].sort(),
|
|
642
|
-
userVerified: fact.userVerified,
|
|
643
|
-
phishingResistant: fact.phishingResistant,
|
|
644
|
-
};
|
|
645
|
-
|
|
646
|
-
const prior = facts.get(fact.credentialId);
|
|
647
|
-
|
|
648
|
-
// oxlint-disable-next-line no-restricted-properties -- Canonical bounded eligibility fact fingerprint rejects contradictory duplicate IDs.
|
|
649
|
-
invariant(prior === undefined || JSON.stringify(prior) === JSON.stringify(normalized));
|
|
650
|
-
facts.set(fact.credentialId, normalized);
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
const available = [...facts.values()];
|
|
654
|
-
|
|
655
|
-
const requirement = snapshotOAuthSync(
|
|
656
|
-
AuthenticationRequirement,
|
|
657
|
-
mapping.subject.decodeAuthenticationRequirement(copiedRow(current.row)),
|
|
658
|
-
);
|
|
659
|
-
|
|
660
|
-
return available.some((fact) => fact.usablePrimary) && satisfies(available, requirement);
|
|
661
|
-
}),
|
|
662
|
-
);
|
|
663
|
-
|
|
664
|
-
const unlink = (mapping: any, input: any) =>
|
|
665
|
-
Effect.flatMap(CurrentOAuthTransaction, (owner) =>
|
|
666
|
-
Effect.gen(function* () {
|
|
667
|
-
const expected = snapshotOAuthSync(OAuthCredentialSnapshot, input.credential);
|
|
668
|
-
|
|
669
|
-
invariant(expected.moduleId === input.moduleId);
|
|
670
|
-
const current = yield* accountCurrent(mapping, expected.revision.subjectId);
|
|
671
|
-
|
|
672
|
-
if (current === undefined) return { _tag: "Rejected" } as const;
|
|
673
|
-
|
|
674
|
-
const guards: ReadonlyArray<OAuthReferenceGuardDescriptor<unknown>> =
|
|
675
|
-
mapping.connectedReferenceGuards ?? [];
|
|
676
|
-
|
|
677
|
-
invariant(guards.length <= 32);
|
|
678
|
-
let referencesGuarded = mapping.connectedReference !== undefined && guards.length > 0;
|
|
679
|
-
|
|
680
|
-
if (mapping.connectedReference !== undefined)
|
|
681
|
-
for (const guard of guards) {
|
|
682
|
-
const condition = guard.condition({
|
|
683
|
-
identity: snapshotOAuthSync(
|
|
684
|
-
OAuthCredentialSnapshot.fields.identity,
|
|
685
|
-
expected.identity,
|
|
686
|
-
),
|
|
687
|
-
identityKey: yield* oauthIdentityKey(expected.identity),
|
|
688
|
-
subjectId: copiedRow({ value: current.nativeId }).value,
|
|
689
|
-
});
|
|
690
|
-
|
|
691
|
-
const read = yield* owner.read(
|
|
692
|
-
guard.table,
|
|
693
|
-
Effect.isEffect(condition) ? yield* condition : condition,
|
|
694
|
-
{ orderBy: col(guard.table, guard.orderBy) },
|
|
695
|
-
);
|
|
696
|
-
|
|
697
|
-
if (read.rows.length === 0) referencesGuarded = false;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
const command = yield* unlinkCommand(mapping, input.moduleId, input.commandId),
|
|
701
|
-
r = mapping.command;
|
|
702
|
-
|
|
703
|
-
const previous = command.rows[0];
|
|
704
|
-
|
|
705
|
-
if (previous !== undefined) {
|
|
706
|
-
if (
|
|
707
|
-
previous[r.intentSnapshot] !== credentialStorage.encode(expected) ||
|
|
708
|
-
previous[r.credentialId] !== expected.credentialId ||
|
|
709
|
-
!mapping.subjectId.equals(previous[r.subjectId], current.nativeId)
|
|
710
|
-
)
|
|
711
|
-
return { _tag: "Conflict" } as const;
|
|
712
|
-
const metadata = mapping.metadata.condition(current.nativeId);
|
|
713
|
-
|
|
714
|
-
if (!(yield* owner.check(metadata))) return { _tag: "Rejected" } as const;
|
|
715
|
-
owner.postconditions.push(metadata);
|
|
716
|
-
|
|
717
|
-
return {
|
|
718
|
-
_tag: "Unlinked",
|
|
719
|
-
replayed: true,
|
|
720
|
-
result: unlinkedStorage.decode(previous[r.decision]),
|
|
721
|
-
} as const;
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
const actual = yield* targetCredential(
|
|
725
|
-
mapping,
|
|
726
|
-
input.moduleId,
|
|
727
|
-
expected.credentialId,
|
|
728
|
-
current,
|
|
729
|
-
);
|
|
730
|
-
|
|
731
|
-
if (
|
|
732
|
-
actual === undefined ||
|
|
733
|
-
credentialStorage.encode(actual) !== credentialStorage.encode(expected)
|
|
734
|
-
)
|
|
735
|
-
return { _tag: "Rejected" } as const;
|
|
736
|
-
const auth = snapshotOAuthSync(OAuthActionAuthorization, input.authorization);
|
|
737
|
-
|
|
738
|
-
if (
|
|
739
|
-
auth.challenge.moduleId !== input.moduleId ||
|
|
740
|
-
!(yield* authorization(
|
|
741
|
-
mapping,
|
|
742
|
-
current,
|
|
743
|
-
auth,
|
|
744
|
-
"unlink",
|
|
745
|
-
input.commandId,
|
|
746
|
-
input.commandId,
|
|
747
|
-
credentialStorage.encode(expected),
|
|
748
|
-
auth.requirement.maximumAgeMillis,
|
|
749
|
-
))
|
|
750
|
-
)
|
|
751
|
-
return { _tag: "Rejected" } as const;
|
|
752
|
-
if (!(yield* remainingEligibility(mapping, current, expected.credentialId)))
|
|
753
|
-
return { _tag: "LastSignInMethod" } as const;
|
|
754
|
-
|
|
755
|
-
const invalidation = checkInvalidation(mapping, input.invalidation),
|
|
756
|
-
cr = mapping.credential,
|
|
757
|
-
a = mapping.authority;
|
|
758
|
-
|
|
759
|
-
const key = yield* oauthIdentityKey(expected.identity),
|
|
760
|
-
t = mapping.ownership.tuple;
|
|
761
|
-
|
|
762
|
-
const connected = mapping.connectedReference?.({
|
|
763
|
-
identityKey: key,
|
|
764
|
-
subjectId: copiedRow({ value: current.nativeId }).value,
|
|
765
|
-
});
|
|
766
|
-
|
|
767
|
-
const retain =
|
|
768
|
-
connected !== undefined && (!referencesGuarded || (yield* owner.check(connected)));
|
|
769
|
-
|
|
770
|
-
if (connected !== undefined && referencesGuarded)
|
|
771
|
-
owner.postconditions.push(retain ? connected : sql`not (${connected})`);
|
|
772
|
-
yield* owner.remove(cr.table, { [cr.credentialId]: expected.credentialId });
|
|
773
|
-
yield* owner.remove(a.table, {
|
|
774
|
-
[a.subjectId]: current.nativeId,
|
|
775
|
-
[a.credentialId]: expected.credentialId,
|
|
776
|
-
});
|
|
777
|
-
if (!retain) {
|
|
778
|
-
yield* owner.update(
|
|
779
|
-
t.table,
|
|
780
|
-
{ [t.identityKey]: key },
|
|
781
|
-
{
|
|
782
|
-
[t.state]: "Unowned",
|
|
783
|
-
[t.subjectId]: null,
|
|
784
|
-
[t.reservation]: null,
|
|
785
|
-
[t.version]: owner.marker,
|
|
786
|
-
},
|
|
787
|
-
);
|
|
788
|
-
if (mapping.ownership.mode === "separate")
|
|
789
|
-
yield* owner.remove(mapping.ownership.external.table, {
|
|
790
|
-
[mapping.ownership.external.identityKey]: key,
|
|
791
|
-
});
|
|
792
|
-
}
|
|
793
|
-
yield* advance(mapping, current, expected.credentialId);
|
|
794
|
-
|
|
795
|
-
const result = snapshotOAuthSync(OAuthUnlinked, {
|
|
796
|
-
_tag: "Unlinked",
|
|
797
|
-
credentialId: expected.credentialId,
|
|
798
|
-
invalidation,
|
|
799
|
-
});
|
|
800
|
-
|
|
801
|
-
const now = yield* owner.now(mapping.clock);
|
|
802
|
-
|
|
803
|
-
invariant(
|
|
804
|
-
Number.isSafeInteger(input.retentionUntilMillis) &&
|
|
805
|
-
input.retentionUntilMillis > now &&
|
|
806
|
-
input.retentionUntilMillis >= input.nowMillis + 120000,
|
|
807
|
-
);
|
|
808
|
-
const commandKey = { [r.moduleId]: input.moduleId, [r.commandId]: input.commandId };
|
|
809
|
-
|
|
810
|
-
const values = {
|
|
811
|
-
...r.encodeInsert({
|
|
812
|
-
moduleId: input.moduleId,
|
|
813
|
-
commandId: input.commandId,
|
|
814
|
-
credential: snapshotOAuthSync(OAuthCredentialSnapshot, expected),
|
|
815
|
-
}),
|
|
816
|
-
...commandKey,
|
|
817
|
-
[r.subjectId]: current.nativeId,
|
|
818
|
-
[r.credentialId]: expected.credentialId,
|
|
819
|
-
[r.intentSnapshot]: credentialStorage.encode(expected),
|
|
820
|
-
[r.decision]: unlinkedStorage.encode(result),
|
|
821
|
-
[r.retentionUntil]: mapping.clock.encodeInstant(input.retentionUntilMillis),
|
|
822
|
-
};
|
|
823
|
-
|
|
824
|
-
const inserted = yield* owner.insert(r.table, values, commandKey);
|
|
825
|
-
|
|
826
|
-
command.rows = inserted.rows;
|
|
827
|
-
|
|
828
|
-
return { _tag: "Unlinked", result, replayed: false } as const;
|
|
829
|
-
}),
|
|
830
|
-
);
|
|
831
|
-
|
|
832
|
-
return { accountCurrent, issueLink, preflightLink, claimLink, settleLink, inspectUnlink, unlink };
|
|
833
|
-
});
|
|
834
|
-
|
|
835
|
-
export class OAuthAccounts extends Context.Service<OAuthAccounts, Effect.Success<typeof make>>()(
|
|
836
|
-
"effect-auth/persistence/OAuthAccounts",
|
|
837
|
-
) {
|
|
838
|
-
static readonly layer = Layer.effect(OAuthAccounts, make);
|
|
839
|
-
}
|