From c060689d97273c091e9d5dfa268903b4dfc03cf1 Mon Sep 17 00:00:00 2001 From: Gustavo Narea Date: Tue, 27 Feb 2018 11:30:25 +0000 Subject: [PATCH 1/7] Make compatible with Node 6 --- .travis.yml | 5 ++++- lib/encoders.js | 2 +- package.json | 4 ++-- test/encoders.tests.js | 15 +++++++++++++++ 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 test/encoders.tests.js diff --git a/.travis.yml b/.travis.yml index d048b50..5f73b05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ language: node_js before_install: npm i -g npm@1.4.28 node_js: - - 0.8 \ No newline at end of file + - 0.8 + - 4 + - 6 + - 8 diff --git a/lib/encoders.js b/lib/encoders.js index 213c92c..67cdc1c 100644 --- a/lib/encoders.js +++ b/lib/encoders.js @@ -1,4 +1,4 @@ -var thumbprint = require('thumbprint'); +var thumbprint = require('@auth0/thumbprint'); var removeHeaders = module.exports.removeHeaders = function (cert) { var pem = /-----BEGIN (\w*)-----([^-]*)-----END (\w*)-----/g.exec(cert.toString()); diff --git a/package.json b/package.json index 9051917..2f88338 100644 --- a/package.json +++ b/package.json @@ -18,10 +18,10 @@ "author": "Auth0", "license": "mit", "dependencies": { + "@auth0/thumbprint": "0.0.6", "ejs": "2.5.5", "jsonwebtoken": "~5.0.4", - "saml": "^0.12.1", - "thumbprint": "0.0.1" + "saml": "^0.12.1" }, "devDependencies": { "chai": "~1.5.0", diff --git a/test/encoders.tests.js b/test/encoders.tests.js new file mode 100644 index 0000000..19b85aa --- /dev/null +++ b/test/encoders.tests.js @@ -0,0 +1,15 @@ +'use strict'; + +const assert = require('assert'); +const encoders = require('../lib/encoders'); +const fixtures = require('./fixture/server'); + + +describe('encoders', function () { + describe('thumbprint', function () { + it('should return the thumbprint in all caps', function () { + const certThumbprint = encoders.thumbprint(fixtures.credentials.cert); + assert.equal(certThumbprint, '499FDF1C2218A99C8595AAC2FD95CE36F0A6D59D'); + }); + }); +}); From d91011a65c263fc2a7e2d8efd7120127ff115dc7 Mon Sep 17 00:00:00 2001 From: Gustavo Narea Date: Tue, 27 Feb 2018 11:34:23 +0000 Subject: [PATCH 2/7] Remove dependency on npm v1 in the CIS Because scoped packages like @auth0/thumbprint are not supported in npm 1 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5f73b05..fc36550 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: node_js -before_install: npm i -g npm@1.4.28 node_js: - 0.8 - 4 From 373ed582cef4f5c62155de3c13afae11b3924f66 Mon Sep 17 00:00:00 2001 From: Gustavo Narea Date: Tue, 27 Feb 2018 11:37:48 +0000 Subject: [PATCH 3/7] Travis CI: Replace Node 0.8 with 0.10 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fc36550..575a65f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - 0.8 + - 0.10 - 4 - 6 - 8 From eaf1ad7298f958981e1c57f59a407d652333f951 Mon Sep 17 00:00:00 2001 From: Gustavo Narea Date: Tue, 27 Feb 2018 11:42:18 +0000 Subject: [PATCH 4/7] =?UTF-8?q?Make=20compatible=20with=20Node=200.10=20?= =?UTF-8?q?=F0=9F=A4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/encoders.tests.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/encoders.tests.js b/test/encoders.tests.js index 19b85aa..06971dc 100644 --- a/test/encoders.tests.js +++ b/test/encoders.tests.js @@ -1,14 +1,12 @@ -'use strict'; - -const assert = require('assert'); -const encoders = require('../lib/encoders'); -const fixtures = require('./fixture/server'); +var assert = require('assert'); +var encoders = require('../lib/encoders'); +var fixtures = require('./fixture/server'); describe('encoders', function () { describe('thumbprint', function () { it('should return the thumbprint in all caps', function () { - const certThumbprint = encoders.thumbprint(fixtures.credentials.cert); + var certThumbprint = encoders.thumbprint(fixtures.credentials.cert); assert.equal(certThumbprint, '499FDF1C2218A99C8595AAC2FD95CE36F0A6D59D'); }); }); From 77a52ec0744869aaba29b1e9c0b49c680044b6e8 Mon Sep 17 00:00:00 2001 From: Gustavo Narea Date: Tue, 27 Feb 2018 11:44:16 +0000 Subject: [PATCH 5/7] Remove unnecessary whitespace --- test/encoders.tests.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/encoders.tests.js b/test/encoders.tests.js index 06971dc..114722d 100644 --- a/test/encoders.tests.js +++ b/test/encoders.tests.js @@ -2,7 +2,6 @@ var assert = require('assert'); var encoders = require('../lib/encoders'); var fixtures = require('./fixture/server'); - describe('encoders', function () { describe('thumbprint', function () { it('should return the thumbprint in all caps', function () { From 343e008335f272f2832e793f9e98cb5aef192a47 Mon Sep 17 00:00:00 2001 From: Gustavo Narea Date: Tue, 27 Feb 2018 15:22:29 +0000 Subject: [PATCH 6/7] Drop support for Node 0.10 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 575a65f..de50a1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: node_js node_js: - - 0.10 - 4 - 6 - 8 From 414958ef0ee5d48d7f823517976493a2b237d2f3 Mon Sep 17 00:00:00 2001 From: Gustavo Narea Date: Tue, 27 Feb 2018 15:23:02 +0000 Subject: [PATCH 7/7] =?UTF-8?q?Revert=20"Make=20compatible=20with=20Node?= =?UTF-8?q?=200.10=20=F0=9F=A4=A2"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit eaf1ad7 --- test/encoders.tests.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/encoders.tests.js b/test/encoders.tests.js index 114722d..5d80f76 100644 --- a/test/encoders.tests.js +++ b/test/encoders.tests.js @@ -1,11 +1,13 @@ -var assert = require('assert'); -var encoders = require('../lib/encoders'); -var fixtures = require('./fixture/server'); +'use strict'; + +const assert = require('assert'); +const encoders = require('../lib/encoders'); +const fixtures = require('./fixture/server'); describe('encoders', function () { describe('thumbprint', function () { it('should return the thumbprint in all caps', function () { - var certThumbprint = encoders.thumbprint(fixtures.credentials.cert); + const certThumbprint = encoders.thumbprint(fixtures.credentials.cert); assert.equal(certThumbprint, '499FDF1C2218A99C8595AAC2FD95CE36F0A6D59D'); }); });