@yielded/auth-persistence-drizzle 0.1.0-beta.22 → 0.1.0-beta.24
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 +3 -0
- package/dist/D1.d.mts +11 -11
- package/dist/D1.mjs +2 -1
- package/dist/D1.mjs.map +1 -1
- package/dist/Libsql.d.mts +40 -56
- package/dist/Libsql.mjs +2 -1
- package/dist/Libsql.mjs.map +1 -1
- package/dist/Mysql2.d.mts +16 -17
- package/dist/Pglite.d.mts +18 -18
- package/dist/Pglite.mjs +2 -1
- package/dist/Pglite.mjs.map +1 -1
- package/dist/Postgres.d.mts +24 -24
- package/dist/Postgres.mjs +2 -1
- package/dist/Postgres.mjs.map +1 -1
- package/dist/SqliteBun.d.mts +39 -55
- package/dist/SqliteBun.mjs +2 -1
- package/dist/SqliteBun.mjs.map +1 -1
- package/dist/SqliteDo.d.mts +48 -64
- package/dist/SqliteDo.mjs +2 -1
- package/dist/SqliteDo.mjs.map +1 -1
- package/dist/SqliteNode.d.mts +45 -61
- package/dist/SqliteNode.mjs +2 -1
- package/dist/SqliteNode.mjs.map +1 -1
- package/dist/SqliteWasm.d.mts +48 -64
- package/dist/SqliteWasm.mjs +2 -1
- package/dist/SqliteWasm.mjs.map +1 -1
- package/dist/drizzle/crypto.mjs +1 -1
- package/dist/drizzle/d1-emails.d.mts +1 -1
- package/dist/drizzle/d1-oauth.d.mts +14 -14
- package/dist/drizzle/d1-passkey.d.mts +1 -1
- package/dist/drizzle/d1-password-prepared.d.mts +4 -4
- package/dist/drizzle/d1-password-prepared.mjs.map +1 -1
- package/dist/drizzle/d1-passwords.d.mts +18 -35
- package/dist/drizzle/d1-passwords.mjs +78 -290
- package/dist/drizzle/d1-passwords.mjs.map +1 -1
- package/dist/drizzle/d1-phone.d.mts +1 -1
- package/dist/drizzle/d1-proofs.d.mts +2 -2
- package/dist/drizzle/d1-sessions.d.mts +3 -3
- package/dist/drizzle/d1-sessions.mjs +11 -6
- package/dist/drizzle/d1-sessions.mjs.map +1 -1
- package/dist/drizzle/d1-totp.d.mts +1 -1
- package/dist/drizzle/mysql-password-prepared.d.mts +5 -5
- package/dist/drizzle/mysql-password-prepared.mjs.map +1 -1
- package/dist/drizzle/mysql-passwords.d.mts +16 -32
- package/dist/drizzle/mysql-passwords.mjs.map +1 -1
- package/dist/drizzle/mysql-sessions.d.mts +1 -1
- package/dist/drizzle/native-sql-table.mjs +135 -0
- package/dist/drizzle/native-sql-table.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-model.d.mts +20 -281
- package/dist/drizzle/oauth-connected-model.mjs +3 -17
- package/dist/drizzle/oauth-connected-model.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-reference.d.mts +1 -3
- package/dist/drizzle/oauth-connected-reference.mjs +4 -53
- package/dist/drizzle/oauth-connected-reference.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-target.d.mts +3 -990
- package/dist/drizzle/oauth-connected-target.mjs +8 -92
- package/dist/drizzle/oauth-connected-target.mjs.map +1 -1
- package/dist/drizzle/oauth-kernel.mjs +11 -0
- package/dist/drizzle/oauth-kernel.mjs.map +1 -0
- package/dist/drizzle/oauth-model.d.mts +35 -438
- package/dist/drizzle/oauth-model.mjs +6 -44
- package/dist/drizzle/oauth-model.mjs.map +1 -1
- package/dist/drizzle/oauth-mysql.mjs +2 -2
- package/dist/drizzle/oauth-mysql.mjs.map +1 -1
- package/dist/drizzle/oauth-proxy.d.mts +10 -0
- package/dist/drizzle/oauth-proxy.mjs +54 -0
- package/dist/drizzle/oauth-proxy.mjs.map +1 -0
- package/dist/drizzle/oauth-target.d.mts +6 -107
- package/dist/drizzle/oauth-target.mjs +15 -245
- package/dist/drizzle/oauth-target.mjs.map +1 -1
- package/dist/drizzle/password-model.d.mts +5 -8
- package/dist/drizzle/password-prepared-model.d.mts +5 -5
- package/dist/drizzle/password-prepared-model.mjs.map +1 -1
- package/dist/drizzle/password-prepared-state.mjs +1 -1
- package/dist/drizzle/password-sql.mjs +2 -1
- package/dist/drizzle/password-sql.mjs.map +1 -1
- package/dist/drizzle/password-target.mjs +13 -2
- package/dist/drizzle/password-target.mjs.map +1 -1
- package/dist/drizzle/pg-password-prepared.d.mts +5 -5
- package/dist/drizzle/pg-password-prepared.mjs.map +1 -1
- package/dist/drizzle/pg-passwords.d.mts +16 -32
- package/dist/drizzle/pg-passwords.mjs.map +1 -1
- package/dist/drizzle/pg-sessions.d.mts +1 -1
- package/dist/drizzle/phone-target.d.mts +2 -2
- package/dist/drizzle/phone-target.mjs +1 -1
- package/dist/drizzle/query-operations.mjs +3 -1
- package/dist/drizzle/query-operations.mjs.map +1 -1
- package/dist/drizzle/session-sql.mjs +2 -1
- package/dist/drizzle/session-sql.mjs.map +1 -1
- package/dist/drizzle/sqlite-password-prepared.mjs.map +1 -1
- package/dist/drizzle/sqlite-passwords.mjs.map +1 -1
- package/dist/drizzle/storage-validation.mjs +10 -198
- package/dist/drizzle/storage-validation.mjs.map +1 -1
- package/dist/drizzle/totp-target.d.mts +3 -3
- package/dist/drizzle/totp-target.mjs +2 -2
- package/dist/drizzle/transaction-execution.d.mts +2 -2
- package/dist/drizzle/transaction-owner.d.mts +1 -2
- package/dist/index.d.mts +3 -2
- package/dist/internal/drizzle-postgres-oauth-proxy.d.mts +138 -0
- package/dist/internal/drizzle-postgres-oauth-proxy.mjs +29 -0
- package/dist/internal/drizzle-postgres-oauth-proxy.mjs.map +1 -0
- package/dist/internal/drizzle-postgres.mjs +2 -0
- package/dist/internal/drizzle-postgres.mjs.map +1 -1
- package/dist/internal/drizzle-sqlite-oauth-proxy.d.mts +146 -0
- package/dist/internal/drizzle-sqlite-oauth-proxy.mjs +29 -0
- package/dist/internal/drizzle-sqlite-oauth-proxy.mjs.map +1 -0
- package/dist/internal/drizzle-sqlite.mjs +2 -0
- package/dist/internal/drizzle-sqlite.mjs.map +1 -1
- package/package.json +1 -1
- package/src/D1.ts +2 -0
- package/src/Libsql.ts +2 -0
- package/src/Pglite.ts +2 -0
- package/src/Postgres.ts +2 -0
- package/src/SqliteBun.ts +2 -0
- package/src/SqliteDo.ts +2 -0
- package/src/SqliteNode.ts +2 -0
- package/src/SqliteWasm.ts +2 -0
- package/src/drizzle/d1-password-prepared.ts +2 -23
- package/src/drizzle/d1-passwords.ts +158 -780
- package/src/drizzle/d1-sessions.ts +21 -6
- package/src/drizzle/mysql-password-prepared.ts +4 -16
- package/src/drizzle/mysql-passwords.ts +5 -20
- package/src/drizzle/native-sql-table.ts +259 -0
- package/src/drizzle/oauth-connected-model.ts +97 -315
- package/src/drizzle/oauth-connected-reference.ts +13 -93
- package/src/drizzle/oauth-connected-target.ts +14 -271
- package/src/drizzle/oauth-kernel.ts +10 -0
- package/src/drizzle/oauth-model.ts +188 -541
- package/src/drizzle/oauth-mysql.ts +2 -2
- package/src/drizzle/oauth-proxy.ts +101 -0
- package/src/drizzle/oauth-target.ts +33 -737
- package/src/drizzle/password-model.ts +0 -33
- package/src/drizzle/password-prepared-model.ts +0 -18
- package/src/drizzle/password-sql.ts +3 -0
- package/src/drizzle/password-target.ts +41 -4
- package/src/drizzle/pg-password-prepared.ts +4 -16
- package/src/drizzle/pg-passwords.ts +5 -20
- package/src/drizzle/query-operations.ts +4 -0
- package/src/drizzle/session-sql.ts +2 -1
- package/src/drizzle/sqlite-password-prepared.ts +4 -52
- package/src/drizzle/sqlite-passwords.ts +7 -28
- package/src/drizzle/storage-validation.ts +13 -222
- package/src/index.ts +2 -8
- package/src/internal/drizzle-postgres-oauth-proxy.ts +37 -0
- package/src/internal/drizzle-postgres.ts +2 -0
- package/src/internal/drizzle-sqlite-oauth-proxy.ts +44 -0
- package/src/internal/drizzle-sqlite.ts +2 -0
- package/dist/_virtual/_rolldown/runtime.mjs +0 -13
- package/dist/drizzle/oauth-accounts.mjs +0 -359
- package/dist/drizzle/oauth-accounts.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-access.mjs +0 -212
- package/dist/drizzle/oauth-connected-access.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-collection.mjs +0 -202
- package/dist/drizzle/oauth-connected-collection.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-custody.mjs +0 -147
- package/dist/drizzle/oauth-connected-custody.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-flow.mjs +0 -297
- package/dist/drizzle/oauth-connected-flow.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-input.mjs +0 -122
- package/dist/drizzle/oauth-connected-input.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-maintenance.mjs +0 -214
- package/dist/drizzle/oauth-connected-maintenance.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-management.mjs +0 -229
- package/dist/drizzle/oauth-connected-management.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-settlement.mjs +0 -128
- package/dist/drizzle/oauth-connected-settlement.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-sign-in.mjs +0 -265
- package/dist/drizzle/oauth-connected-sign-in.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-state.d.mts +0 -2062
- package/dist/drizzle/oauth-connected-state.mjs +0 -430
- package/dist/drizzle/oauth-connected-state.mjs.map +0 -1
- package/dist/drizzle/oauth-flow.d.mts +0 -22
- package/dist/drizzle/oauth-flow.mjs +0 -253
- package/dist/drizzle/oauth-flow.mjs.map +0 -1
- package/dist/drizzle/oauth-input.mjs +0 -127
- package/dist/drizzle/oauth-input.mjs.map +0 -1
- package/dist/drizzle/oauth-owner.d.mts +0 -10
- package/dist/drizzle/oauth-owner.mjs +0 -10
- package/dist/drizzle/oauth-owner.mjs.map +0 -1
- package/dist/drizzle/oauth-registration.d.mts +0 -5
- package/dist/drizzle/oauth-registration.mjs +0 -374
- package/dist/drizzle/oauth-registration.mjs.map +0 -1
- package/dist/drizzle/oauth-state.mjs +0 -107
- package/dist/drizzle/oauth-state.mjs.map +0 -1
- package/src/drizzle/oauth-accounts.ts +0 -805
- package/src/drizzle/oauth-connected-access.ts +0 -361
- package/src/drizzle/oauth-connected-collection.ts +0 -324
- package/src/drizzle/oauth-connected-custody.ts +0 -279
- package/src/drizzle/oauth-connected-flow.ts +0 -529
- package/src/drizzle/oauth-connected-input.ts +0 -147
- package/src/drizzle/oauth-connected-maintenance.ts +0 -346
- package/src/drizzle/oauth-connected-management.ts +0 -365
- package/src/drizzle/oauth-connected-settlement.ts +0 -251
- package/src/drizzle/oauth-connected-sign-in.ts +0 -443
- package/src/drizzle/oauth-connected-state.ts +0 -872
- package/src/drizzle/oauth-flow.ts +0 -462
- package/src/drizzle/oauth-input.ts +0 -201
- package/src/drizzle/oauth-owner.ts +0 -29
- package/src/drizzle/oauth-registration.ts +0 -640
- package/src/drizzle/oauth-state.ts +0 -218
|
@@ -1,331 +1,140 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
| "Claimed"
|
|
20
|
-
| "Verified"
|
|
21
|
-
| "RegistrationIssued"
|
|
22
|
-
| "Linked"
|
|
23
|
-
| "Cancelled"
|
|
24
|
-
| "Rejected"
|
|
25
|
-
| "Ambiguous"
|
|
26
|
-
| "Conflict";
|
|
27
|
-
|
|
28
|
-
export type OAuthTupleState = "Unowned" | "Reserved" | "Owned";
|
|
29
|
-
export type OAuthRegistrationState = "Unbound" | "Registered" | "ProvisioningPending" | "Rejected";
|
|
30
|
-
export type OAuthAction = OAuthActionAuthorization["challenge"]["action"];
|
|
1
|
+
import * as Shared from "@yielded/auth-persistence/Adapter";
|
|
2
|
+
import type { SQL, Table } from "drizzle-orm";
|
|
3
|
+
|
|
4
|
+
import type { DrizzleTableModel } from "./table-model";
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
type OAuthFlowState,
|
|
8
|
+
type OAuthTupleState,
|
|
9
|
+
type OAuthRegistrationState,
|
|
10
|
+
type OAuthAction,
|
|
11
|
+
type OAuthEligibilityFact,
|
|
12
|
+
type OAuthD1Mapping,
|
|
13
|
+
requiredOAuthSignInConstraints,
|
|
14
|
+
requiredOAuthTupleConstraints,
|
|
15
|
+
requiredOAuthRegistrationConstraints,
|
|
16
|
+
requiredOAuthAccountsConstraints,
|
|
17
|
+
type OAuthRegistrationAuthority,
|
|
18
|
+
} from "@yielded/auth-persistence/Adapter";
|
|
31
19
|
|
|
32
20
|
/** The engine writes every critical column explicitly after applying the pure
|
|
33
21
|
* consumer encoder. Native instant values must roundtrip without precision loss. */
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
export
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export interface OAuthCredentialReadTable<C extends Table> {
|
|
82
|
-
readonly table: C;
|
|
83
|
-
readonly moduleId: Column<C>;
|
|
84
|
-
readonly credentialId: Column<C>;
|
|
85
|
-
readonly subjectId: Column<C>;
|
|
86
|
-
readonly identityKey: Column<C>;
|
|
87
|
-
readonly credentialRevision: Column<C>;
|
|
88
|
-
readonly status: Column<C>;
|
|
89
|
-
readonly isActiveStatus: (value: unknown) => boolean;
|
|
90
|
-
readonly activeCondition: SQL;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface OAuthCredentialTable<C extends Table, N> extends OAuthCredentialReadTable<C> {
|
|
94
|
-
readonly encodeInsert: (input: {
|
|
95
|
-
readonly moduleId: string;
|
|
96
|
-
readonly subjectId: N;
|
|
97
|
-
readonly identityKey: string;
|
|
98
|
-
readonly credentialId: string;
|
|
99
|
-
readonly credentialRevision: SecurityRevision;
|
|
100
|
-
}) => InferInsertModel<C>;
|
|
101
|
-
/** This slice removes login rows. Historical records belong in separate audit storage. */
|
|
102
|
-
readonly removal: "delete";
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface OAuthAuthorityReadTable<C extends Table> {
|
|
106
|
-
readonly table: C;
|
|
107
|
-
readonly subjectId: Column<C>;
|
|
108
|
-
readonly credentialId: Column<C>;
|
|
109
|
-
readonly revision: Column<C>;
|
|
110
|
-
readonly status: Column<C>;
|
|
111
|
-
readonly isActiveStatus: (value: unknown) => boolean;
|
|
112
|
-
readonly activeCondition: SQL;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface OAuthAuthorityTable<C extends Table, N> extends OAuthAuthorityReadTable<C> {
|
|
116
|
-
readonly encodeInsert: (input: {
|
|
117
|
-
readonly subjectId: N;
|
|
118
|
-
readonly credentialId: string;
|
|
119
|
-
readonly revision: SecurityRevision;
|
|
120
|
-
}) => InferInsertModel<C>;
|
|
121
|
-
}
|
|
22
|
+
export type OAuthClock = Shared.OAuthClock<SQL>;
|
|
23
|
+
|
|
24
|
+
export type OAuthSubjectReadTable<S extends Table> = Shared.OAuthSubjectReadTable<
|
|
25
|
+
DrizzleTableModel<S>,
|
|
26
|
+
SQL
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
export type OAuthSubjectTable<S extends Table> = Shared.OAuthSubjectTable<
|
|
30
|
+
DrizzleTableModel<S>,
|
|
31
|
+
SQL
|
|
32
|
+
>;
|
|
33
|
+
|
|
34
|
+
export type OAuthOwnershipReadTable<O extends Table, N> = Shared.OAuthOwnershipReadTable<
|
|
35
|
+
DrizzleTableModel<O>,
|
|
36
|
+
N,
|
|
37
|
+
SQL
|
|
38
|
+
>;
|
|
39
|
+
|
|
40
|
+
export type OAuthOwnershipTable<O extends Table, N> = Shared.OAuthOwnershipTable<
|
|
41
|
+
DrizzleTableModel<O>,
|
|
42
|
+
N,
|
|
43
|
+
SQL
|
|
44
|
+
>;
|
|
45
|
+
|
|
46
|
+
export type OAuthCredentialReadTable<C extends Table> = Shared.OAuthCredentialReadTable<
|
|
47
|
+
DrizzleTableModel<C>,
|
|
48
|
+
SQL
|
|
49
|
+
>;
|
|
50
|
+
|
|
51
|
+
export type OAuthCredentialTable<C extends Table, N> = Shared.OAuthCredentialTable<
|
|
52
|
+
DrizzleTableModel<C>,
|
|
53
|
+
N,
|
|
54
|
+
SQL
|
|
55
|
+
>;
|
|
56
|
+
|
|
57
|
+
export type OAuthAuthorityReadTable<C extends Table> = Shared.OAuthAuthorityReadTable<
|
|
58
|
+
DrizzleTableModel<C>,
|
|
59
|
+
SQL
|
|
60
|
+
>;
|
|
61
|
+
|
|
62
|
+
export type OAuthAuthorityTable<C extends Table, N> = Shared.OAuthAuthorityTable<
|
|
63
|
+
DrizzleTableModel<C>,
|
|
64
|
+
N,
|
|
65
|
+
SQL
|
|
66
|
+
>;
|
|
122
67
|
|
|
123
68
|
/** Both purposes may use the same physical table. Shared tables share module/flow
|
|
124
69
|
* and module/command uniqueness. The snapshot has the exact purpose-specific core
|
|
125
70
|
* codec; terminal writes erase it, while identity, claim and retention columns remain. */
|
|
126
|
-
export
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
readonly encodeInsert: (input: {
|
|
146
|
-
readonly moduleId: string;
|
|
147
|
-
readonly flowId: string;
|
|
148
|
-
readonly purpose: "sign-in" | "link";
|
|
149
|
-
}) => InferInsertModel<F>;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface OAuthTupleAuthorityTable<T extends Table, N> {
|
|
153
|
-
readonly table: T;
|
|
154
|
-
readonly identityKey: Column<T>;
|
|
155
|
-
readonly provider: Column<T>;
|
|
156
|
-
readonly issuer: Column<T>;
|
|
157
|
-
readonly externalSubject: Column<T>;
|
|
158
|
-
readonly state: Column<T>;
|
|
159
|
-
readonly version: Column<T>;
|
|
160
|
-
readonly subjectId: Column<T>;
|
|
161
|
-
/** Exact reservation identity; no application payload or bearer. */
|
|
162
|
-
readonly reservation: Column<T>;
|
|
163
|
-
readonly encodeInsert: (input: {
|
|
164
|
-
readonly identityKey: string;
|
|
165
|
-
readonly identity: typeof OAuthExternalIdentity.Type;
|
|
166
|
-
readonly subjectId?: N;
|
|
167
|
-
}) => InferInsertModel<T>;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export interface OAuthRegistrationIntentTable<I extends Table> {
|
|
171
|
-
readonly table: I;
|
|
172
|
-
readonly moduleId: Column<I>;
|
|
173
|
-
readonly reference: Column<I>;
|
|
174
|
-
readonly flowId: Column<I>;
|
|
175
|
-
readonly claimId: Column<I>;
|
|
176
|
-
readonly identityKey: Column<I>;
|
|
177
|
-
readonly version: Column<I>;
|
|
178
|
-
readonly state: Column<I>;
|
|
179
|
-
readonly snapshot: Column<I>;
|
|
180
|
-
readonly commandId: Column<I>;
|
|
181
|
-
readonly fingerprint: Column<I>;
|
|
182
|
-
readonly pendingReference: Column<I>;
|
|
183
|
-
readonly expiresAt: Column<I>;
|
|
184
|
-
readonly retentionUntil: Column<I>;
|
|
185
|
-
readonly encodeInsert: (intent: OAuthRegistrationIntent) => InferInsertModel<I>;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export interface OAuthRegistrationCommandTable<R extends Table, Registration> {
|
|
189
|
-
readonly table: R;
|
|
190
|
-
readonly moduleId: Column<R>;
|
|
191
|
-
readonly commandId: Column<R>;
|
|
192
|
-
readonly reference: Column<R>;
|
|
193
|
-
readonly identityKey: Column<R>;
|
|
194
|
-
readonly fingerprint: Column<R>;
|
|
195
|
-
readonly intentSnapshot: Column<R>;
|
|
196
|
-
readonly applicationSnapshot: Column<R>;
|
|
197
|
-
readonly provisioningIdentity: Column<R>;
|
|
198
|
-
readonly decision: Column<R>;
|
|
199
|
-
readonly retentionUntil: Column<R>;
|
|
200
|
-
/** Persists exact detached Type before protected pending work can start. */
|
|
201
|
-
readonly encodeInsert: (input: {
|
|
202
|
-
readonly intent: OAuthRegistrationIntent;
|
|
203
|
-
readonly commandId: string;
|
|
204
|
-
readonly fingerprint: string;
|
|
205
|
-
readonly registration: Registration;
|
|
206
|
-
readonly provisioningIdentity: string;
|
|
207
|
-
}) => InferInsertModel<R>;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export interface OAuthUnlinkCommandTable<U extends Table> {
|
|
211
|
-
readonly table: U;
|
|
212
|
-
readonly moduleId: Column<U>;
|
|
213
|
-
readonly commandId: Column<U>;
|
|
214
|
-
readonly subjectId: Column<U>;
|
|
215
|
-
readonly credentialId: Column<U>;
|
|
216
|
-
readonly intentSnapshot: Column<U>;
|
|
217
|
-
readonly decision: Column<U>;
|
|
218
|
-
readonly retentionUntil: Column<U>;
|
|
219
|
-
readonly encodeInsert: (input: {
|
|
220
|
-
readonly moduleId: string;
|
|
221
|
-
readonly commandId: string;
|
|
222
|
-
readonly credential: OAuthCredentialSnapshot;
|
|
223
|
-
}) => InferInsertModel<U>;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export interface OAuthEligibilityFact {
|
|
227
|
-
readonly credentialId: string;
|
|
228
|
-
readonly revision: SecurityRevision;
|
|
229
|
-
readonly usablePrimary: boolean;
|
|
230
|
-
readonly factors: ReadonlyArray<AuthenticationFactor>;
|
|
231
|
-
readonly userVerified: boolean;
|
|
232
|
-
readonly phishingResistant: boolean;
|
|
233
|
-
}
|
|
71
|
+
export type OAuthFlowTable<F extends Table> = Shared.OAuthFlowTable<DrizzleTableModel<F>>;
|
|
72
|
+
|
|
73
|
+
export type OAuthTupleAuthorityTable<T extends Table, N> = Shared.OAuthTupleAuthorityTable<
|
|
74
|
+
DrizzleTableModel<T>,
|
|
75
|
+
N
|
|
76
|
+
>;
|
|
77
|
+
|
|
78
|
+
export type OAuthRegistrationIntentTable<I extends Table> = Shared.OAuthRegistrationIntentTable<
|
|
79
|
+
DrizzleTableModel<I>
|
|
80
|
+
>;
|
|
81
|
+
|
|
82
|
+
export type OAuthRegistrationCommandTable<
|
|
83
|
+
R extends Table,
|
|
84
|
+
Registration,
|
|
85
|
+
> = Shared.OAuthRegistrationCommandTable<DrizzleTableModel<R>, Registration>;
|
|
86
|
+
|
|
87
|
+
export type OAuthUnlinkCommandTable<U extends Table> = Shared.OAuthUnlinkCommandTable<
|
|
88
|
+
DrizzleTableModel<U>
|
|
89
|
+
>;
|
|
234
90
|
|
|
235
91
|
/** Each descriptor reads only its own subject-scoped method rows. The native row
|
|
236
92
|
* projector and SQL condition must express the same installed method eligibility.
|
|
237
93
|
* All source/identifier/policy mutations advance subject securityRevision. D1 also
|
|
238
94
|
* guards exact selected IDs/versions and absence/count assumptions, never just a
|
|
239
95
|
* stale boolean. An over-limit graph fails closed rather than truncating. */
|
|
240
|
-
export
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
readonly scope: string;
|
|
246
|
-
readonly condition: (subjectId: N) => SQL;
|
|
247
|
-
readonly decode: (row: InferSelectModel<T>) => OAuthEligibilityFact | undefined;
|
|
248
|
-
}
|
|
96
|
+
export type OAuthEligibilityTable<T extends Table, N> = Shared.OAuthEligibilityTable<
|
|
97
|
+
DrizzleTableModel<T>,
|
|
98
|
+
N,
|
|
99
|
+
SQL
|
|
100
|
+
>;
|
|
249
101
|
|
|
250
102
|
/** Authenticated command replay uses current subject status and this additional
|
|
251
103
|
* nonconsuming SQL policy. It never consumes a fresh action factor. */
|
|
252
|
-
export
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
readonly removedCredentialId?: string;
|
|
264
|
-
}) => SQL;
|
|
265
|
-
readonly disposition: "delete";
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export interface OAuthRegistrationEligibility<N> {
|
|
269
|
-
/** Pure SQL guards for mutable app policy; evaluated again after app writes. */
|
|
270
|
-
readonly condition: (input: {
|
|
271
|
-
readonly intent: OAuthRegistrationIntent;
|
|
272
|
-
readonly nativeSubjectId?: N;
|
|
273
|
-
}) => SQL;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
export interface OAuthD1Mapping {
|
|
277
|
-
readonly d1: { readonly primary: true };
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
export const requiredOAuthSignInConstraints = {
|
|
281
|
-
flow: "unique(flow.moduleId,flow.flowId)",
|
|
282
|
-
command: "unique(flow.moduleId,flow.commandId)",
|
|
283
|
-
stateDigest: "unique(flow.stateDigest)",
|
|
284
|
-
ownership: "unique(ownership.identityKey)",
|
|
285
|
-
credentialId: "unique(credential.credentialId)",
|
|
286
|
-
credentialIdentity: "unique(credential.identityKey)",
|
|
287
|
-
authorityCredential: "unique(authority.subjectId,authority.credentialId)",
|
|
288
|
-
} as const;
|
|
289
|
-
|
|
290
|
-
export const requiredOAuthTupleConstraints = { identityKey: "unique(tuple.identityKey)" } as const;
|
|
291
|
-
|
|
292
|
-
export const requiredOAuthRegistrationConstraints = {
|
|
293
|
-
intentReference: "unique(intent.moduleId,intent.reference)",
|
|
294
|
-
intentFlow: "unique(intent.moduleId,intent.flowId)",
|
|
295
|
-
command: "unique(registrationCommand.moduleId,registrationCommand.commandId)",
|
|
296
|
-
} as const;
|
|
297
|
-
|
|
298
|
-
export const requiredOAuthAccountsConstraints = {
|
|
299
|
-
unlinkCommand: "unique(unlinkCommand.moduleId,unlinkCommand.commandId)",
|
|
300
|
-
} as const;
|
|
301
|
-
|
|
302
|
-
export interface OAuthSignInMapping<
|
|
104
|
+
export type OAuthMetadataPolicy<N> = Shared.OAuthMetadataPolicy<N, SQL>;
|
|
105
|
+
|
|
106
|
+
export type OAuthCleanupTable<T extends Table, N> = Shared.OAuthCleanupTable<
|
|
107
|
+
DrizzleTableModel<T>,
|
|
108
|
+
N,
|
|
109
|
+
SQL
|
|
110
|
+
>;
|
|
111
|
+
|
|
112
|
+
export type OAuthRegistrationEligibility<N> = Shared.OAuthRegistrationEligibility<N, SQL>;
|
|
113
|
+
|
|
114
|
+
export type OAuthSignInMapping<
|
|
303
115
|
S extends Table,
|
|
304
116
|
O extends Table,
|
|
305
117
|
C extends Table,
|
|
306
118
|
AC extends Table,
|
|
307
119
|
F extends Table,
|
|
308
120
|
N,
|
|
309
|
-
>
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
export interface OAuthRegistrationIntentMapping<
|
|
121
|
+
> = Shared.OAuthSignInMapping<
|
|
122
|
+
DrizzleTableModel<S>,
|
|
123
|
+
DrizzleTableModel<O>,
|
|
124
|
+
DrizzleTableModel<C>,
|
|
125
|
+
DrizzleTableModel<AC>,
|
|
126
|
+
DrizzleTableModel<F>,
|
|
127
|
+
N,
|
|
128
|
+
SQL
|
|
129
|
+
>;
|
|
130
|
+
|
|
131
|
+
export type OAuthOwnershipMutation<
|
|
132
|
+
T extends Table,
|
|
133
|
+
O extends Table,
|
|
134
|
+
N,
|
|
135
|
+
> = Shared.OAuthOwnershipMutation<DrizzleTableModel<T>, DrizzleTableModel<O>, N, SQL>;
|
|
136
|
+
|
|
137
|
+
export type OAuthRegistrationIntentMapping<
|
|
329
138
|
S extends Table,
|
|
330
139
|
O extends Table,
|
|
331
140
|
C extends Table,
|
|
@@ -334,104 +143,49 @@ export interface OAuthRegistrationIntentMapping<
|
|
|
334
143
|
T extends Table,
|
|
335
144
|
I extends Table,
|
|
336
145
|
N,
|
|
337
|
-
>
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
export
|
|
146
|
+
> = Shared.OAuthRegistrationIntentMapping<
|
|
147
|
+
DrizzleTableModel<S>,
|
|
148
|
+
DrizzleTableModel<O>,
|
|
149
|
+
DrizzleTableModel<C>,
|
|
150
|
+
DrizzleTableModel<AC>,
|
|
151
|
+
DrizzleTableModel<F>,
|
|
152
|
+
DrizzleTableModel<T>,
|
|
153
|
+
DrizzleTableModel<I>,
|
|
154
|
+
N,
|
|
155
|
+
SQL
|
|
156
|
+
>;
|
|
157
|
+
|
|
158
|
+
export type OAuthRegistrationBase<
|
|
350
159
|
Registration,
|
|
351
160
|
T extends Table,
|
|
352
161
|
O extends Table,
|
|
353
162
|
I extends Table,
|
|
354
163
|
R extends Table,
|
|
355
164
|
N,
|
|
356
|
-
>
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}) => { readonly fingerprint: string; readonly eligible: boolean };
|
|
376
|
-
/** Type projection, never the original wire transformation. */
|
|
377
|
-
readonly snapshot: (
|
|
378
|
-
registration: Registration,
|
|
379
|
-
) => Effect.Effect<Registration, PersistenceMappingError>;
|
|
380
|
-
readonly snapshotSync?: (registration: Registration) => Registration;
|
|
381
|
-
/** Canonical bounded storage of Registration.Type. These are Type codecs, not
|
|
382
|
-
* the original wire decoder/encoder; decode(encode(value)) must encode identically.
|
|
383
|
-
* The engine writes and roundtrip-checks this exact string (maximum 1 MiB). */
|
|
384
|
-
readonly application: {
|
|
385
|
-
readonly encode: (registration: Registration) => string;
|
|
386
|
-
readonly decode: (stored: string) => Registration;
|
|
387
|
-
};
|
|
388
|
-
readonly eligibility: {
|
|
389
|
-
/** Stable application authority anchors, in one configured global order.
|
|
390
|
-
* Omit only for immutable/tuple-local policy or an equivalent explicit outer
|
|
391
|
-
* owner lock. Each scope must match 1..64 rows, never an absent quota row.
|
|
392
|
-
* Locks precede tuple/intent/command locks; postcondition owns changed state. */
|
|
393
|
-
readonly guards?: ReadonlyArray<OAuthRegistrationGuardDescriptor<Registration, N>>;
|
|
394
|
-
readonly admission: (input: {
|
|
395
|
-
readonly intent: OAuthRegistrationIntent;
|
|
396
|
-
readonly registration: Registration;
|
|
397
|
-
readonly nativeSubjectId?: N;
|
|
398
|
-
}) => SQL;
|
|
399
|
-
/** Evaluated after subject/application writes, including appended coordinator
|
|
400
|
-
* writes. May assert consumption of the admission invitation/quota. */
|
|
401
|
-
readonly postcondition: (input: {
|
|
402
|
-
readonly intent: OAuthRegistrationIntent;
|
|
403
|
-
readonly registration: Registration;
|
|
404
|
-
readonly nativeSubjectId?: N;
|
|
405
|
-
}) => SQL;
|
|
406
|
-
};
|
|
407
|
-
readonly allocateProvisioningIdentity: Effect.Effect<string, PersistenceMappingError>;
|
|
408
|
-
readonly retentionMillis: number;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
export interface OAuthRegistrationGuardTable<T extends Table, Registration, N> {
|
|
412
|
-
readonly table: T;
|
|
413
|
-
readonly orderBy: Column<T>;
|
|
414
|
-
readonly condition: (input: {
|
|
415
|
-
readonly intent: OAuthRegistrationIntent;
|
|
416
|
-
readonly registration: Registration;
|
|
417
|
-
readonly nativeSubjectId?: N;
|
|
418
|
-
}) => SQL;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
export interface OAuthRegistrationGuardDescriptor<Registration, N> {
|
|
422
|
-
readonly table: Table;
|
|
423
|
-
readonly orderBy: string;
|
|
424
|
-
readonly condition: OAuthRegistrationGuardTable<Table, Registration, N>["condition"];
|
|
425
|
-
}
|
|
165
|
+
> = Shared.OAuthRegistrationBase<
|
|
166
|
+
Registration,
|
|
167
|
+
DrizzleTableModel<T>,
|
|
168
|
+
DrizzleTableModel<O>,
|
|
169
|
+
DrizzleTableModel<I>,
|
|
170
|
+
DrizzleTableModel<R>,
|
|
171
|
+
N,
|
|
172
|
+
SQL,
|
|
173
|
+
Table
|
|
174
|
+
>;
|
|
175
|
+
|
|
176
|
+
export type OAuthRegistrationGuardTable<
|
|
177
|
+
T extends Table,
|
|
178
|
+
Registration,
|
|
179
|
+
N,
|
|
180
|
+
> = Shared.OAuthRegistrationGuardTable<DrizzleTableModel<T>, Registration, N, SQL>;
|
|
181
|
+
|
|
182
|
+
export type OAuthRegistrationGuardDescriptor<Registration, N> =
|
|
183
|
+
Shared.OAuthRegistrationGuardDescriptor<Registration, N, SQL, Table>;
|
|
426
184
|
|
|
427
185
|
export const oauthRegistrationGuardTable = <T extends Table, Registration, N>(
|
|
428
186
|
input: OAuthRegistrationGuardTable<T, Registration, N>,
|
|
429
187
|
): OAuthRegistrationGuardDescriptor<Registration, N> =>
|
|
430
|
-
|
|
431
|
-
table: input.table,
|
|
432
|
-
orderBy: input.orderBy,
|
|
433
|
-
condition: input.condition,
|
|
434
|
-
});
|
|
188
|
+
Shared.oauthRegistrationGuardTable<DrizzleTableModel<T>, Registration, N, SQL>(input);
|
|
435
189
|
|
|
436
190
|
export type OAuthRegistrationMapping<
|
|
437
191
|
Registration,
|
|
@@ -443,97 +197,51 @@ export type OAuthRegistrationMapping<
|
|
|
443
197
|
I extends Table,
|
|
444
198
|
R extends Table,
|
|
445
199
|
N,
|
|
446
|
-
> =
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
readonly allocateCredentialId: Effect.Effect<string, PersistenceMappingError>;
|
|
460
|
-
readonly allocateRevision: Effect.Effect<SecurityRevision, PersistenceMappingError>;
|
|
461
|
-
readonly encodeSubjectInsert: (
|
|
462
|
-
input: { readonly intent: OAuthRegistrationIntent; readonly registration: Registration },
|
|
463
|
-
ids: { readonly subjectId: N; readonly securityRevision: SecurityRevision },
|
|
464
|
-
) => InferInsertModel<S>;
|
|
465
|
-
}
|
|
466
|
-
);
|
|
200
|
+
> = Shared.OAuthRegistrationMapping<
|
|
201
|
+
Registration,
|
|
202
|
+
DrizzleTableModel<S>,
|
|
203
|
+
DrizzleTableModel<O>,
|
|
204
|
+
DrizzleTableModel<C>,
|
|
205
|
+
DrizzleTableModel<AC>,
|
|
206
|
+
DrizzleTableModel<T>,
|
|
207
|
+
DrizzleTableModel<I>,
|
|
208
|
+
DrizzleTableModel<R>,
|
|
209
|
+
N,
|
|
210
|
+
SQL,
|
|
211
|
+
Table
|
|
212
|
+
>;
|
|
467
213
|
|
|
468
214
|
/** Heterogeneous descriptors are made by typed factories and projected privately. */
|
|
469
|
-
export
|
|
470
|
-
readonly _tag: "OAuthEligibilityDescriptor";
|
|
471
|
-
readonly scope: string;
|
|
472
|
-
readonly table: Table;
|
|
473
|
-
readonly subjectId: string;
|
|
474
|
-
readonly credentialId: string;
|
|
475
|
-
readonly revision: string;
|
|
476
|
-
readonly condition: (subjectId: N) => SQL;
|
|
477
|
-
readonly decode: (row: unknown) => OAuthEligibilityFact | undefined;
|
|
478
|
-
}
|
|
215
|
+
export type OAuthEligibilityDescriptor<N> = Shared.OAuthEligibilityDescriptor<N, SQL, Table>;
|
|
479
216
|
|
|
480
217
|
export const oauthEligibilityTable = <T extends Table, N>(
|
|
481
218
|
input: OAuthEligibilityTable<T, N>,
|
|
482
|
-
): OAuthEligibilityDescriptor<N> =>
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
_tag: "OAuthEligibilityDescriptor",
|
|
487
|
-
table,
|
|
488
|
-
subjectId,
|
|
489
|
-
credentialId,
|
|
490
|
-
revision,
|
|
491
|
-
scope,
|
|
492
|
-
condition,
|
|
493
|
-
decode: (row: unknown) => decode(row as InferSelectModel<T>),
|
|
494
|
-
});
|
|
495
|
-
};
|
|
496
|
-
|
|
497
|
-
export interface OAuthCleanupDescriptor<N> {
|
|
498
|
-
readonly table: Table;
|
|
499
|
-
readonly subjectId: string;
|
|
500
|
-
readonly condition: OAuthCleanupTable<Table, N>["condition"];
|
|
501
|
-
}
|
|
219
|
+
): OAuthEligibilityDescriptor<N> =>
|
|
220
|
+
Shared.oauthEligibilityTable<DrizzleTableModel<T>, N, SQL>(input);
|
|
221
|
+
|
|
222
|
+
export type OAuthCleanupDescriptor<N> = Shared.OAuthCleanupDescriptor<N, SQL, Table>;
|
|
502
223
|
|
|
503
224
|
export const oauthCleanupTable = <T extends Table, N>(
|
|
504
225
|
input: OAuthCleanupTable<T, N>,
|
|
505
|
-
): OAuthCleanupDescriptor<N> =>
|
|
506
|
-
Object.freeze({ table: input.table, subjectId: input.subjectId, condition: input.condition });
|
|
226
|
+
): OAuthCleanupDescriptor<N> => Shared.oauthCleanupTable<DrizzleTableModel<T>, N, SQL>(input);
|
|
507
227
|
|
|
508
228
|
/** A stable application/reference lock acquired before an ownership target.
|
|
509
229
|
* Missing rows retain ownership. Conditions use detached native IDs; every
|
|
510
230
|
* writer of the guarded reference follows the same order. */
|
|
511
|
-
export
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
}) => SQL | Effect.Effect<SQL, PlatformError.PlatformError, Crypto.Crypto>;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
export interface OAuthReferenceGuardDescriptor<N> {
|
|
522
|
-
readonly table: Table;
|
|
523
|
-
readonly orderBy: string;
|
|
524
|
-
readonly condition: OAuthReferenceGuardTable<Table, N>["condition"];
|
|
525
|
-
}
|
|
231
|
+
export type OAuthReferenceGuardTable<T extends Table, N> = Shared.OAuthReferenceGuardTable<
|
|
232
|
+
DrizzleTableModel<T>,
|
|
233
|
+
N,
|
|
234
|
+
SQL
|
|
235
|
+
>;
|
|
236
|
+
|
|
237
|
+
export type OAuthReferenceGuardDescriptor<N> = Shared.OAuthReferenceGuardDescriptor<N, SQL, Table>;
|
|
526
238
|
|
|
527
239
|
export const oauthReferenceGuardTable = <T extends Table, N>(
|
|
528
240
|
input: OAuthReferenceGuardTable<T, N>,
|
|
529
241
|
): OAuthReferenceGuardDescriptor<N> =>
|
|
530
|
-
|
|
531
|
-
table: input.table,
|
|
532
|
-
orderBy: input.orderBy,
|
|
533
|
-
condition: input.condition,
|
|
534
|
-
});
|
|
242
|
+
Shared.oauthReferenceGuardTable<DrizzleTableModel<T>, N, SQL>(input);
|
|
535
243
|
|
|
536
|
-
export
|
|
244
|
+
export type OAuthAccountsMapping<
|
|
537
245
|
S extends Table,
|
|
538
246
|
O extends Table,
|
|
539
247
|
C extends Table,
|
|
@@ -542,76 +250,15 @@ export interface OAuthAccountsMapping<
|
|
|
542
250
|
T extends Table,
|
|
543
251
|
U extends Table,
|
|
544
252
|
N,
|
|
545
|
-
>
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
readonly eligibility: ReadonlyArray<OAuthEligibilityDescriptor<N>>;
|
|
558
|
-
readonly cleanup: ReadonlyArray<OAuthCleanupDescriptor<N>>;
|
|
559
|
-
readonly metadata: OAuthMetadataPolicy<N>;
|
|
560
|
-
readonly sessionInvalidation: "same-authority-immediate" | "original-absolute-expiry";
|
|
561
|
-
/** Omit only when connected access is absent. A predicate alone conservatively
|
|
562
|
-
* retains ownership; release also needs all configured guard rows below. */
|
|
563
|
-
readonly connectedReference?: (input: {
|
|
564
|
-
readonly identityKey: string;
|
|
565
|
-
readonly subjectId: N;
|
|
566
|
-
}) => SQL;
|
|
567
|
-
/** At most 32 descriptors, each locking 1..64 stable rows in supplied order.
|
|
568
|
-
* Missing/empty guards retain Owned, even when the reference predicate is false. */
|
|
569
|
-
readonly connectedReferenceGuards?: ReadonlyArray<OAuthReferenceGuardDescriptor<N>>;
|
|
570
|
-
readonly allocateCredentialId: Effect.Effect<string, PersistenceMappingError>;
|
|
571
|
-
readonly allocateRevision: Effect.Effect<SecurityRevision, PersistenceMappingError>;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
export interface OAuthRegistrationAuthority<Registration> {
|
|
575
|
-
readonly read: (
|
|
576
|
-
access: import("@yielded/auth/OAuth").OAuthRegistrationAccess,
|
|
577
|
-
) => Effect.Effect<
|
|
578
|
-
import("@yielded/auth/OAuth").OAuthRegistrationInspection | undefined,
|
|
579
|
-
import("@yielded/auth/OAuth").OAuthUnavailable
|
|
580
|
-
>;
|
|
581
|
-
readonly inspect: (input: {
|
|
582
|
-
readonly intent: OAuthRegistrationIntent;
|
|
583
|
-
readonly registration: Registration;
|
|
584
|
-
}) => Effect.Effect<
|
|
585
|
-
{
|
|
586
|
-
readonly fingerprint: import("@yielded/auth/Schema").TokenDigest;
|
|
587
|
-
readonly eligible: boolean;
|
|
588
|
-
},
|
|
589
|
-
import("@yielded/auth/OAuth").OAuthUnavailable
|
|
590
|
-
>;
|
|
591
|
-
readonly register: <A>(
|
|
592
|
-
input: {
|
|
593
|
-
readonly access: import("@yielded/auth/OAuth").OAuthRegistrationAccess;
|
|
594
|
-
readonly intent: OAuthRegistrationIntent;
|
|
595
|
-
readonly commandId: typeof import("@yielded/auth/OAuth").OAuthCommandId.Type;
|
|
596
|
-
readonly registration: Registration;
|
|
597
|
-
readonly fingerprint: import("@yielded/auth/Schema").TokenDigest;
|
|
598
|
-
},
|
|
599
|
-
prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<
|
|
600
|
-
import("@yielded/auth/OAuth").OAuthRegistrationDecision,
|
|
601
|
-
A
|
|
602
|
-
>,
|
|
603
|
-
) => Effect.Effect<
|
|
604
|
-
import("@yielded/auth/Hooks").PreparedCommit<A>,
|
|
605
|
-
import("@yielded/auth/OAuth").OAuthUnavailable
|
|
606
|
-
>;
|
|
607
|
-
readonly cleanup: <A>(
|
|
608
|
-
input: import("@yielded/auth/OAuth").OAuthCleanupInput,
|
|
609
|
-
prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<
|
|
610
|
-
{ readonly removed: number; readonly hasMore: boolean },
|
|
611
|
-
A
|
|
612
|
-
>,
|
|
613
|
-
) => Effect.Effect<
|
|
614
|
-
import("@yielded/auth/Hooks").PreparedCommit<A>,
|
|
615
|
-
import("@yielded/auth/OAuth").OAuthUnavailable
|
|
616
|
-
>;
|
|
617
|
-
}
|
|
253
|
+
> = Shared.OAuthAccountsMapping<
|
|
254
|
+
DrizzleTableModel<S>,
|
|
255
|
+
DrizzleTableModel<O>,
|
|
256
|
+
DrizzleTableModel<C>,
|
|
257
|
+
DrizzleTableModel<AC>,
|
|
258
|
+
DrizzleTableModel<F>,
|
|
259
|
+
DrizzleTableModel<T>,
|
|
260
|
+
DrizzleTableModel<U>,
|
|
261
|
+
N,
|
|
262
|
+
SQL,
|
|
263
|
+
Table
|
|
264
|
+
>;
|