@middy/rds-signer 7.2.1 → 7.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +3 -2
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -24,16 +24,17 @@ const rdsSignerMiddleware = (opts = {}) => {
24
24
  const options = { ...defaults, ...opts };
25
25
 
26
26
  const fetchDataKeys = Object.keys(options.fetchData);
27
+ const clients = {};
27
28
  const fetchRequest = (request, cachedValues = {}) => {
28
29
  const values = {};
29
30
  for (const internalKey of fetchDataKeys) {
30
31
  if (cachedValues[internalKey]) continue;
31
32
 
32
- const client = new options.AwsClient({
33
+ clients[internalKey] ??= new options.AwsClient({
33
34
  ...options.awsClientOptions,
34
35
  ...options.fetchData[internalKey],
35
36
  });
36
- values[internalKey] = client
37
+ values[internalKey] = clients[internalKey]
37
38
  .getAuthToken()
38
39
  .then((token) => {
39
40
  // Catch Missing token, this usually means there is something wrong with the credentials
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/rds-signer",
3
- "version": "7.2.1",
3
+ "version": "7.2.3",
4
4
  "description": "RDS (Relational Database Service) credentials middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -73,11 +73,11 @@
73
73
  }
74
74
  },
75
75
  "dependencies": {
76
- "@middy/util": "7.2.1"
76
+ "@middy/util": "7.2.3"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@aws-sdk/rds-signer": "^3.0.0",
80
- "@middy/core": "7.2.1",
80
+ "@middy/core": "7.2.3",
81
81
  "@types/aws-lambda": "^8.0.0",
82
82
  "@types/node": "^22.0.0",
83
83
  "aws-xray-sdk": "^3.3.3"