jose-node-esm-runtime
Advanced tools
Comparing version 5.1.1 to 5.1.2
@@ -12,3 +12,3 @@ import fetchJwks from '../runtime/fetch_jwks.js'; | ||
const NAME = 'jose'; | ||
const VERSION = 'v5.1.1'; | ||
const VERSION = 'v5.1.2'; | ||
USER_AGENT = `${NAME}/${VERSION}`; | ||
@@ -15,0 +15,0 @@ } |
@@ -33,11 +33,12 @@ import { JWTClaimValidationFailed, JWTExpired, JWTInvalid } from '../util/errors.js'; | ||
const { requiredClaims = [], issuer, subject, audience, maxTokenAge } = options; | ||
const presenceCheck = [...requiredClaims]; | ||
if (maxTokenAge !== undefined) | ||
requiredClaims.push('iat'); | ||
presenceCheck.push('iat'); | ||
if (audience !== undefined) | ||
requiredClaims.push('aud'); | ||
presenceCheck.push('aud'); | ||
if (subject !== undefined) | ||
requiredClaims.push('sub'); | ||
presenceCheck.push('sub'); | ||
if (issuer !== undefined) | ||
requiredClaims.push('iss'); | ||
for (const claim of new Set(requiredClaims.reverse())) { | ||
presenceCheck.push('iss'); | ||
for (const claim of new Set(presenceCheck.reverse())) { | ||
if (!(claim in payload)) { | ||
@@ -44,0 +45,0 @@ throw new JWTClaimValidationFailed(`missing required "${claim}" claim`, claim, 'missing'); |
{ | ||
"name": "jose-node-esm-runtime", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"homepage": "https://github.com/panva/jose", | ||
@@ -5,0 +5,0 @@ "repository": "panva/jose", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202094
5067