@sphereon/ssi-sdk.siopv2-oid4vp-rp-auth 0.34.1-feature.DIIPv4.113 → 0.34.1-feature.DIIPv4.140

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/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 { CredentialMapper, Hasher, OriginalVerifiableCredential, PresentationSubmission } from '@sphereon/ssi-types'
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 }
@@ -161,7 +164,7 @@ export async function createRPBuilder(args: {
161
164
  uniresolverResolution: rpOpts.identifierOpts.resolveOpts?.noUniversalResolverFallback !== true,
162
165
  })
163
166
  //todo: probably wise to first look and see if we actually need the hasher to begin with
164
- let hasher: Hasher | undefined = rpOpts.credentialOpts?.hasher
167
+ let hasher: HasherSync | undefined = rpOpts.credentialOpts?.hasher
165
168
  if (!rpOpts.credentialOpts?.hasher || typeof rpOpts.credentialOpts?.hasher !== 'function') {
166
169
  hasher = defaultHasher
167
170
  }
@@ -197,7 +200,7 @@ export async function createRPBuilder(args: {
197
200
 
198
201
  const oidfOpts = identifierOpts.oidfOpts
199
202
  if (oidfOpts && isExternalIdentifierOIDFEntityIdOpts(oidfOpts)) {
200
- builder.withEntityId(oidfOpts.identifier, PropertyTarget.REQUEST_OBJECT).withClientIdScheme('entity_id', PropertyTarget.REQUEST_OBJECT)
203
+ builder.withEntityId(oidfOpts.identifier, PropertyTarget.REQUEST_OBJECT)
201
204
  } else {
202
205
  const resolution = await context.agent.identifierManagedGet(identifierOpts.idOpts)
203
206
  builder
@@ -205,10 +208,6 @@ export async function createRPBuilder(args: {
205
208
  resolution.issuer ?? (isManagedIdentifierDidResult(resolution) ? resolution.did : resolution.jwkThumbprint),
206
209
  PropertyTarget.REQUEST_OBJECT,
207
210
  )
208
- .withClientIdScheme(
209
- (resolution.clientIdScheme as ClientIdScheme) ?? (identifierOpts.idOpts.clientIdScheme as ClientIdScheme),
210
- PropertyTarget.REQUEST_OBJECT,
211
- )
212
211
  }
213
212
 
214
213
  if (hasher) {
@@ -222,9 +221,6 @@ export async function createRPBuilder(args: {
222
221
  //fixme: this has been removed in the new version of did-auth-siop
223
222
  // builder.withWellknownDIDVerifyCallback(getWellKnownDIDVerifyCallback(didOpts, context))
224
223
 
225
- if (definition) {
226
- builder.withPresentationDefinition({ definition }, PropertyTarget.REQUEST_OBJECT)
227
- }
228
224
  if (dcqlQuery) {
229
225
  builder.withDcqlQuery(dcqlQuery)
230
226
  }
@@ -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, DcqlQueryREST, HasherSync } from '@sphereon/ssi-types'
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
- dcqlQuery?: DcqlQueryREST
110
+ dcqlQueryPayload?: DcqlQueryPayload
111
111
  }
112
112
 
113
113
  export interface IDefinitionPair {
114
- definitionPayload: IPresentationDefinition
115
- dcqlPayload?: DcqlQueryREST
114
+ definitionPayload?: IPresentationDefinition
115
+ dcqlPayload?: DcqlQueryPayload
116
116
  }
117
117
 
118
118
  export interface ImportDefinitionsArgs {