From 7b8f9c9cadebed1745b18388618511f2895513d1 Mon Sep 17 00:00:00 2001 From: Mahendra Date: Sun, 3 Jul 2022 13:17:08 +0530 Subject: [PATCH 1/2] fix: add missing types 'requiredClaims' and 'checkTyp' to VerifierOptions --- src/index.d.ts | 2 ++ test/types.spec.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index 768645b..a267a9b 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -104,6 +104,8 @@ export interface VerifierOptions { maxAge: number clockTimestamp: number clockTolerance: number + requiredClaims: Array + checkTyp:string } export interface PrivateKey { diff --git a/test/types.spec.ts b/test/types.spec.ts index 4586e38..e850e0b 100644 --- a/test/types.spec.ts +++ b/test/types.spec.ts @@ -38,7 +38,7 @@ decoder(Buffer.from('FOO')) // Verifying // String key, both async/callback styles -const verifierSync = createVerifier({ key: 'KEY', algorithms: ['RS256'] }) +const verifierSync = createVerifier({ key: 'KEY', algorithms: ['RS256'], requiredClaims: ['aud'], checkTyp: 'JWT' }) verifierSync('2134') const verifierAsync = createVerifier({ key: () => 'KEY', algorithms: ['RS256'] }) From cb120777320fe5fe3589ab4559fffd91f1c27ec5 Mon Sep 17 00:00:00 2001 From: Mahendra Kumar Date: Sun, 3 Jul 2022 16:23:42 +0530 Subject: [PATCH 2/2] Update linting Co-authored-by: Simone Busoli --- src/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index a267a9b..8239207 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -105,7 +105,7 @@ export interface VerifierOptions { clockTimestamp: number clockTolerance: number requiredClaims: Array - checkTyp:string + checkTyp: string } export interface PrivateKey {