@middy/ssm 7.6.5 → 7.6.6
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.
- package/README.md +1 -1
- package/index.js +4 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<a href="https://biomejs.dev"><img alt="Checked with Biome" src="https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome"></a>
|
|
23
23
|
<a href="https://conventionalcommits.org"><img alt="Conventional Commits" src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white"></a>
|
|
24
24
|
<a href="https://github.com/middyjs/middy/blob/main/package.json#L32">
|
|
25
|
-
<img alt="code coverage" src="https://img.shields.io/badge/code%20coverage-
|
|
25
|
+
<img alt="code coverage" src="https://img.shields.io/badge/code%20coverage-100%25-brightgreen"></a>
|
|
26
26
|
<br/>
|
|
27
27
|
</p>
|
|
28
28
|
<p>You can read the documentation at: <a href="https://middy.js.org/docs/middlewares/ssm">https://middy.js.org/docs/middlewares/ssm</a></p>
|
package/index.js
CHANGED
|
@@ -112,6 +112,7 @@ const ssmMiddleware = (opts = {}) => {
|
|
|
112
112
|
.then((resp) => {
|
|
113
113
|
// Don't sanitize key, mapped to set value in options
|
|
114
114
|
const result = {};
|
|
115
|
+
// Stryker disable next-line ArrayDeclaration: a non-empty fallback injects a bogus fetchKey whose indexOf is -1, so it only writes result[bogus]=Promise.reject and value[undefined]=undefined; neither is ever read back (only requested keys are resolved), so it is indistinguishable from the empty fallback.
|
|
115
116
|
for (const fetchKey of resp.InvalidParameters ?? []) {
|
|
116
117
|
const internalKey = internalKeys[fetchKeys.indexOf(fetchKey)];
|
|
117
118
|
const value = getCache(options.cacheKey).value ?? {};
|
|
@@ -123,6 +124,7 @@ const ssmMiddleware = (opts = {}) => {
|
|
|
123
124
|
}),
|
|
124
125
|
);
|
|
125
126
|
}
|
|
127
|
+
// Stryker disable next-line ArrayDeclaration: a non-empty fallback injects a string element whose .Name and .Value are undefined, so parseValue yields undefined and only result["undefined"]=undefined is added, which is indistinguishable from the key being absent.
|
|
126
128
|
for (const param of resp.Parameters ?? []) {
|
|
127
129
|
result[param.Name] = parseValue(param);
|
|
128
130
|
}
|
|
@@ -143,7 +145,7 @@ const ssmMiddleware = (opts = {}) => {
|
|
|
143
145
|
const matchingParamName = Object.keys(params).find((key) =>
|
|
144
146
|
fetchKey.endsWith(`:parameter${key}`),
|
|
145
147
|
);
|
|
146
|
-
return params[matchingParamName];
|
|
148
|
+
return params[matchingParamName] ?? params[fetchKey];
|
|
147
149
|
}
|
|
148
150
|
|
|
149
151
|
return params[options.fetchData[internalKey]];
|
|
@@ -219,6 +221,7 @@ const ssmMiddleware = (opts = {}) => {
|
|
|
219
221
|
|
|
220
222
|
if (contextSpec) {
|
|
221
223
|
const pending = assignSetToContext(contextSpec, value, request);
|
|
224
|
+
// Stryker disable next-line ConditionalExpression: assignSetToContext returns a Promise or undefined; awaiting undefined (forced true) is a no-op with no observable difference.
|
|
222
225
|
if (pending) await pending;
|
|
223
226
|
}
|
|
224
227
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/ssm",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.6",
|
|
4
4
|
"description": "SSM (EC2 Systems Manager) parameters middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"test": "npm run test:unit && npm run test:fuzz",
|
|
30
30
|
"test:unit": "node --test",
|
|
31
31
|
"test:fuzz": "node --test index.fuzz.js",
|
|
32
|
-
"test:perf": "node --test index.perf.js"
|
|
32
|
+
"test:perf": "node --test index.perf.js",
|
|
33
|
+
"test:mutation": "cd ../.. && MUTATE_PACKAGE=\"$(basename \"$OLDPWD\")\" stryker run"
|
|
33
34
|
},
|
|
34
35
|
"license": "MIT",
|
|
35
36
|
"keywords": [
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
"url": "https://github.com/sponsors/willfarrell"
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
|
-
"@middy/util": "7.6.
|
|
66
|
+
"@middy/util": "7.6.6"
|
|
66
67
|
},
|
|
67
68
|
"peerDependencies": {
|
|
68
69
|
"@aws-sdk/client-ssm": "^3.0.0"
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
},
|
|
75
76
|
"devDependencies": {
|
|
76
77
|
"@aws-sdk/client-ssm": "^3.0.0",
|
|
77
|
-
"@middy/core": "7.6.
|
|
78
|
+
"@middy/core": "7.6.6",
|
|
78
79
|
"@types/aws-lambda": "^8.0.0",
|
|
79
80
|
"@types/node": "^22.0.0",
|
|
80
81
|
"aws-xray-sdk": "^3.3.3"
|