Skip to content

Commit

Permalink
fix: ensure runtime @panva/jose dependency ^1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jun 21, 2019
1 parent 674d766 commit d992deb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async function claimJWT(jwt) {
}

function getKeystore(jwks) {
const keystore = jose.JWKS.KeyStore.fromJWKS(jwks);
const keystore = jose.JWKS.asKeyStore(jwks);
if (keystore.all().some(key => key.type !== 'private')) {
throw new TypeError('jwks must only contain private keys');
}
Expand Down Expand Up @@ -1000,7 +1000,7 @@ module.exports = (issuer, aadIssValidation = false) => class Client extends Base
.digest()
.slice(0, len / 8);

const key = jose.JWK.importKey({ k: base64url.encode(derivedBuffer), kty: 'oct' });
const key = jose.JWK.asKey({ k: base64url.encode(derivedBuffer), kty: 'oct' });
instance(this).set(cacheKey, key);

return key;
Expand All @@ -1019,7 +1019,7 @@ module.exports = (issuer, aadIssValidation = false) => class Client extends Base
return instance(this).get('jose_secret');
}

const key = jose.JWK.importKey({ k: base64url.encode(this.client_secret), kty: 'oct' });
const key = jose.JWK.asKey({ k: base64url.encode(this.client_secret), kty: 'oct' });
instance(this).set('jose_secret', key);

return key;
Expand Down
2 changes: 1 addition & 1 deletion lib/issuer.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Issuer {
});
const jwks = processResponse(response);

const joseKeyStore = jose.JWKS.KeyStore.fromJWKS(jwks);
const joseKeyStore = jose.JWKS.asKeyStore(jwks);
cache.set('throttle', true, 60 * 1000);
instance(this).set('keystore', joseKeyStore);
return joseKeyStore;
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test": "mocha"
},
"dependencies": {
"@panva/jose": "^1.2.0",
"@panva/jose": "^1.3.0",
"base64url": "^3.0.1",
"got": "^9.6.0",
"lodash": "^4.17.11",
Expand All @@ -47,15 +47,15 @@
"p-any": "^2.1.0"
},
"devDependencies": {
"@commitlint/cli": "^7.6.0",
"@commitlint/config-conventional": "^7.6.0",
"@commitlint/cli": "^8.0.0",
"@commitlint/config-conventional": "^8.0.0",
"chai": "^4.2.0",
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.17.1",
"husky": "^2.2.0",
"husky": "^2.4.1",
"mocha": "^6.1.3",
"nock": "^11.0.0-beta.14",
"nock": "^11.0.0-beta.20",
"nyc": "^14.1.0",
"readable-mock-req": "^0.2.2",
"sinon": "^7.3.1",
Expand Down
2 changes: 1 addition & 1 deletion test/client/client_instance.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2764,7 +2764,7 @@ describe('Client', () => {
/* eslint-disable max-len */
describe('signed and encrypted responses', function () {
before(function () {
this.keystore = jose.JWKS.KeyStore.fromJWKS({
this.keystore = jose.JWKS.asKeyStore({
keys: [
{
kty: 'EC',
Expand Down

0 comments on commit d992deb

Please sign in to comment.