Skip to content

Commit

Permalink
fix: add missing types 'requiredClaims' and 'checkTyp' to VerifierOpt…
Browse files Browse the repository at this point in the history
…ions (#251)

* fix: add missing types 'requiredClaims' and 'checkTyp' to VerifierOptions

* Update linting

Co-authored-by: Simone Busoli <simone.busoli@gmail.com>

Co-authored-by: Simone Busoli <simone.busoli@gmail.com>
  • Loading branch information
mahendraHegde and simoneb authored Jul 10, 2022
1 parent adb2eb2 commit 29c29ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export interface VerifierOptions {
maxAge: number
clockTimestamp: number
clockTolerance: number
requiredClaims: Array<string>
checkTyp: string
}

export interface PrivateKey {
Expand Down
2 changes: 1 addition & 1 deletion test/types.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'] })
Expand Down

0 comments on commit 29c29ae

Please sign in to comment.