From cf095f91778d7461933620db2f7c1f1676dcf1ab Mon Sep 17 00:00:00 2001 From: Bryan Ingle Date: Tue, 19 Nov 2024 13:28:39 -0700 Subject: [PATCH] Update `security/demo/getJwtGenerator` function to request 60 minute expiration. Remove `jsonwebtoken` dependency. --- docs/content/releases/4.21.0.md | 7 +++++++ lib/security/demo/getJwtGenerator.js | 8 +++++--- package.json | 1 - 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 docs/content/releases/4.21.0.md diff --git a/docs/content/releases/4.21.0.md b/docs/content/releases/4.21.0.md new file mode 100644 index 00000000..1489ff00 --- /dev/null +++ b/docs/content/releases/4.21.0.md @@ -0,0 +1,7 @@ +**New Features** + +* Updated the `security/demo/getJwtGenerator` function to request JWT with a 60 minute expiration window. + +**Technical Enhancements** + +* Removed unused [`jsonwebtoken`](https://github.com/auth0/node-jsonwebtoken) library as a dependency. \ No newline at end of file diff --git a/lib/security/demo/getJwtGenerator.js b/lib/security/demo/getJwtGenerator.js index 307532c6..7fce5327 100644 --- a/lib/security/demo/getJwtGenerator.js +++ b/lib/security/demo/getJwtGenerator.js @@ -39,13 +39,15 @@ module.exports = (() => { .withVerb(VerbType.POST) .withProtocol(ProtocolType.HTTPS) .withHost('jwt-public-prod.aws.barchart.com') - .withPathBuilder((pb) => + .withPathBuilder((pb) => { pb.withLiteralParameter('version', 'v1') .withLiteralParameter('tokens', 'tokens') .withLiteralParameter('impersonate', 'impersonate') .withLiteralParameter('service', 'alerts') - .withLiteralParameter('environment', 'demo') - ) + .withLiteralParameter('environment', 'demo'); + }).withQueryBuilder((qb) => { + qb.withLiteralParameter('expirationInMinutes', 'expirationInMinutes', '60'); + }) .withBody() .withResponseInterceptor(ResponseInterceptor.DATA) .endpoint; diff --git a/package.json b/package.json index 9fd633fe..e3f3e15a 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "dependencies": { "@barchart/common-js": "^4.39.2", "@barchart/marketdata-api-js": "^6.2.6", - "jsonwebtoken": "^8.5.1", "socket.io-client": "^2.3.0", "uuid": "^9.0.1" },