Skip to content

Commit

Permalink
chore: fixed correlationId issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Sep 27, 2024
1 parent d36176c commit 2a8e323
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packages/siop-oid4vp/lib/rp/Opts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { defaultHasher, uuidv4 } from '@sphereon/oid4vc-common'
import { defaultHasher } from '@sphereon/oid4vc-common';

import { CreateAuthorizationRequestOpts, PropertyTarget, PropertyTargets, RequestPropertyWithTargets } from '../authorization-request'
import { VerifyAuthorizationResponseOpts } from '../authorization-response'
import {
CreateAuthorizationRequestOpts,
PropertyTarget,
PropertyTargets,
RequestPropertyWithTargets
} from '../authorization-request';
import { VerifyAuthorizationResponseOpts } from '../authorization-response';
// import { CreateAuthorizationRequestOptsSchema } from '../schemas';
import { ClientMetadataOpts, RequestObjectPayload, SIOPErrors, Verification } from '../types'
import { ClientMetadataOpts, RequestObjectPayload, SIOPErrors, Verification } from '../types';

import { RPBuilder } from './RPBuilder'
import { RPBuilder } from './RPBuilder';

export const createRequestOptsFromBuilderOrExistingOpts = (opts: { builder?: RPBuilder; createRequestOpts?: CreateAuthorizationRequestOpts }) => {
const version = opts.builder ? opts.builder.getSupportedRequestVersion() : opts.createRequestOpts.version
Expand Down Expand Up @@ -48,11 +53,11 @@ export const createRequestOptsFromBuilderOrExistingOpts = (opts: { builder?: RPB
return createRequestOpts
}

export const createVerifyResponseOptsFromBuilderOrExistingOpts = (opts: { builder?: RPBuilder; verifyOpts?: VerifyAuthorizationResponseOpts }):VerifyAuthorizationResponseOpts => {
export const createVerifyResponseOptsFromBuilderOrExistingOpts = (opts: { builder?: RPBuilder; verifyOpts?: VerifyAuthorizationResponseOpts }):Partial<VerifyAuthorizationResponseOpts> => {
return opts.builder
? {
hasher: opts.builder.hasher ?? defaultHasher,
correlationId: uuidv4(),
// correlationId: uuidv4(), We can't set a correlationId here, it will no longer check functions like this.sessionManager.getCorrelationIdByNonce(resNonce, false)
verifyJwtCallback: opts.builder.verifyJwtCallback,
verification: {
presentationVerificationCallback: opts.builder.presentationVerificationCallback,
Expand Down

0 comments on commit 2a8e323

Please sign in to comment.