@yielded/auth-persistence-drizzle 0.1.0-beta.14 → 0.1.0-beta.16
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/dist/D1.d.mts +123 -9
- package/dist/Libsql.d.mts +141 -27
- package/dist/Mysql2.d.mts +124 -10
- package/dist/Pglite.d.mts +124 -10
- package/dist/Postgres.d.mts +129 -15
- package/dist/SqliteBun.d.mts +135 -21
- package/dist/SqliteDo.d.mts +135 -21
- package/dist/SqliteNode.d.mts +135 -21
- package/dist/SqliteWasm.d.mts +135 -21
- package/dist/drizzle/d1-emails.d.mts +3 -3
- package/dist/drizzle/d1-emails.mjs +56 -11
- package/dist/drizzle/d1-emails.mjs.map +1 -1
- package/dist/drizzle/d1-identity.mjs +9 -2
- package/dist/drizzle/d1-identity.mjs.map +1 -1
- package/dist/drizzle/d1-oauth.d.mts +6 -6
- package/dist/drizzle/d1-oauth.mjs +8 -8
- package/dist/drizzle/d1-oauth.mjs.map +1 -1
- package/dist/drizzle/d1-passkey.d.mts +2 -1
- package/dist/drizzle/d1-passkey.mjs +10 -8
- package/dist/drizzle/d1-passkey.mjs.map +1 -1
- package/dist/drizzle/d1-password-prepared.d.mts +1 -1
- package/dist/drizzle/d1-password-prepared.mjs +16 -5
- package/dist/drizzle/d1-password-prepared.mjs.map +1 -1
- package/dist/drizzle/d1-passwords.d.mts +2 -2
- package/dist/drizzle/d1-passwords.mjs +19 -6
- package/dist/drizzle/d1-passwords.mjs.map +1 -1
- package/dist/drizzle/d1-phone.d.mts +2 -1
- package/dist/drizzle/d1-phone.mjs +4 -2
- package/dist/drizzle/d1-phone.mjs.map +1 -1
- package/dist/drizzle/d1-proofs.d.mts +1 -1
- package/dist/drizzle/d1-proofs.mjs +18 -7
- package/dist/drizzle/d1-proofs.mjs.map +1 -1
- package/dist/drizzle/d1-sessions.d.mts +6 -5
- package/dist/drizzle/d1-sessions.mjs +29 -19
- package/dist/drizzle/d1-sessions.mjs.map +1 -1
- package/dist/drizzle/d1-totp.d.mts +2 -1
- package/dist/drizzle/d1-totp.mjs +4 -2
- package/dist/drizzle/d1-totp.mjs.map +1 -1
- package/dist/drizzle/email-registration.d.mts +5 -1
- package/dist/drizzle/email-registration.mjs +48 -4
- package/dist/drizzle/email-registration.mjs.map +1 -1
- package/dist/drizzle/email-target.d.mts +1 -0
- package/dist/drizzle/email-target.mjs +9 -0
- package/dist/drizzle/email-target.mjs.map +1 -1
- package/dist/drizzle/mysql-emails.d.mts +4 -4
- package/dist/drizzle/mysql-emails.mjs +8 -7
- package/dist/drizzle/mysql-emails.mjs.map +1 -1
- package/dist/drizzle/mysql-identity.mjs +11 -4
- package/dist/drizzle/mysql-identity.mjs.map +1 -1
- package/dist/drizzle/mysql-password-prepared.d.mts +2 -2
- package/dist/drizzle/mysql-password-prepared.mjs +4 -3
- package/dist/drizzle/mysql-password-prepared.mjs.map +1 -1
- package/dist/drizzle/mysql-passwords.d.mts +3 -3
- package/dist/drizzle/mysql-passwords.mjs +7 -6
- package/dist/drizzle/mysql-passwords.mjs.map +1 -1
- package/dist/drizzle/mysql-proofs.d.mts +2 -2
- package/dist/drizzle/mysql-proofs.mjs +4 -3
- package/dist/drizzle/mysql-proofs.mjs.map +1 -1
- package/dist/drizzle/mysql-sessions.d.mts +6 -6
- package/dist/drizzle/mysql-sessions.mjs +16 -15
- package/dist/drizzle/mysql-sessions.mjs.map +1 -1
- package/dist/drizzle/native-database.mjs +1 -1
- package/dist/drizzle/native-database.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-drivers.mjs +10 -8
- package/dist/drizzle/oauth-connected-drivers.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-flow.mjs +62 -13
- package/dist/drizzle/oauth-connected-flow.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-input.mjs +6 -0
- package/dist/drizzle/oauth-connected-input.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-maintenance.mjs +3 -3
- package/dist/drizzle/oauth-connected-maintenance.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-target.d.mts +116 -2
- package/dist/drizzle/oauth-connected-target.mjs +5 -3
- package/dist/drizzle/oauth-connected-target.mjs.map +1 -1
- package/dist/drizzle/oauth-drivers.mjs +8 -8
- package/dist/drizzle/oauth-drivers.mjs.map +1 -1
- package/dist/drizzle/oauth-target.d.mts +3 -3
- package/dist/drizzle/oauth-target.mjs +8 -6
- package/dist/drizzle/oauth-target.mjs.map +1 -1
- package/dist/drizzle/passkey-drivers.mjs +4 -4
- package/dist/drizzle/passkey-drivers.mjs.map +1 -1
- package/dist/drizzle/passkey-write-drivers.mjs +4 -4
- package/dist/drizzle/passkey-write-drivers.mjs.map +1 -1
- package/dist/drizzle/passkey-write-target.d.mts +1 -1
- package/dist/drizzle/password-prepared-sql.mjs +5 -0
- package/dist/drizzle/password-prepared-sql.mjs.map +1 -1
- package/dist/drizzle/password-prepared-target.d.mts +2 -1
- package/dist/drizzle/password-prepared-target.mjs +5 -0
- package/dist/drizzle/password-prepared-target.mjs.map +1 -1
- package/dist/drizzle/password-registration.d.mts +1 -1
- package/dist/drizzle/password-registration.mjs +2 -0
- package/dist/drizzle/password-registration.mjs.map +1 -1
- package/dist/drizzle/password-target.d.mts +1 -0
- package/dist/drizzle/password-target.mjs +6 -0
- package/dist/drizzle/password-target.mjs.map +1 -1
- package/dist/drizzle/pg-emails.d.mts +4 -4
- package/dist/drizzle/pg-emails.mjs +8 -7
- package/dist/drizzle/pg-emails.mjs.map +1 -1
- package/dist/drizzle/pg-identity.mjs +12 -5
- package/dist/drizzle/pg-identity.mjs.map +1 -1
- package/dist/drizzle/pg-password-prepared.d.mts +2 -2
- package/dist/drizzle/pg-password-prepared.mjs +4 -3
- package/dist/drizzle/pg-password-prepared.mjs.map +1 -1
- package/dist/drizzle/pg-passwords.d.mts +3 -3
- package/dist/drizzle/pg-passwords.mjs +7 -6
- package/dist/drizzle/pg-passwords.mjs.map +1 -1
- package/dist/drizzle/pg-proofs.d.mts +2 -2
- package/dist/drizzle/pg-proofs.mjs +4 -3
- package/dist/drizzle/pg-proofs.mjs.map +1 -1
- package/dist/drizzle/pg-sessions.d.mts +6 -6
- package/dist/drizzle/pg-sessions.mjs +16 -15
- package/dist/drizzle/pg-sessions.mjs.map +1 -1
- package/dist/drizzle/phone-target.mjs +11 -2
- package/dist/drizzle/phone-target.mjs.map +1 -1
- package/dist/drizzle/proof-target.d.mts +1 -0
- package/dist/drizzle/proof-target.mjs +2 -0
- package/dist/drizzle/proof-target.mjs.map +1 -1
- package/dist/drizzle/query-operations.mjs +2 -0
- package/dist/drizzle/query-operations.mjs.map +1 -1
- package/dist/drizzle/session-target.d.mts +1 -0
- package/dist/drizzle/session-target.mjs +9 -6
- package/dist/drizzle/session-target.mjs.map +1 -1
- package/dist/drizzle/sqlite-emails.mjs +8 -7
- package/dist/drizzle/sqlite-emails.mjs.map +1 -1
- package/dist/drizzle/sqlite-identity.mjs +7 -2
- package/dist/drizzle/sqlite-identity.mjs.map +1 -1
- package/dist/drizzle/sqlite-password-prepared.mjs +4 -3
- package/dist/drizzle/sqlite-password-prepared.mjs.map +1 -1
- package/dist/drizzle/sqlite-passwords.mjs +7 -6
- package/dist/drizzle/sqlite-passwords.mjs.map +1 -1
- package/dist/drizzle/sqlite-proofs.mjs +4 -3
- package/dist/drizzle/sqlite-proofs.mjs.map +1 -1
- package/dist/drizzle/sqlite-sessions.mjs +16 -15
- package/dist/drizzle/sqlite-sessions.mjs.map +1 -1
- package/dist/drizzle/storage-validation.mjs +234 -0
- package/dist/drizzle/storage-validation.mjs.map +1 -0
- package/dist/drizzle/totp-target.mjs +5 -2
- package/dist/drizzle/totp-target.mjs.map +1 -1
- package/dist/drizzle/transaction-mysql.mjs +1 -1
- package/package.json +1 -1
- package/src/drizzle/d1-emails.ts +158 -40
- package/src/drizzle/d1-identity.ts +13 -0
- package/src/drizzle/d1-oauth.ts +8 -8
- package/src/drizzle/d1-passkey.ts +10 -8
- package/src/drizzle/d1-password-prepared.ts +14 -2
- package/src/drizzle/d1-passwords.ts +22 -4
- package/src/drizzle/d1-phone.ts +4 -2
- package/src/drizzle/d1-proofs.ts +55 -3
- package/src/drizzle/d1-sessions.ts +67 -18
- package/src/drizzle/d1-totp.ts +4 -2
- package/src/drizzle/email-registration.ts +160 -12
- package/src/drizzle/email-target.ts +22 -4
- package/src/drizzle/mysql-emails.ts +17 -7
- package/src/drizzle/mysql-identity.ts +13 -0
- package/src/drizzle/mysql-password-prepared.ts +7 -3
- package/src/drizzle/mysql-passwords.ts +13 -6
- package/src/drizzle/mysql-proofs.ts +7 -3
- package/src/drizzle/mysql-sessions.ts +31 -15
- package/src/drizzle/native-database.ts +5 -4
- package/src/drizzle/oauth-connected-drivers.ts +10 -8
- package/src/drizzle/oauth-connected-flow.ts +98 -10
- package/src/drizzle/oauth-connected-input.ts +7 -0
- package/src/drizzle/oauth-connected-maintenance.ts +3 -2
- package/src/drizzle/oauth-connected-target.ts +4 -2
- package/src/drizzle/oauth-drivers.ts +8 -8
- package/src/drizzle/oauth-target.ts +13 -7
- package/src/drizzle/passkey-drivers.ts +4 -4
- package/src/drizzle/passkey-write-drivers.ts +8 -5
- package/src/drizzle/password-prepared-sql.ts +13 -1
- package/src/drizzle/password-prepared-target.ts +7 -1
- package/src/drizzle/password-registration.ts +10 -3
- package/src/drizzle/password-target.ts +22 -4
- package/src/drizzle/pg-emails.ts +17 -7
- package/src/drizzle/pg-identity.ts +13 -0
- package/src/drizzle/pg-password-prepared.ts +7 -3
- package/src/drizzle/pg-passwords.ts +13 -6
- package/src/drizzle/pg-proofs.ts +7 -3
- package/src/drizzle/pg-sessions.ts +31 -15
- package/src/drizzle/phone-target.ts +30 -5
- package/src/drizzle/proof-target.ts +10 -2
- package/src/drizzle/query-operations.ts +2 -0
- package/src/drizzle/session-target.ts +20 -3
- package/src/drizzle/sqlite-emails.ts +17 -7
- package/src/drizzle/sqlite-identity.ts +5 -0
- package/src/drizzle/sqlite-password-prepared.ts +7 -3
- package/src/drizzle/sqlite-passwords.ts +13 -6
- package/src/drizzle/sqlite-proofs.ts +7 -3
- package/src/drizzle/sqlite-sessions.ts +31 -15
- package/src/drizzle/storage-validation.ts +285 -0
- package/src/drizzle/totp-target.ts +16 -4
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
type PhoneMapping,
|
|
29
29
|
type PhoneMappingSource,
|
|
30
30
|
type PhonePersistenceServices,
|
|
31
|
+
type PhoneProofCompletionMapping,
|
|
31
32
|
requiredPhoneConstraints,
|
|
32
33
|
} from "./phone-model";
|
|
33
34
|
import {
|
|
@@ -43,6 +44,7 @@ import {
|
|
|
43
44
|
} from "./phone-state";
|
|
44
45
|
import { requiredProofConstraints } from "./proof-model";
|
|
45
46
|
import { completeProofPlanIn, CurrentProofSql } from "./proof-sql";
|
|
47
|
+
import { validateDrizzleStorage } from "./storage-validation";
|
|
46
48
|
import type { SuppliedService } from "./SuppliedService";
|
|
47
49
|
import {
|
|
48
50
|
coordinateTransactionOwner,
|
|
@@ -277,6 +279,11 @@ export const makeTargetPhonePersistence = <
|
|
|
277
279
|
catch: () => PhoneConfigurationError.make({}),
|
|
278
280
|
});
|
|
279
281
|
|
|
282
|
+
yield* validateDrizzleStorage({
|
|
283
|
+
...mapping,
|
|
284
|
+
proofs: phoneProofs(mapping.proofs),
|
|
285
|
+
}).pipe(Effect.mapError(() => PhoneConfigurationError.make({})));
|
|
286
|
+
|
|
280
287
|
const execution = yield* makeTransactionExecution(
|
|
281
288
|
CurrentPhoneTransaction,
|
|
282
289
|
configuration,
|
|
@@ -287,7 +294,13 @@ export const makeTargetPhonePersistence = <
|
|
|
287
294
|
return yield* services(mapping, execution, configuration);
|
|
288
295
|
});
|
|
289
296
|
|
|
290
|
-
export const coordinateTargetPhone = <
|
|
297
|
+
export const coordinateTargetPhone = <
|
|
298
|
+
M extends { readonly proofs: PhoneProofCompletionMapping },
|
|
299
|
+
A,
|
|
300
|
+
E,
|
|
301
|
+
R,
|
|
302
|
+
RSetup = never,
|
|
303
|
+
>(
|
|
291
304
|
database: TransactionNativeDatabase,
|
|
292
305
|
source: PhoneMappingSource<M, RSetup>,
|
|
293
306
|
configuration: PhoneTargetConfiguration,
|
|
@@ -296,7 +309,7 @@ export const coordinateTargetPhone = <M, A, E, R, RSetup = never>(
|
|
|
296
309
|
services: PhonePersistenceServices,
|
|
297
310
|
append: (statement: Statement<any>) => void,
|
|
298
311
|
) => Effect.Effect<A, E, R>,
|
|
299
|
-
): Effect.Effect<A, PhoneCoordinatorError<E>, R | RSetup | LifecycleHooks> =>
|
|
312
|
+
): Effect.Effect<A, PhoneCoordinatorError<E>, R | RSetup | LifecycleHooks | NativeDatabase> =>
|
|
300
313
|
Effect.gen(function* () {
|
|
301
314
|
const original = yield* Effect.isEffect(source) ? source : Effect.succeed(source);
|
|
302
315
|
|
|
@@ -305,6 +318,11 @@ export const coordinateTargetPhone = <M, A, E, R, RSetup = never>(
|
|
|
305
318
|
catch: () => PhoneConfigurationError.make({}),
|
|
306
319
|
});
|
|
307
320
|
|
|
321
|
+
yield* validateDrizzleStorage({
|
|
322
|
+
...mapping,
|
|
323
|
+
proofs: phoneProofs(mapping.proofs),
|
|
324
|
+
}).pipe(Effect.mapError(() => PhoneConfigurationError.make({})));
|
|
325
|
+
|
|
308
326
|
return yield* coordinateTransactionOwner(
|
|
309
327
|
database,
|
|
310
328
|
CurrentPhoneTransaction,
|
|
@@ -437,12 +455,19 @@ export const makePhoneTarget = <
|
|
|
437
455
|
| RSetup
|
|
438
456
|
| DatabaseRequirements
|
|
439
457
|
> {
|
|
440
|
-
return Effect.flatMap(acquire, (database) =>
|
|
458
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
441
459
|
coordinateTargetPhone(
|
|
442
460
|
database as any,
|
|
443
461
|
options.mapping,
|
|
444
462
|
configuration,
|
|
445
|
-
(
|
|
463
|
+
(
|
|
464
|
+
transaction: TransactionOf<Database>,
|
|
465
|
+
services,
|
|
466
|
+
): Effect.Effect<
|
|
467
|
+
A,
|
|
468
|
+
E,
|
|
469
|
+
Exclude<R, PhonePersistence | PhoneAdmission | PhoneSignInTargets>
|
|
470
|
+
> => {
|
|
446
471
|
const provided = Context.make(PhonePersistence, services.phonePersistence).pipe(
|
|
447
472
|
Context.add(PhoneAdmission, services.phoneAdmission),
|
|
448
473
|
Context.add(PhoneSignInTargets, services.phoneSignInTargets),
|
|
@@ -454,7 +479,7 @@ export const makePhoneTarget = <
|
|
|
454
479
|
? work
|
|
455
480
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
456
481
|
},
|
|
457
|
-
),
|
|
482
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
458
483
|
);
|
|
459
484
|
}
|
|
460
485
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NativeDatabase } from "@yielded/auth-persistence/Adapter";
|
|
1
2
|
import {
|
|
2
3
|
coordinateCommit,
|
|
3
4
|
hasCommitScope,
|
|
@@ -17,6 +18,7 @@ import {
|
|
|
17
18
|
type ProofSqlQuery,
|
|
18
19
|
} from "./proof-sql";
|
|
19
20
|
import { sqlClientStandaloneGuard, type TransactionService } from "./standalone-guard";
|
|
21
|
+
import { validateDrizzleStorage } from "./storage-validation";
|
|
20
22
|
|
|
21
23
|
export interface ProofTargetConfiguration {
|
|
22
24
|
readonly mode: "interactive" | "synchronous";
|
|
@@ -83,13 +85,19 @@ export const coordinateTargetProofPersistence = <Transaction, A, E, R>(
|
|
|
83
85
|
transaction: Transaction,
|
|
84
86
|
services: { readonly proofPersistence: ProofPersistence["Service"] },
|
|
85
87
|
) => Effect.Effect<A, E, R>,
|
|
86
|
-
): Effect.Effect<A, ProofCoordinatorError<E>, R | LifecycleHooks> =>
|
|
87
|
-
Effect.gen(function* (): Effect.fn.Return<
|
|
88
|
+
): Effect.Effect<A, ProofCoordinatorError<E>, R | LifecycleHooks | NativeDatabase> =>
|
|
89
|
+
Effect.gen(function* (): Effect.fn.Return<
|
|
90
|
+
A,
|
|
91
|
+
ProofCoordinatorError<E>,
|
|
92
|
+
R | LifecycleHooks | NativeDatabase
|
|
93
|
+
> {
|
|
88
94
|
const hooks = yield* LifecycleHooks;
|
|
89
95
|
|
|
90
96
|
if (yield* hasCommitScope) return yield* ProofUnavailable.make({});
|
|
91
97
|
yield* configuration.coordinatorGuard ?? configuration.standaloneGuard;
|
|
92
98
|
|
|
99
|
+
yield* validateDrizzleStorage(mapping).pipe(Effect.mapError(() => ProofUnavailable.make({})));
|
|
100
|
+
|
|
93
101
|
const result = yield* coordinateCommit(
|
|
94
102
|
() =>
|
|
95
103
|
database.transaction((transaction) =>
|
|
@@ -18,8 +18,10 @@ import {
|
|
|
18
18
|
|
|
19
19
|
import { balancedD1And, compactD1GeneratedStatement } from "./d1-generated-statement";
|
|
20
20
|
import { column, updateValues } from "./model";
|
|
21
|
+
import { validateDrizzleStorage } from "./storage-validation";
|
|
21
22
|
|
|
22
23
|
const operations = {
|
|
24
|
+
validateStorage: validateDrizzleStorage,
|
|
23
25
|
and,
|
|
24
26
|
asc,
|
|
25
27
|
or,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NativeDatabase } from "@yielded/auth-persistence/Adapter";
|
|
1
2
|
import {
|
|
2
3
|
coordinateCommit,
|
|
3
4
|
hasCommitScope,
|
|
@@ -28,6 +29,7 @@ import {
|
|
|
28
29
|
type SessionSqlOptions,
|
|
29
30
|
} from "./session-sql";
|
|
30
31
|
import { sqlClientStandaloneGuard, type TransactionService } from "./standalone-guard";
|
|
32
|
+
import { validateDrizzleStorage } from "./storage-validation";
|
|
31
33
|
|
|
32
34
|
export interface SessionTargetConfiguration {
|
|
33
35
|
readonly mode: "interactive" | "synchronous";
|
|
@@ -53,6 +55,7 @@ const options = (
|
|
|
53
55
|
configuration: SessionTargetConfiguration,
|
|
54
56
|
transactionBound = false,
|
|
55
57
|
): SessionSqlOptions => ({
|
|
58
|
+
coordinated: transactionBound,
|
|
56
59
|
mode: configuration.mode,
|
|
57
60
|
locking: configuration.locking,
|
|
58
61
|
standaloneGuard: transactionBound ? Effect.void : configuration.standaloneGuard,
|
|
@@ -101,13 +104,22 @@ export const makeTargetSignedSessionValidityServices = (
|
|
|
101
104
|
const coordinate = <Transaction, Services, A, E, R>(
|
|
102
105
|
database: TransactionOwner<Transaction>,
|
|
103
106
|
configuration: SessionTargetConfiguration,
|
|
104
|
-
|
|
107
|
+
mapping: object,
|
|
108
|
+
make: (
|
|
109
|
+
transaction: Transaction,
|
|
110
|
+
) => Effect.Effect<Services, SessionUnavailable, LifecycleHooks | NativeDatabase>,
|
|
105
111
|
owner: (transaction: Transaction, services: Services) => Effect.Effect<A, E, R>,
|
|
106
|
-
): Effect.Effect<A, CoordinatorError<E>, R | LifecycleHooks> =>
|
|
107
|
-
Effect.gen(function* (): Effect.fn.Return<
|
|
112
|
+
): Effect.Effect<A, CoordinatorError<E>, R | LifecycleHooks | NativeDatabase> =>
|
|
113
|
+
Effect.gen(function* (): Effect.fn.Return<
|
|
114
|
+
A,
|
|
115
|
+
CoordinatorError<E>,
|
|
116
|
+
R | LifecycleHooks | NativeDatabase
|
|
117
|
+
> {
|
|
108
118
|
if (yield* hasCommitScope) return yield* SessionUnavailable.make({});
|
|
109
119
|
yield* configuration.coordinatorGuard ?? configuration.standaloneGuard;
|
|
110
120
|
|
|
121
|
+
yield* validateDrizzleStorage(mapping).pipe(Effect.mapError(() => SessionUnavailable.make({})));
|
|
122
|
+
|
|
111
123
|
const result = yield* coordinateCommit(
|
|
112
124
|
() =>
|
|
113
125
|
database.transaction((transaction) =>
|
|
@@ -137,6 +149,7 @@ export const coordinateTargetAuthenticationAuthority = <Claims, Transaction, A,
|
|
|
137
149
|
coordinate(
|
|
138
150
|
database,
|
|
139
151
|
configuration,
|
|
152
|
+
mapping,
|
|
140
153
|
(transaction) =>
|
|
141
154
|
Effect.map(
|
|
142
155
|
makeSqlAuthenticationAuthority<Claims>(mapping, options(configuration, true)).pipe(
|
|
@@ -159,6 +172,7 @@ export const coordinateTargetPendingAuthentication = <Claims, Transaction, A, E,
|
|
|
159
172
|
coordinate(
|
|
160
173
|
database,
|
|
161
174
|
configuration,
|
|
175
|
+
mapping,
|
|
162
176
|
(transaction) =>
|
|
163
177
|
Effect.map(
|
|
164
178
|
makeSqlPendingAuthentication<Claims>(mapping, options(configuration, true)).pipe(
|
|
@@ -184,6 +198,7 @@ export const coordinateTargetStatefulSessions = <Claims, Transaction, A, E, R>(
|
|
|
184
198
|
coordinate(
|
|
185
199
|
database,
|
|
186
200
|
configuration,
|
|
201
|
+
mapping,
|
|
187
202
|
(transaction) =>
|
|
188
203
|
makeSqlStatefulSessions<Claims>(mapping, options(configuration, true)).pipe(
|
|
189
204
|
Effect.provideService(CurrentSessionSql, transaction as unknown as SessionSqlDatabase),
|
|
@@ -203,6 +218,7 @@ export const coordinateTargetSignedSessionValidity = <Transaction, A, E, R>(
|
|
|
203
218
|
coordinate(
|
|
204
219
|
database,
|
|
205
220
|
configuration,
|
|
221
|
+
mapping,
|
|
206
222
|
(transaction) =>
|
|
207
223
|
Effect.map(
|
|
208
224
|
makeSqlSignedValidity(mapping, options(configuration, true)).pipe(
|
|
@@ -307,6 +323,7 @@ export const coordinateTargetSessionStepUp = <Claims, Id, Transaction, A, E, R>(
|
|
|
307
323
|
coordinate(
|
|
308
324
|
database,
|
|
309
325
|
configuration,
|
|
326
|
+
mapping,
|
|
310
327
|
(transaction) =>
|
|
311
328
|
Effect.map(
|
|
312
329
|
makeSqlSessionStepUp<Claims>(mapping, options(configuration, true)).pipe(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NativeDatabase } from "@yielded/auth-persistence/Adapter";
|
|
1
2
|
import { EmailAddressPersistence, type EmailUnavailable } from "@yielded/auth/Email";
|
|
2
3
|
import type { LifecycleHooks, HookConfigurationError } from "@yielded/auth/Hooks";
|
|
3
4
|
/* oxlint-disable no-explicit-any -- proof mapping tables are independently typed by the proof owner; this driver forwards them unchanged to the shared target. */
|
|
@@ -189,7 +190,7 @@ export const makeSqliteEmailTarget = <
|
|
|
189
190
|
E | EmailUnavailable | HookConfigurationError | SqlError | DatabaseError,
|
|
190
191
|
Exclude<R, EmailAddressPersistence> | LifecycleHooks | DatabaseRequirements
|
|
191
192
|
> {
|
|
192
|
-
return Effect.flatMap(acquire, (database) =>
|
|
193
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
193
194
|
coordinateTargetEmailAddress<
|
|
194
195
|
TransactionOf<Database>,
|
|
195
196
|
Out,
|
|
@@ -211,7 +212,7 @@ export const makeSqliteEmailTarget = <
|
|
|
211
212
|
? work
|
|
212
213
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
213
214
|
},
|
|
214
|
-
),
|
|
215
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
215
216
|
);
|
|
216
217
|
}
|
|
217
218
|
function coordinateEmailRegistration<
|
|
@@ -309,7 +310,7 @@ export const makeSqliteEmailTarget = <
|
|
|
309
310
|
E | EmailUnavailable | HookConfigurationError | SqlError | DatabaseError,
|
|
310
311
|
Exclude<R, TargetId> | LifecycleHooks | DatabaseRequirements
|
|
311
312
|
> {
|
|
312
|
-
return Effect.flatMap(acquire, (database) =>
|
|
313
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
313
314
|
coordinateTargetEmailRegistration<
|
|
314
315
|
Registration,
|
|
315
316
|
TransactionOf<Database>,
|
|
@@ -332,7 +333,7 @@ export const makeSqliteEmailTarget = <
|
|
|
332
333
|
? work
|
|
333
334
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
334
335
|
},
|
|
335
|
-
),
|
|
336
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
336
337
|
);
|
|
337
338
|
}
|
|
338
339
|
|
|
@@ -347,7 +348,10 @@ export const makeSqliteEmailTarget = <
|
|
|
347
348
|
) =>
|
|
348
349
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
349
350
|
makeTargetEmailSignInServices(mapping, configuration),
|
|
350
|
-
).pipe(
|
|
351
|
+
).pipe(
|
|
352
|
+
Effect.provideServiceEffect(CurrentEmailSql, nativeDatabase(databaseService)),
|
|
353
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
354
|
+
),
|
|
351
355
|
makeEmailAddressServices: <
|
|
352
356
|
S extends AnySQLiteTable,
|
|
353
357
|
I extends AnySQLiteTable,
|
|
@@ -361,7 +365,10 @@ export const makeSqliteEmailTarget = <
|
|
|
361
365
|
) =>
|
|
362
366
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
363
367
|
makeTargetEmailAddressServices(mapping, proofMapping, configuration),
|
|
364
|
-
).pipe(
|
|
368
|
+
).pipe(
|
|
369
|
+
Effect.provideServiceEffect(CurrentEmailSql, nativeDatabase(databaseService)),
|
|
370
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
371
|
+
),
|
|
365
372
|
coordinateEmailAddress,
|
|
366
373
|
makeEmailRegistrationServices: <
|
|
367
374
|
Registration,
|
|
@@ -377,7 +384,10 @@ export const makeSqliteEmailTarget = <
|
|
|
377
384
|
) =>
|
|
378
385
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
379
386
|
makeTargetEmailRegistrationServices<Registration>(mapping, proofMapping, configuration),
|
|
380
|
-
).pipe(
|
|
387
|
+
).pipe(
|
|
388
|
+
Effect.provideServiceEffect(CurrentEmailSql, nativeDatabase(databaseService)),
|
|
389
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
390
|
+
),
|
|
381
391
|
coordinateEmailRegistration,
|
|
382
392
|
};
|
|
383
393
|
};
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
type IdentityTables,
|
|
27
27
|
type SubjectProvisioningTables,
|
|
28
28
|
} from "./model";
|
|
29
|
+
import { validateDrizzleStorage } from "./storage-validation";
|
|
29
30
|
|
|
30
31
|
type ClosedQueryEffectHKT = QueryEffectHKTBase & { readonly context: never };
|
|
31
32
|
type RuntimeDatabase = SQLiteEffectDatabase<ClosedQueryEffectHKT, unknown, any>;
|
|
@@ -52,6 +53,8 @@ export const makeSqliteSubjectProvisioningServices = Effect.fnUntraced(function*
|
|
|
52
53
|
) {
|
|
53
54
|
const database = yield* NativeDatabase;
|
|
54
55
|
|
|
56
|
+
yield* validateDrizzleStorage(mapping).pipe(Effect.mapError(() => IdentityUnavailable.make()));
|
|
57
|
+
|
|
55
58
|
const db = database as unknown as RuntimeDatabase;
|
|
56
59
|
const requestTable = mapping.provisioningRequest.table;
|
|
57
60
|
|
|
@@ -200,6 +203,8 @@ export const makeSqliteExternalIdentityServices = Effect.fnUntraced(function* <
|
|
|
200
203
|
>(mapping: ExternalIdentityTables<Subject, External, NativeId>) {
|
|
201
204
|
const database = yield* NativeDatabase;
|
|
202
205
|
|
|
206
|
+
yield* validateDrizzleStorage(mapping).pipe(Effect.mapError(() => IdentityUnavailable.make()));
|
|
207
|
+
|
|
203
208
|
const db = database as unknown as RuntimeDatabase;
|
|
204
209
|
const externalTable = mapping.externalIdentity.table;
|
|
205
210
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NativeDatabase } from "@yielded/auth-persistence/Adapter";
|
|
1
2
|
import type { LifecycleHooks, HookConfigurationError } from "@yielded/auth/Hooks";
|
|
2
3
|
import type { PasswordUnavailable, PasswordPreparedPersistence } from "@yielded/auth/Password";
|
|
3
4
|
import type { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
@@ -216,7 +217,7 @@ export const makeSqlitePasswordPreparedTarget = <
|
|
|
216
217
|
E | PasswordUnavailable | HookConfigurationError | SqlError | DatabaseError,
|
|
217
218
|
Exclude<R, TargetId> | LifecycleHooks | DatabaseRequirements
|
|
218
219
|
> {
|
|
219
|
-
return Effect.flatMap(acquire, (database) =>
|
|
220
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
220
221
|
coordinateTargetPasswordPreparedPersistence<
|
|
221
222
|
TransactionOf<Database>,
|
|
222
223
|
Out,
|
|
@@ -238,7 +239,7 @@ export const makeSqlitePasswordPreparedTarget = <
|
|
|
238
239
|
? work
|
|
239
240
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
240
241
|
},
|
|
241
|
-
),
|
|
242
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
242
243
|
);
|
|
243
244
|
}
|
|
244
245
|
|
|
@@ -268,7 +269,10 @@ export const makeSqlitePasswordPreparedTarget = <
|
|
|
268
269
|
) =>
|
|
269
270
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
270
271
|
makeTargetPasswordPreparedPersistenceServices(mapping, configuration, proofMapping),
|
|
271
|
-
).pipe(
|
|
272
|
+
).pipe(
|
|
273
|
+
Effect.provideServiceEffect(CurrentPasswordSql, nativeDatabase(databaseService)),
|
|
274
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
275
|
+
),
|
|
272
276
|
coordinatePasswordPreparedPersistence,
|
|
273
277
|
};
|
|
274
278
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NativeDatabase } from "@yielded/auth-persistence/Adapter";
|
|
1
2
|
import type { LifecycleHooks, HookConfigurationError } from "@yielded/auth/Hooks";
|
|
2
3
|
import { type PasswordUnavailable, PasswordPersistence } from "@yielded/auth/Password";
|
|
3
4
|
/* oxlint-disable no-explicit-any -- proof mapping tables are independently typed by the proof owner; this driver forwards them unchanged to the shared target. */
|
|
@@ -304,7 +305,7 @@ export const makeSqlitePasswordTarget = <
|
|
|
304
305
|
E | PasswordUnavailable | HookConfigurationError | SqlError | DatabaseError,
|
|
305
306
|
Exclude<R, PasswordPersistence> | LifecycleHooks | DatabaseRequirements
|
|
306
307
|
> {
|
|
307
|
-
return Effect.flatMap(acquire, (database) =>
|
|
308
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
308
309
|
coordinateSqlitePasswordPersistence(
|
|
309
310
|
database,
|
|
310
311
|
options.mapping,
|
|
@@ -321,7 +322,7 @@ export const makeSqlitePasswordTarget = <
|
|
|
321
322
|
? work
|
|
322
323
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
323
324
|
},
|
|
324
|
-
),
|
|
325
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
325
326
|
);
|
|
326
327
|
}
|
|
327
328
|
function coordinatePasswordRegistration<
|
|
@@ -440,7 +441,7 @@ export const makeSqlitePasswordTarget = <
|
|
|
440
441
|
E | PasswordUnavailable | HookConfigurationError | SqlError | DatabaseError,
|
|
441
442
|
Exclude<R, TargetId> | LifecycleHooks | DatabaseRequirements
|
|
442
443
|
> {
|
|
443
|
-
return Effect.flatMap(acquire, (database) =>
|
|
444
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
444
445
|
coordinateSqlitePasswordRegistration(
|
|
445
446
|
database,
|
|
446
447
|
options.mapping,
|
|
@@ -456,7 +457,7 @@ export const makeSqlitePasswordTarget = <
|
|
|
456
457
|
? work
|
|
457
458
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
458
459
|
},
|
|
459
|
-
),
|
|
460
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
460
461
|
);
|
|
461
462
|
}
|
|
462
463
|
|
|
@@ -490,7 +491,10 @@ export const makeSqlitePasswordTarget = <
|
|
|
490
491
|
) =>
|
|
491
492
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
492
493
|
makeSqlitePasswordPersistenceServices(mapping, configuration, proofMapping),
|
|
493
|
-
).pipe(
|
|
494
|
+
).pipe(
|
|
495
|
+
Effect.provideServiceEffect(CurrentPasswordSql, nativeDatabase(databaseService)),
|
|
496
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
497
|
+
),
|
|
494
498
|
coordinatePasswordPersistence,
|
|
495
499
|
makePasswordRegistrationServices: <
|
|
496
500
|
Registration,
|
|
@@ -505,7 +509,10 @@ export const makeSqlitePasswordTarget = <
|
|
|
505
509
|
) =>
|
|
506
510
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
507
511
|
makeSqlitePasswordRegistrationServices(mapping, configuration),
|
|
508
|
-
).pipe(
|
|
512
|
+
).pipe(
|
|
513
|
+
Effect.provideServiceEffect(CurrentPasswordSql, nativeDatabase(databaseService)),
|
|
514
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
515
|
+
),
|
|
509
516
|
coordinatePasswordRegistration,
|
|
510
517
|
};
|
|
511
518
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NativeDatabase } from "@yielded/auth-persistence/Adapter";
|
|
1
2
|
import type { LifecycleHooks, HookConfigurationError } from "@yielded/auth/Hooks";
|
|
2
3
|
import { type ProofUnavailable, ProofPersistence } from "@yielded/auth/Proofs";
|
|
3
4
|
import type { AnyRelations } from "drizzle-orm";
|
|
@@ -180,7 +181,7 @@ export const makeSqliteProofTarget = <
|
|
|
180
181
|
E | ProofUnavailable | HookConfigurationError | SqlError | DatabaseError,
|
|
181
182
|
Exclude<R, ProofPersistence> | LifecycleHooks | DatabaseRequirements
|
|
182
183
|
> {
|
|
183
|
-
return Effect.flatMap(acquire, (database) =>
|
|
184
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
184
185
|
coordinateTargetProofPersistence<TransactionOf<Database>, A, E, Exclude<R, ProofPersistence>>(
|
|
185
186
|
database,
|
|
186
187
|
options.mapping,
|
|
@@ -196,7 +197,7 @@ export const makeSqliteProofTarget = <
|
|
|
196
197
|
? work
|
|
197
198
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
198
199
|
},
|
|
199
|
-
),
|
|
200
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
200
201
|
);
|
|
201
202
|
}
|
|
202
203
|
|
|
@@ -219,7 +220,10 @@ export const makeSqliteProofTarget = <
|
|
|
219
220
|
) =>
|
|
220
221
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
221
222
|
makeTargetProofPersistenceServices(mapping, configuration),
|
|
222
|
-
).pipe(
|
|
223
|
+
).pipe(
|
|
224
|
+
Effect.provideServiceEffect(CurrentProofSql, nativeDatabase(databaseService)),
|
|
225
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
226
|
+
),
|
|
223
227
|
coordinateProofPersistence,
|
|
224
228
|
};
|
|
225
229
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NativeDatabase } from "@yielded/auth-persistence/Adapter";
|
|
1
2
|
import type { LifecycleHooks, HookConfigurationError } from "@yielded/auth/Hooks";
|
|
2
3
|
import {
|
|
3
4
|
AuthenticationAuthority,
|
|
@@ -364,7 +365,7 @@ export const makeSqliteSessionTarget = <
|
|
|
364
365
|
E | SessionUnavailable | HookConfigurationError | SqlError | DatabaseError,
|
|
365
366
|
Exclude<R, Id> | LifecycleHooks | DatabaseRequirements
|
|
366
367
|
> {
|
|
367
|
-
return Effect.flatMap(acquire, (database) =>
|
|
368
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
368
369
|
coordinateSqliteSessionStepUp(
|
|
369
370
|
database,
|
|
370
371
|
options.mapping,
|
|
@@ -381,7 +382,7 @@ export const makeSqliteSessionTarget = <
|
|
|
381
382
|
? work
|
|
382
383
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
383
384
|
},
|
|
384
|
-
),
|
|
385
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
385
386
|
);
|
|
386
387
|
}
|
|
387
388
|
function coordinateAuthenticationAuthority<
|
|
@@ -471,7 +472,7 @@ export const makeSqliteSessionTarget = <
|
|
|
471
472
|
E | SessionUnavailable | HookConfigurationError | SqlError | DatabaseError,
|
|
472
473
|
Exclude<R, AuthenticationAuthority> | LifecycleHooks | DatabaseRequirements
|
|
473
474
|
> {
|
|
474
|
-
return Effect.flatMap(acquire, (database) =>
|
|
475
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
475
476
|
coordinateSqliteAuthenticationAuthority(
|
|
476
477
|
database,
|
|
477
478
|
options.mapping,
|
|
@@ -487,7 +488,7 @@ export const makeSqliteSessionTarget = <
|
|
|
487
488
|
? work
|
|
488
489
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
489
490
|
},
|
|
490
|
-
),
|
|
491
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
491
492
|
);
|
|
492
493
|
}
|
|
493
494
|
function coordinatePendingAuthentication<
|
|
@@ -579,7 +580,7 @@ export const makeSqliteSessionTarget = <
|
|
|
579
580
|
E | SessionUnavailable | HookConfigurationError | SqlError | DatabaseError,
|
|
580
581
|
Exclude<R, TargetId> | LifecycleHooks | DatabaseRequirements
|
|
581
582
|
> {
|
|
582
|
-
return Effect.flatMap(acquire, (database) =>
|
|
583
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
583
584
|
coordinateSqlitePendingAuthentication(
|
|
584
585
|
database,
|
|
585
586
|
options.mapping,
|
|
@@ -595,7 +596,7 @@ export const makeSqliteSessionTarget = <
|
|
|
595
596
|
? work
|
|
596
597
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
597
598
|
},
|
|
598
|
-
),
|
|
599
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
599
600
|
);
|
|
600
601
|
}
|
|
601
602
|
function coordinateStatefulSessions<
|
|
@@ -730,7 +731,7 @@ export const makeSqliteSessionTarget = <
|
|
|
730
731
|
E | SessionUnavailable | HookConfigurationError | SqlError | DatabaseError,
|
|
731
732
|
Exclude<R, PersistenceId | RepositoryId> | LifecycleHooks | DatabaseRequirements
|
|
732
733
|
> {
|
|
733
|
-
return Effect.flatMap(acquire, (database) =>
|
|
734
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
734
735
|
coordinateSqliteStatefulSessions(
|
|
735
736
|
database,
|
|
736
737
|
options.mapping,
|
|
@@ -753,7 +754,7 @@ export const makeSqliteSessionTarget = <
|
|
|
753
754
|
? work
|
|
754
755
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
755
756
|
},
|
|
756
|
-
),
|
|
757
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
757
758
|
);
|
|
758
759
|
}
|
|
759
760
|
function coordinateSignedSessionValidity<
|
|
@@ -839,7 +840,7 @@ export const makeSqliteSessionTarget = <
|
|
|
839
840
|
E | SessionUnavailable | HookConfigurationError | SqlError | DatabaseError,
|
|
840
841
|
Exclude<R, TargetId> | LifecycleHooks | DatabaseRequirements
|
|
841
842
|
> {
|
|
842
|
-
return Effect.flatMap(acquire, (database) =>
|
|
843
|
+
return Effect.flatMap(nativeDatabase(acquire), (database) =>
|
|
843
844
|
coordinateSqliteSignedSessionValidity(
|
|
844
845
|
database,
|
|
845
846
|
options.mapping,
|
|
@@ -855,7 +856,7 @@ export const makeSqliteSessionTarget = <
|
|
|
855
856
|
? work
|
|
856
857
|
: Effect.provideService(work, options.transaction, options.transaction.of(transaction));
|
|
857
858
|
},
|
|
858
|
-
),
|
|
859
|
+
).pipe(Effect.provideService(NativeDatabase, database)),
|
|
859
860
|
);
|
|
860
861
|
}
|
|
861
862
|
|
|
@@ -885,7 +886,10 @@ export const makeSqliteSessionTarget = <
|
|
|
885
886
|
) =>
|
|
886
887
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
887
888
|
makeSqliteSessionStepUpServices(mapping, target, configuration),
|
|
888
|
-
).pipe(
|
|
889
|
+
).pipe(
|
|
890
|
+
Effect.provideServiceEffect(CurrentSessionSql, nativeDatabase(databaseService)),
|
|
891
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
892
|
+
),
|
|
889
893
|
coordinateSessionStepUp,
|
|
890
894
|
makeAuthenticationAuthorityServices: <
|
|
891
895
|
Claims,
|
|
@@ -899,7 +903,10 @@ export const makeSqliteSessionTarget = <
|
|
|
899
903
|
) =>
|
|
900
904
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
901
905
|
makeSqliteAuthenticationAuthorityServices(mapping, configuration),
|
|
902
|
-
).pipe(
|
|
906
|
+
).pipe(
|
|
907
|
+
Effect.provideServiceEffect(CurrentSessionSql, nativeDatabase(databaseService)),
|
|
908
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
909
|
+
),
|
|
903
910
|
makePendingAuthenticationServices: <
|
|
904
911
|
Claims,
|
|
905
912
|
S extends AnySQLiteTable,
|
|
@@ -912,7 +919,10 @@ export const makeSqliteSessionTarget = <
|
|
|
912
919
|
) =>
|
|
913
920
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
914
921
|
makeSqlitePendingAuthenticationServices(mapping, configuration),
|
|
915
|
-
).pipe(
|
|
922
|
+
).pipe(
|
|
923
|
+
Effect.provideServiceEffect(CurrentSessionSql, nativeDatabase(databaseService)),
|
|
924
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
925
|
+
),
|
|
916
926
|
makeStatefulSessionServices: <
|
|
917
927
|
Claims,
|
|
918
928
|
S extends AnySQLiteTable,
|
|
@@ -927,7 +937,10 @@ export const makeSqliteSessionTarget = <
|
|
|
927
937
|
) =>
|
|
928
938
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
929
939
|
makeSqliteStatefulSessionServices(mapping, configuration),
|
|
930
|
-
).pipe(
|
|
940
|
+
).pipe(
|
|
941
|
+
Effect.provideServiceEffect(CurrentSessionSql, nativeDatabase(databaseService)),
|
|
942
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
943
|
+
),
|
|
931
944
|
makeSignedSessionValidityServices: <
|
|
932
945
|
S extends AnySQLiteTable,
|
|
933
946
|
T extends AnySQLiteTable,
|
|
@@ -938,7 +951,10 @@ export const makeSqliteSessionTarget = <
|
|
|
938
951
|
) =>
|
|
939
952
|
Effect.flatMap(standaloneConfiguration, (configuration) =>
|
|
940
953
|
makeSqliteSignedSessionValidityServices(mapping, configuration),
|
|
941
|
-
).pipe(
|
|
954
|
+
).pipe(
|
|
955
|
+
Effect.provideServiceEffect(CurrentSessionSql, nativeDatabase(databaseService)),
|
|
956
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
957
|
+
),
|
|
942
958
|
coordinateAuthenticationAuthority,
|
|
943
959
|
coordinatePendingAuthentication,
|
|
944
960
|
coordinateStatefulSessions,
|