@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth 0.34.1-feature.SSISDK.47.43 → 0.34.1-feature.SSISDK.50.100
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 +351 -333
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -739
- package/dist/index.d.ts +40 -739
- package/dist/index.js +344 -325
- package/dist/index.js.map +1 -1
- package/package.json +19 -19
- package/src/RPInstance.ts +4 -5
- package/src/agent/SIOPv2RP.ts +47 -35
- package/src/functions.ts +2 -2
- package/src/index.ts +1 -1
- package/src/types/ISIOPv2RP.ts +33 -42
package/src/agent/SIOPv2RP.ts
CHANGED
|
@@ -3,9 +3,8 @@ import {
|
|
|
3
3
|
AuthorizationResponsePayload,
|
|
4
4
|
AuthorizationResponseState,
|
|
5
5
|
AuthorizationResponseStateStatus,
|
|
6
|
-
AuthorizationResponseStateWithVerifiedData,
|
|
7
6
|
decodeUriAsJson,
|
|
8
|
-
VerifiedAuthorizationResponse
|
|
7
|
+
VerifiedAuthorizationResponse,
|
|
9
8
|
} from '@sphereon/did-auth-siop'
|
|
10
9
|
import { getAgentResolver } from '@sphereon/ssi-sdk-ext.did-utils'
|
|
11
10
|
import {
|
|
@@ -23,7 +22,9 @@ import {
|
|
|
23
22
|
SdJwtDecodedVerifiableCredential,
|
|
24
23
|
} from '@sphereon/ssi-types'
|
|
25
24
|
import { IAgentPlugin } from '@veramo/core'
|
|
25
|
+
import { DcqlQuery } from 'dcql'
|
|
26
26
|
import {
|
|
27
|
+
AuthorizationResponseStateWithVerifiedData,
|
|
27
28
|
IAuthorizationRequestPayloads,
|
|
28
29
|
ICreateAuthRequestArgs,
|
|
29
30
|
IGetAuthRequestStateArgs,
|
|
@@ -42,9 +43,9 @@ import {
|
|
|
42
43
|
VerifiedDataMode,
|
|
43
44
|
} from '../index'
|
|
44
45
|
import { RPInstance } from '../RPInstance'
|
|
46
|
+
|
|
45
47
|
import { ISIOPv2RP } from '../types/ISIOPv2RP'
|
|
46
48
|
import { shaHasher as defaultHasher } from '@sphereon/ssi-sdk.core'
|
|
47
|
-
import { DcqlQuery } from 'dcql'
|
|
48
49
|
|
|
49
50
|
export class SIOPv2RP implements IAgentPlugin {
|
|
50
51
|
private readonly opts: ISiopv2RPOpts
|
|
@@ -84,7 +85,7 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
private async createAuthorizationRequestURI(createArgs: ICreateAuthRequestArgs, context: IRequiredContext): Promise<string> {
|
|
87
|
-
return await this.getRPInstance({
|
|
88
|
+
return await this.getRPInstance({ definitionId: createArgs.definitionId, responseRedirectURI: createArgs.responseRedirectURI }, context)
|
|
88
89
|
.then((rp) => rp.createAuthorizationRequestURI(createArgs, context))
|
|
89
90
|
.then((URI) => URI.encodedUri)
|
|
90
91
|
}
|
|
@@ -93,23 +94,21 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
93
94
|
createArgs: ICreateAuthRequestArgs,
|
|
94
95
|
context: IRequiredContext,
|
|
95
96
|
): Promise<IAuthorizationRequestPayloads> {
|
|
96
|
-
return await this.getRPInstance({
|
|
97
|
+
return await this.getRPInstance({ definitionId: createArgs.definitionId }, context)
|
|
97
98
|
.then((rp) => rp.createAuthorizationRequest(createArgs, context))
|
|
98
99
|
.then(async (request) => {
|
|
99
100
|
const authRequest: IAuthorizationRequestPayloads = {
|
|
100
101
|
authorizationRequest: request.payload,
|
|
101
102
|
requestObject: await request.requestObjectJwt(),
|
|
102
|
-
requestObjectDecoded: request.requestObject?.getPayload(),
|
|
103
|
+
requestObjectDecoded: await request.requestObject?.getPayload(),
|
|
103
104
|
}
|
|
104
105
|
return authRequest
|
|
105
106
|
})
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
private async siopGetRequestState(args: IGetAuthRequestStateArgs, context: IRequiredContext): Promise<AuthorizationRequestState | undefined> {
|
|
109
|
-
return await this.getRPInstance({
|
|
110
|
-
rp.get(context).then((rp) =>
|
|
111
|
-
rp.sessionManager.getRequestStateByCorrelationId(args.correlationId, args.errorOnNotFound)
|
|
112
|
-
),
|
|
110
|
+
return await this.getRPInstance({ definitionId: args.definitionId }, context).then((rp) =>
|
|
111
|
+
rp.get(context).then((rp) => rp.sessionManager.getRequestStateByCorrelationId(args.correlationId, args.errorOnNotFound)),
|
|
113
112
|
)
|
|
114
113
|
}
|
|
115
114
|
|
|
@@ -117,7 +116,7 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
117
116
|
args: IGetAuthResponseStateArgs,
|
|
118
117
|
context: IRequiredContext,
|
|
119
118
|
): Promise<AuthorizationResponseStateWithVerifiedData | undefined> {
|
|
120
|
-
const rpInstance: RPInstance = await this.getRPInstance({
|
|
119
|
+
const rpInstance: RPInstance = await this.getRPInstance({ definitionId: args.definitionId }, context)
|
|
121
120
|
const authorizationResponseState: AuthorizationResponseState | undefined = await rpInstance
|
|
122
121
|
.get(context)
|
|
123
122
|
.then((rp) => rp.sessionManager.getResponseStateByCorrelationId(args.correlationId, args.errorOnNotFound))
|
|
@@ -194,10 +193,10 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
194
193
|
: CredentialMapper.toUniformPresentation(presentationDecoded as OriginalVerifiablePresentation)
|
|
195
194
|
|
|
196
195
|
private async siopUpdateRequestState(args: IUpdateRequestStateArgs, context: IRequiredContext): Promise<AuthorizationRequestState> {
|
|
197
|
-
if (args.state !== '
|
|
198
|
-
throw Error(`Only '
|
|
196
|
+
if (args.state !== 'sent') {
|
|
197
|
+
throw Error(`Only 'sent' status is supported for this method at this point`)
|
|
199
198
|
}
|
|
200
|
-
return await this.getRPInstance({
|
|
199
|
+
return await this.getRPInstance({ definitionId: args.definitionId }, context)
|
|
201
200
|
// todo: In the SIOP library we need to update the signal method to be more like this method
|
|
202
201
|
.then((rp) =>
|
|
203
202
|
rp.get(context).then(async (rp) => {
|
|
@@ -211,7 +210,7 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
211
210
|
}
|
|
212
211
|
|
|
213
212
|
private async siopDeleteState(args: IGetAuthResponseStateArgs, context: IRequiredContext): Promise<boolean> {
|
|
214
|
-
return await this.getRPInstance({
|
|
213
|
+
return await this.getRPInstance({ definitionId: args.definitionId }, context)
|
|
215
214
|
.then((rp) => rp.get(context).then((rp) => rp.sessionManager.deleteStateForCorrelationId(args.correlationId)))
|
|
216
215
|
.then(() => true)
|
|
217
216
|
}
|
|
@@ -224,12 +223,11 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
224
223
|
typeof args.authorizationResponse === 'string'
|
|
225
224
|
? (decodeUriAsJson(args.authorizationResponse) as AuthorizationResponsePayload)
|
|
226
225
|
: args.authorizationResponse
|
|
227
|
-
return await this.getRPInstance({
|
|
226
|
+
return await this.getRPInstance({ definitionId: args.definitionId }, context).then((rp) =>
|
|
228
227
|
rp.get(context).then((rp) =>
|
|
229
228
|
rp.verifyAuthorizationResponse(authResponse, {
|
|
230
229
|
correlationId: args.correlationId,
|
|
231
|
-
...(args.
|
|
232
|
-
...(args.dcqlQuery ? { dcqlQuery: args.dcqlQuery as DcqlQuery } : {}), // TODO BEFORE PR, check compatibility and whether we can remove local type
|
|
230
|
+
...(args.dcqlQueryPayload ? { dcqlQuery: args.dcqlQueryPayload.dcqlQuery } : {}),
|
|
233
231
|
audience: args.audience,
|
|
234
232
|
}),
|
|
235
233
|
),
|
|
@@ -237,15 +235,29 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
237
235
|
}
|
|
238
236
|
|
|
239
237
|
private async siopImportDefinitions(args: ImportDefinitionsArgs, context: IRequiredContext): Promise<void> {
|
|
240
|
-
const {
|
|
238
|
+
const { definitions, tenantId, version, versionControlMode } = args
|
|
241
239
|
await Promise.all(
|
|
242
|
-
|
|
240
|
+
definitions.map(async (definitionPair) => {
|
|
243
241
|
const definitionPayload = definitionPair.definitionPayload
|
|
244
|
-
|
|
242
|
+
if (!definitionPayload && !definitionPair.dcqlPayload) {
|
|
243
|
+
return Promise.reject(Error('Either dcqlPayload or definitionPayload must be suppplied'))
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
let definitionId: string
|
|
247
|
+
if (definitionPair.dcqlPayload) {
|
|
248
|
+
DcqlQuery.validate(definitionPair.dcqlPayload.dcqlQuery)
|
|
249
|
+
console.log(`persisting DCQL definition ${definitionPair.dcqlPayload.queryId} with versionControlMode ${versionControlMode}`)
|
|
250
|
+
definitionId = definitionPair.dcqlPayload.queryId
|
|
251
|
+
}
|
|
252
|
+
if (definitionPayload) {
|
|
253
|
+
await context.agent.pexValidateDefinition({ definition: definitionPayload })
|
|
254
|
+
console.log(`persisting PEX definition ${definitionPayload.id} / ${definitionPayload.name} with versionControlMode ${versionControlMode}`)
|
|
255
|
+
definitionId = definitionPayload.id
|
|
256
|
+
}
|
|
245
257
|
|
|
246
|
-
console.log(`persisting definition ${definitionPayload.id} / ${definitionPayload.name} with versionControlMode ${versionControlMode}`)
|
|
247
258
|
return context.agent.pdmPersistDefinition({
|
|
248
259
|
definitionItem: {
|
|
260
|
+
definitionId: definitionId!,
|
|
249
261
|
tenantId: tenantId,
|
|
250
262
|
version: version,
|
|
251
263
|
definitionPayload,
|
|
@@ -258,7 +270,7 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
258
270
|
}
|
|
259
271
|
|
|
260
272
|
private async siopGetRedirectURI(args: IGetRedirectUriArgs, context: IRequiredContext): Promise<string | undefined> {
|
|
261
|
-
const instanceId = args.
|
|
273
|
+
const instanceId = args.definitionId ?? SIOPv2RP._DEFAULT_OPTS_KEY
|
|
262
274
|
if (this.instances.has(instanceId)) {
|
|
263
275
|
const rpInstance = this.instances.get(instanceId)
|
|
264
276
|
if (rpInstance !== undefined) {
|
|
@@ -273,17 +285,17 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
273
285
|
return undefined
|
|
274
286
|
}
|
|
275
287
|
|
|
276
|
-
async getRPInstance({
|
|
277
|
-
const instanceId =
|
|
288
|
+
async getRPInstance({ definitionId, responseRedirectURI }: ISiopRPInstanceArgs, context: IRequiredContext): Promise<RPInstance> {
|
|
289
|
+
const instanceId = definitionId ?? SIOPv2RP._DEFAULT_OPTS_KEY
|
|
278
290
|
if (!this.instances.has(instanceId)) {
|
|
279
|
-
const instanceOpts = this.getInstanceOpts(
|
|
280
|
-
const rpOpts = await this.getRPOptions(context, {
|
|
291
|
+
const instanceOpts = this.getInstanceOpts(definitionId)
|
|
292
|
+
const rpOpts = await this.getRPOptions(context, { definitionId, responseRedirectURI: responseRedirectURI })
|
|
281
293
|
if (!rpOpts.identifierOpts.resolveOpts?.resolver || typeof rpOpts.identifierOpts.resolveOpts.resolver.resolve !== 'function') {
|
|
282
294
|
if (!rpOpts.identifierOpts?.resolveOpts) {
|
|
283
295
|
rpOpts.identifierOpts = { ...rpOpts.identifierOpts }
|
|
284
296
|
rpOpts.identifierOpts.resolveOpts = { ...rpOpts.identifierOpts.resolveOpts }
|
|
285
297
|
}
|
|
286
|
-
console.log('Using agent DID resolver for RP instance with definition id ' +
|
|
298
|
+
console.log('Using agent DID resolver for RP instance with definition id ' + definitionId)
|
|
287
299
|
rpOpts.identifierOpts.resolveOpts.resolver = getAgentResolver(context, {
|
|
288
300
|
uniresolverResolution: true,
|
|
289
301
|
localResolution: true,
|
|
@@ -299,11 +311,11 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
299
311
|
return rpInstance
|
|
300
312
|
}
|
|
301
313
|
|
|
302
|
-
async getRPOptions(context: IRequiredContext, opts: {
|
|
303
|
-
const {
|
|
304
|
-
const options = this.getInstanceOpts(
|
|
314
|
+
async getRPOptions(context: IRequiredContext, opts: { definitionId?: string; responseRedirectURI?: string }): Promise<IRPOptions> {
|
|
315
|
+
const { definitionId, responseRedirectURI: responseRedirectURI } = opts
|
|
316
|
+
const options = this.getInstanceOpts(definitionId)?.rpOpts ?? this.opts.defaultOpts
|
|
305
317
|
if (!options) {
|
|
306
|
-
throw Error(`Could not get specific nor default options for definition ${
|
|
318
|
+
throw Error(`Could not get specific nor default options for definition ${definitionId}`)
|
|
307
319
|
}
|
|
308
320
|
if (this.opts.defaultOpts) {
|
|
309
321
|
if (!options.identifierOpts) {
|
|
@@ -337,7 +349,7 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
337
349
|
getInstanceOpts(definitionId?: string): IPEXInstanceOptions | undefined {
|
|
338
350
|
if (!this.opts.instanceOpts) return undefined
|
|
339
351
|
|
|
340
|
-
const instanceOpt = definitionId ? this.opts.instanceOpts.find((i) => i.
|
|
352
|
+
const instanceOpt = definitionId ? this.opts.instanceOpts.find((i) => i.definitionId === definitionId) : undefined
|
|
341
353
|
|
|
342
354
|
return instanceOpt ?? this.getDefaultOptions(definitionId)
|
|
343
355
|
}
|
|
@@ -345,11 +357,11 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
345
357
|
private getDefaultOptions(definitionId: string | undefined) {
|
|
346
358
|
if (!this.opts.instanceOpts) return undefined
|
|
347
359
|
|
|
348
|
-
const defaultOptions = this.opts.instanceOpts.find((i) => i.
|
|
360
|
+
const defaultOptions = this.opts.instanceOpts.find((i) => i.definitionId === 'default')
|
|
349
361
|
if (defaultOptions) {
|
|
350
362
|
const clonedOptions = { ...defaultOptions }
|
|
351
363
|
if (definitionId !== undefined) {
|
|
352
|
-
clonedOptions.
|
|
364
|
+
clonedOptions.definitionId = definitionId
|
|
353
365
|
}
|
|
354
366
|
return clonedOptions
|
|
355
367
|
}
|
package/src/functions.ts
CHANGED
|
@@ -113,11 +113,11 @@ export async function createRPBuilder(args: {
|
|
|
113
113
|
let definition: IPresentationDefinition | undefined = args.definition
|
|
114
114
|
let dcqlQuery: DcqlQuery | undefined = args.dcql
|
|
115
115
|
|
|
116
|
-
if (!definition && pexOpts && pexOpts.
|
|
116
|
+
if (!definition && pexOpts && pexOpts.definitionId) {
|
|
117
117
|
const presentationDefinitionItems = await context.agent.pdmGetDefinitions({
|
|
118
118
|
filter: [
|
|
119
119
|
{
|
|
120
|
-
definitionId: pexOpts.
|
|
120
|
+
definitionId: pexOpts.definitionId,
|
|
121
121
|
version: pexOpts.version,
|
|
122
122
|
tenantId: pexOpts.tenantId,
|
|
123
123
|
},
|
package/src/index.ts
CHANGED
package/src/types/ISIOPv2RP.ts
CHANGED
|
@@ -2,40 +2,37 @@ import {
|
|
|
2
2
|
AuthorizationRequestPayload,
|
|
3
3
|
AuthorizationRequestState,
|
|
4
4
|
AuthorizationResponsePayload,
|
|
5
|
-
|
|
6
|
-
CallbackOpts,
|
|
5
|
+
AuthorizationResponseState,
|
|
7
6
|
ClaimPayloadCommonOpts,
|
|
8
7
|
ClientMetadataOpts,
|
|
9
8
|
IRPSessionManager,
|
|
10
|
-
PresentationDefinitionWithLocation,
|
|
11
9
|
PresentationVerificationCallback,
|
|
12
10
|
RequestObjectPayload,
|
|
13
11
|
ResponseMode,
|
|
14
12
|
ResponseURIType,
|
|
15
13
|
SupportedVersion,
|
|
16
|
-
VerifiablePresentationTypeFormat,
|
|
17
14
|
VerifiedAuthorizationResponse,
|
|
18
15
|
VerifyJwtCallback,
|
|
19
|
-
VPTokenLocation
|
|
20
16
|
} from '@sphereon/did-auth-siop'
|
|
21
|
-
import {
|
|
22
|
-
import { IAgentContext, ICredentialIssuer, ICredentialVerifier, IDIDManager, IKeyManager, IPluginMethodMap, IResolver } from '@veramo/core'
|
|
23
|
-
import { DcqlQueryREST, HasherSync, W3CVerifiablePresentation } from '@sphereon/ssi-types'
|
|
24
|
-
import { Resolvable } from 'did-resolver'
|
|
17
|
+
import { CheckLinkedDomain } from '@sphereon/did-auth-siop-adapter'
|
|
25
18
|
import { DIDDocument } from '@sphereon/did-uni-client'
|
|
26
|
-
import {
|
|
19
|
+
import { JwtIssuer } from '@sphereon/oid4vc-common'
|
|
27
20
|
import { IPresentationDefinition } from '@sphereon/pex'
|
|
28
21
|
import { IDIDOptions } from '@sphereon/ssi-sdk-ext.did-utils'
|
|
29
|
-
import {
|
|
30
|
-
import { VerifyCallback } from '@sphereon/wellknown-dids-client'
|
|
31
|
-
import { AuthorizationRequestStateStatus } from '@sphereon/ssi-sdk.siopv2-oid4vp-common'
|
|
32
|
-
import { IPDManager, VersionControlMode } from '@sphereon/ssi-sdk.pd-manager'
|
|
33
|
-
import { CheckLinkedDomain } from '@sphereon/did-auth-siop-adapter'
|
|
34
|
-
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt'
|
|
22
|
+
import { ExternalIdentifierOIDFEntityIdOpts, IIdentifierResolution, ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
35
23
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service'
|
|
36
|
-
import { JwtIssuer } from '@sphereon/oid4vc-common'
|
|
37
|
-
import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc'
|
|
38
24
|
import { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation'
|
|
25
|
+
import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc'
|
|
26
|
+
import { IPDManager, VersionControlMode } from '@sphereon/ssi-sdk.pd-manager'
|
|
27
|
+
import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange'
|
|
28
|
+
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt'
|
|
29
|
+
import { AuthorizationRequestStateStatus } from '@sphereon/ssi-sdk.siopv2-oid4vp-common'
|
|
30
|
+
import { AdditionalClaims, DcqlQueryPayload, HasherSync } from '@sphereon/ssi-types'
|
|
31
|
+
import { VerifyCallback } from '@sphereon/wellknown-dids-client'
|
|
32
|
+
import { IAgentContext, ICredentialIssuer, ICredentialVerifier, IDIDManager, IKeyManager, IPluginMethodMap, IResolver } from '@veramo/core'
|
|
33
|
+
|
|
34
|
+
import { Resolvable } from 'did-resolver'
|
|
35
|
+
import { EventEmitter } from 'events'
|
|
39
36
|
|
|
40
37
|
export enum VerifiedDataMode {
|
|
41
38
|
NONE = 'none',
|
|
@@ -55,6 +52,7 @@ export interface ISIOPv2RP extends IPluginMethodMap {
|
|
|
55
52
|
siopDeleteAuthState(args: IDeleteAuthStateArgs, context: IRequiredContext): Promise<boolean>
|
|
56
53
|
siopVerifyAuthResponse(args: IVerifyAuthResponseStateArgs, context: IRequiredContext): Promise<VerifiedAuthorizationResponse>
|
|
57
54
|
siopImportDefinitions(args: ImportDefinitionsArgs, context: IRequiredContext): Promise<void>
|
|
55
|
+
|
|
58
56
|
siopGetRedirectURI(args: IGetRedirectUriArgs, context: IRequiredContext): Promise<string | undefined>
|
|
59
57
|
}
|
|
60
58
|
|
|
@@ -66,9 +64,8 @@ export interface ISiopv2RPOpts {
|
|
|
66
64
|
export interface IRPDefaultOpts extends IRPOptions {}
|
|
67
65
|
|
|
68
66
|
export interface ICreateAuthRequestArgs {
|
|
69
|
-
|
|
67
|
+
definitionId: string
|
|
70
68
|
correlationId: string
|
|
71
|
-
useQueryIdInstance?: boolean
|
|
72
69
|
responseURIType: ResponseURIType
|
|
73
70
|
responseURI: string
|
|
74
71
|
responseRedirectURI?: string
|
|
@@ -77,25 +74,24 @@ export interface ICreateAuthRequestArgs {
|
|
|
77
74
|
nonce?: string
|
|
78
75
|
state?: string
|
|
79
76
|
claims?: ClaimPayloadCommonOpts
|
|
80
|
-
callback?: CallbackOpts
|
|
81
77
|
}
|
|
82
78
|
|
|
83
79
|
export interface IGetAuthRequestStateArgs {
|
|
84
80
|
correlationId: string
|
|
85
|
-
|
|
81
|
+
definitionId: string
|
|
86
82
|
errorOnNotFound?: boolean
|
|
87
83
|
}
|
|
88
84
|
|
|
89
85
|
export interface IGetAuthResponseStateArgs {
|
|
90
86
|
correlationId: string
|
|
91
|
-
|
|
87
|
+
definitionId: string
|
|
92
88
|
errorOnNotFound?: boolean
|
|
93
89
|
progressRequestStateTo?: AuthorizationRequestStateStatus
|
|
94
90
|
includeVerifiedData?: VerifiedDataMode
|
|
95
91
|
}
|
|
96
92
|
|
|
97
93
|
export interface IUpdateRequestStateArgs {
|
|
98
|
-
|
|
94
|
+
definitionId: string
|
|
99
95
|
correlationId: string
|
|
100
96
|
state: AuthorizationRequestStateStatus
|
|
101
97
|
error?: string
|
|
@@ -103,25 +99,24 @@ export interface IUpdateRequestStateArgs {
|
|
|
103
99
|
|
|
104
100
|
export interface IDeleteAuthStateArgs {
|
|
105
101
|
correlationId: string
|
|
106
|
-
|
|
102
|
+
definitionId: string
|
|
107
103
|
}
|
|
108
104
|
|
|
109
105
|
export interface IVerifyAuthResponseStateArgs {
|
|
110
106
|
authorizationResponse: string | AuthorizationResponsePayload
|
|
111
|
-
|
|
107
|
+
definitionId?: string
|
|
112
108
|
correlationId: string
|
|
113
109
|
audience?: string
|
|
114
|
-
|
|
115
|
-
dcqlQuery?: DcqlQueryREST
|
|
110
|
+
dcqlQueryPayload?: DcqlQueryPayload
|
|
116
111
|
}
|
|
117
112
|
|
|
118
113
|
export interface IDefinitionPair {
|
|
119
|
-
definitionPayload
|
|
120
|
-
dcqlPayload?:
|
|
114
|
+
definitionPayload?: IPresentationDefinition
|
|
115
|
+
dcqlPayload?: DcqlQueryPayload
|
|
121
116
|
}
|
|
122
117
|
|
|
123
118
|
export interface ImportDefinitionsArgs {
|
|
124
|
-
|
|
119
|
+
definitions: Array<IDefinitionPair>
|
|
125
120
|
tenantId?: string
|
|
126
121
|
version?: string
|
|
127
122
|
versionControlMode?: VersionControlMode
|
|
@@ -129,7 +124,7 @@ export interface ImportDefinitionsArgs {
|
|
|
129
124
|
|
|
130
125
|
export interface IGetRedirectUriArgs {
|
|
131
126
|
correlationId: string
|
|
132
|
-
|
|
127
|
+
definitionId?: string
|
|
133
128
|
state?: string
|
|
134
129
|
}
|
|
135
130
|
|
|
@@ -145,7 +140,7 @@ export interface IPEXDefinitionPersistArgs extends IPEXInstanceOptions {
|
|
|
145
140
|
}
|
|
146
141
|
|
|
147
142
|
export interface ISiopRPInstanceArgs {
|
|
148
|
-
|
|
143
|
+
definitionId?: string
|
|
149
144
|
responseRedirectURI?: string
|
|
150
145
|
}
|
|
151
146
|
|
|
@@ -170,7 +165,7 @@ export interface IRPOptions {
|
|
|
170
165
|
export interface IPEXOptions {
|
|
171
166
|
presentationVerifyCallback?: PresentationVerificationCallback
|
|
172
167
|
// definition?: IPresentationDefinition
|
|
173
|
-
|
|
168
|
+
definitionId: string
|
|
174
169
|
version?: string
|
|
175
170
|
tenantId?: string
|
|
176
171
|
}
|
|
@@ -187,17 +182,9 @@ export interface PerDidResolver {
|
|
|
187
182
|
export interface IAuthRequestDetails {
|
|
188
183
|
rpDIDDocument?: DIDDocument
|
|
189
184
|
id: string
|
|
190
|
-
verifiablePresentationMatches: IPresentationWithDefinition[]
|
|
191
185
|
alsoKnownAs?: string[]
|
|
192
186
|
}
|
|
193
187
|
|
|
194
|
-
export interface IPresentationWithDefinition {
|
|
195
|
-
location: VPTokenLocation
|
|
196
|
-
definition: PresentationDefinitionWithLocation
|
|
197
|
-
format: VerifiablePresentationTypeFormat
|
|
198
|
-
presentation: W3CVerifiablePresentation
|
|
199
|
-
}
|
|
200
|
-
|
|
201
188
|
export interface ISIOPIdentifierOptions extends Omit<IDIDOptions, 'idOpts'> {
|
|
202
189
|
// we replace the legacy idOpts with the Managed Identifier opts from the identifier resolution module
|
|
203
190
|
idOpts: ManagedIdentifierOptsOrResult
|
|
@@ -211,6 +198,10 @@ export type CredentialOpts = {
|
|
|
211
198
|
hasher?: HasherSync
|
|
212
199
|
}
|
|
213
200
|
|
|
201
|
+
export interface AuthorizationResponseStateWithVerifiedData extends AuthorizationResponseState {
|
|
202
|
+
verifiedData?: AdditionalClaims
|
|
203
|
+
}
|
|
204
|
+
|
|
214
205
|
export type IRequiredContext = IAgentContext<
|
|
215
206
|
IResolver &
|
|
216
207
|
IDIDManager &
|