jose-browser-runtime
Advanced tools
Comparing version 4.7.0 to 4.8.0
@@ -13,3 +13,3 @@ import fetchJwks from '../runtime/fetch_jwks.js'; | ||
this._url = new URL(url.href); | ||
this._options = { agent: options === null || options === void 0 ? void 0 : options.agent }; | ||
this._options = { agent: options === null || options === void 0 ? void 0 : options.agent, headers: options === null || options === void 0 ? void 0 : options.headers }; | ||
this._timeoutDuration = | ||
@@ -16,0 +16,0 @@ typeof (options === null || options === void 0 ? void 0 : options.timeoutDuration) === 'number' ? options === null || options === void 0 ? void 0 : options.timeoutDuration : 5000; |
import { JOSEError, JWKSTimeout } from '../util/errors.js'; | ||
const fetchJwks = async (url, timeout) => { | ||
const fetchJwks = async (url, timeout, options) => { | ||
let controller; | ||
@@ -16,2 +16,3 @@ let id; | ||
redirect: 'manual', | ||
headers: options.headers, | ||
}).catch((err) => { | ||
@@ -18,0 +19,0 @@ if (timedOut) |
export default crypto; | ||
export function isCryptoKey(key) { | ||
try { | ||
return (key != null && | ||
typeof key.extractable === 'boolean' && | ||
typeof key.algorithm.name === 'string' && | ||
typeof key.type === 'string'); | ||
} | ||
catch (_a) { | ||
return false; | ||
} | ||
} | ||
export const isCryptoKey = (key) => key instanceof CryptoKey; |
@@ -35,2 +35,6 @@ import type { JWSHeaderParameters, FlattenedJWSInput, GetKeyFunction } from '../types'; | ||
agent?: any; | ||
/** | ||
* Optional headers to be sent with the HTTP request. | ||
*/ | ||
headers?: Record<string, string>; | ||
} | ||
@@ -37,0 +41,0 @@ interface URL { |
{ | ||
"name": "jose-browser-runtime", | ||
"version": "4.7.0", | ||
"version": "4.8.0", | ||
"homepage": "https://github.com/panva/jose", | ||
@@ -14,3 +14,4 @@ "repository": "panva/jose", | ||
".": { | ||
"browser": "./dist/browser/index.js" | ||
"browser": "./dist/browser/index.js", | ||
"worker": "./dist/browser/index.js" | ||
}, | ||
@@ -17,0 +18,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
216114
5667