jose-browser-runtime
Advanced tools
Comparing version 5.9.3 to 5.9.4
@@ -13,3 +13,3 @@ import fetchJwks from '../runtime/fetch_jwks.js'; | ||
const NAME = 'jose'; | ||
const VERSION = 'v5.9.3'; | ||
const VERSION = 'v5.9.4'; | ||
USER_AGENT = `${NAME}/${VERSION}`; | ||
@@ -16,0 +16,0 @@ } |
export class JOSEError extends Error { | ||
static get code() { | ||
return 'ERR_JOSE_GENERIC'; | ||
} | ||
constructor(message) { | ||
super(message); | ||
constructor(message, options) { | ||
super(message, options); | ||
this.code = 'ERR_JOSE_GENERIC'; | ||
@@ -12,8 +9,6 @@ this.name = this.constructor.name; | ||
} | ||
JOSEError.code = 'ERR_JOSE_GENERIC'; | ||
export class JWTClaimValidationFailed extends JOSEError { | ||
static get code() { | ||
return 'ERR_JWT_CLAIM_VALIDATION_FAILED'; | ||
} | ||
constructor(message, payload, claim = 'unspecified', reason = 'unspecified') { | ||
super(message); | ||
super(message, { cause: { claim, reason, payload } }); | ||
this.code = 'ERR_JWT_CLAIM_VALIDATION_FAILED'; | ||
@@ -25,8 +20,6 @@ this.claim = claim; | ||
} | ||
JWTClaimValidationFailed.code = 'ERR_JWT_CLAIM_VALIDATION_FAILED'; | ||
export class JWTExpired extends JOSEError { | ||
static get code() { | ||
return 'ERR_JWT_EXPIRED'; | ||
} | ||
constructor(message, payload, claim = 'unspecified', reason = 'unspecified') { | ||
super(message); | ||
super(message, { cause: { claim, reason, payload } }); | ||
this.code = 'ERR_JWT_EXPIRED'; | ||
@@ -38,2 +31,3 @@ this.claim = claim; | ||
} | ||
JWTExpired.code = 'ERR_JWT_EXPIRED'; | ||
export class JOSEAlgNotAllowed extends JOSEError { | ||
@@ -44,6 +38,4 @@ constructor() { | ||
} | ||
static get code() { | ||
return 'ERR_JOSE_ALG_NOT_ALLOWED'; | ||
} | ||
} | ||
JOSEAlgNotAllowed.code = 'ERR_JOSE_ALG_NOT_ALLOWED'; | ||
export class JOSENotSupported extends JOSEError { | ||
@@ -54,16 +46,11 @@ constructor() { | ||
} | ||
static get code() { | ||
return 'ERR_JOSE_NOT_SUPPORTED'; | ||
} | ||
} | ||
JOSENotSupported.code = 'ERR_JOSE_NOT_SUPPORTED'; | ||
export class JWEDecryptionFailed extends JOSEError { | ||
constructor() { | ||
super(...arguments); | ||
constructor(message = 'decryption operation failed', options) { | ||
super(message, options); | ||
this.code = 'ERR_JWE_DECRYPTION_FAILED'; | ||
this.message = 'decryption operation failed'; | ||
} | ||
static get code() { | ||
return 'ERR_JWE_DECRYPTION_FAILED'; | ||
} | ||
} | ||
JWEDecryptionFailed.code = 'ERR_JWE_DECRYPTION_FAILED'; | ||
export class JWEInvalid extends JOSEError { | ||
@@ -74,6 +61,4 @@ constructor() { | ||
} | ||
static get code() { | ||
return 'ERR_JWE_INVALID'; | ||
} | ||
} | ||
JWEInvalid.code = 'ERR_JWE_INVALID'; | ||
export class JWSInvalid extends JOSEError { | ||
@@ -84,6 +69,4 @@ constructor() { | ||
} | ||
static get code() { | ||
return 'ERR_JWS_INVALID'; | ||
} | ||
} | ||
JWSInvalid.code = 'ERR_JWS_INVALID'; | ||
export class JWTInvalid extends JOSEError { | ||
@@ -94,6 +77,4 @@ constructor() { | ||
} | ||
static get code() { | ||
return 'ERR_JWT_INVALID'; | ||
} | ||
} | ||
JWTInvalid.code = 'ERR_JWT_INVALID'; | ||
export class JWKInvalid extends JOSEError { | ||
@@ -104,6 +85,4 @@ constructor() { | ||
} | ||
static get code() { | ||
return 'ERR_JWK_INVALID'; | ||
} | ||
} | ||
JWKInvalid.code = 'ERR_JWK_INVALID'; | ||
export class JWKSInvalid extends JOSEError { | ||
@@ -114,46 +93,32 @@ constructor() { | ||
} | ||
static get code() { | ||
return 'ERR_JWKS_INVALID'; | ||
} | ||
} | ||
JWKSInvalid.code = 'ERR_JWKS_INVALID'; | ||
export class JWKSNoMatchingKey extends JOSEError { | ||
constructor() { | ||
super(...arguments); | ||
constructor(message = 'no applicable key found in the JSON Web Key Set', options) { | ||
super(message, options); | ||
this.code = 'ERR_JWKS_NO_MATCHING_KEY'; | ||
this.message = 'no applicable key found in the JSON Web Key Set'; | ||
} | ||
static get code() { | ||
return 'ERR_JWKS_NO_MATCHING_KEY'; | ||
} | ||
} | ||
JWKSNoMatchingKey.code = 'ERR_JWKS_NO_MATCHING_KEY'; | ||
export class JWKSMultipleMatchingKeys extends JOSEError { | ||
constructor() { | ||
super(...arguments); | ||
constructor(message = 'multiple matching keys found in the JSON Web Key Set', options) { | ||
super(message, options); | ||
this.code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS'; | ||
this.message = 'multiple matching keys found in the JSON Web Key Set'; | ||
} | ||
static get code() { | ||
return 'ERR_JWKS_MULTIPLE_MATCHING_KEYS'; | ||
} | ||
} | ||
Symbol.asyncIterator; | ||
JWKSMultipleMatchingKeys.code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS'; | ||
export class JWKSTimeout extends JOSEError { | ||
constructor() { | ||
super(...arguments); | ||
constructor(message = 'request timed out', options) { | ||
super(message, options); | ||
this.code = 'ERR_JWKS_TIMEOUT'; | ||
this.message = 'request timed out'; | ||
} | ||
static get code() { | ||
return 'ERR_JWKS_TIMEOUT'; | ||
} | ||
} | ||
JWKSTimeout.code = 'ERR_JWKS_TIMEOUT'; | ||
export class JWSSignatureVerificationFailed extends JOSEError { | ||
constructor() { | ||
super(...arguments); | ||
constructor(message = 'signature verification failed', options) { | ||
super(message, options); | ||
this.code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED'; | ||
this.message = 'signature verification failed'; | ||
} | ||
static get code() { | ||
return 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED'; | ||
} | ||
} | ||
JWSSignatureVerificationFailed.code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED'; |
@@ -29,7 +29,7 @@ import type { KeyLike, JWSHeaderParameters, FlattenedJWSInput, JSONWebKeySet } from '../types'; | ||
* | ||
* import * as jose from 'jose' | ||
* | ||
* // Prerequisites | ||
* let url!: URL | ||
* let jwt!: string | ||
* let getPreviouslyCachedJWKS!: () => Promise<jose.ExportedJWKSCache> | ||
* let storeNewJWKScache!: (cache: jose.ExportedJWKSCache) => Promise<void> | ||
* | ||
@@ -36,0 +36,0 @@ * // Load JSON Web Key Set cache |
@@ -12,7 +12,9 @@ import type { JWTPayload, KeyLike } from '../types'; | ||
*/ | ||
static get code(): string; | ||
static code: string; | ||
/** A unique error code for this particular error subclass. */ | ||
code: string; | ||
/** @ignore */ | ||
constructor(message?: string); | ||
constructor(message?: string, options?: { | ||
cause?: unknown; | ||
}); | ||
} | ||
@@ -25,3 +27,3 @@ /** | ||
/** @ignore */ | ||
static get code(): 'ERR_JWT_CLAIM_VALIDATION_FAILED'; | ||
static code: string; | ||
code: string; | ||
@@ -48,3 +50,3 @@ /** The Claim for which the validation failed. */ | ||
/** @ignore */ | ||
static get code(): 'ERR_JWT_EXPIRED'; | ||
static code: string; | ||
code: string; | ||
@@ -71,3 +73,3 @@ /** The Claim for which the validation failed. */ | ||
/** @ignore */ | ||
static get code(): 'ERR_JOSE_ALG_NOT_ALLOWED'; | ||
static code: string; | ||
code: string; | ||
@@ -82,3 +84,3 @@ } | ||
/** @ignore */ | ||
static get code(): 'ERR_JOSE_NOT_SUPPORTED'; | ||
static code: string; | ||
code: string; | ||
@@ -92,5 +94,8 @@ } | ||
/** @ignore */ | ||
static get code(): 'ERR_JWE_DECRYPTION_FAILED'; | ||
static code: string; | ||
code: string; | ||
message: string; | ||
/** @ignore */ | ||
constructor(message?: string, options?: { | ||
cause?: unknown; | ||
}); | ||
} | ||
@@ -103,3 +108,3 @@ /** | ||
/** @ignore */ | ||
static get code(): 'ERR_JWE_INVALID'; | ||
static code: string; | ||
code: string; | ||
@@ -113,3 +118,3 @@ } | ||
/** @ignore */ | ||
static get code(): 'ERR_JWS_INVALID'; | ||
static code: string; | ||
code: string; | ||
@@ -123,3 +128,3 @@ } | ||
/** @ignore */ | ||
static get code(): 'ERR_JWT_INVALID'; | ||
static code: string; | ||
code: string; | ||
@@ -133,3 +138,3 @@ } | ||
/** @ignore */ | ||
static get code(): 'ERR_JWK_INVALID'; | ||
static code: string; | ||
code: string; | ||
@@ -143,3 +148,3 @@ } | ||
/** @ignore */ | ||
static get code(): 'ERR_JWKS_INVALID'; | ||
static code: string; | ||
code: string; | ||
@@ -153,5 +158,8 @@ } | ||
/** @ignore */ | ||
static get code(): 'ERR_JWKS_NO_MATCHING_KEY'; | ||
static code: string; | ||
code: string; | ||
message: string; | ||
/** @ignore */ | ||
constructor(message?: string, options?: { | ||
cause?: unknown; | ||
}); | ||
} | ||
@@ -165,5 +173,9 @@ /** | ||
[Symbol.asyncIterator]: () => AsyncIterableIterator<KeyLike>; | ||
static get code(): 'ERR_JWKS_MULTIPLE_MATCHING_KEYS'; | ||
/** @ignore */ | ||
static code: string; | ||
code: string; | ||
message: string; | ||
/** @ignore */ | ||
constructor(message?: string, options?: { | ||
cause?: unknown; | ||
}); | ||
} | ||
@@ -176,5 +188,8 @@ /** | ||
/** @ignore */ | ||
static get code(): 'ERR_JWKS_TIMEOUT'; | ||
static code: string; | ||
code: string; | ||
message: string; | ||
/** @ignore */ | ||
constructor(message?: string, options?: { | ||
cause?: unknown; | ||
}); | ||
} | ||
@@ -187,5 +202,8 @@ /** | ||
/** @ignore */ | ||
static get code(): 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED'; | ||
static code: string; | ||
code: string; | ||
message: string; | ||
/** @ignore */ | ||
constructor(message?: string, options?: { | ||
cause?: unknown; | ||
}); | ||
} |
{ | ||
"name": "jose-browser-runtime", | ||
"version": "5.9.3", | ||
"version": "5.9.4", | ||
"homepage": "https://github.com/panva/jose", | ||
@@ -5,0 +5,0 @@ "repository": "panva/jose", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
615219
13112