Skip to content

Commit

Permalink
chore: update express and express-jwt packages (#2598)
Browse files Browse the repository at this point in the history
* fix(express): migrate to express-jwt v7

* chore: update express

* docs: changeset

* chore: update lockfile
  • Loading branch information
emmenko authored May 9, 2022
1 parent a5c26f2 commit b151505
Show file tree
Hide file tree
Showing 6 changed files with 235 additions and 71 deletions.
7 changes: 7 additions & 0 deletions .changeset/late-suits-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@commercetools-backend/express': patch
'@commercetools-backend/loggers': patch
'@commercetools-frontend/mc-dev-authentication': patch
---

Update `express` and `express-jwt` packages
8 changes: 5 additions & 3 deletions packages-backend/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
"@babel/runtime": "^7.17.9",
"@babel/runtime-corejs3": "^7.17.9",
"@types/node": "16.11.26",
"express": "4.17.3",
"express-jwt": "6.1.1",
"jwks-rsa": "2.0.5"
"express": "4.18.1",
"express-jwt": "7.7.0",
"jwks-rsa": "2.1.1"
},
"devDependencies": {
"@types/express-unless": "^0.5.3",
"@types/jsonwebtoken": "^8.5.8",
"jose": "2.0.5",
"msw": "0.39.2"
}
Expand Down
7 changes: 5 additions & 2 deletions packages-backend/express/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import type {
} from './types';

import jwksRsa from 'jwks-rsa';
import expressJwtMiddleware from 'express-jwt';
import {
expressjwt as expressJwtMiddleware,
type GetVerificationKey,
} from 'express-jwt';
import {
CLOUD_IDENTIFIERS,
MC_API_URLS,
Expand Down Expand Up @@ -179,7 +182,7 @@ function createSessionAuthVerifier<Request extends TBaseRequest>(
...(options.jwks || {}),
// This should be set by the middleware, no matter what.
jwksUri: `${issuer}/.well-known/jwks.json`,
}),
}) as GetVerificationKey,
requestProperty: decodedTokenKey,
// Validate the audience and the issuer.
audience,
Expand Down
2 changes: 1 addition & 1 deletion packages-backend/loggers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
"winston": "3.7.2"
},
"devDependencies": {
"express": "4.17.3"
"express": "4.18.1"
}
}
2 changes: 1 addition & 1 deletion packages/mc-dev-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"devDependencies": {
"@commercetools-frontend/application-config": "21.5.0",
"@tsconfig/node14": "^1.0.1",
"express": "4.17.3"
"express": "4.18.1"
},
"engines": {
"node": ">=14"
Expand Down
Loading

1 comment on commit b151505

@vercel
Copy link

@vercel vercel bot commented on b151505 May 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.