@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth 0.34.1-feature.SSISDK.58.host.nonce.endpoint.145 → 0.34.1-feature.SSISDK.58.host.nonce.endpoint.194
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 +340 -353
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +722 -34
- package/dist/index.d.ts +722 -34
- package/dist/index.js +333 -347
- package/dist/index.js.map +1 -1
- package/package.json +17 -17
- package/src/RPInstance.ts +6 -4
- package/src/agent/SIOPv2RP.ts +41 -51
- package/src/functions.ts +20 -16
- package/src/index.ts +1 -1
- package/src/types/ISIOPv2RP.ts +19 -28
package/src/agent/SIOPv2RP.ts
CHANGED
|
@@ -3,10 +3,13 @@ import {
|
|
|
3
3
|
AuthorizationResponsePayload,
|
|
4
4
|
AuthorizationResponseState,
|
|
5
5
|
AuthorizationResponseStateStatus,
|
|
6
|
+
AuthorizationResponseStateWithVerifiedData,
|
|
6
7
|
decodeUriAsJson,
|
|
7
|
-
VerifiedAuthorizationResponse
|
|
8
|
+
VerifiedAuthorizationResponse
|
|
8
9
|
} from '@sphereon/did-auth-siop'
|
|
9
10
|
import { getAgentResolver } from '@sphereon/ssi-sdk-ext.did-utils'
|
|
11
|
+
import { shaHasher as defaultHasher } from '@sphereon/ssi-sdk.core'
|
|
12
|
+
import type { ImportDcqlQueryItem } from '@sphereon/ssi-sdk.pd-manager'
|
|
10
13
|
import {
|
|
11
14
|
AdditionalClaims,
|
|
12
15
|
CredentialMapper,
|
|
@@ -24,7 +27,6 @@ import {
|
|
|
24
27
|
import { IAgentPlugin } from '@veramo/core'
|
|
25
28
|
import { DcqlQuery } from 'dcql'
|
|
26
29
|
import {
|
|
27
|
-
AuthorizationResponseStateWithVerifiedData,
|
|
28
30
|
IAuthorizationRequestPayloads,
|
|
29
31
|
ICreateAuthRequestArgs,
|
|
30
32
|
IGetAuthRequestStateArgs,
|
|
@@ -43,9 +45,7 @@ import {
|
|
|
43
45
|
VerifiedDataMode,
|
|
44
46
|
} from '../index'
|
|
45
47
|
import { RPInstance } from '../RPInstance'
|
|
46
|
-
|
|
47
48
|
import { ISIOPv2RP } from '../types/ISIOPv2RP'
|
|
48
|
-
import { shaHasher as defaultHasher } from '@sphereon/ssi-sdk.core'
|
|
49
49
|
|
|
50
50
|
export class SIOPv2RP implements IAgentPlugin {
|
|
51
51
|
private readonly opts: ISiopv2RPOpts
|
|
@@ -85,7 +85,10 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
private async createAuthorizationRequestURI(createArgs: ICreateAuthRequestArgs, context: IRequiredContext): Promise<string> {
|
|
88
|
-
return await this.getRPInstance(
|
|
88
|
+
return await this.getRPInstance(
|
|
89
|
+
{ responseRedirectURI: createArgs.responseRedirectURI, ...(createArgs.useQueryIdInstance === true && { queryId: createArgs.queryId } ) },
|
|
90
|
+
context,
|
|
91
|
+
)
|
|
89
92
|
.then((rp) => rp.createAuthorizationRequestURI(createArgs, context))
|
|
90
93
|
.then((URI) => URI.encodedUri)
|
|
91
94
|
}
|
|
@@ -94,21 +97,23 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
94
97
|
createArgs: ICreateAuthRequestArgs,
|
|
95
98
|
context: IRequiredContext,
|
|
96
99
|
): Promise<IAuthorizationRequestPayloads> {
|
|
97
|
-
return await this.getRPInstance({
|
|
100
|
+
return await this.getRPInstance({ queryId: createArgs.queryId }, context)
|
|
98
101
|
.then((rp) => rp.createAuthorizationRequest(createArgs, context))
|
|
99
102
|
.then(async (request) => {
|
|
100
103
|
const authRequest: IAuthorizationRequestPayloads = {
|
|
101
104
|
authorizationRequest: request.payload,
|
|
102
105
|
requestObject: await request.requestObjectJwt(),
|
|
103
|
-
requestObjectDecoded:
|
|
106
|
+
requestObjectDecoded: request.requestObject?.getPayload(),
|
|
104
107
|
}
|
|
105
108
|
return authRequest
|
|
106
109
|
})
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
private async siopGetRequestState(args: IGetAuthRequestStateArgs, context: IRequiredContext): Promise<AuthorizationRequestState | undefined> {
|
|
110
|
-
return await this.getRPInstance({
|
|
111
|
-
rp.get(context).then((rp) =>
|
|
113
|
+
return await this.getRPInstance({ queryId: args.queryId }, context).then((rp) =>
|
|
114
|
+
rp.get(context).then((rp) =>
|
|
115
|
+
rp.sessionManager.getRequestStateByCorrelationId(args.correlationId, args.errorOnNotFound)
|
|
116
|
+
),
|
|
112
117
|
)
|
|
113
118
|
}
|
|
114
119
|
|
|
@@ -116,7 +121,7 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
116
121
|
args: IGetAuthResponseStateArgs,
|
|
117
122
|
context: IRequiredContext,
|
|
118
123
|
): Promise<AuthorizationResponseStateWithVerifiedData | undefined> {
|
|
119
|
-
const rpInstance: RPInstance = await this.getRPInstance({
|
|
124
|
+
const rpInstance: RPInstance = await this.getRPInstance({ queryId: args.queryId }, context)
|
|
120
125
|
const authorizationResponseState: AuthorizationResponseState | undefined = await rpInstance
|
|
121
126
|
.get(context)
|
|
122
127
|
.then((rp) => rp.sessionManager.getResponseStateByCorrelationId(args.correlationId, args.errorOnNotFound))
|
|
@@ -193,10 +198,10 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
193
198
|
: CredentialMapper.toUniformPresentation(presentationDecoded as OriginalVerifiablePresentation)
|
|
194
199
|
|
|
195
200
|
private async siopUpdateRequestState(args: IUpdateRequestStateArgs, context: IRequiredContext): Promise<AuthorizationRequestState> {
|
|
196
|
-
if (args.state !== '
|
|
197
|
-
throw Error(`Only '
|
|
201
|
+
if (args.state !== 'authorization_request_created') {
|
|
202
|
+
throw Error(`Only 'authorization_request_created' status is supported for this method at this point`)
|
|
198
203
|
}
|
|
199
|
-
return await this.getRPInstance({
|
|
204
|
+
return await this.getRPInstance({ queryId: args.queryId }, context)
|
|
200
205
|
// todo: In the SIOP library we need to update the signal method to be more like this method
|
|
201
206
|
.then((rp) =>
|
|
202
207
|
rp.get(context).then(async (rp) => {
|
|
@@ -210,7 +215,7 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
210
215
|
}
|
|
211
216
|
|
|
212
217
|
private async siopDeleteState(args: IGetAuthResponseStateArgs, context: IRequiredContext): Promise<boolean> {
|
|
213
|
-
return await this.getRPInstance({
|
|
218
|
+
return await this.getRPInstance({ queryId: args.queryId }, context)
|
|
214
219
|
.then((rp) => rp.get(context).then((rp) => rp.sessionManager.deleteStateForCorrelationId(args.correlationId)))
|
|
215
220
|
.then(() => true)
|
|
216
221
|
}
|
|
@@ -223,45 +228,30 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
223
228
|
typeof args.authorizationResponse === 'string'
|
|
224
229
|
? (decodeUriAsJson(args.authorizationResponse) as AuthorizationResponsePayload)
|
|
225
230
|
: args.authorizationResponse
|
|
226
|
-
return await this.getRPInstance({
|
|
231
|
+
return await this.getRPInstance({ queryId: args.queryId }, context).then((rp) =>
|
|
227
232
|
rp.get(context).then((rp) =>
|
|
228
233
|
rp.verifyAuthorizationResponse(authResponse, {
|
|
229
234
|
correlationId: args.correlationId,
|
|
230
|
-
|
|
231
|
-
|
|
235
|
+
...(args.dcqlQuery ? { dcqlQuery: args.dcqlQuery } : {}),
|
|
236
|
+
audience: args.audience,
|
|
232
237
|
}),
|
|
233
238
|
),
|
|
234
239
|
)
|
|
235
240
|
}
|
|
236
241
|
|
|
237
242
|
private async siopImportDefinitions(args: ImportDefinitionsArgs, context: IRequiredContext): Promise<void> {
|
|
238
|
-
const {
|
|
243
|
+
const { importItems, tenantId, version, versionControlMode } = args
|
|
239
244
|
await Promise.all(
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
+
importItems.map(async (importItem: ImportDcqlQueryItem) => {
|
|
246
|
+
DcqlQuery.validate(importItem.query)
|
|
247
|
+
console.log(`persisting DCQL definition ${importItem.queryId} with versionControlMode ${versionControlMode}`)
|
|
257
248
|
|
|
258
249
|
return context.agent.pdmPersistDefinition({
|
|
259
250
|
definitionItem: {
|
|
260
|
-
|
|
251
|
+
queryId: importItem.queryId!,
|
|
261
252
|
tenantId: tenantId,
|
|
262
253
|
version: version,
|
|
263
|
-
|
|
264
|
-
dcqlPayload: definitionPair.dcqlPayload,
|
|
254
|
+
query: importItem.query,
|
|
265
255
|
},
|
|
266
256
|
opts: { versionControlMode: versionControlMode },
|
|
267
257
|
})
|
|
@@ -270,7 +260,7 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
270
260
|
}
|
|
271
261
|
|
|
272
262
|
private async siopGetRedirectURI(args: IGetRedirectUriArgs, context: IRequiredContext): Promise<string | undefined> {
|
|
273
|
-
const instanceId = args.
|
|
263
|
+
const instanceId = args.queryId ?? SIOPv2RP._DEFAULT_OPTS_KEY
|
|
274
264
|
if (this.instances.has(instanceId)) {
|
|
275
265
|
const rpInstance = this.instances.get(instanceId)
|
|
276
266
|
if (rpInstance !== undefined) {
|
|
@@ -285,17 +275,17 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
285
275
|
return undefined
|
|
286
276
|
}
|
|
287
277
|
|
|
288
|
-
async getRPInstance({
|
|
289
|
-
const instanceId =
|
|
278
|
+
async getRPInstance({ queryId, responseRedirectURI }: ISiopRPInstanceArgs, context: IRequiredContext): Promise<RPInstance> {
|
|
279
|
+
const instanceId = queryId ?? SIOPv2RP._DEFAULT_OPTS_KEY
|
|
290
280
|
if (!this.instances.has(instanceId)) {
|
|
291
|
-
const instanceOpts = this.getInstanceOpts(
|
|
292
|
-
const rpOpts = await this.getRPOptions(context, {
|
|
281
|
+
const instanceOpts = this.getInstanceOpts(queryId)
|
|
282
|
+
const rpOpts = await this.getRPOptions(context, { queryId, responseRedirectURI: responseRedirectURI })
|
|
293
283
|
if (!rpOpts.identifierOpts.resolveOpts?.resolver || typeof rpOpts.identifierOpts.resolveOpts.resolver.resolve !== 'function') {
|
|
294
284
|
if (!rpOpts.identifierOpts?.resolveOpts) {
|
|
295
285
|
rpOpts.identifierOpts = { ...rpOpts.identifierOpts }
|
|
296
286
|
rpOpts.identifierOpts.resolveOpts = { ...rpOpts.identifierOpts.resolveOpts }
|
|
297
287
|
}
|
|
298
|
-
console.log('Using agent DID resolver for RP instance with definition id ' +
|
|
288
|
+
console.log('Using agent DID resolver for RP instance with definition id ' + queryId)
|
|
299
289
|
rpOpts.identifierOpts.resolveOpts.resolver = getAgentResolver(context, {
|
|
300
290
|
uniresolverResolution: true,
|
|
301
291
|
localResolution: true,
|
|
@@ -311,11 +301,11 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
311
301
|
return rpInstance
|
|
312
302
|
}
|
|
313
303
|
|
|
314
|
-
async getRPOptions(context: IRequiredContext, opts: {
|
|
315
|
-
const {
|
|
316
|
-
const options = this.getInstanceOpts(
|
|
304
|
+
async getRPOptions(context: IRequiredContext, opts: { queryId?: string; responseRedirectURI?: string }): Promise<IRPOptions> {
|
|
305
|
+
const { queryId, responseRedirectURI: responseRedirectURI } = opts
|
|
306
|
+
const options = this.getInstanceOpts(queryId)?.rpOpts ?? this.opts.defaultOpts
|
|
317
307
|
if (!options) {
|
|
318
|
-
throw Error(`Could not get specific nor default options for definition ${
|
|
308
|
+
throw Error(`Could not get specific nor default options for definition ${queryId}`)
|
|
319
309
|
}
|
|
320
310
|
if (this.opts.defaultOpts) {
|
|
321
311
|
if (!options.identifierOpts) {
|
|
@@ -349,7 +339,7 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
349
339
|
getInstanceOpts(definitionId?: string): IPEXInstanceOptions | undefined {
|
|
350
340
|
if (!this.opts.instanceOpts) return undefined
|
|
351
341
|
|
|
352
|
-
const instanceOpt = definitionId ? this.opts.instanceOpts.find((i) => i.
|
|
342
|
+
const instanceOpt = definitionId ? this.opts.instanceOpts.find((i) => i.queryId === definitionId) : undefined
|
|
353
343
|
|
|
354
344
|
return instanceOpt ?? this.getDefaultOptions(definitionId)
|
|
355
345
|
}
|
|
@@ -357,11 +347,11 @@ export class SIOPv2RP implements IAgentPlugin {
|
|
|
357
347
|
private getDefaultOptions(definitionId: string | undefined) {
|
|
358
348
|
if (!this.opts.instanceOpts) return undefined
|
|
359
349
|
|
|
360
|
-
const defaultOptions = this.opts.instanceOpts.find((i) => i.
|
|
350
|
+
const defaultOptions = this.opts.instanceOpts.find((i) => i.queryId === 'default')
|
|
361
351
|
if (defaultOptions) {
|
|
362
352
|
const clonedOptions = { ...defaultOptions }
|
|
363
353
|
if (definitionId !== undefined) {
|
|
364
|
-
clonedOptions.
|
|
354
|
+
clonedOptions.queryId = definitionId
|
|
365
355
|
}
|
|
366
356
|
return clonedOptions
|
|
367
357
|
}
|
package/src/functions.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ClientIdentifierPrefix,
|
|
2
3
|
ClientMetadataOpts,
|
|
3
4
|
InMemoryRPSessionManager,
|
|
4
5
|
PassBy,
|
|
@@ -13,7 +14,7 @@ import {
|
|
|
13
14
|
Scope,
|
|
14
15
|
SubjectType,
|
|
15
16
|
SupportedVersion,
|
|
16
|
-
VerifyJwtCallback
|
|
17
|
+
VerifyJwtCallback
|
|
17
18
|
} from '@sphereon/did-auth-siop'
|
|
18
19
|
import { CreateJwtCallback, JwtHeader, JwtIssuer, JwtPayload, SigningAlgo } from '@sphereon/oid4vc-common'
|
|
19
20
|
import { IPresentationDefinition } from '@sphereon/pex'
|
|
@@ -27,14 +28,8 @@ import {
|
|
|
27
28
|
} from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
28
29
|
import { JwtCompactResult } from '@sphereon/ssi-sdk-ext.jwt-service'
|
|
29
30
|
import { IVerifySdJwtPresentationResult } from '@sphereon/ssi-sdk.sd-jwt'
|
|
30
|
-
import {
|
|
31
|
-
CredentialMapper,
|
|
32
|
-
HasherSync,
|
|
33
|
-
OriginalVerifiableCredential,
|
|
34
|
-
PresentationSubmission
|
|
35
|
-
} from '@sphereon/ssi-types'
|
|
31
|
+
import { CredentialMapper, HasherSync, OriginalVerifiableCredential, PresentationSubmission } from '@sphereon/ssi-types'
|
|
36
32
|
import { IVerifyCallbackArgs, IVerifyCredentialResult, VerifyCallback } from '@sphereon/wellknown-dids-client'
|
|
37
|
-
// import { KeyAlgo, SuppliedSigner } from '@sphereon/ssi-sdk.core'
|
|
38
33
|
import { TKeyType } from '@veramo/core'
|
|
39
34
|
import { JWTVerifyOptions } from 'did-jwt'
|
|
40
35
|
import { Resolvable } from 'did-resolver'
|
|
@@ -72,7 +67,7 @@ export function getPresentationVerificationCallback(
|
|
|
72
67
|
): Promise<PresentationVerificationResult> {
|
|
73
68
|
if (CredentialMapper.isSdJwtEncoded(args)) {
|
|
74
69
|
const result: IVerifySdJwtPresentationResult = await context.agent.verifySdJwtPresentation({
|
|
75
|
-
presentation: args
|
|
70
|
+
presentation: args,
|
|
76
71
|
})
|
|
77
72
|
// fixme: investigate the correct way to handle this
|
|
78
73
|
return { verified: !!result.payload }
|
|
@@ -116,11 +111,11 @@ export async function createRPBuilder(args: {
|
|
|
116
111
|
let definition: IPresentationDefinition | undefined = args.definition
|
|
117
112
|
let dcqlQuery: DcqlQuery | undefined = args.dcql
|
|
118
113
|
|
|
119
|
-
if (!definition && pexOpts && pexOpts.
|
|
114
|
+
if (!definition && pexOpts && pexOpts.queryId) {
|
|
120
115
|
const presentationDefinitionItems = await context.agent.pdmGetDefinitions({
|
|
121
116
|
filter: [
|
|
122
117
|
{
|
|
123
|
-
|
|
118
|
+
queryId: pexOpts.queryId,
|
|
124
119
|
version: pexOpts.version,
|
|
125
120
|
tenantId: pexOpts.tenantId,
|
|
126
121
|
},
|
|
@@ -202,11 +197,11 @@ export async function createRPBuilder(args: {
|
|
|
202
197
|
builder.withEntityId(oidfOpts.identifier, PropertyTarget.REQUEST_OBJECT)
|
|
203
198
|
} else {
|
|
204
199
|
const resolution = await context.agent.identifierManagedGet(identifierOpts.idOpts)
|
|
205
|
-
|
|
206
|
-
.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
200
|
+
const clientId: string = rpOpts.clientMetadataOpts?.client_id ??
|
|
201
|
+
resolution.issuer ?? (isManagedIdentifierDidResult(resolution) ? resolution.did : resolution.jwkThumbprint)
|
|
202
|
+
const clientIdPrefixed = prefixClientId(clientId)
|
|
203
|
+
builder.withClientId(clientIdPrefixed, PropertyTarget.REQUEST_OBJECT
|
|
204
|
+
)
|
|
210
205
|
}
|
|
211
206
|
|
|
212
207
|
if (hasher) {
|
|
@@ -304,3 +299,12 @@ export function getSigningAlgo(type: TKeyType): SigningAlgo {
|
|
|
304
299
|
throw Error('Key type not yet supported')
|
|
305
300
|
}
|
|
306
301
|
}
|
|
302
|
+
|
|
303
|
+
export function prefixClientId(clientId: string): string {
|
|
304
|
+
// FIXME SSISDK-60
|
|
305
|
+
if (clientId.startsWith('did:')) {
|
|
306
|
+
return `${ClientIdentifierPrefix.DECENTRALIZED_IDENTIFIER}:${clientId}`;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return clientId;
|
|
310
|
+
}
|
package/src/index.ts
CHANGED
package/src/types/ISIOPv2RP.ts
CHANGED
|
@@ -2,7 +2,8 @@ import {
|
|
|
2
2
|
AuthorizationRequestPayload,
|
|
3
3
|
AuthorizationRequestState,
|
|
4
4
|
AuthorizationResponsePayload,
|
|
5
|
-
|
|
5
|
+
AuthorizationResponseStateWithVerifiedData,
|
|
6
|
+
CallbackOpts,
|
|
6
7
|
ClaimPayloadCommonOpts,
|
|
7
8
|
ClientMetadataOpts,
|
|
8
9
|
IRPSessionManager,
|
|
@@ -23,14 +24,14 @@ import { ExternalIdentifierOIDFEntityIdOpts, IIdentifierResolution, ManagedIdent
|
|
|
23
24
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service'
|
|
24
25
|
import { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation'
|
|
25
26
|
import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc'
|
|
26
|
-
import { IPDManager, VersionControlMode } from '@sphereon/ssi-sdk.pd-manager'
|
|
27
|
+
import { ImportDcqlQueryItem, IPDManager, VersionControlMode } from '@sphereon/ssi-sdk.pd-manager'
|
|
27
28
|
import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange'
|
|
28
29
|
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt'
|
|
29
30
|
import { AuthorizationRequestStateStatus } from '@sphereon/ssi-sdk.siopv2-oid4vp-common'
|
|
30
|
-
import {
|
|
31
|
+
import { HasherSync } from '@sphereon/ssi-types'
|
|
31
32
|
import { VerifyCallback } from '@sphereon/wellknown-dids-client'
|
|
32
|
-
import { IAgentContext,
|
|
33
|
-
|
|
33
|
+
import { IAgentContext, ICredentialVerifier, IDIDManager, IKeyManager, IPluginMethodMap, IResolver } from '@veramo/core'
|
|
34
|
+
import { DcqlQuery } from 'dcql'
|
|
34
35
|
import { Resolvable } from 'did-resolver'
|
|
35
36
|
import { EventEmitter } from 'events'
|
|
36
37
|
|
|
@@ -52,7 +53,6 @@ export interface ISIOPv2RP extends IPluginMethodMap {
|
|
|
52
53
|
siopDeleteAuthState(args: IDeleteAuthStateArgs, context: IRequiredContext): Promise<boolean>
|
|
53
54
|
siopVerifyAuthResponse(args: IVerifyAuthResponseStateArgs, context: IRequiredContext): Promise<VerifiedAuthorizationResponse>
|
|
54
55
|
siopImportDefinitions(args: ImportDefinitionsArgs, context: IRequiredContext): Promise<void>
|
|
55
|
-
|
|
56
56
|
siopGetRedirectURI(args: IGetRedirectUriArgs, context: IRequiredContext): Promise<string | undefined>
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -64,8 +64,9 @@ export interface ISiopv2RPOpts {
|
|
|
64
64
|
export interface IRPDefaultOpts extends IRPOptions {}
|
|
65
65
|
|
|
66
66
|
export interface ICreateAuthRequestArgs {
|
|
67
|
-
|
|
67
|
+
queryId: string
|
|
68
68
|
correlationId: string
|
|
69
|
+
useQueryIdInstance?: boolean
|
|
69
70
|
responseURIType: ResponseURIType
|
|
70
71
|
responseURI: string
|
|
71
72
|
responseRedirectURI?: string
|
|
@@ -74,24 +75,25 @@ export interface ICreateAuthRequestArgs {
|
|
|
74
75
|
nonce?: string
|
|
75
76
|
state?: string
|
|
76
77
|
claims?: ClaimPayloadCommonOpts
|
|
78
|
+
callback?: CallbackOpts
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
export interface IGetAuthRequestStateArgs {
|
|
80
82
|
correlationId: string
|
|
81
|
-
|
|
83
|
+
queryId?: string
|
|
82
84
|
errorOnNotFound?: boolean
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
export interface IGetAuthResponseStateArgs {
|
|
86
88
|
correlationId: string
|
|
87
|
-
|
|
89
|
+
queryId?: string
|
|
88
90
|
errorOnNotFound?: boolean
|
|
89
91
|
progressRequestStateTo?: AuthorizationRequestStateStatus
|
|
90
92
|
includeVerifiedData?: VerifiedDataMode
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
export interface IUpdateRequestStateArgs {
|
|
94
|
-
|
|
96
|
+
queryId: string
|
|
95
97
|
correlationId: string
|
|
96
98
|
state: AuthorizationRequestStateStatus
|
|
97
99
|
error?: string
|
|
@@ -99,24 +101,18 @@ export interface IUpdateRequestStateArgs {
|
|
|
99
101
|
|
|
100
102
|
export interface IDeleteAuthStateArgs {
|
|
101
103
|
correlationId: string
|
|
102
|
-
|
|
104
|
+
queryId?: string
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
export interface IVerifyAuthResponseStateArgs {
|
|
106
108
|
authorizationResponse: string | AuthorizationResponsePayload
|
|
107
|
-
|
|
109
|
+
queryId?: string
|
|
108
110
|
correlationId: string
|
|
109
111
|
audience?: string
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export interface IDefinitionPair {
|
|
114
|
-
definitionPayload?: IPresentationDefinition
|
|
115
|
-
dcqlPayload?: DcqlQueryPayload
|
|
112
|
+
dcqlQuery?: DcqlQuery
|
|
116
113
|
}
|
|
117
|
-
|
|
118
114
|
export interface ImportDefinitionsArgs {
|
|
119
|
-
|
|
115
|
+
importItems: Array<ImportDcqlQueryItem>
|
|
120
116
|
tenantId?: string
|
|
121
117
|
version?: string
|
|
122
118
|
versionControlMode?: VersionControlMode
|
|
@@ -124,7 +120,7 @@ export interface ImportDefinitionsArgs {
|
|
|
124
120
|
|
|
125
121
|
export interface IGetRedirectUriArgs {
|
|
126
122
|
correlationId: string
|
|
127
|
-
|
|
123
|
+
queryId?: string
|
|
128
124
|
state?: string
|
|
129
125
|
}
|
|
130
126
|
|
|
@@ -140,7 +136,7 @@ export interface IPEXDefinitionPersistArgs extends IPEXInstanceOptions {
|
|
|
140
136
|
}
|
|
141
137
|
|
|
142
138
|
export interface ISiopRPInstanceArgs {
|
|
143
|
-
|
|
139
|
+
queryId?: string
|
|
144
140
|
responseRedirectURI?: string
|
|
145
141
|
}
|
|
146
142
|
|
|
@@ -165,7 +161,7 @@ export interface IRPOptions {
|
|
|
165
161
|
export interface IPEXOptions {
|
|
166
162
|
presentationVerifyCallback?: PresentationVerificationCallback
|
|
167
163
|
// definition?: IPresentationDefinition
|
|
168
|
-
|
|
164
|
+
queryId: string
|
|
169
165
|
version?: string
|
|
170
166
|
tenantId?: string
|
|
171
167
|
}
|
|
@@ -198,16 +194,11 @@ export type CredentialOpts = {
|
|
|
198
194
|
hasher?: HasherSync
|
|
199
195
|
}
|
|
200
196
|
|
|
201
|
-
export interface AuthorizationResponseStateWithVerifiedData extends AuthorizationResponseState {
|
|
202
|
-
verifiedData?: AdditionalClaims
|
|
203
|
-
}
|
|
204
|
-
|
|
205
197
|
export type IRequiredContext = IAgentContext<
|
|
206
198
|
IResolver &
|
|
207
199
|
IDIDManager &
|
|
208
200
|
IKeyManager &
|
|
209
201
|
IIdentifierResolution &
|
|
210
|
-
ICredentialIssuer &
|
|
211
202
|
ICredentialValidation &
|
|
212
203
|
ICredentialVerifier &
|
|
213
204
|
IPresentationExchange &
|