Skip to content

Commit

Permalink
Update security/demo/getJwtGenerator function to request 60 minute …
Browse files Browse the repository at this point in the history
…expiration. Remove `jsonwebtoken` dependency.
  • Loading branch information
bryaningl3 committed Nov 19, 2024
1 parent d0b8fb2 commit cf095f9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions docs/content/releases/4.21.0.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 5 additions & 3 deletions lib/security/demo/getJwtGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit cf095f9

Please sign in to comment.