jose-node-esm-runtime
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -1,16 +0,20 @@ | ||
import { get as http } from 'http'; | ||
import { get as https } from 'https'; | ||
import * as http from 'http'; | ||
import * as https from 'https'; | ||
import { once } from 'events'; | ||
import { JOSEError, JWKSTimeout } from '../util/errors.js'; | ||
import { concat, decoder } from '../lib/buffer_utils.js'; | ||
const protocols = { | ||
'https:': https, | ||
'http:': http, | ||
}; | ||
const fetchJwks = async (url, timeout, options) => { | ||
if (protocols[url.protocol] === undefined) { | ||
throw new TypeError('Unsupported URL protocol.'); | ||
let get; | ||
switch (url.protocol) { | ||
case 'https:': | ||
get = https.get; | ||
break; | ||
case 'http:': | ||
get = http.get; | ||
break; | ||
default: | ||
throw new TypeError('Unsupported URL protocol.'); | ||
} | ||
const { agent } = options; | ||
const req = protocols[url.protocol](url.href, { | ||
const req = get(url.href, { | ||
agent, | ||
@@ -17,0 +21,0 @@ timeout, |
@@ -17,2 +17,3 @@ export { compactDecrypt } from './jwe/compact/decrypt'; | ||
export type { JWTDecryptOptions, JWTDecryptGetKey } from './jwt/decrypt'; | ||
export type { ProduceJWT } from './jwt/produce'; | ||
export { CompactEncrypt } from './jwe/compact/encrypt'; | ||
@@ -19,0 +20,0 @@ export { FlattenedEncrypt } from './jwe/flattened/encrypt'; |
{ | ||
"name": "jose-node-esm-runtime", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "(Node.JS ESM Runtime) 'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
167603
4211