From 0489d20fd33dcad3b755deb43f889cfaa3693611 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 11 May 2019 23:40:22 -0600 Subject: [PATCH] typo fixes --- bin/telebit-remote.js | 7 ++++++- bin/telebitd.js | 4 +++- lib/keystore-fallback.js | 2 +- lib/rc/index.js | 2 +- package-lock.json | 36 ++++++++++++++++++++++-------------- package.json | 2 +- 6 files changed, 34 insertions(+), 19 deletions(-) diff --git a/bin/telebit-remote.js b/bin/telebit-remote.js index 933893c..99023ed 100755 --- a/bin/telebit-remote.js +++ b/bin/telebit-remote.js @@ -369,7 +369,12 @@ function parseConfig(err, text) { if (!state.config.relay || !state.config.token) { if (!state.config.relay) { - state.config.relay = 'telebit.cloud'; + try { + state.config.relay = 'telebit.cloud'; + } catch(e) { + console.error(state.config); + throw e; + } } //console.log("question the user?", Date.now()); diff --git a/bin/telebitd.js b/bin/telebitd.js index fe5c70e..0c22280 100755 --- a/bin/telebitd.js +++ b/bin/telebitd.js @@ -586,8 +586,10 @@ function jwtEggspress(req, res, next) { req.jwt = decodeJwt(jwt); } catch(e) { // ignore + next(); + return; } - if (!req.jwk.kid) { + if (!req.jwt.header.kid) { res.send({ error: { message: "JWT must include a SHA thumbprint as the 'kid' (key id)" } }); return; } diff --git a/lib/keystore-fallback.js b/lib/keystore-fallback.js index f0a91e2..227d49c 100644 --- a/lib/keystore-fallback.js +++ b/lib/keystore-fallback.js @@ -24,7 +24,7 @@ module.exports.create = function (opts) { return fs.unlink(f); } , findCredentials: function (/*service*/) { - return fs.readDir(opts.configDir).then(function (nodes) { + return fs.readdir(opts.configDir).then(function (nodes) { return Promise.all(nodes.filter(function (node) { return keyext === node.slice(-4); }).map(function (node) { diff --git a/lib/rc/index.js b/lib/rc/index.js index 66579f2..9ef2df6 100644 --- a/lib/rc/index.js +++ b/lib/rc/index.js @@ -150,7 +150,7 @@ module.exports.create = function (state) { , claims: { iss: false, exp: Math.round(Date.now()/1000) + (15 * 60) } //TODO , exp: '15m' }).then(function (jwt) { - req.setHeader("authorization", 'bearer ' + jwt); + req.setHeader("Authorization", 'Bearer ' + jwt); req.end(); }); } diff --git a/package-lock.json b/package-lock.json index 4fa8db7..4d43f49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -454,13 +454,21 @@ } }, "keytar": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/keytar/-/keytar-4.4.1.tgz", - "integrity": "sha512-6xEe7ybXSR5EZC+z0GI2yqLYZjV1tyPQY2xSZ8rGsBxrrLEh8VR/Lfqv59uGX+I+W+OZxH0jCXN1dU1++ify4g==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/keytar/-/keytar-4.6.0.tgz", + "integrity": "sha512-8wWWTC62QHvUvgW/QYyJv7X0GFZfp2Ykr5n3PuXKADro0Sv2RKvuYxbkzoZvsw33EDNAKnUTSA0/KLGN/MbwDw==", "optional": true, "requires": { - "nan": "2.12.1", - "prebuild-install": "5.2.4" + "nan": "2.13.2", + "prebuild-install": "5.3.0" + }, + "dependencies": { + "nan": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", + "optional": true + } } }, "le-challenge-fs": { @@ -577,9 +585,9 @@ "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" }, "node-abi": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.7.1.tgz", - "integrity": "sha512-OV8Bq1OrPh6z+Y4dqwo05HqrRL9YNF7QVMRfq1/pguwKLG+q9UB/Lk0x5qXjO23JjJg+/jqCHSTaG1P3tfKfuw==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.8.0.tgz", + "integrity": "sha512-1/aa2clS0pue0HjckL62CsbhWWU35HARvBDXcJtYKbYR7LnIutmpxmXbuDMV9kEviD2lP/wACOgWmmwljghHyQ==", "optional": true, "requires": { "semver": "^5.4.1" @@ -667,9 +675,9 @@ } }, "prebuild-install": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.2.4.tgz", - "integrity": "sha512-CG3JnpTZXdmr92GW4zbcba4jkDha6uHraJ7hW4Fn8j0mExxwOKK20hqho8ZuBDCKYCHYIkFM1P2jhtG+KpP4fg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.0.tgz", + "integrity": "sha512-aaLVANlj4HgZweKttFNUVNRxDukytuIuxeK2boIMHjagNJCiVKWFsKF4tCE3ql3GbrD2tExPQ7/pwtEJcHNZeg==", "optional": true, "requires": { "detect-libc": "^1.0.3", @@ -822,9 +830,9 @@ "integrity": "sha1-Az1go60g7PLgCUDRT5eCNGV3QzU=" }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "optional": true }, "send": { diff --git a/package.json b/package.json index 9a300ce..b0d7402 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "ws": "^6.0.0" }, "optionalDependencies": { - "keytar": "^4.4.1" + "keytar": "^4.6.0" }, "trulyOptionalDependencies": { "bluebird": "^3.5.1"