jose-node-esm-runtime
Advanced tools
Comparing version 4.14.3 to 4.14.4
import fetchJwks from '../runtime/fetch_jwks.js'; | ||
import { isCloudflareWorkers } from '../runtime/env.js'; | ||
import { JWKSInvalid, JWKSNoMatchingKey } from '../util/errors.js'; | ||
import { isJWKSLike, LocalJWKSet } from './local.js'; | ||
function isCloudflareWorkers() { | ||
return (typeof WebSocketPair !== 'undefined' || | ||
(typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers') || | ||
(typeof EdgeRuntime !== 'undefined' && EdgeRuntime === 'vercel')); | ||
} | ||
class RemoteJWKSet extends LocalJWKSet { | ||
@@ -6,0 +10,0 @@ constructor(url, options) { |
@@ -1,2 +0,1 @@ | ||
import { isCloudflareWorkers } from '../runtime/env.js'; | ||
function unusable(name, prop = 'algorithm.name') { | ||
@@ -76,7 +75,2 @@ return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`); | ||
if (key.algorithm.name !== 'Ed25519' && key.algorithm.name !== 'Ed448') { | ||
if (isCloudflareWorkers()) { | ||
if (isAlgorithm(key.algorithm, 'NODE-ED25519')) | ||
break; | ||
throw unusable('Ed25519, Ed448, or NODE-ED25519'); | ||
} | ||
throw unusable('Ed25519 or Ed448'); | ||
@@ -83,0 +77,0 @@ } |
{ | ||
"name": "jose-node-esm-runtime", | ||
"version": "4.14.3", | ||
"version": "4.14.4", | ||
"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
220915
116
5488