@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth 0.34.1-fix.80 → 0.34.1-next.278
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/index.cjs +481 -429
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +739 -67
- package/dist/index.d.ts +739 -67
- package/dist/index.js +472 -421
- package/dist/index.js.map +1 -1
- package/package.json +18 -18
- package/src/RPInstance.ts +14 -29
- package/src/agent/SIOPv2RP.ts +138 -66
- package/src/functions.ts +49 -52
- package/src/index.ts +1 -1
- package/src/types/ISIOPv2RP.ts +32 -59
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,395 @@
|
|
|
1
|
-
import { IPluginMethodMap, IAgentContext, IResolver, IDIDManager, IKeyManager,
|
|
2
|
-
import { ResponseURIType, ClaimPayloadCommonOpts, AuthorizationRequestPayload, RequestObjectPayload, AuthorizationRequestState,
|
|
3
|
-
import {
|
|
4
|
-
import { AdditionalClaims, DcqlQueryREST, HasherSync, W3CVerifiablePresentation } from '@sphereon/ssi-types';
|
|
5
|
-
import { Resolvable } from 'did-resolver';
|
|
1
|
+
import { IPluginMethodMap, IAgentContext, IResolver, IDIDManager, IKeyManager, ICredentialVerifier, IAgentPlugin } from '@veramo/core';
|
|
2
|
+
import { ResponseURIType, ClaimPayloadCommonOpts, CallbackOpts, AuthorizationRequestPayload, RequestObjectPayload, AuthorizationRequestState, AuthorizationResponseStateWithVerifiedData, AuthorizationResponsePayload, VerifiedAuthorizationResponse, ResponseMode, SupportedVersion, IRPSessionManager, ClientMetadataOpts, VerifyJwtCallback, PresentationVerificationCallback, RP, URI, AuthorizationRequest } from '@sphereon/did-auth-siop';
|
|
3
|
+
import { CheckLinkedDomain } from '@sphereon/did-auth-siop-adapter';
|
|
6
4
|
import { DIDDocument } from '@sphereon/did-uni-client';
|
|
7
|
-
import {
|
|
5
|
+
import { JwtIssuer } from '@sphereon/oid4vc-common';
|
|
8
6
|
import { IPresentationDefinition } from '@sphereon/pex';
|
|
9
7
|
import { IDIDOptions } from '@sphereon/ssi-sdk-ext.did-utils';
|
|
10
|
-
import {
|
|
11
|
-
import { VerifyCallback } from '@sphereon/wellknown-dids-client';
|
|
12
|
-
import { AuthorizationRequestStateStatus } from '@sphereon/ssi-sdk.siopv2-oid4vp-common';
|
|
13
|
-
import { IPDManager, VersionControlMode } from '@sphereon/ssi-sdk.pd-manager';
|
|
14
|
-
import { CheckLinkedDomain } from '@sphereon/did-auth-siop-adapter';
|
|
15
|
-
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
|
|
8
|
+
import { IIdentifierResolution, ManagedIdentifierOptsOrResult, ExternalIdentifierOIDFEntityIdOpts } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
16
9
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
17
|
-
import { JwtIssuer } from '@sphereon/oid4vc-common';
|
|
18
|
-
import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc';
|
|
19
10
|
import { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation';
|
|
11
|
+
import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc';
|
|
12
|
+
import { IPDManager, ImportDcqlQueryItem, VersionControlMode } from '@sphereon/ssi-sdk.pd-manager';
|
|
13
|
+
import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange';
|
|
14
|
+
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
|
|
15
|
+
import { AuthorizationRequestStateStatus } from '@sphereon/ssi-sdk.siopv2-oid4vp-common';
|
|
16
|
+
import { HasherSync } from '@sphereon/ssi-types';
|
|
17
|
+
import { VerifyCallback } from '@sphereon/wellknown-dids-client';
|
|
18
|
+
import { DcqlQuery } from 'dcql';
|
|
19
|
+
import { Resolvable } from 'did-resolver';
|
|
20
|
+
import { EventEmitter } from 'events';
|
|
21
|
+
|
|
22
|
+
var IDidAuthSiopOpAuthenticator = {
|
|
23
|
+
components: {
|
|
24
|
+
schemas: {
|
|
25
|
+
IGetSiopSessionArgs: {
|
|
26
|
+
type: "object",
|
|
27
|
+
properties: {
|
|
28
|
+
sessionId: {
|
|
29
|
+
type: "string"
|
|
30
|
+
},
|
|
31
|
+
additionalProperties: false
|
|
32
|
+
},
|
|
33
|
+
required: [
|
|
34
|
+
"sessionId"
|
|
35
|
+
],
|
|
36
|
+
description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.getSessionForSiop } "
|
|
37
|
+
},
|
|
38
|
+
IRegisterSiopSessionArgs: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
identifier: {
|
|
42
|
+
type: "object",
|
|
43
|
+
properties: {
|
|
44
|
+
did: {
|
|
45
|
+
type: "string"
|
|
46
|
+
},
|
|
47
|
+
alias: {
|
|
48
|
+
type: "string"
|
|
49
|
+
},
|
|
50
|
+
provider: {
|
|
51
|
+
type: "string"
|
|
52
|
+
},
|
|
53
|
+
controllerKeyId: {
|
|
54
|
+
type: "string"
|
|
55
|
+
},
|
|
56
|
+
keys: {
|
|
57
|
+
type: "array",
|
|
58
|
+
items: {
|
|
59
|
+
type: "object",
|
|
60
|
+
properties: {
|
|
61
|
+
additionalProperties: true
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
services: {
|
|
66
|
+
type: "array",
|
|
67
|
+
items: {
|
|
68
|
+
type: "object",
|
|
69
|
+
properties: {
|
|
70
|
+
additionalProperties: true
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
additionalProperties: false,
|
|
76
|
+
required: [
|
|
77
|
+
"did",
|
|
78
|
+
"provider",
|
|
79
|
+
"keys",
|
|
80
|
+
"services"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
sessionId: {
|
|
84
|
+
type: "string"
|
|
85
|
+
},
|
|
86
|
+
expiresIn: {
|
|
87
|
+
type: "number"
|
|
88
|
+
},
|
|
89
|
+
additionalProperties: false
|
|
90
|
+
},
|
|
91
|
+
required: [
|
|
92
|
+
"identifier"
|
|
93
|
+
],
|
|
94
|
+
description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.registerSessionForSiop } "
|
|
95
|
+
},
|
|
96
|
+
IRemoveSiopSessionArgs: {
|
|
97
|
+
type: "object",
|
|
98
|
+
properties: {
|
|
99
|
+
sessionId: {
|
|
100
|
+
type: "string"
|
|
101
|
+
},
|
|
102
|
+
additionalProperties: false
|
|
103
|
+
},
|
|
104
|
+
required: [
|
|
105
|
+
"sessionId"
|
|
106
|
+
],
|
|
107
|
+
description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.removeSessionForSiop } "
|
|
108
|
+
},
|
|
109
|
+
IAuthenticateWithSiopArgs: {
|
|
110
|
+
type: "object",
|
|
111
|
+
properties: {
|
|
112
|
+
sessionId: {
|
|
113
|
+
type: "string"
|
|
114
|
+
},
|
|
115
|
+
stateId: {
|
|
116
|
+
type: "string"
|
|
117
|
+
},
|
|
118
|
+
redirectUrl: {
|
|
119
|
+
type: "string"
|
|
120
|
+
},
|
|
121
|
+
additionalProperties: false
|
|
122
|
+
},
|
|
123
|
+
required: [
|
|
124
|
+
"sessionId",
|
|
125
|
+
"stateId",
|
|
126
|
+
"redirectUrl"
|
|
127
|
+
],
|
|
128
|
+
description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.authenticateWithSiop } "
|
|
129
|
+
},
|
|
130
|
+
IResponse: {
|
|
131
|
+
type: "object",
|
|
132
|
+
properties: {
|
|
133
|
+
status: {
|
|
134
|
+
type: "number"
|
|
135
|
+
},
|
|
136
|
+
additionalProperties: true
|
|
137
|
+
},
|
|
138
|
+
required: [
|
|
139
|
+
"status"
|
|
140
|
+
],
|
|
141
|
+
description: "Result of {@link DidAuthSiopOpAuthenticator.authenticateWithSiop & DidAuthSiopOpAuthenticator.sendSiopAuthenticationResponse } "
|
|
142
|
+
},
|
|
143
|
+
IGetSiopAuthenticationRequestFromRpArgs: {
|
|
144
|
+
type: "object",
|
|
145
|
+
properties: {
|
|
146
|
+
sessionId: {
|
|
147
|
+
type: "string"
|
|
148
|
+
},
|
|
149
|
+
stateId: {
|
|
150
|
+
type: "string"
|
|
151
|
+
},
|
|
152
|
+
redirectUrl: {
|
|
153
|
+
type: "string"
|
|
154
|
+
},
|
|
155
|
+
additionalProperties: false
|
|
156
|
+
},
|
|
157
|
+
required: [
|
|
158
|
+
"sessionId",
|
|
159
|
+
"stateId",
|
|
160
|
+
"redirectUrl"
|
|
161
|
+
],
|
|
162
|
+
description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.getSiopAuthenticationRequestFromRP } "
|
|
163
|
+
},
|
|
164
|
+
ParsedAuthenticationRequestURI: {
|
|
165
|
+
type: "object",
|
|
166
|
+
properties: {
|
|
167
|
+
jwt: {
|
|
168
|
+
type: "string"
|
|
169
|
+
},
|
|
170
|
+
requestPayload: {
|
|
171
|
+
type: "object",
|
|
172
|
+
properties: {
|
|
173
|
+
additionalProperties: true
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
registration: {
|
|
177
|
+
type: "object",
|
|
178
|
+
properties: {
|
|
179
|
+
additionalProperties: true
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
additionalProperties: false
|
|
183
|
+
},
|
|
184
|
+
required: [
|
|
185
|
+
"jwt",
|
|
186
|
+
"requestPayload",
|
|
187
|
+
"registration"
|
|
188
|
+
],
|
|
189
|
+
description: "Result of {@link DidAuthSiopOpAuthenticator.getSiopAuthenticationRequestFromRP } "
|
|
190
|
+
},
|
|
191
|
+
IGetSiopAuthenticationRequestDetailsArgs: {
|
|
192
|
+
type: "object",
|
|
193
|
+
properties: {
|
|
194
|
+
sessionId: {
|
|
195
|
+
type: "string"
|
|
196
|
+
},
|
|
197
|
+
verifiedAuthenticationRequest: {
|
|
198
|
+
type: "object",
|
|
199
|
+
properties: {
|
|
200
|
+
additionalProperties: true
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
credentialFilter: {
|
|
204
|
+
type: "object",
|
|
205
|
+
properties: {
|
|
206
|
+
additionalProperties: true
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
additionalProperties: false
|
|
210
|
+
},
|
|
211
|
+
required: [
|
|
212
|
+
"sessionId",
|
|
213
|
+
"verifiedAuthenticationRequest"
|
|
214
|
+
],
|
|
215
|
+
description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.getSiopAuthenticationRequestDetails } "
|
|
216
|
+
},
|
|
217
|
+
IAuthRequestDetails: {
|
|
218
|
+
type: "object",
|
|
219
|
+
properties: {
|
|
220
|
+
id: {
|
|
221
|
+
type: "string"
|
|
222
|
+
},
|
|
223
|
+
alsoKnownAs: {
|
|
224
|
+
type: "array",
|
|
225
|
+
items: {
|
|
226
|
+
type: "string"
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
vpResponseOpts: {
|
|
230
|
+
type: "object",
|
|
231
|
+
properties: {
|
|
232
|
+
additionalProperties: true
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
additionalProperties: false
|
|
236
|
+
},
|
|
237
|
+
required: [
|
|
238
|
+
"id",
|
|
239
|
+
"vpResponseOpts"
|
|
240
|
+
],
|
|
241
|
+
description: "Result of {@link DidAuthSiopOpAuthenticator.getSiopAuthenticationRequestDetails } "
|
|
242
|
+
},
|
|
243
|
+
IVerifySiopAuthenticationRequestUriArgs: {
|
|
244
|
+
type: "object",
|
|
245
|
+
properties: {
|
|
246
|
+
sessionId: {
|
|
247
|
+
type: "string"
|
|
248
|
+
},
|
|
249
|
+
ParsedAuthenticationRequestURI: {
|
|
250
|
+
type: "object",
|
|
251
|
+
properties: {
|
|
252
|
+
additionalProperties: true
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
additionalProperties: false
|
|
256
|
+
},
|
|
257
|
+
required: [
|
|
258
|
+
"sessionId",
|
|
259
|
+
"ParsedAuthenticationRequestURI"
|
|
260
|
+
],
|
|
261
|
+
description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.verifySiopAuthenticationRequestURI } "
|
|
262
|
+
},
|
|
263
|
+
VerifiedAuthorizationRequest: {
|
|
264
|
+
type: "object",
|
|
265
|
+
properties: {
|
|
266
|
+
payload: {
|
|
267
|
+
type: "object",
|
|
268
|
+
properties: {
|
|
269
|
+
additionalProperties: true
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
presentationDefinitions: {
|
|
273
|
+
type: "object",
|
|
274
|
+
properties: {
|
|
275
|
+
additionalProperties: true
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
verifyOpts: {
|
|
279
|
+
type: "object",
|
|
280
|
+
properties: {
|
|
281
|
+
additionalProperties: true
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
additionalProperties: false
|
|
285
|
+
},
|
|
286
|
+
required: [
|
|
287
|
+
"payload",
|
|
288
|
+
"verifyOpts"
|
|
289
|
+
],
|
|
290
|
+
description: "Result of {@link DidAuthSiopOpAuthenticator.verifySiopAuthenticationRequestURI } "
|
|
291
|
+
},
|
|
292
|
+
ISendSiopAuthenticationResponseArgs: {
|
|
293
|
+
type: "object",
|
|
294
|
+
properties: {
|
|
295
|
+
sessionId: {
|
|
296
|
+
type: "string"
|
|
297
|
+
},
|
|
298
|
+
verifiedAuthenticationRequest: {
|
|
299
|
+
type: "object",
|
|
300
|
+
properties: {
|
|
301
|
+
additionalProperties: true
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
verifiablePresentationResponse: {
|
|
305
|
+
type: "object",
|
|
306
|
+
properties: {
|
|
307
|
+
additionalProperties: true
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
additionalProperties: false
|
|
311
|
+
},
|
|
312
|
+
required: [
|
|
313
|
+
"sessionId",
|
|
314
|
+
"verifiedAuthenticationRequest"
|
|
315
|
+
],
|
|
316
|
+
description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.sendSiopAuthenticationResponse } "
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
methods: {
|
|
320
|
+
getSessionForSiop: {
|
|
321
|
+
description: "Get SIOP session",
|
|
322
|
+
"arguments": {
|
|
323
|
+
$ref: "#/components/schemas/IGetSiopSessionArgs"
|
|
324
|
+
},
|
|
325
|
+
returnType: "object"
|
|
326
|
+
},
|
|
327
|
+
registerSessionForSiop: {
|
|
328
|
+
description: "Register SIOP session",
|
|
329
|
+
"arguments": {
|
|
330
|
+
$ref: "#/components/schemas/IRegisterSiopSessionArgs"
|
|
331
|
+
},
|
|
332
|
+
returnType: "object"
|
|
333
|
+
},
|
|
334
|
+
removeSessionForSiop: {
|
|
335
|
+
description: "Remove SIOP session",
|
|
336
|
+
"arguments": {
|
|
337
|
+
$ref: "#/components/schemas/IRemoveSiopSessionArgs"
|
|
338
|
+
},
|
|
339
|
+
returnType: "boolean"
|
|
340
|
+
},
|
|
341
|
+
authenticateWithSiop: {
|
|
342
|
+
description: "Authenticate using DID Auth SIOP",
|
|
343
|
+
"arguments": {
|
|
344
|
+
$ref: "#/components/schemas/IAuthenticateWithSiopArgs"
|
|
345
|
+
},
|
|
346
|
+
returnType: {
|
|
347
|
+
$ref: "#/components/schemas/Response"
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
getSiopAuthenticationRequestFromRP: {
|
|
351
|
+
description: "Get authentication request from RP",
|
|
352
|
+
"arguments": {
|
|
353
|
+
$ref: "#/components/schemas/IGetSiopAuthenticationRequestFromRpArgs"
|
|
354
|
+
},
|
|
355
|
+
returnType: {
|
|
356
|
+
$ref: "#/components/schemas/ParsedAuthenticationRequestURI"
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
getSiopAuthenticationRequestDetails: {
|
|
360
|
+
description: "Get authentication request details",
|
|
361
|
+
"arguments": {
|
|
362
|
+
$ref: "#/components/schemas/IGetSiopAuthenticationRequestDetailsArgs"
|
|
363
|
+
},
|
|
364
|
+
returnType: {
|
|
365
|
+
$ref: "#/components/schemas/IAuthRequestDetails"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
verifySiopAuthenticationRequestURI: {
|
|
369
|
+
description: "Verify authentication request URI",
|
|
370
|
+
"arguments": {
|
|
371
|
+
$ref: "#/components/schemas/IVerifySiopAuthenticationRequestUriArgs"
|
|
372
|
+
},
|
|
373
|
+
returnType: {
|
|
374
|
+
$ref: "#/components/schemas/VerifiedAuthorizationRequest"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
sendSiopAuthenticationResponse: {
|
|
378
|
+
description: "Send authentication response",
|
|
379
|
+
"arguments": {
|
|
380
|
+
$ref: "#/components/schemas/ISendSiopAuthenticationResponseArgs"
|
|
381
|
+
},
|
|
382
|
+
returnType: {
|
|
383
|
+
$ref: "#/components/schemas/IRequiredContext"
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
var plugin_schema = {
|
|
390
|
+
IDidAuthSiopOpAuthenticator: IDidAuthSiopOpAuthenticator
|
|
391
|
+
};
|
|
20
392
|
|
|
21
|
-
declare enum VerifiedDataMode {
|
|
22
|
-
NONE = "none",
|
|
23
|
-
VERIFIED_PRESENTATION = "vp",
|
|
24
|
-
CREDENTIAL_SUBJECT_FLATTENED = "cs-flat"
|
|
25
|
-
}
|
|
26
393
|
interface ISIOPv2RP extends IPluginMethodMap {
|
|
27
394
|
siopCreateAuthRequestURI(createArgs: ICreateAuthRequestArgs, context: IRequiredContext): Promise<string>;
|
|
28
395
|
siopCreateAuthRequestPayloads(createArgs: ICreateAuthRequestArgs, context: IRequiredContext): Promise<IAuthorizationRequestPayloads>;
|
|
@@ -41,8 +408,9 @@ interface ISiopv2RPOpts {
|
|
|
41
408
|
interface IRPDefaultOpts extends IRPOptions {
|
|
42
409
|
}
|
|
43
410
|
interface ICreateAuthRequestArgs {
|
|
44
|
-
|
|
411
|
+
queryId: string;
|
|
45
412
|
correlationId: string;
|
|
413
|
+
useQueryIdInstance?: boolean;
|
|
46
414
|
responseURIType: ResponseURIType;
|
|
47
415
|
responseURI: string;
|
|
48
416
|
responseRedirectURI?: string;
|
|
@@ -51,49 +419,45 @@ interface ICreateAuthRequestArgs {
|
|
|
51
419
|
nonce?: string;
|
|
52
420
|
state?: string;
|
|
53
421
|
claims?: ClaimPayloadCommonOpts;
|
|
422
|
+
callback?: CallbackOpts;
|
|
54
423
|
}
|
|
55
424
|
interface IGetAuthRequestStateArgs {
|
|
56
425
|
correlationId: string;
|
|
57
|
-
|
|
426
|
+
queryId?: string;
|
|
58
427
|
errorOnNotFound?: boolean;
|
|
59
428
|
}
|
|
60
429
|
interface IGetAuthResponseStateArgs {
|
|
61
430
|
correlationId: string;
|
|
62
|
-
|
|
431
|
+
queryId?: string;
|
|
63
432
|
errorOnNotFound?: boolean;
|
|
64
433
|
progressRequestStateTo?: AuthorizationRequestStateStatus;
|
|
65
|
-
includeVerifiedData?: VerifiedDataMode;
|
|
66
434
|
}
|
|
67
435
|
interface IUpdateRequestStateArgs {
|
|
68
|
-
|
|
436
|
+
queryId?: string;
|
|
69
437
|
correlationId: string;
|
|
70
438
|
state: AuthorizationRequestStateStatus;
|
|
71
439
|
error?: string;
|
|
72
440
|
}
|
|
73
441
|
interface IDeleteAuthStateArgs {
|
|
74
442
|
correlationId: string;
|
|
75
|
-
|
|
443
|
+
queryId?: string;
|
|
76
444
|
}
|
|
77
445
|
interface IVerifyAuthResponseStateArgs {
|
|
78
446
|
authorizationResponse: string | AuthorizationResponsePayload;
|
|
79
|
-
|
|
447
|
+
queryId?: string;
|
|
80
448
|
correlationId: string;
|
|
81
449
|
audience?: string;
|
|
82
|
-
dcqlQuery?:
|
|
83
|
-
}
|
|
84
|
-
interface IDefinitionPair {
|
|
85
|
-
definitionPayload: IPresentationDefinition;
|
|
86
|
-
dcqlPayload?: DcqlQueryREST;
|
|
450
|
+
dcqlQuery?: DcqlQuery;
|
|
87
451
|
}
|
|
88
452
|
interface ImportDefinitionsArgs {
|
|
89
|
-
|
|
453
|
+
importItems: Array<ImportDcqlQueryItem>;
|
|
90
454
|
tenantId?: string;
|
|
91
455
|
version?: string;
|
|
92
456
|
versionControlMode?: VersionControlMode;
|
|
93
457
|
}
|
|
94
458
|
interface IGetRedirectUriArgs {
|
|
95
459
|
correlationId: string;
|
|
96
|
-
|
|
460
|
+
queryId?: string;
|
|
97
461
|
state?: string;
|
|
98
462
|
}
|
|
99
463
|
interface IAuthorizationRequestPayloads {
|
|
@@ -106,10 +470,11 @@ interface IPEXDefinitionPersistArgs extends IPEXInstanceOptions {
|
|
|
106
470
|
ttl?: number;
|
|
107
471
|
}
|
|
108
472
|
interface ISiopRPInstanceArgs {
|
|
109
|
-
|
|
473
|
+
createWhenNotPresent: boolean;
|
|
474
|
+
queryId?: string;
|
|
110
475
|
responseRedirectURI?: string;
|
|
111
476
|
}
|
|
112
|
-
interface IPEXInstanceOptions extends
|
|
477
|
+
interface IPEXInstanceOptions extends IPresentationOptions {
|
|
113
478
|
rpOpts?: IRPOptions;
|
|
114
479
|
}
|
|
115
480
|
interface IRPOptions {
|
|
@@ -125,11 +490,9 @@ interface IRPOptions {
|
|
|
125
490
|
verifyJwtCallback?: VerifyJwtCallback;
|
|
126
491
|
responseRedirectUri?: string;
|
|
127
492
|
}
|
|
128
|
-
interface
|
|
493
|
+
interface IPresentationOptions {
|
|
494
|
+
queryId: string;
|
|
129
495
|
presentationVerifyCallback?: PresentationVerificationCallback;
|
|
130
|
-
definitionId: string;
|
|
131
|
-
version?: string;
|
|
132
|
-
tenantId?: string;
|
|
133
496
|
}
|
|
134
497
|
type VerificationPolicies = {
|
|
135
498
|
schemaValidation: SchemaValidation;
|
|
@@ -141,14 +504,8 @@ interface PerDidResolver {
|
|
|
141
504
|
interface IAuthRequestDetails {
|
|
142
505
|
rpDIDDocument?: DIDDocument;
|
|
143
506
|
id: string;
|
|
144
|
-
verifiablePresentationMatches: IPresentationWithDefinition[];
|
|
145
507
|
alsoKnownAs?: string[];
|
|
146
508
|
}
|
|
147
|
-
interface IPresentationWithDefinition {
|
|
148
|
-
location: VPTokenLocation;
|
|
149
|
-
format: VerifiablePresentationTypeFormat;
|
|
150
|
-
presentation: W3CVerifiablePresentation;
|
|
151
|
-
}
|
|
152
509
|
interface ISIOPIdentifierOptions extends Omit<IDIDOptions, 'idOpts'> {
|
|
153
510
|
idOpts: ManagedIdentifierOptsOrResult;
|
|
154
511
|
oidfOpts?: ExternalIdentifierOIDFEntityIdOpts;
|
|
@@ -158,34 +515,354 @@ interface ISIOPIdentifierOptions extends Omit<IDIDOptions, 'idOpts'> {
|
|
|
158
515
|
type CredentialOpts = {
|
|
159
516
|
hasher?: HasherSync;
|
|
160
517
|
};
|
|
161
|
-
|
|
162
|
-
verifiedData?: AdditionalClaims;
|
|
163
|
-
}
|
|
164
|
-
type IRequiredContext = IAgentContext<IResolver & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialValidation & ICredentialVerifier & IPresentationExchange & IPDManager & ISDJwtPlugin & IJwtService & ImDLMdoc>;
|
|
518
|
+
type IRequiredContext = IAgentContext<IResolver & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialValidation & ICredentialVerifier & IPresentationExchange & IPDManager & ISDJwtPlugin & IJwtService & ImDLMdoc>;
|
|
165
519
|
|
|
166
520
|
declare class RPInstance {
|
|
167
521
|
private _rp;
|
|
168
|
-
private readonly
|
|
522
|
+
private readonly _presentationOptions;
|
|
169
523
|
private readonly _rpOptions;
|
|
170
524
|
constructor({ rpOpts, pexOpts }: {
|
|
171
525
|
rpOpts: IRPOptions;
|
|
172
|
-
pexOpts?:
|
|
526
|
+
pexOpts?: IPresentationOptions;
|
|
173
527
|
});
|
|
174
528
|
get(context: IRequiredContext): Promise<RP>;
|
|
175
529
|
get rpOptions(): IRPOptions;
|
|
176
|
-
get
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
getPresentationDefinition(context: IRequiredContext): Promise<IPresentationDefinition | undefined>;
|
|
180
|
-
createAuthorizationRequestURI(createArgs: Omit<ICreateAuthRequestArgs, 'definitionId'>, context: IRequiredContext): Promise<URI>;
|
|
181
|
-
createAuthorizationRequest(createArgs: Omit<ICreateAuthRequestArgs, 'definitionId'>, context: IRequiredContext): Promise<AuthorizationRequest>;
|
|
530
|
+
get presentationOptions(): IPresentationOptions | undefined;
|
|
531
|
+
createAuthorizationRequestURI(createArgs: ICreateAuthRequestArgs, context: IRequiredContext): Promise<URI>;
|
|
532
|
+
createAuthorizationRequest(createArgs: Omit<ICreateAuthRequestArgs, 'queryId'>, context: IRequiredContext): Promise<AuthorizationRequest>;
|
|
182
533
|
}
|
|
183
534
|
|
|
184
535
|
declare class SIOPv2RP implements IAgentPlugin {
|
|
185
536
|
private readonly opts;
|
|
186
537
|
private static readonly _DEFAULT_OPTS_KEY;
|
|
187
538
|
private readonly instances;
|
|
188
|
-
readonly schema:
|
|
539
|
+
readonly schema: {
|
|
540
|
+
components: {
|
|
541
|
+
schemas: {
|
|
542
|
+
IGetSiopSessionArgs: {
|
|
543
|
+
type: string;
|
|
544
|
+
properties: {
|
|
545
|
+
sessionId: {
|
|
546
|
+
type: string;
|
|
547
|
+
};
|
|
548
|
+
additionalProperties: boolean;
|
|
549
|
+
};
|
|
550
|
+
required: string[];
|
|
551
|
+
description: string;
|
|
552
|
+
};
|
|
553
|
+
IRegisterSiopSessionArgs: {
|
|
554
|
+
type: string;
|
|
555
|
+
properties: {
|
|
556
|
+
identifier: {
|
|
557
|
+
type: string;
|
|
558
|
+
properties: {
|
|
559
|
+
did: {
|
|
560
|
+
type: string;
|
|
561
|
+
};
|
|
562
|
+
alias: {
|
|
563
|
+
type: string;
|
|
564
|
+
};
|
|
565
|
+
provider: {
|
|
566
|
+
type: string;
|
|
567
|
+
};
|
|
568
|
+
controllerKeyId: {
|
|
569
|
+
type: string;
|
|
570
|
+
};
|
|
571
|
+
keys: {
|
|
572
|
+
type: string;
|
|
573
|
+
items: {
|
|
574
|
+
type: string;
|
|
575
|
+
properties: {
|
|
576
|
+
additionalProperties: boolean;
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
};
|
|
580
|
+
services: {
|
|
581
|
+
type: string;
|
|
582
|
+
items: {
|
|
583
|
+
type: string;
|
|
584
|
+
properties: {
|
|
585
|
+
additionalProperties: boolean;
|
|
586
|
+
};
|
|
587
|
+
};
|
|
588
|
+
};
|
|
589
|
+
};
|
|
590
|
+
additionalProperties: boolean;
|
|
591
|
+
required: string[];
|
|
592
|
+
};
|
|
593
|
+
sessionId: {
|
|
594
|
+
type: string;
|
|
595
|
+
};
|
|
596
|
+
expiresIn: {
|
|
597
|
+
type: string;
|
|
598
|
+
};
|
|
599
|
+
additionalProperties: boolean;
|
|
600
|
+
};
|
|
601
|
+
required: string[];
|
|
602
|
+
description: string;
|
|
603
|
+
};
|
|
604
|
+
IRemoveSiopSessionArgs: {
|
|
605
|
+
type: string;
|
|
606
|
+
properties: {
|
|
607
|
+
sessionId: {
|
|
608
|
+
type: string;
|
|
609
|
+
};
|
|
610
|
+
additionalProperties: boolean;
|
|
611
|
+
};
|
|
612
|
+
required: string[];
|
|
613
|
+
description: string;
|
|
614
|
+
};
|
|
615
|
+
IAuthenticateWithSiopArgs: {
|
|
616
|
+
type: string;
|
|
617
|
+
properties: {
|
|
618
|
+
sessionId: {
|
|
619
|
+
type: string;
|
|
620
|
+
};
|
|
621
|
+
stateId: {
|
|
622
|
+
type: string;
|
|
623
|
+
};
|
|
624
|
+
redirectUrl: {
|
|
625
|
+
type: string;
|
|
626
|
+
};
|
|
627
|
+
additionalProperties: boolean;
|
|
628
|
+
};
|
|
629
|
+
required: string[];
|
|
630
|
+
description: string;
|
|
631
|
+
};
|
|
632
|
+
IResponse: {
|
|
633
|
+
type: string;
|
|
634
|
+
properties: {
|
|
635
|
+
status: {
|
|
636
|
+
type: string;
|
|
637
|
+
};
|
|
638
|
+
additionalProperties: boolean;
|
|
639
|
+
};
|
|
640
|
+
required: string[];
|
|
641
|
+
description: string;
|
|
642
|
+
};
|
|
643
|
+
IGetSiopAuthenticationRequestFromRpArgs: {
|
|
644
|
+
type: string;
|
|
645
|
+
properties: {
|
|
646
|
+
sessionId: {
|
|
647
|
+
type: string;
|
|
648
|
+
};
|
|
649
|
+
stateId: {
|
|
650
|
+
type: string;
|
|
651
|
+
};
|
|
652
|
+
redirectUrl: {
|
|
653
|
+
type: string;
|
|
654
|
+
};
|
|
655
|
+
additionalProperties: boolean;
|
|
656
|
+
};
|
|
657
|
+
required: string[];
|
|
658
|
+
description: string;
|
|
659
|
+
};
|
|
660
|
+
ParsedAuthenticationRequestURI: {
|
|
661
|
+
type: string;
|
|
662
|
+
properties: {
|
|
663
|
+
jwt: {
|
|
664
|
+
type: string;
|
|
665
|
+
};
|
|
666
|
+
requestPayload: {
|
|
667
|
+
type: string;
|
|
668
|
+
properties: {
|
|
669
|
+
additionalProperties: boolean;
|
|
670
|
+
};
|
|
671
|
+
};
|
|
672
|
+
registration: {
|
|
673
|
+
type: string;
|
|
674
|
+
properties: {
|
|
675
|
+
additionalProperties: boolean;
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
additionalProperties: boolean;
|
|
679
|
+
};
|
|
680
|
+
required: string[];
|
|
681
|
+
description: string;
|
|
682
|
+
};
|
|
683
|
+
IGetSiopAuthenticationRequestDetailsArgs: {
|
|
684
|
+
type: string;
|
|
685
|
+
properties: {
|
|
686
|
+
sessionId: {
|
|
687
|
+
type: string;
|
|
688
|
+
};
|
|
689
|
+
verifiedAuthenticationRequest: {
|
|
690
|
+
type: string;
|
|
691
|
+
properties: {
|
|
692
|
+
additionalProperties: boolean;
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
credentialFilter: {
|
|
696
|
+
type: string;
|
|
697
|
+
properties: {
|
|
698
|
+
additionalProperties: boolean;
|
|
699
|
+
};
|
|
700
|
+
};
|
|
701
|
+
additionalProperties: boolean;
|
|
702
|
+
};
|
|
703
|
+
required: string[];
|
|
704
|
+
description: string;
|
|
705
|
+
};
|
|
706
|
+
IAuthRequestDetails: {
|
|
707
|
+
type: string;
|
|
708
|
+
properties: {
|
|
709
|
+
id: {
|
|
710
|
+
type: string;
|
|
711
|
+
};
|
|
712
|
+
alsoKnownAs: {
|
|
713
|
+
type: string;
|
|
714
|
+
items: {
|
|
715
|
+
type: string;
|
|
716
|
+
};
|
|
717
|
+
};
|
|
718
|
+
vpResponseOpts: {
|
|
719
|
+
type: string;
|
|
720
|
+
properties: {
|
|
721
|
+
additionalProperties: boolean;
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
additionalProperties: boolean;
|
|
725
|
+
};
|
|
726
|
+
required: string[];
|
|
727
|
+
description: string;
|
|
728
|
+
};
|
|
729
|
+
IVerifySiopAuthenticationRequestUriArgs: {
|
|
730
|
+
type: string;
|
|
731
|
+
properties: {
|
|
732
|
+
sessionId: {
|
|
733
|
+
type: string;
|
|
734
|
+
};
|
|
735
|
+
ParsedAuthenticationRequestURI: {
|
|
736
|
+
type: string;
|
|
737
|
+
properties: {
|
|
738
|
+
additionalProperties: boolean;
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
additionalProperties: boolean;
|
|
742
|
+
};
|
|
743
|
+
required: string[];
|
|
744
|
+
description: string;
|
|
745
|
+
};
|
|
746
|
+
VerifiedAuthorizationRequest: {
|
|
747
|
+
type: string;
|
|
748
|
+
properties: {
|
|
749
|
+
payload: {
|
|
750
|
+
type: string;
|
|
751
|
+
properties: {
|
|
752
|
+
additionalProperties: boolean;
|
|
753
|
+
};
|
|
754
|
+
};
|
|
755
|
+
presentationDefinitions: {
|
|
756
|
+
type: string;
|
|
757
|
+
properties: {
|
|
758
|
+
additionalProperties: boolean;
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
verifyOpts: {
|
|
762
|
+
type: string;
|
|
763
|
+
properties: {
|
|
764
|
+
additionalProperties: boolean;
|
|
765
|
+
};
|
|
766
|
+
};
|
|
767
|
+
additionalProperties: boolean;
|
|
768
|
+
};
|
|
769
|
+
required: string[];
|
|
770
|
+
description: string;
|
|
771
|
+
};
|
|
772
|
+
ISendSiopAuthenticationResponseArgs: {
|
|
773
|
+
type: string;
|
|
774
|
+
properties: {
|
|
775
|
+
sessionId: {
|
|
776
|
+
type: string;
|
|
777
|
+
};
|
|
778
|
+
verifiedAuthenticationRequest: {
|
|
779
|
+
type: string;
|
|
780
|
+
properties: {
|
|
781
|
+
additionalProperties: boolean;
|
|
782
|
+
};
|
|
783
|
+
};
|
|
784
|
+
verifiablePresentationResponse: {
|
|
785
|
+
type: string;
|
|
786
|
+
properties: {
|
|
787
|
+
additionalProperties: boolean;
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
additionalProperties: boolean;
|
|
791
|
+
};
|
|
792
|
+
required: string[];
|
|
793
|
+
description: string;
|
|
794
|
+
};
|
|
795
|
+
};
|
|
796
|
+
methods: {
|
|
797
|
+
getSessionForSiop: {
|
|
798
|
+
description: string;
|
|
799
|
+
arguments: {
|
|
800
|
+
$ref: string;
|
|
801
|
+
};
|
|
802
|
+
returnType: string;
|
|
803
|
+
};
|
|
804
|
+
registerSessionForSiop: {
|
|
805
|
+
description: string;
|
|
806
|
+
arguments: {
|
|
807
|
+
$ref: string;
|
|
808
|
+
};
|
|
809
|
+
returnType: string;
|
|
810
|
+
};
|
|
811
|
+
removeSessionForSiop: {
|
|
812
|
+
description: string;
|
|
813
|
+
arguments: {
|
|
814
|
+
$ref: string;
|
|
815
|
+
};
|
|
816
|
+
returnType: string;
|
|
817
|
+
};
|
|
818
|
+
authenticateWithSiop: {
|
|
819
|
+
description: string;
|
|
820
|
+
arguments: {
|
|
821
|
+
$ref: string;
|
|
822
|
+
};
|
|
823
|
+
returnType: {
|
|
824
|
+
$ref: string;
|
|
825
|
+
};
|
|
826
|
+
};
|
|
827
|
+
getSiopAuthenticationRequestFromRP: {
|
|
828
|
+
description: string;
|
|
829
|
+
arguments: {
|
|
830
|
+
$ref: string;
|
|
831
|
+
};
|
|
832
|
+
returnType: {
|
|
833
|
+
$ref: string;
|
|
834
|
+
};
|
|
835
|
+
};
|
|
836
|
+
getSiopAuthenticationRequestDetails: {
|
|
837
|
+
description: string;
|
|
838
|
+
arguments: {
|
|
839
|
+
$ref: string;
|
|
840
|
+
};
|
|
841
|
+
returnType: {
|
|
842
|
+
$ref: string;
|
|
843
|
+
};
|
|
844
|
+
};
|
|
845
|
+
verifySiopAuthenticationRequestURI: {
|
|
846
|
+
description: string;
|
|
847
|
+
arguments: {
|
|
848
|
+
$ref: string;
|
|
849
|
+
};
|
|
850
|
+
returnType: {
|
|
851
|
+
$ref: string;
|
|
852
|
+
};
|
|
853
|
+
};
|
|
854
|
+
sendSiopAuthenticationResponse: {
|
|
855
|
+
description: string;
|
|
856
|
+
arguments: {
|
|
857
|
+
$ref: string;
|
|
858
|
+
};
|
|
859
|
+
returnType: {
|
|
860
|
+
$ref: string;
|
|
861
|
+
};
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
};
|
|
865
|
+
};
|
|
189
866
|
readonly methods: ISIOPv2RP;
|
|
190
867
|
constructor(opts: ISiopv2RPOpts);
|
|
191
868
|
setDefaultOpts(rpDefaultOpts: IRPDefaultOpts, context: IRequiredContext): void;
|
|
@@ -199,18 +876,13 @@ declare class SIOPv2RP implements IAgentPlugin {
|
|
|
199
876
|
private siopVerifyAuthResponse;
|
|
200
877
|
private siopImportDefinitions;
|
|
201
878
|
private siopGetRedirectURI;
|
|
202
|
-
getRPInstance({
|
|
879
|
+
getRPInstance({ createWhenNotPresent, queryId, responseRedirectURI }: ISiopRPInstanceArgs, context: IRequiredContext): Promise<RPInstance>;
|
|
203
880
|
getRPOptions(context: IRequiredContext, opts: {
|
|
204
|
-
|
|
881
|
+
queryId?: string;
|
|
205
882
|
responseRedirectURI?: string;
|
|
206
883
|
}): Promise<IRPOptions>;
|
|
207
|
-
getInstanceOpts(
|
|
884
|
+
getInstanceOpts(queryId?: string): IPEXInstanceOptions | undefined;
|
|
208
885
|
private getDefaultOptions;
|
|
209
886
|
}
|
|
210
887
|
|
|
211
|
-
|
|
212
|
-
* @public
|
|
213
|
-
*/
|
|
214
|
-
declare const schema: any;
|
|
215
|
-
|
|
216
|
-
export { type AuthorizationResponseStateWithVerifiedData, type CredentialOpts, type IAuthRequestDetails, type IAuthorizationRequestPayloads, type ICreateAuthRequestArgs, type IDefinitionPair, type IDeleteAuthStateArgs, type IGetAuthRequestStateArgs, type IGetAuthResponseStateArgs, type IGetRedirectUriArgs, type IPEXDefinitionPersistArgs, type IPEXInstanceOptions, type IPEXOptions, type IPresentationWithDefinition, type IRPDefaultOpts, type IRPOptions, type IRequiredContext, type ISIOPIdentifierOptions, type ISIOPv2RP, type ISiopRPInstanceArgs, type ISiopv2RPOpts, type IUpdateRequestStateArgs, type IVerifyAuthResponseStateArgs, type ImportDefinitionsArgs, type PerDidResolver, SIOPv2RP, type VerificationPolicies, VerifiedDataMode, schema };
|
|
888
|
+
export { type CredentialOpts, type IAuthRequestDetails, type IAuthorizationRequestPayloads, type ICreateAuthRequestArgs, type IDeleteAuthStateArgs, type IGetAuthRequestStateArgs, type IGetAuthResponseStateArgs, type IGetRedirectUriArgs, type IPEXDefinitionPersistArgs, type IPEXInstanceOptions, type IPresentationOptions, type IRPDefaultOpts, type IRPOptions, type IRequiredContext, type ISIOPIdentifierOptions, type ISIOPv2RP, type ISiopRPInstanceArgs, type ISiopv2RPOpts, type IUpdateRequestStateArgs, type IVerifyAuthResponseStateArgs, type ImportDefinitionsArgs, type PerDidResolver, SIOPv2RP, type VerificationPolicies, plugin_schema as schema };
|