Skip to content

Commit 40fd382

Browse files
committed
updates
Signed-off-by: Timo Glastra <timo@animo.id>
1 parent ec09e8a commit 40fd382

File tree

6 files changed

+24
-25
lines changed

6 files changed

+24
-25
lines changed

packages/openid4vc/src/openid4vc-holder/OpenId4vpHolderService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import type {
1212
import type {
1313
OpenId4VpAcceptAuthorizationRequestOptions,
1414
OpenId4VpFetchEntityConfigurationOptions,
15-
OpenId4VpResolvedAuthorizationRequest,
1615
OpenId4VpResolveTrustChainsOptions,
16+
OpenId4VpResolvedAuthorizationRequest,
1717
ParsedTransactionDataEntry,
1818
ResolveOpenId4VpAuthorizationRequestOptions,
1919
} from './OpenId4vpHolderServiceOptions'
@@ -30,6 +30,10 @@ import {
3030
getJwkFromJson,
3131
injectable,
3232
} from '@credo-ts/core'
33+
import {
34+
fetchEntityConfiguration as federationFetchEntityConfiguration,
35+
resolveTrustChains as federationResolveTrustChains,
36+
} from '@openid-federation/core'
3337
import {
3438
Openid4vpAuthorizationResponse,
3539
Openid4vpClient,
@@ -39,10 +43,6 @@ import {
3943
isOpenid4vpAuthorizationRequestDcApi,
4044
parseTransactionData,
4145
} from '@openid4vc/openid4vp'
42-
import {
43-
fetchEntityConfiguration as federationFetchEntityConfiguration,
44-
resolveTrustChains as federationResolveTrustChains,
45-
} from '@openid-federation/core'
4646

4747
import { getOid4vcCallbacks } from '../shared/callbacks'
4848

packages/openid4vc/src/openid4vc-issuer/router/federationEndpoint.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { OpenId4VcIssuanceRequest } from './requestContext'
21
import type { Buffer } from '@credo-ts/core'
3-
import type { Router, Response } from 'express'
2+
import type { Response, Router } from 'express'
3+
import type { OpenId4VcIssuanceRequest } from './requestContext'
44

5-
import { Key, getJwkFromKey, KeyType } from '@credo-ts/core'
5+
import { Key, KeyType, getJwkFromKey } from '@credo-ts/core'
66
import { createEntityConfiguration } from '@openid-federation/core'
77

88
import { getRequestContext, sendErrorResponse } from '../../shared/router'

packages/openid4vc/src/openid4vc-verifier/OpenId4VcVerifierModuleConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Router } from 'express'
22

3-
import { importExpress } from '../shared/router'
43
import { AgentContext } from '@credo-ts/core'
4+
import { importExpress } from '../shared/router'
55

66
export interface OpenId4VcVerifierModuleConfigOptions {
77
/**

packages/openid4vc/src/openid4vc-verifier/router/federationEndpoint.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import type { Buffer, Key } from '@credo-ts/core'
2+
import type { Response, Router } from 'express'
13
import type { OpenId4VcVerificationRequest } from './requestContext'
2-
import type { Key, Buffer } from '@credo-ts/core'
3-
import type { Router, Response } from 'express'
44

5-
import { getJwkFromJson, getJwkFromKey, JwsService, KeyType } from '@credo-ts/core'
5+
import { JwsService, KeyType, getJwkFromJson, getJwkFromKey } from '@credo-ts/core'
66
import { createEntityConfiguration, createEntityStatement, fetchEntityConfiguration } from '@openid-federation/core'
77

88
import { getRequestContext, sendErrorResponse } from '../../shared/router'

packages/openid4vc/src/shared/callbacks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import {
2727
} from '@credo-ts/core'
2828
import { clientAuthenticationDynamic, clientAuthenticationNone, decodeJwtHeader } from '@openid4vc/oauth2'
2929

30-
import { getKeyFromDid } from './utils'
3130
import { fetchEntityConfiguration, resolveTrustChains } from '@openid-federation/core'
31+
import { getKeyFromDid } from './utils'
3232

3333
export function getOid4vcJwtVerifyCallback(
3434
agentContext: AgentContext,

packages/openid4vc/tests/openid4vc-federation.e2e.test.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import type { AgentType, TenantType } from './utils'
2-
import type { OpenId4VcVerifierModuleConfig } from '../src'
31
import type { Server } from 'http'
2+
import type { OpenId4VcVerifierModuleConfig } from '../src'
3+
import type { AgentType, TenantType } from './utils'
44

55
import {
66
ClaimFormat,
77
DidsApi,
8+
DifPresentationExchangeService,
89
JwaSignatureAlgorithm,
910
W3cCredential,
1011
W3cCredentialSubject,
11-
w3cDate,
1212
W3cIssuer,
13-
DifPresentationExchangeService,
13+
w3cDate,
1414
} from '@credo-ts/core'
1515
import express, { type Express } from 'express'
1616

@@ -96,9 +96,8 @@ describe('OpenId4Vc-federation', () => {
9696
disclosureFrame: { _sd: ['university', 'degree'] },
9797
})),
9898
}
99-
} else {
100-
throw new Error('Invalid request')
10199
}
100+
throw new Error('Invalid request')
102101
},
103102
}),
104103
askar: new AskarModule(askarModuleConfig),
@@ -127,13 +126,13 @@ describe('OpenId4Vc-federation', () => {
127126
baseUrl: verificationBaseUrl,
128127
federation: {
129128
async isSubordinateEntity(agentContext, options) {
130-
if (federationConfig && federationConfig.isSubordinateEntity) {
129+
if (federationConfig?.isSubordinateEntity) {
131130
return federationConfig.isSubordinateEntity(agentContext, options)
132131
}
133132
return false
134133
},
135134
async getAuthorityHints(agentContext, options) {
136-
if (federationConfig && federationConfig.getAuthorityHints) {
135+
if (federationConfig?.getAuthorityHints) {
137136
return federationConfig.getAuthorityHints(agentContext, options)
138137
}
139138
return undefined
@@ -493,11 +492,11 @@ describe('OpenId4Vc-federation', () => {
493492
await verifierTenant2.endSession()
494493

495494
federationConfig = {
496-
isSubordinateEntity: async (agentContext, options) => {
495+
isSubordinateEntity: async (_agentContext, options) => {
497496
// When the verifier 2 gets asked if verifier 1 is a subordinate entity, it should return true
498497
return options.verifierId === openIdVerifierTenant2.verifierId
499498
},
500-
getAuthorityHints: async (agentContext, options) => {
499+
getAuthorityHints: async (_agentContext, options) => {
501500
// The verifier 1 says that the verifier 2 is above him
502501
return options.verifierId === openIdVerifierTenant1.verifierId
503502
? [`http://localhost:1234/oid4vp/${openIdVerifierTenant2.verifierId}`]
@@ -766,13 +765,13 @@ describe('OpenId4Vc-federation', () => {
766765

767766
// TODO: Look into this error see if we can make it more specific
768767
await expect(resolvedProofRequestWithFederationPromise).rejects.toThrow(
769-
`Error verifying the DID Auth Token signature.`
768+
'Error verifying the DID Auth Token signature.'
770769
)
771770

772771
const resolvedProofRequestWithoutFederationPromise =
773772
holderTenant.modules.openId4VcHolder.resolveSiopAuthorizationRequest(authorizationRequestUri2)
774773
await expect(resolvedProofRequestWithoutFederationPromise).rejects.toThrow(
775-
`Error verifying the DID Auth Token signature.`
774+
'Error verifying the DID Auth Token signature.'
776775
)
777776
})
778777
})

0 commit comments

Comments
 (0)