diff --git a/src/types.d.ts b/src/types.d.ts index bf675eba..739dfc32 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -164,7 +164,7 @@ export interface JWK { * @param token The consumed JWE or JWS token. */ export interface GetKeyFunction { - (protectedHeader: T, token: T2): Promise + (protectedHeader: T, token: T2): Promise | KeyLike | Uint8Array } /** diff --git a/test-deno/jwks.test.ts b/test-deno/jwks.test.ts index 034d4d17..6ecdef13 100644 --- a/test-deno/jwks.test.ts +++ b/test-deno/jwks.test.ts @@ -10,12 +10,12 @@ Deno.test('fetches the JWKSet', async () => { const { alg, kid } = response.keys[0] const jwks = createRemoteJWKSet(new URL(jwksUri)) await assertThrowsAsync( - () => jwks({ alg: 'RS256' }, {}), + async () => jwks({ alg: 'RS256' }, {}), errors.JWKSMultipleMatchingKeys, 'multiple matching keys found in the JSON Web Key Set', ) await assertThrowsAsync( - () => jwks({ kid: 'foo', alg: 'RS256' }, {}), + async () => jwks({ kid: 'foo', alg: 'RS256' }, {}), errors.JWKSNoMatchingKey, 'no applicable key found in the JSON Web Key Set', )