use updated @root/request

This commit is contained in:
AJ ONeal 2020-04-08 16:07:34 -04:00
parent aba70bf0ff
commit d1acc8d635
3 changed files with 11 additions and 13 deletions

View File

@ -2,8 +2,7 @@
var keyfetch = module.exports;
var promisify = require("util").promisify;
var requestAsync = promisify(require("@coolaj86/urequest"));
var request = require("@root/request");
var Rasha = require("rasha");
var Eckles = require("eckles");
var mincache = 1 * 60 * 60;
@ -34,7 +33,7 @@ keyfetch.init = function (opts) {
};
keyfetch._oidc = function (iss) {
return Promise.resolve().then(function () {
return requestAsync({
return request({
url: normalizeIss(iss) + "/.well-known/openid-configuration",
json: true
}).then(function (resp) {
@ -52,7 +51,7 @@ keyfetch._wellKnownJwks = function (iss) {
});
};
keyfetch._jwks = function (iss) {
return requestAsync({ url: iss, json: true }).then(function (resp) {
return request({ url: iss, json: true }).then(function (resp) {
return Promise.all(
resp.body.keys.map(function (jwk) {
// EC keys have an x values, whereas RSA keys do not

10
package-lock.json generated
View File

@ -1,13 +1,13 @@
{
"name": "keyfetch",
"version": "1.1.8",
"version": "1.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@coolaj86/urequest": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/@coolaj86/urequest/-/urequest-1.3.7.tgz",
"integrity": "sha512-PPrVYra9aWvZjSCKl/x1pJ9ZpXda1652oJrPBYy5rQumJJMkmTBN3ux+sK2xAUwVvv2wnewDlaQaHLxLwSHnIA=="
"@root/request": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@root/request/-/request-1.5.0.tgz",
"integrity": "sha512-J9RUIwVU99/cOVuDVYlNpr4G0A1/3ZxhCXIRiTZzu8RntOnb0lmDBMckhaus5ry9x/dBqJKDplFIgwHbLi6rLA=="
},
"eckles": {
"version": "1.4.1",

View File

@ -1,12 +1,12 @@
{
"name": "keyfetch",
"version": "1.2.1",
"version": "1.3.0",
"description": "Lightweight support for fetching JWKs.",
"homepage": "https://git.coolaj86.com/coolaj86/keyfetch.js",
"main": "keyfetch.js",
"files": [],
"dependencies": {
"@coolaj86/urequest": "^1.3.7",
"@root/request": "^1.5.0",
"eckles": "^1.4.1",
"rasha": "^1.2.4"
},
@ -30,7 +30,6 @@
"OIDC",
"well-known"
],
"author": "AJ ONeal <solderjs@gmail.com> (https://coolaj86.com/)",
"author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)",
"license": "MPL-2.0"
}