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