Skip to content

Commit

Permalink
fix(deps): update dependency jose to v4
Browse files Browse the repository at this point in the history
* fix(deps): update dependency jose to v4

* fix(deps): Update code using jose v4

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com>
  • Loading branch information
3 people committed Dec 16, 2021
1 parent 04e9598 commit a90687d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 25 deletions.
53 changes: 35 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"dependencies": {
"@comunica/actor-init-sparql": "^1.21.3",
"@rdfjs/data-model": "^1.2.0",
"@solid/access-token-verifier": "^1.0.1",
"@solid/access-token-verifier": "^1.1.2",
"@types/arrayify-stream": "^1.0.0",
"@types/async-lock": "^1.1.2",
"@types/bcrypt": "^5.0.0",
Expand Down Expand Up @@ -109,7 +109,7 @@
"escape-string-regexp": "^4.0.0",
"fetch-sparql-endpoint": "^2.0.1",
"handlebars": "^4.7.7",
"jose": "^3.11.6",
"jose": "^4.3.7",
"lodash.orderby": "^4.6.0",
"marked": "^3.0.0",
"mime-types": "^2.1.32",
Expand Down
9 changes: 4 additions & 5 deletions src/identity/configuration/IdentityProviderFactory.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* eslint-disable @typescript-eslint/naming-convention, import/no-unresolved, tsdoc/syntax */
/* eslint-disable @typescript-eslint/naming-convention, tsdoc/syntax */
// import/no-unresolved can't handle jose imports
// tsdoc/syntax can't handle {json} parameter
import { randomBytes } from 'crypto';
import type { JWK } from 'jose/jwk/from_key_like';
import { fromKeyLike } from 'jose/jwk/from_key_like';
import { generateKeyPair } from 'jose/util/generate_key_pair';
import type { JWK } from 'jose';
import { exportJWK, generateKeyPair } from 'jose';
import type { AnyObject,
CanBePromise,
KoaContextWithOIDC,
Expand Down Expand Up @@ -148,7 +147,7 @@ export class IdentityProviderFactory implements ProviderFactory {
}
// If they are not, generate and save them
const { privateKey } = await generateKeyPair('RS256');
const jwk = await fromKeyLike(privateKey);
const jwk = await exportJWK(privateKey);
// Required for Solid authn client
jwk.alg = 'RS256';
// In node v15.12.0 the JWKS does not get accepted because the JWK is not a plain object,
Expand Down

0 comments on commit a90687d

Please sign in to comment.