Skip to content

Commit 1a54e69

Browse files
committed
fix: nits
Signed-off-by: Martin Auer <martin.auer97@gmail.com>
1 parent 3c71599 commit 1a54e69

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/common/lib/jwt/Jwt.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export type JwtHeader = jwtDecodeJwtHeader & {
55
alg?: string;
66
x5c?: string[];
77
kid?: string;
8-
jwk?: JWK;
8+
jwk?: JWK & { kty: string };
99
jwt?: string;
1010
} & Record<string, unknown>;
1111

packages/common/lib/jwt/JwtVerifier.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const getDidJwtVerifier = (jwt: { header: JwtHeader; payload: JwtPayload
6363
if (!jwt.header.kid.includes('#')) {
6464
throw new Error(`Received an invalid JWT.. '${type}' contains an invalid kid header.`);
6565
}
66-
return { method: 'did', didUrl: jwt.header.kid, type: type, alg: jwt.header.alg as SigningAlgo };
66+
return { method: 'did', didUrl: jwt.header.kid, type: type, alg: jwt.header.alg };
6767
};
6868

6969
export const getX5cVerifier = (jwt: { header: JwtHeader; payload: JwtPayload }, options: { type: JwtType }): X5cJwtVerifier => {
@@ -79,7 +79,7 @@ export const getX5cVerifier = (jwt: { header: JwtHeader; payload: JwtPayload },
7979
throw new Error(`Received an invalid JWT. '${type}' contains an invalid iss claim.`);
8080
}
8181

82-
return { method: 'x5c', x5c: jwt.header.x5c, issuer: jwt.payload.iss, type: type, alg: jwt.header.alg as SigningAlgo };
82+
return { method: 'x5c', x5c: jwt.header.x5c, issuer: jwt.payload.iss, type: type, alg: jwt.header.alg };
8383
};
8484

8585
export const getJwkVerifier = async (jwt: { header: JwtHeader; payload: JwtPayload }, options: { type: JwtType }): Promise<JwkJwtVerifier> => {
@@ -91,7 +91,7 @@ export const getJwkVerifier = async (jwt: { header: JwtHeader; payload: JwtPaylo
9191
throw new Error(`Received an invalid JWT. '${type}' contains an invalid jwk header.`);
9292
}
9393

94-
return { method: 'jwk', type, jwk: jwt.header.jwk, alg: jwt.header.alg as SigningAlgo };
94+
return { method: 'jwk', type, jwk: jwt.header.jwk, alg: jwt.header.alg };
9595
};
9696

9797
export const getJwtVerifierWithContext = async (

packages/siop-oid4vp/lib/types/VpJwtVerifier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export const getRequestObjectJwtVerifier = async (
145145
}
146146
// The iss claim value of the Verifier Attestation JWT MUST identify a party the Wallet trusts for issuing Verifier Attestation JWTs.
147147
// If the Wallet cannot establish trust, it MUST refuse the request.
148-
return { method: 'jwk', type, jwk: attestationPayload.cnf['jwk'] as JWK, alg: (jwk.alg ?? attestationHeader.alg) as SigningAlgo }
148+
return { method: 'jwk', type, jwk: attestationPayload.cnf['jwk'] as JWK, alg: jwk.alg ?? attestationHeader.alg }
149149
} else if (clientIdScheme === 'entity_id') {
150150
if (!clientId.startsWith('http')) {
151151
throw new Error(SIOPErrors.INVALID_REQUEST_OBJECT_ENTITY_ID_SCHEME_CLIENT_ID)

0 commit comments

Comments
 (0)