ac-awssecrets 2.4.1 → 2.4.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 (4) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/g.sh +11 -0
  3. package/index.js +14 -1
  4. package/package.json +8 -7
package/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+
2
+ ## [2.4.3](https://github.com/admiralcloud/ac-awssecrets/compare/v2.4.2..v2.4.3) (2025-04-19 18:41:08)
3
+
4
+
5
+ ### Bug Fix
6
+
7
+ * **App:** Package update | MP | [2c47ae14297e0b007deff0264e383a59c3dd2476](https://github.com/admiralcloud/ac-awssecrets/commit/2c47ae14297e0b007deff0264e383a59c3dd2476)
8
+ Package updates
9
+ Related issues:
10
+ <a name="2.4.2"></a>
11
+
12
+ ## [2.4.2](https://github.com/admiralcloud/ac-awssecrets/compare/v2.4.1..v2.4.2) (2024-11-16 15:52:33)
13
+
14
+
15
+ ### Bug Fix
16
+
17
+ * **App:** Deep merge parameters | MP | [ba51f27d9f9723dcdbd4ad265ba5f359a4048456](https://github.com/admiralcloud/ac-awssecrets/commit/ba51f27d9f9723dcdbd4ad265ba5f359a4048456)
18
+ If merge is true, make sure to deep merge objects
19
+ Related issues: [undefined/undefined#master](undefined/browse/master)
1
20
  <a name="2.4.1"></a>
2
21
 
3
22
  ## [2.4.1](https://github.com/admiralcloud/ac-awssecrets/compare/v2.4.0..v2.4.1) (2024-10-18 13:50:58)
package/g.sh ADDED
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+ aws ssm get-parameters-by-path \
3
+ --path "/development" \
4
+ --recursive \
5
+ --profile dev.mfa --region eu-central-1 \
6
+ --output json | \
7
+ jq '.Parameters[] |
8
+ {Name: .Name}'
9
+
10
+
11
+ {"secret":"L4w,UU3g;NAh)e6,HV(TTzUZ2G>","name":"acauth","valueHasJSON":"true","defaultApps":{"acapp":"8d09356a-042f-4d4a-9c6f-935329000969","embedlink": "5ffd8ff6-2aeb-44b0-8a6c-f413de58df3c"},"passwordAlgorithm":"aes-256-ctr","password":"8gZVqjzKN@g4XdD7Cq#9qAPh>iPdKNkr"}
package/index.js CHANGED
@@ -31,6 +31,19 @@ const awsSecrets = () => {
31
31
  : setKey(obj[head], rest.join('.'), value)
32
32
  }
33
33
 
34
+ const deepMerge = (target, source) => {
35
+ const result = { ...target }
36
+ for (const key in source) {
37
+ if (typeof source[key] === 'object' && !Array.isArray(source[key]) && typeof result[key] === 'object' && !Array.isArray(result[key])) {
38
+ result[key] = deepMerge(result[key], source[key])
39
+ }
40
+ else {
41
+ result[key] = source[key]
42
+ }
43
+ }
44
+ return result
45
+ }
46
+
34
47
  const setValue = (config, { path, value, array = false, property, merge = false }) => {
35
48
  // path can be from AWS parametes store (/a/b/c) or a real JSON path (a.b.c)
36
49
  const keys = path.includes('/') ? path.split('/').filter(Boolean) : path.split('.')
@@ -69,7 +82,7 @@ const awsSecrets = () => {
69
82
  }
70
83
  else {
71
84
  if (merge && typeof pointer[lastKey] === 'object' && !Array.isArray(pointer[lastKey]) && typeof value === 'object' && !Array.isArray(value)) {
72
- pointer[lastKey] = { ...pointer[lastKey], ...value }
85
+ pointer[lastKey] = deepMerge(pointer[lastKey], value) // Use deepMerge instead of spread
73
86
  }
74
87
  else {
75
88
  pointer[lastKey] = value
package/package.json CHANGED
@@ -3,17 +3,17 @@
3
3
  "author": "Mark Poepping (https://www.admiralcloud.com)",
4
4
  "license": "MIT",
5
5
  "repository": "admiralcloud/ac-awssecrets",
6
- "version": "2.4.1",
6
+ "version": "2.4.3",
7
7
  "dependencies": {
8
- "@aws-sdk/client-secrets-manager": "^3.674.0",
9
- "@aws-sdk/client-ssm": "^3.674.0"
8
+ "@aws-sdk/client-secrets-manager": "^3.787.0",
9
+ "@aws-sdk/client-ssm": "^3.787.0"
10
10
  },
11
11
  "devDependencies": {
12
- "ac-semantic-release": "^0.4.3",
13
- "c8": "^10.1.2",
12
+ "ac-semantic-release": "^0.4.5",
13
+ "c8": "^10.1.3",
14
14
  "chai": "^4.x",
15
15
  "eslint": "9.x",
16
- "mocha": "^10.7.3"
16
+ "mocha": "^11.1.0"
17
17
  },
18
18
  "scripts": {
19
19
  "test": "NODE_ENV=test mocha --reporter spec --bail",
@@ -21,5 +21,6 @@
21
21
  },
22
22
  "engines": {
23
23
  "node": ">=8.0.0"
24
- }
24
+ },
25
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
25
26
  }