@middy/rds-signer 7.6.3 → 7.6.4

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 +6 -4
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -2,9 +2,10 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  import { Signer } from "@aws-sdk/rds-signer";
4
4
  import {
5
+ assignSetToContext,
6
+ buildSetToContextSpec,
5
7
  canPrefetch,
6
8
  getCache,
7
- getInternal,
8
9
  modifyCache,
9
10
  processCache,
10
11
  validateOptions,
@@ -79,6 +80,7 @@ const rdsSignerMiddleware = (opts = {}) => {
79
80
  }
80
81
 
81
82
  const fetchDataKeys = Object.keys(options.fetchData);
83
+ const contextSpec = buildSetToContextSpec(options);
82
84
  const clients = {};
83
85
  const fetchRequest = (request, cachedValues = {}) => {
84
86
  const values = {};
@@ -124,9 +126,9 @@ const rdsSignerMiddleware = (opts = {}) => {
124
126
 
125
127
  Object.assign(request.internal, value);
126
128
 
127
- if (options.setToContext) {
128
- const data = await getInternal(fetchDataKeys, request);
129
- Object.assign(request.context, data);
129
+ if (contextSpec) {
130
+ const pending = assignSetToContext(contextSpec, value, request);
131
+ if (pending) await pending;
130
132
  }
131
133
  };
132
134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/rds-signer",
3
- "version": "7.6.3",
3
+ "version": "7.6.4",
4
4
  "description": "RDS (Relational Database Service) credentials middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -70,11 +70,11 @@
70
70
  }
71
71
  },
72
72
  "dependencies": {
73
- "@middy/util": "7.6.3"
73
+ "@middy/util": "7.6.4"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@aws-sdk/rds-signer": "^3.0.0",
77
- "@middy/core": "7.6.3",
77
+ "@middy/core": "7.6.4",
78
78
  "@types/aws-lambda": "^8.0.0",
79
79
  "@types/node": "^22.0.0",
80
80
  "aws-xray-sdk": "^3.3.3"