Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jose

Package Overview
Dependencies
Maintainers
1
Versions
213
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jose - npm Package Compare versions

Comparing version 5.9.3 to 5.9.4

2

dist/browser/jwks/remote.js

@@ -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';

@@ -16,3 +16,3 @@ "use strict";

const NAME = 'jose';
const VERSION = 'v5.9.3';
const VERSION = 'v5.9.4';
USER_AGENT = `${NAME}/${VERSION}`;

@@ -19,0 +19,0 @@ }

@@ -5,8 +5,6 @@ "use strict";

class JOSEError extends Error {
static get code() {
return 'ERR_JOSE_GENERIC';
}
static code = 'ERR_JOSE_GENERIC';
code = 'ERR_JOSE_GENERIC';
constructor(message) {
super(message);
constructor(message, options) {
super(message, options);
this.name = this.constructor.name;

@@ -18,5 +16,3 @@ Error.captureStackTrace?.(this, this.constructor);

class JWTClaimValidationFailed extends JOSEError {
static get code() {
return 'ERR_JWT_CLAIM_VALIDATION_FAILED';
}
static code = 'ERR_JWT_CLAIM_VALIDATION_FAILED';
code = 'ERR_JWT_CLAIM_VALIDATION_FAILED';

@@ -27,3 +23,3 @@ claim;

constructor(message, payload, claim = 'unspecified', reason = 'unspecified') {
super(message);
super(message, { cause: { claim, reason, payload } });
this.claim = claim;

@@ -36,5 +32,3 @@ this.reason = reason;

class JWTExpired extends JOSEError {
static get code() {
return 'ERR_JWT_EXPIRED';
}
static code = 'ERR_JWT_EXPIRED';
code = 'ERR_JWT_EXPIRED';

@@ -45,3 +39,3 @@ claim;

constructor(message, payload, claim = 'unspecified', reason = 'unspecified') {
super(message);
super(message, { cause: { claim, reason, payload } });
this.claim = claim;

@@ -54,5 +48,3 @@ this.reason = reason;

class JOSEAlgNotAllowed extends JOSEError {
static get code() {
return 'ERR_JOSE_ALG_NOT_ALLOWED';
}
static code = 'ERR_JOSE_ALG_NOT_ALLOWED';
code = 'ERR_JOSE_ALG_NOT_ALLOWED';

@@ -62,5 +54,3 @@ }

class JOSENotSupported extends JOSEError {
static get code() {
return 'ERR_JOSE_NOT_SUPPORTED';
}
static code = 'ERR_JOSE_NOT_SUPPORTED';
code = 'ERR_JOSE_NOT_SUPPORTED';

@@ -70,13 +60,11 @@ }

class JWEDecryptionFailed extends JOSEError {
static get code() {
return 'ERR_JWE_DECRYPTION_FAILED';
static code = 'ERR_JWE_DECRYPTION_FAILED';
code = 'ERR_JWE_DECRYPTION_FAILED';
constructor(message = 'decryption operation failed', options) {
super(message, options);
}
code = 'ERR_JWE_DECRYPTION_FAILED';
message = 'decryption operation failed';
}
exports.JWEDecryptionFailed = JWEDecryptionFailed;
class JWEInvalid extends JOSEError {
static get code() {
return 'ERR_JWE_INVALID';
}
static code = 'ERR_JWE_INVALID';
code = 'ERR_JWE_INVALID';

@@ -86,5 +74,3 @@ }

class JWSInvalid extends JOSEError {
static get code() {
return 'ERR_JWS_INVALID';
}
static code = 'ERR_JWS_INVALID';
code = 'ERR_JWS_INVALID';

@@ -94,5 +80,3 @@ }

class JWTInvalid extends JOSEError {
static get code() {
return 'ERR_JWT_INVALID';
}
static code = 'ERR_JWT_INVALID';
code = 'ERR_JWT_INVALID';

@@ -102,5 +86,3 @@ }

class JWKInvalid extends JOSEError {
static get code() {
return 'ERR_JWK_INVALID';
}
static code = 'ERR_JWK_INVALID';
code = 'ERR_JWK_INVALID';

@@ -110,5 +92,3 @@ }

class JWKSInvalid extends JOSEError {
static get code() {
return 'ERR_JWKS_INVALID';
}
static code = 'ERR_JWKS_INVALID';
code = 'ERR_JWKS_INVALID';

@@ -118,7 +98,7 @@ }

class JWKSNoMatchingKey extends JOSEError {
static get code() {
return 'ERR_JWKS_NO_MATCHING_KEY';
static code = 'ERR_JWKS_NO_MATCHING_KEY';
code = 'ERR_JWKS_NO_MATCHING_KEY';
constructor(message = 'no applicable key found in the JSON Web Key Set', options) {
super(message, options);
}
code = 'ERR_JWKS_NO_MATCHING_KEY';
message = 'no applicable key found in the JSON Web Key Set';
}

@@ -128,24 +108,24 @@ exports.JWKSNoMatchingKey = JWKSNoMatchingKey;

[Symbol.asyncIterator];
static get code() {
return 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
static code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
constructor(message = 'multiple matching keys found in the JSON Web Key Set', options) {
super(message, options);
}
code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
message = 'multiple matching keys found in the JSON Web Key Set';
}
exports.JWKSMultipleMatchingKeys = JWKSMultipleMatchingKeys;
class JWKSTimeout extends JOSEError {
static get code() {
return 'ERR_JWKS_TIMEOUT';
static code = 'ERR_JWKS_TIMEOUT';
code = 'ERR_JWKS_TIMEOUT';
constructor(message = 'request timed out', options) {
super(message, options);
}
code = 'ERR_JWKS_TIMEOUT';
message = 'request timed out';
}
exports.JWKSTimeout = JWKSTimeout;
class JWSSignatureVerificationFailed extends JOSEError {
static get code() {
return 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED';
static code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED';
code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED';
constructor(message = 'signature verification failed', options) {
super(message, options);
}
code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED';
message = 'signature verification failed';
}
exports.JWSSignatureVerificationFailed = JWSSignatureVerificationFailed;

@@ -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';
}
static code = 'ERR_JOSE_GENERIC';
code = 'ERR_JOSE_GENERIC';
constructor(message) {
super(message);
constructor(message, options) {
super(message, options);
this.name = this.constructor.name;

@@ -13,5 +11,3 @@ Error.captureStackTrace?.(this, this.constructor);

export class JWTClaimValidationFailed extends JOSEError {
static get code() {
return 'ERR_JWT_CLAIM_VALIDATION_FAILED';
}
static code = 'ERR_JWT_CLAIM_VALIDATION_FAILED';
code = 'ERR_JWT_CLAIM_VALIDATION_FAILED';

@@ -22,3 +18,3 @@ claim;

constructor(message, payload, claim = 'unspecified', reason = 'unspecified') {
super(message);
super(message, { cause: { claim, reason, payload } });
this.claim = claim;

@@ -30,5 +26,3 @@ this.reason = reason;

export class JWTExpired extends JOSEError {
static get code() {
return 'ERR_JWT_EXPIRED';
}
static code = 'ERR_JWT_EXPIRED';
code = 'ERR_JWT_EXPIRED';

@@ -39,3 +33,3 @@ claim;

constructor(message, payload, claim = 'unspecified', reason = 'unspecified') {
super(message);
super(message, { cause: { claim, reason, payload } });
this.claim = claim;

@@ -47,78 +41,64 @@ this.reason = reason;

export class JOSEAlgNotAllowed extends JOSEError {
static get code() {
return 'ERR_JOSE_ALG_NOT_ALLOWED';
}
static code = 'ERR_JOSE_ALG_NOT_ALLOWED';
code = 'ERR_JOSE_ALG_NOT_ALLOWED';
}
export class JOSENotSupported extends JOSEError {
static get code() {
return 'ERR_JOSE_NOT_SUPPORTED';
}
static code = 'ERR_JOSE_NOT_SUPPORTED';
code = 'ERR_JOSE_NOT_SUPPORTED';
}
export class JWEDecryptionFailed extends JOSEError {
static get code() {
return 'ERR_JWE_DECRYPTION_FAILED';
static code = 'ERR_JWE_DECRYPTION_FAILED';
code = 'ERR_JWE_DECRYPTION_FAILED';
constructor(message = 'decryption operation failed', options) {
super(message, options);
}
code = 'ERR_JWE_DECRYPTION_FAILED';
message = 'decryption operation failed';
}
export class JWEInvalid extends JOSEError {
static get code() {
return 'ERR_JWE_INVALID';
}
static code = 'ERR_JWE_INVALID';
code = 'ERR_JWE_INVALID';
}
export class JWSInvalid extends JOSEError {
static get code() {
return 'ERR_JWS_INVALID';
}
static code = 'ERR_JWS_INVALID';
code = 'ERR_JWS_INVALID';
}
export class JWTInvalid extends JOSEError {
static get code() {
return 'ERR_JWT_INVALID';
}
static code = 'ERR_JWT_INVALID';
code = 'ERR_JWT_INVALID';
}
export class JWKInvalid extends JOSEError {
static get code() {
return 'ERR_JWK_INVALID';
}
static code = 'ERR_JWK_INVALID';
code = 'ERR_JWK_INVALID';
}
export class JWKSInvalid extends JOSEError {
static get code() {
return 'ERR_JWKS_INVALID';
}
static code = 'ERR_JWKS_INVALID';
code = 'ERR_JWKS_INVALID';
}
export class JWKSNoMatchingKey extends JOSEError {
static get code() {
return 'ERR_JWKS_NO_MATCHING_KEY';
static code = 'ERR_JWKS_NO_MATCHING_KEY';
code = 'ERR_JWKS_NO_MATCHING_KEY';
constructor(message = 'no applicable key found in the JSON Web Key Set', options) {
super(message, options);
}
code = 'ERR_JWKS_NO_MATCHING_KEY';
message = 'no applicable key found in the JSON Web Key Set';
}
export class JWKSMultipleMatchingKeys extends JOSEError {
[Symbol.asyncIterator];
static get code() {
return 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
static code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
constructor(message = 'multiple matching keys found in the JSON Web Key Set', options) {
super(message, options);
}
code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
message = 'multiple matching keys found in the JSON Web Key Set';
}
export class JWKSTimeout extends JOSEError {
static get code() {
return 'ERR_JWKS_TIMEOUT';
static code = 'ERR_JWKS_TIMEOUT';
code = 'ERR_JWKS_TIMEOUT';
constructor(message = 'request timed out', options) {
super(message, options);
}
code = 'ERR_JWKS_TIMEOUT';
message = 'request timed out';
}
export class JWSSignatureVerificationFailed extends JOSEError {
static get code() {
return 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED';
static code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED';
code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED';
constructor(message = 'signature verification failed', options) {
super(message, options);
}
code = 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED';
message = '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",
"version": "5.9.3",
"version": "5.9.4",
"description": "JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",

@@ -5,0 +5,0 @@ "keywords": [

@@ -5,2 +5,12 @@ # jose

## Sponsor
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./sponsor/Auth0byOkta_dark.png">
<source media="(prefers-color-scheme: light)" srcset="./sponsor/Auth0byOkta_light.png">
<img height="65" align="left" alt="Auth0 by Okta" src="./sponsor/Auth0byOkta_light.png">
</picture>
If you want to quickly add JWT authentication to JavaScript apps, feel free to check out Auth0's JavaScript SDK and free plan. [Create an Auth0 account; it's free!][sponsor-auth0]<br><br>
## [💗 Help the project](https://github.com/sponsors/panva)

@@ -139,1 +149,3 @@

</details>
[sponsor-auth0]: https://auth0.com/signup?utm_source=external_sites&utm_medium=panva&utm_campaign=devn_signup
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc