@smithy/core 3.38.0 → 3.38.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.38.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 6871574: Redact sensitive fields within list items and map values in schema-based logging.
8
+
3
9
  ## 3.38.0
4
10
 
5
11
  ### Minor Changes
@@ -559,16 +559,22 @@ function schemaLogFilter(schema, data) {
559
559
  return SENSITIVE_STRING$1;
560
560
  }
561
561
  if (ns.isListSchema()) {
562
- const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive;
563
- if (isSensitive) {
562
+ const valueSchema = ns.getValueSchema();
563
+ if (valueSchema.getMergedTraits().sensitive) {
564
564
  return SENSITIVE_STRING$1;
565
565
  }
566
+ if (Array.isArray(data)) {
567
+ return data.map((value) => schemaLogFilter(valueSchema, value));
568
+ }
566
569
  }
567
570
  else if (ns.isMapSchema()) {
568
- const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive;
569
- if (isSensitive) {
571
+ const valueSchema = ns.getValueSchema();
572
+ if (ns.getKeySchema().getMergedTraits().sensitive || valueSchema.getMergedTraits().sensitive) {
570
573
  return SENSITIVE_STRING$1;
571
574
  }
575
+ if (typeof data === "object") {
576
+ return Object.fromEntries(Object.entries(data).map(([key, value]) => [key, schemaLogFilter(valueSchema, value)]));
577
+ }
572
578
  }
573
579
  else if (ns.isStructSchema() && typeof data === "object") {
574
580
  const object = data;
@@ -9,16 +9,22 @@ export function schemaLogFilter(schema, data) {
9
9
  return SENSITIVE_STRING;
10
10
  }
11
11
  if (ns.isListSchema()) {
12
- const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive;
13
- if (isSensitive) {
12
+ const valueSchema = ns.getValueSchema();
13
+ if (valueSchema.getMergedTraits().sensitive) {
14
14
  return SENSITIVE_STRING;
15
15
  }
16
+ if (Array.isArray(data)) {
17
+ return data.map((value) => schemaLogFilter(valueSchema, value));
18
+ }
16
19
  }
17
20
  else if (ns.isMapSchema()) {
18
- const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive;
19
- if (isSensitive) {
21
+ const valueSchema = ns.getValueSchema();
22
+ if (ns.getKeySchema().getMergedTraits().sensitive || valueSchema.getMergedTraits().sensitive) {
20
23
  return SENSITIVE_STRING;
21
24
  }
25
+ if (typeof data === "object") {
26
+ return Object.fromEntries(Object.entries(data).map(([key, value]) => [key, schemaLogFilter(valueSchema, value)]));
27
+ }
22
28
  }
23
29
  else if (ns.isStructSchema() && typeof data === "object") {
24
30
  const object = data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.38.0",
3
+ "version": "3.38.1",
4
4
  "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core",
5
5
  "license": "Apache-2.0",
6
6
  "author": {