@absolutejs/auth 0.40.0-beta.0 → 0.40.0-beta.2
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/cli/migrate.js +72 -34
- package/dist/cli/migrate.js.map +5 -4
- package/dist/index.d.ts +9 -2
- package/dist/index.js +762 -146
- package/dist/index.js.map +12 -6
- package/dist/migrations/index.d.ts +1 -1
- package/dist/oidc/routes.d.ts +2 -2
- package/dist/vc/inMemoryVpStores.d.ts +2 -0
- package/dist/vc/openid4vp.d.ts +82 -0
- package/dist/vc/postgresVcStores.d.ts +360 -0
- package/dist/vc/statusList.d.ts +29 -0
- package/dist/vc/statusListRoutes.d.ts +63 -0
- package/dist/vc/vpRoutes.d.ts +120 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BlockMigrations } from './types';
|
|
2
|
-
export type BlockName = 'adaptive' | 'apikeys' | 'audit' | 'credentials' | 'fga' | 'linkedProviders' | 'lockout' | 'mfa' | 'oidc' | 'organizations' | 'passwordless' | 'portal' | 'roles' | 'scim' | 'sessions' | 'sso' | 'vault' | 'webauthn' | 'webhooks';
|
|
2
|
+
export type BlockName = 'adaptive' | 'apikeys' | 'audit' | 'credentials' | 'fga' | 'linkedProviders' | 'lockout' | 'mfa' | 'oidc' | 'organizations' | 'passwordless' | 'portal' | 'roles' | 'scim' | 'sessions' | 'sso' | 'vault' | 'vc' | 'webauthn' | 'webhooks';
|
|
3
3
|
export declare const blockMigrations: Record<BlockName, BlockMigrations>;
|
|
4
4
|
export { runMigrations } from './runner';
|
|
5
5
|
export type { Migration, BlockMigrations } from './types';
|
package/dist/oidc/routes.d.ts
CHANGED
|
@@ -29,8 +29,8 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
29
29
|
query: {
|
|
30
30
|
client_id?: string | undefined;
|
|
31
31
|
scope?: string | undefined;
|
|
32
|
-
claims?: string | undefined;
|
|
33
32
|
nonce?: string | undefined;
|
|
33
|
+
claims?: string | undefined;
|
|
34
34
|
request?: string | undefined;
|
|
35
35
|
redirect_uri?: string | undefined;
|
|
36
36
|
acr_values?: string | undefined;
|
|
@@ -103,9 +103,9 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
103
103
|
body: {
|
|
104
104
|
client_id?: string | undefined;
|
|
105
105
|
scope?: string | undefined;
|
|
106
|
+
nonce?: string | undefined;
|
|
106
107
|
audience?: string | undefined;
|
|
107
108
|
claims?: string | undefined;
|
|
108
|
-
nonce?: string | undefined;
|
|
109
109
|
resource?: string | undefined;
|
|
110
110
|
client_secret?: string | undefined;
|
|
111
111
|
redirect_uri?: string | undefined;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type SigningKey } from '../oidc/keys';
|
|
2
|
+
export type PresentationResponseInput = {
|
|
3
|
+
requestId: string;
|
|
4
|
+
vpToken: string;
|
|
5
|
+
};
|
|
6
|
+
export type PresentationRequest = {
|
|
7
|
+
clientId: string;
|
|
8
|
+
createdAt: number;
|
|
9
|
+
expectedIssuerPublicJwk: JsonWebKey;
|
|
10
|
+
expiresAt: number;
|
|
11
|
+
nonce: string;
|
|
12
|
+
requestedClaims: string[];
|
|
13
|
+
requestId: string;
|
|
14
|
+
responseUri: string;
|
|
15
|
+
state: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type PresentationRequestStore = {
|
|
18
|
+
consumeRequest: (requestId: string) => Promise<PresentationRequest | undefined>;
|
|
19
|
+
getRequest: (requestId: string) => Promise<PresentationRequest | undefined>;
|
|
20
|
+
saveRequest: (request: PresentationRequest) => Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
export type Vp4Config = {
|
|
23
|
+
clientSigningKey: SigningKey;
|
|
24
|
+
defaultExpectedIssuerPublicJwk: JsonWebKey;
|
|
25
|
+
getResponseUri: (requestId: string) => string;
|
|
26
|
+
requestStore: PresentationRequestStore;
|
|
27
|
+
requestTtlMs?: number;
|
|
28
|
+
statusListResolver?: (uri: string) => Promise<string | undefined>;
|
|
29
|
+
statusListPublicJwk?: JsonWebKey;
|
|
30
|
+
};
|
|
31
|
+
export type CreatePresentationRequestInput = {
|
|
32
|
+
clientId: string;
|
|
33
|
+
now?: number;
|
|
34
|
+
requestedClaims: string[];
|
|
35
|
+
state?: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const createPresentationRequest: ({ config, getRequestUri, input, issuer }: {
|
|
38
|
+
config: Vp4Config;
|
|
39
|
+
getRequestUri: (requestId: string) => string;
|
|
40
|
+
input: CreatePresentationRequestInput;
|
|
41
|
+
issuer: string;
|
|
42
|
+
}) => Promise<{
|
|
43
|
+
nonce: string;
|
|
44
|
+
request: PresentationRequest;
|
|
45
|
+
requestObject: string;
|
|
46
|
+
requestUri: string;
|
|
47
|
+
}>;
|
|
48
|
+
export type VerifiedPresentation = {
|
|
49
|
+
disclosedClaims: Record<string, unknown>;
|
|
50
|
+
holderJwk: JsonWebKey | undefined;
|
|
51
|
+
missingClaims: string[];
|
|
52
|
+
protectedClaims: Record<string, unknown>;
|
|
53
|
+
requestId: string;
|
|
54
|
+
statusValid: boolean;
|
|
55
|
+
};
|
|
56
|
+
export type PresentationVerifyError = 'expired_request' | 'invalid_holder_binding' | 'invalid_signature' | 'missing_claims' | 'revoked_credential' | 'unknown_request';
|
|
57
|
+
export type PresentationVerifyResult = {
|
|
58
|
+
error: PresentationVerifyError;
|
|
59
|
+
ok: false;
|
|
60
|
+
} | {
|
|
61
|
+
ok: true;
|
|
62
|
+
verified: VerifiedPresentation;
|
|
63
|
+
};
|
|
64
|
+
export declare const verifyPresentationResponse: ({ config, input, now }: {
|
|
65
|
+
config: Vp4Config;
|
|
66
|
+
input: PresentationResponseInput;
|
|
67
|
+
now?: number;
|
|
68
|
+
}) => Promise<{
|
|
69
|
+
error: PresentationVerifyError;
|
|
70
|
+
ok: false;
|
|
71
|
+
} | {
|
|
72
|
+
ok: true;
|
|
73
|
+
verified: VerifiedPresentation;
|
|
74
|
+
}>;
|
|
75
|
+
export declare const buildHolderKeyBindingJwt: ({ audience, holderKey, nonce, now, sdHash }: {
|
|
76
|
+
audience: string;
|
|
77
|
+
holderKey: SigningKey;
|
|
78
|
+
nonce: string;
|
|
79
|
+
now?: number;
|
|
80
|
+
sdHash?: string;
|
|
81
|
+
}) => Promise<string>;
|
|
82
|
+
export declare const parsePresentationToken: (vpToken: string) => import("./sdJwt").ParsedSdJwtVc;
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { type AnyPgDatabase } from '../stores/postgres';
|
|
2
|
+
import type { CredentialNonceStore, CredentialOfferStore } from '../oidc/vci';
|
|
3
|
+
import type { PresentationRequestStore } from './openid4vp';
|
|
4
|
+
export declare const vcCredentialNoncesTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
5
|
+
name: "auth_vc_credential_nonces";
|
|
6
|
+
schema: undefined;
|
|
7
|
+
columns: {
|
|
8
|
+
expires_at_ms: import("drizzle-orm/pg-core").PgColumn<{
|
|
9
|
+
name: "expires_at_ms";
|
|
10
|
+
tableName: "auth_vc_credential_nonces";
|
|
11
|
+
dataType: "number";
|
|
12
|
+
columnType: "PgBigInt53";
|
|
13
|
+
data: number;
|
|
14
|
+
driverParam: string | number;
|
|
15
|
+
notNull: true;
|
|
16
|
+
hasDefault: false;
|
|
17
|
+
isPrimaryKey: false;
|
|
18
|
+
isAutoincrement: false;
|
|
19
|
+
hasRuntimeDefault: false;
|
|
20
|
+
enumValues: undefined;
|
|
21
|
+
baseColumn: never;
|
|
22
|
+
identity: undefined;
|
|
23
|
+
generated: undefined;
|
|
24
|
+
}, {}, {}>;
|
|
25
|
+
nonce_hash: import("drizzle-orm/pg-core").PgColumn<{
|
|
26
|
+
name: "nonce_hash";
|
|
27
|
+
tableName: "auth_vc_credential_nonces";
|
|
28
|
+
dataType: "string";
|
|
29
|
+
columnType: "PgVarchar";
|
|
30
|
+
data: string;
|
|
31
|
+
driverParam: string;
|
|
32
|
+
notNull: true;
|
|
33
|
+
hasDefault: false;
|
|
34
|
+
isPrimaryKey: true;
|
|
35
|
+
isAutoincrement: false;
|
|
36
|
+
hasRuntimeDefault: false;
|
|
37
|
+
enumValues: [string, ...string[]];
|
|
38
|
+
baseColumn: never;
|
|
39
|
+
identity: undefined;
|
|
40
|
+
generated: undefined;
|
|
41
|
+
}, {}, {
|
|
42
|
+
length: 255;
|
|
43
|
+
}>;
|
|
44
|
+
};
|
|
45
|
+
dialect: "pg";
|
|
46
|
+
}>;
|
|
47
|
+
export declare const vcCredentialOffersTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
48
|
+
name: "auth_vc_credential_offers";
|
|
49
|
+
schema: undefined;
|
|
50
|
+
columns: {
|
|
51
|
+
client_id: import("drizzle-orm/pg-core").PgColumn<{
|
|
52
|
+
name: "client_id";
|
|
53
|
+
tableName: "auth_vc_credential_offers";
|
|
54
|
+
dataType: "string";
|
|
55
|
+
columnType: "PgVarchar";
|
|
56
|
+
data: string;
|
|
57
|
+
driverParam: string;
|
|
58
|
+
notNull: true;
|
|
59
|
+
hasDefault: false;
|
|
60
|
+
isPrimaryKey: false;
|
|
61
|
+
isAutoincrement: false;
|
|
62
|
+
hasRuntimeDefault: false;
|
|
63
|
+
enumValues: [string, ...string[]];
|
|
64
|
+
baseColumn: never;
|
|
65
|
+
identity: undefined;
|
|
66
|
+
generated: undefined;
|
|
67
|
+
}, {}, {
|
|
68
|
+
length: 255;
|
|
69
|
+
}>;
|
|
70
|
+
configuration_id: import("drizzle-orm/pg-core").PgColumn<{
|
|
71
|
+
name: "configuration_id";
|
|
72
|
+
tableName: "auth_vc_credential_offers";
|
|
73
|
+
dataType: "string";
|
|
74
|
+
columnType: "PgVarchar";
|
|
75
|
+
data: string;
|
|
76
|
+
driverParam: string;
|
|
77
|
+
notNull: true;
|
|
78
|
+
hasDefault: false;
|
|
79
|
+
isPrimaryKey: false;
|
|
80
|
+
isAutoincrement: false;
|
|
81
|
+
hasRuntimeDefault: false;
|
|
82
|
+
enumValues: [string, ...string[]];
|
|
83
|
+
baseColumn: never;
|
|
84
|
+
identity: undefined;
|
|
85
|
+
generated: undefined;
|
|
86
|
+
}, {}, {
|
|
87
|
+
length: 255;
|
|
88
|
+
}>;
|
|
89
|
+
created_at_ms: import("drizzle-orm/pg-core").PgColumn<{
|
|
90
|
+
name: "created_at_ms";
|
|
91
|
+
tableName: "auth_vc_credential_offers";
|
|
92
|
+
dataType: "number";
|
|
93
|
+
columnType: "PgBigInt53";
|
|
94
|
+
data: number;
|
|
95
|
+
driverParam: string | number;
|
|
96
|
+
notNull: true;
|
|
97
|
+
hasDefault: false;
|
|
98
|
+
isPrimaryKey: false;
|
|
99
|
+
isAutoincrement: false;
|
|
100
|
+
hasRuntimeDefault: false;
|
|
101
|
+
enumValues: undefined;
|
|
102
|
+
baseColumn: never;
|
|
103
|
+
identity: undefined;
|
|
104
|
+
generated: undefined;
|
|
105
|
+
}, {}, {}>;
|
|
106
|
+
expires_at_ms: import("drizzle-orm/pg-core").PgColumn<{
|
|
107
|
+
name: "expires_at_ms";
|
|
108
|
+
tableName: "auth_vc_credential_offers";
|
|
109
|
+
dataType: "number";
|
|
110
|
+
columnType: "PgBigInt53";
|
|
111
|
+
data: number;
|
|
112
|
+
driverParam: string | number;
|
|
113
|
+
notNull: true;
|
|
114
|
+
hasDefault: false;
|
|
115
|
+
isPrimaryKey: false;
|
|
116
|
+
isAutoincrement: false;
|
|
117
|
+
hasRuntimeDefault: false;
|
|
118
|
+
enumValues: undefined;
|
|
119
|
+
baseColumn: never;
|
|
120
|
+
identity: undefined;
|
|
121
|
+
generated: undefined;
|
|
122
|
+
}, {}, {}>;
|
|
123
|
+
pre_authorized_code_hash: import("drizzle-orm/pg-core").PgColumn<{
|
|
124
|
+
name: "pre_authorized_code_hash";
|
|
125
|
+
tableName: "auth_vc_credential_offers";
|
|
126
|
+
dataType: "string";
|
|
127
|
+
columnType: "PgVarchar";
|
|
128
|
+
data: string;
|
|
129
|
+
driverParam: string;
|
|
130
|
+
notNull: true;
|
|
131
|
+
hasDefault: false;
|
|
132
|
+
isPrimaryKey: true;
|
|
133
|
+
isAutoincrement: false;
|
|
134
|
+
hasRuntimeDefault: false;
|
|
135
|
+
enumValues: [string, ...string[]];
|
|
136
|
+
baseColumn: never;
|
|
137
|
+
identity: undefined;
|
|
138
|
+
generated: undefined;
|
|
139
|
+
}, {}, {
|
|
140
|
+
length: 255;
|
|
141
|
+
}>;
|
|
142
|
+
redeemed: import("drizzle-orm/pg-core").PgColumn<{
|
|
143
|
+
name: "redeemed";
|
|
144
|
+
tableName: "auth_vc_credential_offers";
|
|
145
|
+
dataType: "boolean";
|
|
146
|
+
columnType: "PgBoolean";
|
|
147
|
+
data: boolean;
|
|
148
|
+
driverParam: boolean;
|
|
149
|
+
notNull: true;
|
|
150
|
+
hasDefault: false;
|
|
151
|
+
isPrimaryKey: false;
|
|
152
|
+
isAutoincrement: false;
|
|
153
|
+
hasRuntimeDefault: false;
|
|
154
|
+
enumValues: undefined;
|
|
155
|
+
baseColumn: never;
|
|
156
|
+
identity: undefined;
|
|
157
|
+
generated: undefined;
|
|
158
|
+
}, {}, {}>;
|
|
159
|
+
user_id: import("drizzle-orm/pg-core").PgColumn<{
|
|
160
|
+
name: "user_id";
|
|
161
|
+
tableName: "auth_vc_credential_offers";
|
|
162
|
+
dataType: "string";
|
|
163
|
+
columnType: "PgVarchar";
|
|
164
|
+
data: string;
|
|
165
|
+
driverParam: string;
|
|
166
|
+
notNull: true;
|
|
167
|
+
hasDefault: false;
|
|
168
|
+
isPrimaryKey: false;
|
|
169
|
+
isAutoincrement: false;
|
|
170
|
+
hasRuntimeDefault: false;
|
|
171
|
+
enumValues: [string, ...string[]];
|
|
172
|
+
baseColumn: never;
|
|
173
|
+
identity: undefined;
|
|
174
|
+
generated: undefined;
|
|
175
|
+
}, {}, {
|
|
176
|
+
length: 255;
|
|
177
|
+
}>;
|
|
178
|
+
};
|
|
179
|
+
dialect: "pg";
|
|
180
|
+
}>;
|
|
181
|
+
export declare const vcPresentationRequestsTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
182
|
+
name: "auth_vc_presentation_requests";
|
|
183
|
+
schema: undefined;
|
|
184
|
+
columns: {
|
|
185
|
+
client_id: import("drizzle-orm/pg-core").PgColumn<{
|
|
186
|
+
name: "client_id";
|
|
187
|
+
tableName: "auth_vc_presentation_requests";
|
|
188
|
+
dataType: "string";
|
|
189
|
+
columnType: "PgVarchar";
|
|
190
|
+
data: string;
|
|
191
|
+
driverParam: string;
|
|
192
|
+
notNull: true;
|
|
193
|
+
hasDefault: false;
|
|
194
|
+
isPrimaryKey: false;
|
|
195
|
+
isAutoincrement: false;
|
|
196
|
+
hasRuntimeDefault: false;
|
|
197
|
+
enumValues: [string, ...string[]];
|
|
198
|
+
baseColumn: never;
|
|
199
|
+
identity: undefined;
|
|
200
|
+
generated: undefined;
|
|
201
|
+
}, {}, {
|
|
202
|
+
length: 255;
|
|
203
|
+
}>;
|
|
204
|
+
created_at_ms: import("drizzle-orm/pg-core").PgColumn<{
|
|
205
|
+
name: "created_at_ms";
|
|
206
|
+
tableName: "auth_vc_presentation_requests";
|
|
207
|
+
dataType: "number";
|
|
208
|
+
columnType: "PgBigInt53";
|
|
209
|
+
data: number;
|
|
210
|
+
driverParam: string | number;
|
|
211
|
+
notNull: true;
|
|
212
|
+
hasDefault: false;
|
|
213
|
+
isPrimaryKey: false;
|
|
214
|
+
isAutoincrement: false;
|
|
215
|
+
hasRuntimeDefault: false;
|
|
216
|
+
enumValues: undefined;
|
|
217
|
+
baseColumn: never;
|
|
218
|
+
identity: undefined;
|
|
219
|
+
generated: undefined;
|
|
220
|
+
}, {}, {}>;
|
|
221
|
+
expected_issuer_jwk_json: import("drizzle-orm/pg-core").PgColumn<{
|
|
222
|
+
name: "expected_issuer_jwk_json";
|
|
223
|
+
tableName: "auth_vc_presentation_requests";
|
|
224
|
+
dataType: "json";
|
|
225
|
+
columnType: "PgJsonb";
|
|
226
|
+
data: JsonWebKey;
|
|
227
|
+
driverParam: unknown;
|
|
228
|
+
notNull: true;
|
|
229
|
+
hasDefault: false;
|
|
230
|
+
isPrimaryKey: false;
|
|
231
|
+
isAutoincrement: false;
|
|
232
|
+
hasRuntimeDefault: false;
|
|
233
|
+
enumValues: undefined;
|
|
234
|
+
baseColumn: never;
|
|
235
|
+
identity: undefined;
|
|
236
|
+
generated: undefined;
|
|
237
|
+
}, {}, {
|
|
238
|
+
$type: JsonWebKey;
|
|
239
|
+
}>;
|
|
240
|
+
expires_at_ms: import("drizzle-orm/pg-core").PgColumn<{
|
|
241
|
+
name: "expires_at_ms";
|
|
242
|
+
tableName: "auth_vc_presentation_requests";
|
|
243
|
+
dataType: "number";
|
|
244
|
+
columnType: "PgBigInt53";
|
|
245
|
+
data: number;
|
|
246
|
+
driverParam: string | number;
|
|
247
|
+
notNull: true;
|
|
248
|
+
hasDefault: false;
|
|
249
|
+
isPrimaryKey: false;
|
|
250
|
+
isAutoincrement: false;
|
|
251
|
+
hasRuntimeDefault: false;
|
|
252
|
+
enumValues: undefined;
|
|
253
|
+
baseColumn: never;
|
|
254
|
+
identity: undefined;
|
|
255
|
+
generated: undefined;
|
|
256
|
+
}, {}, {}>;
|
|
257
|
+
nonce: import("drizzle-orm/pg-core").PgColumn<{
|
|
258
|
+
name: "nonce";
|
|
259
|
+
tableName: "auth_vc_presentation_requests";
|
|
260
|
+
dataType: "string";
|
|
261
|
+
columnType: "PgVarchar";
|
|
262
|
+
data: string;
|
|
263
|
+
driverParam: string;
|
|
264
|
+
notNull: true;
|
|
265
|
+
hasDefault: false;
|
|
266
|
+
isPrimaryKey: false;
|
|
267
|
+
isAutoincrement: false;
|
|
268
|
+
hasRuntimeDefault: false;
|
|
269
|
+
enumValues: [string, ...string[]];
|
|
270
|
+
baseColumn: never;
|
|
271
|
+
identity: undefined;
|
|
272
|
+
generated: undefined;
|
|
273
|
+
}, {}, {
|
|
274
|
+
length: 255;
|
|
275
|
+
}>;
|
|
276
|
+
request_id: import("drizzle-orm/pg-core").PgColumn<{
|
|
277
|
+
name: "request_id";
|
|
278
|
+
tableName: "auth_vc_presentation_requests";
|
|
279
|
+
dataType: "string";
|
|
280
|
+
columnType: "PgVarchar";
|
|
281
|
+
data: string;
|
|
282
|
+
driverParam: string;
|
|
283
|
+
notNull: true;
|
|
284
|
+
hasDefault: false;
|
|
285
|
+
isPrimaryKey: true;
|
|
286
|
+
isAutoincrement: false;
|
|
287
|
+
hasRuntimeDefault: false;
|
|
288
|
+
enumValues: [string, ...string[]];
|
|
289
|
+
baseColumn: never;
|
|
290
|
+
identity: undefined;
|
|
291
|
+
generated: undefined;
|
|
292
|
+
}, {}, {
|
|
293
|
+
length: 255;
|
|
294
|
+
}>;
|
|
295
|
+
requested_claims: import("drizzle-orm/pg-core").PgColumn<{
|
|
296
|
+
name: "requested_claims";
|
|
297
|
+
tableName: "auth_vc_presentation_requests";
|
|
298
|
+
dataType: "json";
|
|
299
|
+
columnType: "PgJsonb";
|
|
300
|
+
data: string[];
|
|
301
|
+
driverParam: unknown;
|
|
302
|
+
notNull: true;
|
|
303
|
+
hasDefault: false;
|
|
304
|
+
isPrimaryKey: false;
|
|
305
|
+
isAutoincrement: false;
|
|
306
|
+
hasRuntimeDefault: false;
|
|
307
|
+
enumValues: undefined;
|
|
308
|
+
baseColumn: never;
|
|
309
|
+
identity: undefined;
|
|
310
|
+
generated: undefined;
|
|
311
|
+
}, {}, {
|
|
312
|
+
$type: string[];
|
|
313
|
+
}>;
|
|
314
|
+
response_uri: import("drizzle-orm/pg-core").PgColumn<{
|
|
315
|
+
name: "response_uri";
|
|
316
|
+
tableName: "auth_vc_presentation_requests";
|
|
317
|
+
dataType: "string";
|
|
318
|
+
columnType: "PgVarchar";
|
|
319
|
+
data: string;
|
|
320
|
+
driverParam: string;
|
|
321
|
+
notNull: true;
|
|
322
|
+
hasDefault: false;
|
|
323
|
+
isPrimaryKey: false;
|
|
324
|
+
isAutoincrement: false;
|
|
325
|
+
hasRuntimeDefault: false;
|
|
326
|
+
enumValues: [string, ...string[]];
|
|
327
|
+
baseColumn: never;
|
|
328
|
+
identity: undefined;
|
|
329
|
+
generated: undefined;
|
|
330
|
+
}, {}, {
|
|
331
|
+
length: 255;
|
|
332
|
+
}>;
|
|
333
|
+
state: import("drizzle-orm/pg-core").PgColumn<{
|
|
334
|
+
name: "state";
|
|
335
|
+
tableName: "auth_vc_presentation_requests";
|
|
336
|
+
dataType: "string";
|
|
337
|
+
columnType: "PgVarchar";
|
|
338
|
+
data: string;
|
|
339
|
+
driverParam: string;
|
|
340
|
+
notNull: false;
|
|
341
|
+
hasDefault: false;
|
|
342
|
+
isPrimaryKey: false;
|
|
343
|
+
isAutoincrement: false;
|
|
344
|
+
hasRuntimeDefault: false;
|
|
345
|
+
enumValues: [string, ...string[]];
|
|
346
|
+
baseColumn: never;
|
|
347
|
+
identity: undefined;
|
|
348
|
+
generated: undefined;
|
|
349
|
+
}, {}, {
|
|
350
|
+
length: 255;
|
|
351
|
+
}>;
|
|
352
|
+
};
|
|
353
|
+
dialect: "pg";
|
|
354
|
+
}>;
|
|
355
|
+
export declare const createNeonCredentialNonceStore: (databaseUrl: string) => CredentialNonceStore;
|
|
356
|
+
export declare const createNeonCredentialOfferStore: (databaseUrl: string) => CredentialOfferStore;
|
|
357
|
+
export declare const createNeonPresentationRequestStore: (databaseUrl: string) => PresentationRequestStore;
|
|
358
|
+
export declare const createPostgresCredentialNonceStore: (database: AnyPgDatabase) => CredentialNonceStore;
|
|
359
|
+
export declare const createPostgresCredentialOfferStore: (database: AnyPgDatabase) => CredentialOfferStore;
|
|
360
|
+
export declare const createPostgresPresentationRequestStore: (database: AnyPgDatabase) => PresentationRequestStore;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type SigningKey } from '../oidc/keys';
|
|
2
|
+
declare const STATUS_LIST_TYP = "statuslist+jwt";
|
|
3
|
+
declare const STATUS_LIST_SUB_TYP = "application/statuslist+jwt";
|
|
4
|
+
export type StatusListBits = Uint8Array;
|
|
5
|
+
export declare const createStatusList: (size?: number) => Uint8Array<ArrayBuffer>;
|
|
6
|
+
export declare const getCredentialStatus: (bits: StatusListBits, idx: number) => 1 | 0 | undefined;
|
|
7
|
+
export declare const setCredentialStatus: (bits: StatusListBits, idx: number, value: 0 | 1) => StatusListBits;
|
|
8
|
+
export declare const buildStatusClaim: (idx: number, uri: string) => {
|
|
9
|
+
status_list: {
|
|
10
|
+
idx: number;
|
|
11
|
+
uri: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const signStatusList: ({ bits, issuer, listUri, now, signingKey, ttlSeconds }: {
|
|
15
|
+
bits: StatusListBits;
|
|
16
|
+
issuer: string;
|
|
17
|
+
listUri: string;
|
|
18
|
+
now?: number;
|
|
19
|
+
signingKey: SigningKey;
|
|
20
|
+
ttlSeconds?: number;
|
|
21
|
+
}) => Promise<string>;
|
|
22
|
+
export declare const verifyStatusListJwt: ({ issuerPublicJwk, token }: {
|
|
23
|
+
issuerPublicJwk: JsonWebKey;
|
|
24
|
+
token: string;
|
|
25
|
+
}) => Promise<{
|
|
26
|
+
bits: Uint8Array<ArrayBuffer>;
|
|
27
|
+
sub: string | undefined;
|
|
28
|
+
} | undefined>;
|
|
29
|
+
export { STATUS_LIST_SUB_TYP, STATUS_LIST_TYP };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { SigningKey } from '../oidc/keys';
|
|
3
|
+
import { type StatusListBits } from './statusList';
|
|
4
|
+
export declare const DEFAULT_STATUS_ROUTE = "/vc/status";
|
|
5
|
+
export declare const statusListRoutes: ({ getStatusList, issuerUrl, signingKey, statusRoute, ttlSeconds }: {
|
|
6
|
+
getStatusList: (listId: string) => Promise<StatusListBits | undefined> | StatusListBits | undefined;
|
|
7
|
+
issuerUrl: string;
|
|
8
|
+
signingKey: SigningKey;
|
|
9
|
+
statusRoute?: string;
|
|
10
|
+
ttlSeconds?: number;
|
|
11
|
+
}) => Elysia<"", {
|
|
12
|
+
decorator: {};
|
|
13
|
+
store: {};
|
|
14
|
+
derive: {};
|
|
15
|
+
resolve: {};
|
|
16
|
+
}, {
|
|
17
|
+
typebox: {};
|
|
18
|
+
error: {};
|
|
19
|
+
}, {
|
|
20
|
+
schema: {};
|
|
21
|
+
standaloneSchema: {};
|
|
22
|
+
macro: {};
|
|
23
|
+
macroFn: {};
|
|
24
|
+
parser: {};
|
|
25
|
+
response: {};
|
|
26
|
+
}, {
|
|
27
|
+
[x: string]: {
|
|
28
|
+
":listId": {
|
|
29
|
+
get: {
|
|
30
|
+
body: unknown;
|
|
31
|
+
params: {
|
|
32
|
+
listId: string;
|
|
33
|
+
};
|
|
34
|
+
query: unknown;
|
|
35
|
+
headers: unknown;
|
|
36
|
+
response: {
|
|
37
|
+
200: Response;
|
|
38
|
+
422: {
|
|
39
|
+
type: "validation";
|
|
40
|
+
on: string;
|
|
41
|
+
summary?: string;
|
|
42
|
+
message?: string;
|
|
43
|
+
found?: unknown;
|
|
44
|
+
property?: string;
|
|
45
|
+
expected?: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}, {
|
|
52
|
+
derive: {};
|
|
53
|
+
resolve: {};
|
|
54
|
+
schema: {};
|
|
55
|
+
standaloneSchema: {};
|
|
56
|
+
response: {};
|
|
57
|
+
}, {
|
|
58
|
+
derive: {};
|
|
59
|
+
resolve: {};
|
|
60
|
+
schema: {};
|
|
61
|
+
standaloneSchema: {};
|
|
62
|
+
response: {};
|
|
63
|
+
}>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { type VerifiedPresentation, type Vp4Config } from './openid4vp';
|
|
3
|
+
export declare const DEFAULT_VP_ROUTE = "/vp";
|
|
4
|
+
export declare const vpRoutes: ({ defaultClientId, issuerUrl, onVerifiedPresentation, vpConfig, vpRoute }: {
|
|
5
|
+
defaultClientId: string;
|
|
6
|
+
issuerUrl: string;
|
|
7
|
+
onVerifiedPresentation?: (context: {
|
|
8
|
+
verified: VerifiedPresentation;
|
|
9
|
+
}) => Promise<void> | void;
|
|
10
|
+
vpConfig: Vp4Config;
|
|
11
|
+
vpRoute?: string;
|
|
12
|
+
}) => Elysia<"", {
|
|
13
|
+
decorator: {};
|
|
14
|
+
store: {};
|
|
15
|
+
derive: {};
|
|
16
|
+
resolve: {};
|
|
17
|
+
}, {
|
|
18
|
+
typebox: {};
|
|
19
|
+
error: {};
|
|
20
|
+
}, {
|
|
21
|
+
schema: {};
|
|
22
|
+
standaloneSchema: {};
|
|
23
|
+
macro: {};
|
|
24
|
+
macroFn: {};
|
|
25
|
+
parser: {};
|
|
26
|
+
response: {};
|
|
27
|
+
}, {
|
|
28
|
+
[x: string]: {
|
|
29
|
+
authorize: {
|
|
30
|
+
post: {
|
|
31
|
+
body: {
|
|
32
|
+
client_id?: string | undefined;
|
|
33
|
+
state?: string | undefined;
|
|
34
|
+
requested_claims: string[];
|
|
35
|
+
};
|
|
36
|
+
params: {};
|
|
37
|
+
query: unknown;
|
|
38
|
+
headers: unknown;
|
|
39
|
+
response: {
|
|
40
|
+
200: Response;
|
|
41
|
+
422: {
|
|
42
|
+
type: "validation";
|
|
43
|
+
on: string;
|
|
44
|
+
summary?: string;
|
|
45
|
+
message?: string;
|
|
46
|
+
found?: unknown;
|
|
47
|
+
property?: string;
|
|
48
|
+
expected?: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
} & {
|
|
55
|
+
[x: string]: {
|
|
56
|
+
request: {
|
|
57
|
+
":id": {
|
|
58
|
+
get: {
|
|
59
|
+
body: unknown;
|
|
60
|
+
params: {
|
|
61
|
+
id: string;
|
|
62
|
+
};
|
|
63
|
+
query: unknown;
|
|
64
|
+
headers: unknown;
|
|
65
|
+
response: {
|
|
66
|
+
200: Response;
|
|
67
|
+
422: {
|
|
68
|
+
type: "validation";
|
|
69
|
+
on: string;
|
|
70
|
+
summary?: string;
|
|
71
|
+
message?: string;
|
|
72
|
+
found?: unknown;
|
|
73
|
+
property?: string;
|
|
74
|
+
expected?: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
} & {
|
|
82
|
+
[x: string]: {
|
|
83
|
+
response: {
|
|
84
|
+
post: {
|
|
85
|
+
body: {
|
|
86
|
+
state?: string | undefined;
|
|
87
|
+
presentation_submission?: unknown;
|
|
88
|
+
vp_token: string;
|
|
89
|
+
};
|
|
90
|
+
params: {};
|
|
91
|
+
query: unknown;
|
|
92
|
+
headers: unknown;
|
|
93
|
+
response: {
|
|
94
|
+
200: Response;
|
|
95
|
+
422: {
|
|
96
|
+
type: "validation";
|
|
97
|
+
on: string;
|
|
98
|
+
summary?: string;
|
|
99
|
+
message?: string;
|
|
100
|
+
found?: unknown;
|
|
101
|
+
property?: string;
|
|
102
|
+
expected?: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
}, {
|
|
109
|
+
derive: {};
|
|
110
|
+
resolve: {};
|
|
111
|
+
schema: {};
|
|
112
|
+
standaloneSchema: {};
|
|
113
|
+
response: {};
|
|
114
|
+
}, {
|
|
115
|
+
derive: {};
|
|
116
|
+
resolve: {};
|
|
117
|
+
schema: {};
|
|
118
|
+
standaloneSchema: {};
|
|
119
|
+
response: {};
|
|
120
|
+
}>;
|
package/package.json
CHANGED