@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth 0.34.1-fix.117 → 0.34.1-fix.141
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 +24 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +24 -17
- package/dist/index.js.map +1 -1
- package/package.json +15 -15
- package/src/agent/SIOPv2RP.ts +18 -4
- package/src/functions.ts +10 -15
- package/src/types/ISIOPv2RP.ts +4 -4
package/src/functions.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ClientIdScheme,
|
|
3
2
|
ClientMetadataOpts,
|
|
4
3
|
InMemoryRPSessionManager,
|
|
5
4
|
PassBy,
|
|
@@ -28,7 +27,12 @@ import {
|
|
|
28
27
|
} from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
29
28
|
import { JwtCompactResult } from '@sphereon/ssi-sdk-ext.jwt-service'
|
|
30
29
|
import { IVerifySdJwtPresentationResult } from '@sphereon/ssi-sdk.sd-jwt'
|
|
31
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
CredentialMapper,
|
|
32
|
+
HasherSync,
|
|
33
|
+
OriginalVerifiableCredential,
|
|
34
|
+
PresentationSubmission
|
|
35
|
+
} from '@sphereon/ssi-types'
|
|
32
36
|
import { IVerifyCallbackArgs, IVerifyCredentialResult, VerifyCallback } from '@sphereon/wellknown-dids-client'
|
|
33
37
|
// import { KeyAlgo, SuppliedSigner } from '@sphereon/ssi-sdk.core'
|
|
34
38
|
import { TKeyType } from '@veramo/core'
|
|
@@ -68,8 +72,7 @@ export function getPresentationVerificationCallback(
|
|
|
68
72
|
): Promise<PresentationVerificationResult> {
|
|
69
73
|
if (CredentialMapper.isSdJwtEncoded(args)) {
|
|
70
74
|
const result: IVerifySdJwtPresentationResult = await context.agent.verifySdJwtPresentation({
|
|
71
|
-
presentation: args
|
|
72
|
-
kb: true,
|
|
75
|
+
presentation: args
|
|
73
76
|
})
|
|
74
77
|
// fixme: investigate the correct way to handle this
|
|
75
78
|
return { verified: !!result.payload }
|
|
@@ -126,9 +129,8 @@ export async function createRPBuilder(args: {
|
|
|
126
129
|
|
|
127
130
|
if (presentationDefinitionItems.length > 0) {
|
|
128
131
|
const presentationDefinitionItem = presentationDefinitionItems[0]
|
|
129
|
-
definition = presentationDefinitionItem.definitionPayload
|
|
130
132
|
if (!dcqlQuery && presentationDefinitionItem.dcqlPayload) {
|
|
131
|
-
dcqlQuery = presentationDefinitionItem.dcqlPayload as DcqlQuery // cast from DcqlQueryREST back to valibot DcqlQuery
|
|
133
|
+
dcqlQuery = presentationDefinitionItem.dcqlPayload.dcqlQuery as DcqlQuery // cast from DcqlQueryREST back to valibot DcqlQuery
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
}
|
|
@@ -161,7 +163,7 @@ export async function createRPBuilder(args: {
|
|
|
161
163
|
uniresolverResolution: rpOpts.identifierOpts.resolveOpts?.noUniversalResolverFallback !== true,
|
|
162
164
|
})
|
|
163
165
|
//todo: probably wise to first look and see if we actually need the hasher to begin with
|
|
164
|
-
let hasher:
|
|
166
|
+
let hasher: HasherSync | undefined = rpOpts.credentialOpts?.hasher
|
|
165
167
|
if (!rpOpts.credentialOpts?.hasher || typeof rpOpts.credentialOpts?.hasher !== 'function') {
|
|
166
168
|
hasher = defaultHasher
|
|
167
169
|
}
|
|
@@ -197,7 +199,7 @@ export async function createRPBuilder(args: {
|
|
|
197
199
|
|
|
198
200
|
const oidfOpts = identifierOpts.oidfOpts
|
|
199
201
|
if (oidfOpts && isExternalIdentifierOIDFEntityIdOpts(oidfOpts)) {
|
|
200
|
-
builder.withEntityId(oidfOpts.identifier, PropertyTarget.REQUEST_OBJECT)
|
|
202
|
+
builder.withEntityId(oidfOpts.identifier, PropertyTarget.REQUEST_OBJECT)
|
|
201
203
|
} else {
|
|
202
204
|
const resolution = await context.agent.identifierManagedGet(identifierOpts.idOpts)
|
|
203
205
|
builder
|
|
@@ -205,10 +207,6 @@ export async function createRPBuilder(args: {
|
|
|
205
207
|
resolution.issuer ?? (isManagedIdentifierDidResult(resolution) ? resolution.did : resolution.jwkThumbprint),
|
|
206
208
|
PropertyTarget.REQUEST_OBJECT,
|
|
207
209
|
)
|
|
208
|
-
.withClientIdScheme(
|
|
209
|
-
(resolution.clientIdScheme as ClientIdScheme) ?? (identifierOpts.idOpts.clientIdScheme as ClientIdScheme),
|
|
210
|
-
PropertyTarget.REQUEST_OBJECT,
|
|
211
|
-
)
|
|
212
210
|
}
|
|
213
211
|
|
|
214
212
|
if (hasher) {
|
|
@@ -222,9 +220,6 @@ export async function createRPBuilder(args: {
|
|
|
222
220
|
//fixme: this has been removed in the new version of did-auth-siop
|
|
223
221
|
// builder.withWellknownDIDVerifyCallback(getWellKnownDIDVerifyCallback(didOpts, context))
|
|
224
222
|
|
|
225
|
-
if (definition) {
|
|
226
|
-
builder.withPresentationDefinition({ definition }, PropertyTarget.REQUEST_OBJECT)
|
|
227
|
-
}
|
|
228
223
|
if (dcqlQuery) {
|
|
229
224
|
builder.withDcqlQuery(dcqlQuery)
|
|
230
225
|
}
|
package/src/types/ISIOPv2RP.ts
CHANGED
|
@@ -27,7 +27,7 @@ import { IPDManager, VersionControlMode } from '@sphereon/ssi-sdk.pd-manager'
|
|
|
27
27
|
import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange'
|
|
28
28
|
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt'
|
|
29
29
|
import { AuthorizationRequestStateStatus } from '@sphereon/ssi-sdk.siopv2-oid4vp-common'
|
|
30
|
-
import { AdditionalClaims,
|
|
30
|
+
import { AdditionalClaims, DcqlQueryPayload, HasherSync } from '@sphereon/ssi-types'
|
|
31
31
|
import { VerifyCallback } from '@sphereon/wellknown-dids-client'
|
|
32
32
|
import { IAgentContext, ICredentialIssuer, ICredentialVerifier, IDIDManager, IKeyManager, IPluginMethodMap, IResolver } from '@veramo/core'
|
|
33
33
|
|
|
@@ -107,12 +107,12 @@ export interface IVerifyAuthResponseStateArgs {
|
|
|
107
107
|
definitionId?: string
|
|
108
108
|
correlationId: string
|
|
109
109
|
audience?: string
|
|
110
|
-
|
|
110
|
+
dcqlQueryPayload?: DcqlQueryPayload
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
export interface IDefinitionPair {
|
|
114
|
-
definitionPayload
|
|
115
|
-
dcqlPayload?:
|
|
114
|
+
definitionPayload?: IPresentationDefinition
|
|
115
|
+
dcqlPayload?: DcqlQueryPayload
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
export interface ImportDefinitionsArgs {
|