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