@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth 0.34.1-next.3 → 0.34.1-next.322

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.
@@ -2,46 +2,38 @@ import {
2
2
  AuthorizationRequestPayload,
3
3
  AuthorizationRequestState,
4
4
  AuthorizationResponsePayload,
5
- AuthorizationResponseState,
5
+ AuthorizationResponseStateWithVerifiedData,
6
+ CallbackOpts,
6
7
  ClaimPayloadCommonOpts,
7
8
  ClientMetadataOpts,
8
9
  IRPSessionManager,
9
- PresentationDefinitionWithLocation,
10
10
  PresentationVerificationCallback,
11
11
  RequestObjectPayload,
12
12
  ResponseMode,
13
13
  ResponseURIType,
14
14
  SupportedVersion,
15
- VerifiablePresentationTypeFormat,
16
15
  VerifiedAuthorizationResponse,
17
16
  VerifyJwtCallback,
18
- VPTokenLocation,
19
17
  } from '@sphereon/did-auth-siop'
20
- import { ExternalIdentifierOIDFEntityIdOpts, IIdentifierResolution, ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
21
- import { IAgentContext, ICredentialIssuer, ICredentialVerifier, IDIDManager, IKeyManager, IPluginMethodMap, IResolver } from '@veramo/core'
22
- import { AdditionalClaims, DcqlQueryREST, HasherSync, W3CVerifiablePresentation } from '@sphereon/ssi-types'
23
-
24
- import { Resolvable } from 'did-resolver'
18
+ import { CheckLinkedDomain } from '@sphereon/did-auth-siop-adapter'
25
19
  import { DIDDocument } from '@sphereon/did-uni-client'
26
- import { EventEmitter } from 'events'
20
+ import { JwtIssuer } from '@sphereon/oid4vc-common'
27
21
  import { IPresentationDefinition } from '@sphereon/pex'
28
22
  import { IDIDOptions } from '@sphereon/ssi-sdk-ext.did-utils'
29
- import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange'
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'
23
+ import { ExternalIdentifierOIDFEntityIdOpts, IIdentifierResolution, ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
35
24
  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
25
  import { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation'
39
-
40
- export enum VerifiedDataMode {
41
- NONE = 'none',
42
- VERIFIED_PRESENTATION = 'vp',
43
- CREDENTIAL_SUBJECT_FLATTENED = 'cs-flat',
44
- }
26
+ import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc'
27
+ import { ImportDcqlQueryItem, IPDManager, VersionControlMode } from '@sphereon/ssi-sdk.pd-manager'
28
+ import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange'
29
+ import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt'
30
+ import { AuthorizationRequestStateStatus } from '@sphereon/ssi-sdk.siopv2-oid4vp-common'
31
+ import { HasherSync } from '@sphereon/ssi-types'
32
+ import { VerifyCallback } from '@sphereon/wellknown-dids-client'
33
+ import { IAgentContext, ICredentialVerifier, IDIDManager, IKeyManager, IPluginMethodMap, IResolver } from '@veramo/core'
34
+ import { DcqlQuery } from 'dcql'
35
+ import { Resolvable } from 'did-resolver'
36
+ import { EventEmitter } from 'events'
45
37
 
46
38
  export interface ISIOPv2RP extends IPluginMethodMap {
47
39
  siopCreateAuthRequestURI(createArgs: ICreateAuthRequestArgs, context: IRequiredContext): Promise<string>
@@ -55,7 +47,6 @@ export interface ISIOPv2RP extends IPluginMethodMap {
55
47
  siopDeleteAuthState(args: IDeleteAuthStateArgs, context: IRequiredContext): Promise<boolean>
56
48
  siopVerifyAuthResponse(args: IVerifyAuthResponseStateArgs, context: IRequiredContext): Promise<VerifiedAuthorizationResponse>
57
49
  siopImportDefinitions(args: ImportDefinitionsArgs, context: IRequiredContext): Promise<void>
58
-
59
50
  siopGetRedirectURI(args: IGetRedirectUriArgs, context: IRequiredContext): Promise<string | undefined>
60
51
  }
61
52
 
@@ -67,8 +58,9 @@ export interface ISiopv2RPOpts {
67
58
  export interface IRPDefaultOpts extends IRPOptions {}
68
59
 
69
60
  export interface ICreateAuthRequestArgs {
70
- definitionId: string
61
+ queryId: string
71
62
  correlationId: string
63
+ useQueryIdInstance?: boolean
72
64
  responseURIType: ResponseURIType
73
65
  responseURI: string
74
66
  responseRedirectURI?: string
@@ -77,24 +69,24 @@ export interface ICreateAuthRequestArgs {
77
69
  nonce?: string
78
70
  state?: string
79
71
  claims?: ClaimPayloadCommonOpts
72
+ callback?: CallbackOpts
80
73
  }
81
74
 
82
75
  export interface IGetAuthRequestStateArgs {
83
76
  correlationId: string
84
- definitionId: string
77
+ queryId?: string
85
78
  errorOnNotFound?: boolean
86
79
  }
87
80
 
88
81
  export interface IGetAuthResponseStateArgs {
89
82
  correlationId: string
90
- definitionId: string
83
+ queryId?: string
91
84
  errorOnNotFound?: boolean
92
85
  progressRequestStateTo?: AuthorizationRequestStateStatus
93
- includeVerifiedData?: VerifiedDataMode
94
86
  }
95
87
 
96
88
  export interface IUpdateRequestStateArgs {
97
- definitionId: string
89
+ queryId?: string
98
90
  correlationId: string
99
91
  state: AuthorizationRequestStateStatus
100
92
  error?: string
@@ -102,25 +94,18 @@ export interface IUpdateRequestStateArgs {
102
94
 
103
95
  export interface IDeleteAuthStateArgs {
104
96
  correlationId: string
105
- definitionId: string
97
+ queryId?: string
106
98
  }
107
99
 
108
100
  export interface IVerifyAuthResponseStateArgs {
109
101
  authorizationResponse: string | AuthorizationResponsePayload
110
- definitionId?: string
102
+ queryId?: string
111
103
  correlationId: string
112
104
  audience?: string
113
- presentationDefinitions?: PresentationDefinitionWithLocation | PresentationDefinitionWithLocation[]
114
- dcqlQuery?: DcqlQueryREST
115
- }
116
-
117
- export interface IDefinitionPair {
118
- definitionPayload: IPresentationDefinition
119
- dcqlPayload?: DcqlQueryREST
105
+ dcqlQuery?: DcqlQuery
120
106
  }
121
-
122
107
  export interface ImportDefinitionsArgs {
123
- definitions: Array<IDefinitionPair>
108
+ importItems: Array<ImportDcqlQueryItem>
124
109
  tenantId?: string
125
110
  version?: string
126
111
  versionControlMode?: VersionControlMode
@@ -128,7 +113,7 @@ export interface ImportDefinitionsArgs {
128
113
 
129
114
  export interface IGetRedirectUriArgs {
130
115
  correlationId: string
131
- definitionId?: string
116
+ queryId?: string
132
117
  state?: string
133
118
  }
134
119
 
@@ -144,11 +129,12 @@ export interface IPEXDefinitionPersistArgs extends IPEXInstanceOptions {
144
129
  }
145
130
 
146
131
  export interface ISiopRPInstanceArgs {
147
- definitionId?: string
132
+ createWhenNotPresent: boolean
133
+ queryId?: string
148
134
  responseRedirectURI?: string
149
135
  }
150
136
 
151
- export interface IPEXInstanceOptions extends IPEXOptions {
137
+ export interface IPEXInstanceOptions extends IPresentationOptions {
152
138
  rpOpts?: IRPOptions
153
139
  }
154
140
 
@@ -166,12 +152,9 @@ export interface IRPOptions {
166
152
  responseRedirectUri?: string
167
153
  }
168
154
 
169
- export interface IPEXOptions {
155
+ export interface IPresentationOptions {
156
+ queryId: string
170
157
  presentationVerifyCallback?: PresentationVerificationCallback
171
- // definition?: IPresentationDefinition
172
- definitionId: string
173
- version?: string
174
- tenantId?: string
175
158
  }
176
159
 
177
160
  export type VerificationPolicies = {
@@ -186,17 +169,9 @@ export interface PerDidResolver {
186
169
  export interface IAuthRequestDetails {
187
170
  rpDIDDocument?: DIDDocument
188
171
  id: string
189
- verifiablePresentationMatches: IPresentationWithDefinition[]
190
172
  alsoKnownAs?: string[]
191
173
  }
192
174
 
193
- export interface IPresentationWithDefinition {
194
- location: VPTokenLocation
195
- definition: PresentationDefinitionWithLocation
196
- format: VerifiablePresentationTypeFormat
197
- presentation: W3CVerifiablePresentation
198
- }
199
-
200
175
  export interface ISIOPIdentifierOptions extends Omit<IDIDOptions, 'idOpts'> {
201
176
  // we replace the legacy idOpts with the Managed Identifier opts from the identifier resolution module
202
177
  idOpts: ManagedIdentifierOptsOrResult
@@ -210,16 +185,11 @@ export type CredentialOpts = {
210
185
  hasher?: HasherSync
211
186
  }
212
187
 
213
- export interface AuthorizationResponseStateWithVerifiedData extends AuthorizationResponseState {
214
- verifiedData?: AdditionalClaims
215
- }
216
-
217
188
  export type IRequiredContext = IAgentContext<
218
189
  IResolver &
219
190
  IDIDManager &
220
191
  IKeyManager &
221
192
  IIdentifierResolution &
222
- ICredentialIssuer &
223
193
  ICredentialValidation &
224
194
  ICredentialVerifier &
225
195
  IPresentationExchange &