@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth 0.34.1-next.91 → 0.36.0

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,7 +2,8 @@ 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,
@@ -23,23 +24,17 @@ 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 { AdditionalClaims, DcqlQueryREST, HasherSync } from '@sphereon/ssi-types'
31
+ import { HasherSync } from '@sphereon/ssi-types'
31
32
  import { VerifyCallback } from '@sphereon/wellknown-dids-client'
32
- import { IAgentContext, ICredentialIssuer, ICredentialVerifier, IDIDManager, IKeyManager, IPluginMethodMap, IResolver } from '@veramo/core'
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
 
37
- export enum VerifiedDataMode {
38
- NONE = 'none',
39
- VERIFIED_PRESENTATION = 'vp',
40
- CREDENTIAL_SUBJECT_FLATTENED = 'cs-flat',
41
- }
42
-
43
38
  export interface ISIOPv2RP extends IPluginMethodMap {
44
39
  siopCreateAuthRequestURI(createArgs: ICreateAuthRequestArgs, context: IRequiredContext): Promise<string>
45
40
  siopCreateAuthRequestPayloads(createArgs: ICreateAuthRequestArgs, context: IRequiredContext): Promise<IAuthorizationRequestPayloads>
@@ -52,7 +47,6 @@ export interface ISIOPv2RP extends IPluginMethodMap {
52
47
  siopDeleteAuthState(args: IDeleteAuthStateArgs, context: IRequiredContext): Promise<boolean>
53
48
  siopVerifyAuthResponse(args: IVerifyAuthResponseStateArgs, context: IRequiredContext): Promise<VerifiedAuthorizationResponse>
54
49
  siopImportDefinitions(args: ImportDefinitionsArgs, context: IRequiredContext): Promise<void>
55
-
56
50
  siopGetRedirectURI(args: IGetRedirectUriArgs, context: IRequiredContext): Promise<string | undefined>
57
51
  }
58
52
 
@@ -64,8 +58,9 @@ export interface ISiopv2RPOpts {
64
58
  export interface IRPDefaultOpts extends IRPOptions {}
65
59
 
66
60
  export interface ICreateAuthRequestArgs {
67
- definitionId: string
61
+ queryId: string
68
62
  correlationId: string
63
+ useQueryIdInstance?: boolean
69
64
  responseURIType: ResponseURIType
70
65
  responseURI: string
71
66
  responseRedirectURI?: string
@@ -74,24 +69,24 @@ export interface ICreateAuthRequestArgs {
74
69
  nonce?: string
75
70
  state?: string
76
71
  claims?: ClaimPayloadCommonOpts
72
+ callback?: CallbackOpts
77
73
  }
78
74
 
79
75
  export interface IGetAuthRequestStateArgs {
80
76
  correlationId: string
81
- definitionId: string
77
+ queryId?: string
82
78
  errorOnNotFound?: boolean
83
79
  }
84
80
 
85
81
  export interface IGetAuthResponseStateArgs {
86
82
  correlationId: string
87
- definitionId: string
83
+ queryId?: string
88
84
  errorOnNotFound?: boolean
89
85
  progressRequestStateTo?: AuthorizationRequestStateStatus
90
- includeVerifiedData?: VerifiedDataMode
91
86
  }
92
87
 
93
88
  export interface IUpdateRequestStateArgs {
94
- definitionId: string
89
+ queryId?: string
95
90
  correlationId: string
96
91
  state: AuthorizationRequestStateStatus
97
92
  error?: string
@@ -99,24 +94,18 @@ export interface IUpdateRequestStateArgs {
99
94
 
100
95
  export interface IDeleteAuthStateArgs {
101
96
  correlationId: string
102
- definitionId: string
97
+ queryId?: string
103
98
  }
104
99
 
105
100
  export interface IVerifyAuthResponseStateArgs {
106
101
  authorizationResponse: string | AuthorizationResponsePayload
107
- definitionId?: string
102
+ queryId?: string
108
103
  correlationId: string
109
104
  audience?: string
110
- dcqlQuery?: DcqlQueryREST
111
- }
112
-
113
- export interface IDefinitionPair {
114
- definitionPayload: IPresentationDefinition
115
- dcqlPayload?: DcqlQueryREST
105
+ dcqlQuery?: DcqlQuery
116
106
  }
117
-
118
107
  export interface ImportDefinitionsArgs {
119
- definitions: Array<IDefinitionPair>
108
+ importItems: Array<ImportDcqlQueryItem>
120
109
  tenantId?: string
121
110
  version?: string
122
111
  versionControlMode?: VersionControlMode
@@ -124,7 +113,7 @@ export interface ImportDefinitionsArgs {
124
113
 
125
114
  export interface IGetRedirectUriArgs {
126
115
  correlationId: string
127
- definitionId?: string
116
+ queryId?: string
128
117
  state?: string
129
118
  }
130
119
 
@@ -140,11 +129,12 @@ export interface IPEXDefinitionPersistArgs extends IPEXInstanceOptions {
140
129
  }
141
130
 
142
131
  export interface ISiopRPInstanceArgs {
143
- definitionId?: string
132
+ createWhenNotPresent: boolean
133
+ queryId?: string
144
134
  responseRedirectURI?: string
145
135
  }
146
136
 
147
- export interface IPEXInstanceOptions extends IPEXOptions {
137
+ export interface IPEXInstanceOptions extends IPresentationOptions {
148
138
  rpOpts?: IRPOptions
149
139
  }
150
140
 
@@ -162,12 +152,9 @@ export interface IRPOptions {
162
152
  responseRedirectUri?: string
163
153
  }
164
154
 
165
- export interface IPEXOptions {
155
+ export interface IPresentationOptions {
156
+ queryId: string
166
157
  presentationVerifyCallback?: PresentationVerificationCallback
167
- // definition?: IPresentationDefinition
168
- definitionId: string
169
- version?: string
170
- tenantId?: string
171
158
  }
172
159
 
173
160
  export type VerificationPolicies = {
@@ -198,16 +185,11 @@ export type CredentialOpts = {
198
185
  hasher?: HasherSync
199
186
  }
200
187
 
201
- export interface AuthorizationResponseStateWithVerifiedData extends AuthorizationResponseState {
202
- verifiedData?: AdditionalClaims
203
- }
204
-
205
188
  export type IRequiredContext = IAgentContext<
206
189
  IResolver &
207
190
  IDIDManager &
208
191
  IKeyManager &
209
192
  IIdentifierResolution &
210
- ICredentialIssuer &
211
193
  ICredentialValidation &
212
194
  ICredentialVerifier &
213
195
  IPresentationExchange &