jose-node-esm-runtime
Advanced tools
Comparing version 5.2.0 to 5.2.1
@@ -134,3 +134,3 @@ import { decode as base64url } from '../../runtime/base64url.js'; | ||
} | ||
let plaintext = await decrypt(enc, cek, ciphertext, iv, tag, additionalData); | ||
const plaintext = await decrypt(enc, cek, ciphertext, iv, tag, additionalData); | ||
const result = { plaintext }; | ||
@@ -137,0 +137,0 @@ if (jwe.protected !== undefined) { |
@@ -79,3 +79,3 @@ import { FlattenedEncrypt, unprotected } from '../flattened/encrypt.js'; | ||
.encrypt(recipient.key, { ...recipient.options }); | ||
let jwe = { | ||
const jwe = { | ||
ciphertext: flattened.ciphertext, | ||
@@ -131,3 +131,3 @@ iv: flattened.iv, | ||
const cek = generateCek(enc); | ||
let jwe = { | ||
const jwe = { | ||
ciphertext: '', | ||
@@ -134,0 +134,0 @@ iv: '', |
@@ -83,3 +83,3 @@ import { importJWK } from '../key/import.js'; | ||
} | ||
else if (length !== 1) { | ||
if (length !== 1) { | ||
const error = new JWKSMultipleMatchingKeys(); | ||
@@ -92,5 +92,3 @@ const { _cached } = this; | ||
} | ||
catch { | ||
continue; | ||
} | ||
catch { } | ||
} | ||
@@ -116,5 +114,3 @@ }; | ||
const set = new LocalJWKSet(jwks); | ||
return async function (protectedHeader, token) { | ||
return set.getKey(protectedHeader, token); | ||
}; | ||
return async (protectedHeader, token) => set.getKey(protectedHeader, token); | ||
} |
@@ -12,3 +12,3 @@ import fetchJwks from '../runtime/fetch_jwks.js'; | ||
const NAME = 'jose'; | ||
const VERSION = 'v5.2.0'; | ||
const VERSION = 'v5.2.1'; | ||
USER_AGENT = `${NAME}/${VERSION}`; | ||
@@ -92,5 +92,3 @@ } | ||
const set = new RemoteJWKSet(url, options); | ||
return async function (protectedHeader, token) { | ||
return set.getKey(protectedHeader, token); | ||
}; | ||
return async (protectedHeader, token) => set.getKey(protectedHeader, token); | ||
} |
@@ -9,6 +9,6 @@ import digest from '../runtime/digest.js'; | ||
let i = 0; | ||
buffers.forEach((buffer) => { | ||
for (const buffer of buffers) { | ||
buf.set(buffer, i); | ||
i += buffer.length; | ||
}); | ||
} | ||
return buf; | ||
@@ -15,0 +15,0 @@ } |
@@ -19,3 +19,3 @@ function message(msg, actual, ...types) { | ||
else if (typeof actual === 'object' && actual != null) { | ||
if (actual.constructor && actual.constructor.name) { | ||
if (actual.constructor?.name) { | ||
msg += ` Received an instance of ${actual.constructor.name}`; | ||
@@ -22,0 +22,0 @@ } |
@@ -28,3 +28,3 @@ import { JOSENotSupported } from '../util/errors.js'; | ||
} | ||
else if (recognized.get(parameter) && protectedHeader[parameter] === undefined) { | ||
if (recognized.get(parameter) && protectedHeader[parameter] === undefined) { | ||
throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`); | ||
@@ -31,0 +31,0 @@ } |
@@ -78,3 +78,3 @@ import { createSecretKey, generateKeyPair as generateKeyPairCb } from 'node:crypto'; | ||
case 'ECDH-ES+A192KW': | ||
case 'ECDH-ES+A256KW': | ||
case 'ECDH-ES+A256KW': { | ||
const crv = options?.crv ?? 'P-256'; | ||
@@ -94,2 +94,3 @@ switch (crv) { | ||
} | ||
} | ||
default: | ||
@@ -96,0 +97,0 @@ throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value'); |
@@ -44,3 +44,3 @@ import { KeyObject } from 'node:crypto'; | ||
case 'ec': { | ||
let namedCurve = key.asymmetricKeyDetails.namedCurve; | ||
const namedCurve = key.asymmetricKeyDetails.namedCurve; | ||
if (raw) { | ||
@@ -47,0 +47,0 @@ return namedCurve; |
@@ -14,3 +14,3 @@ import type { JWK, KeyLike } from '../types'; | ||
* | ||
* @param pem PEM-encoded SPKI string | ||
* @param spki PEM-encoded SPKI string | ||
* @param alg (Only effective in Web Crypto API runtimes) JSON Web Algorithm identifier to be used | ||
@@ -25,3 +25,3 @@ * with the imported key, its presence is only enforced in Web Crypto API runtimes. See | ||
* | ||
* @param pem X.509 certificate string | ||
* @param x509 X.509 certificate string | ||
* @param alg (Only effective in Web Crypto API runtimes) JSON Web Algorithm identifier to be used | ||
@@ -36,3 +36,3 @@ * with the imported key, its presence is only enforced in Web Crypto API runtimes. See | ||
* | ||
* @param pem PEM-encoded PKCS#8 string | ||
* @param pkcs8 PEM-encoded PKCS#8 string | ||
* @param alg (Only effective in Web Crypto API runtimes) JSON Web Algorithm identifier to be used | ||
@@ -39,0 +39,0 @@ * with the imported key, its presence is only enforced in Web Crypto API runtimes. See |
@@ -7,6 +7,11 @@ import type { KeyLike } from '../types'; | ||
export declare class JOSEError extends Error { | ||
/** A unique error code for the particular error subclass. */ | ||
/** | ||
* A unique error code for the particular error subclass. | ||
* | ||
* @ignore | ||
*/ | ||
static get code(): string; | ||
/** A unique error code for the particular error subclass. */ | ||
/** A unique error code for this particular error subclass. */ | ||
code: string; | ||
/** @ignore */ | ||
constructor(message?: string); | ||
@@ -19,2 +24,3 @@ } | ||
export declare class JWTClaimValidationFailed extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JWT_CLAIM_VALIDATION_FAILED'; | ||
@@ -26,2 +32,3 @@ code: string; | ||
reason: string; | ||
/** @ignore */ | ||
constructor(message: string, claim?: string, reason?: string); | ||
@@ -34,2 +41,3 @@ } | ||
export declare class JWTExpired extends JOSEError implements JWTClaimValidationFailed { | ||
/** @ignore */ | ||
static get code(): 'ERR_JWT_EXPIRED'; | ||
@@ -41,2 +49,3 @@ code: string; | ||
reason: string; | ||
/** @ignore */ | ||
constructor(message: string, claim?: string, reason?: string); | ||
@@ -49,2 +58,3 @@ } | ||
export declare class JOSEAlgNotAllowed extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JOSE_ALG_NOT_ALLOWED'; | ||
@@ -59,2 +69,3 @@ code: string; | ||
export declare class JOSENotSupported extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JOSE_NOT_SUPPORTED'; | ||
@@ -68,2 +79,3 @@ code: string; | ||
export declare class JWEDecryptionFailed extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JWE_DECRYPTION_FAILED'; | ||
@@ -78,2 +90,3 @@ code: string; | ||
export declare class JWEInvalid extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JWE_INVALID'; | ||
@@ -87,2 +100,3 @@ code: string; | ||
export declare class JWSInvalid extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JWS_INVALID'; | ||
@@ -96,2 +110,3 @@ code: string; | ||
export declare class JWTInvalid extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JWT_INVALID'; | ||
@@ -105,2 +120,3 @@ code: string; | ||
export declare class JWKInvalid extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JWK_INVALID'; | ||
@@ -114,2 +130,3 @@ code: string; | ||
export declare class JWKSInvalid extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JWKS_INVALID'; | ||
@@ -123,2 +140,3 @@ code: string; | ||
export declare class JWKSNoMatchingKey extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JWKS_NO_MATCHING_KEY'; | ||
@@ -144,2 +162,3 @@ code: string; | ||
export declare class JWKSTimeout extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JWKS_TIMEOUT'; | ||
@@ -154,2 +173,3 @@ code: string; | ||
export declare class JWSSignatureVerificationFailed extends JOSEError { | ||
/** @ignore */ | ||
static get code(): 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED'; | ||
@@ -156,0 +176,0 @@ code: string; |
{ | ||
"name": "jose-node-esm-runtime", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"homepage": "https://github.com/panva/jose", | ||
@@ -15,4 +15,2 @@ "repository": "panva/jose", | ||
"types": "./dist/types/index.d.ts", | ||
"bun": "./dist/browser/index.js", | ||
"worker": "./dist/browser/index.js", | ||
"import": "./dist/node/esm/index.js" | ||
@@ -22,17 +20,7 @@ }, | ||
"types": "./dist/types/util/errors.d.ts", | ||
"bun": "./dist/browser/util/errors.js", | ||
"deno": "./dist/browser/util/errors.js", | ||
"browser": "./dist/browser/util/errors.js", | ||
"worker": "./dist/browser/util/errors.js", | ||
"import": "./dist/node/esm/util/errors.js", | ||
"require": "./dist/node/cjs/util/errors.js" | ||
"import": "./dist/node/esm/util/errors.js" | ||
}, | ||
"./base64url": { | ||
"types": "./dist/types/util/base64url.d.ts", | ||
"bun": "./dist/browser/util/base64url.js", | ||
"deno": "./dist/browser/util/base64url.js", | ||
"browser": "./dist/browser/util/base64url.js", | ||
"worker": "./dist/browser/util/base64url.js", | ||
"import": "./dist/node/esm/util/base64url.js", | ||
"require": "./dist/node/cjs/util/base64url.js" | ||
"import": "./dist/node/esm/util/base64url.js" | ||
}, | ||
@@ -39,0 +27,0 @@ "./package.json": "./package.json" |
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
5149
206027