Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Auer <martin.auer97@gmail.com>
  • Loading branch information
auer-martin committed Oct 28, 2024
1 parent cba86a8 commit 9ed736e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ export class OpenId4VcSiopVerifierService {
let authorizationRequestUri = (await authorizationRequest.uri()).encodedUri
if (options.presentationExchange && !options.idToken) {
authorizationRequestUri = authorizationRequestUri.replace('openid://', 'openid4vp://')
} else {
authorizationRequestUri = authorizationRequestUri.replace('openid4vp://', 'openid://')
}

const verificationSession = await verificationSessionCreatedPromise
Expand Down
11 changes: 6 additions & 5 deletions packages/openid4vc/tests/openid4vc.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ describe('OpenId4Vc', () => {
throw new Error('No verification method found')
}

const trustedCertificates = agentContext.dependencyManager.resolve(X509ModuleConfig).trustedCertificates
if (trustedCertificates?.length !== 1) {
throw new Error('Expected exactly one trusted certificate. Received 0.')
}

if (credentialRequest.format === 'vc+sd-jwt') {
return {
credentialSupportedId:
Expand All @@ -123,6 +118,12 @@ describe('OpenId4Vc', () => {
disclosureFrame: { _sd: ['university', 'degree'] },
}
} else if (credentialRequest.format === 'mso_mdoc') {
const trustedCertificates =
agentContext.dependencyManager.resolve(X509ModuleConfig).trustedCertificates
if (trustedCertificates?.length !== 1) {
throw new Error('Expected exactly one trusted certificate. Received 0.')
}

return {
credentialSupportedId: '',
format: ClaimFormat.MsoMdoc,
Expand Down

0 comments on commit 9ed736e

Please sign in to comment.