cdk-real-drift 0.12.1 → 0.12.2

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/dist/cli.js CHANGED
@@ -3618,6 +3618,24 @@ function isCfnTemplateNonAsciiMask(declared, live) {
3618
3618
  } else masked += ch;
3619
3619
  return sawNonAscii && masked === declared;
3620
3620
  }
3621
+ function deepEqualModuloNonAsciiMask(declared, live) {
3622
+ if (declared === live) return true;
3623
+ if (typeof declared === "string" && typeof live === "string") return isCfnTemplateNonAsciiMask(declared, live);
3624
+ if (typeof declared !== "object" || typeof live !== "object" || declared === null || live === null) return false;
3625
+ if (Array.isArray(declared) || Array.isArray(live)) {
3626
+ if (!Array.isArray(declared) || !Array.isArray(live) || declared.length !== live.length) return false;
3627
+ return declared.every((v, i) => deepEqualModuloNonAsciiMask(v, live[i]));
3628
+ }
3629
+ const declaredObj = declared;
3630
+ const liveObj = live;
3631
+ const keys = Object.keys(declaredObj);
3632
+ if (keys.length !== Object.keys(liveObj).length) return false;
3633
+ for (const key of keys) {
3634
+ if (!Object.hasOwn(liveObj, key)) return false;
3635
+ if (!deepEqualModuloNonAsciiMask(declaredObj[key], liveObj[key])) return false;
3636
+ }
3637
+ return true;
3638
+ }
3621
3639
  const ID_RE = /^[a-z][a-z0-9]*-[0-9a-f]{6,}$/;
3622
3640
  const isIdLike = (s) => typeof s === "string" && (s.startsWith("arn:") || ID_RE.test(s));
3623
3641
  const AZ_NAME_RE = /^[a-z]{2}-[a-z]+(-[a-z]+)?-\d{1,2}[a-z]$/;
@@ -6007,6 +6025,16 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6007
6025
  declaredParsed = void 0;
6008
6026
  }
6009
6027
  if (declaredParsed !== void 0 && deepEqual(declaredParsed, liveParsed)) continue;
6028
+ if (declaredParsed !== void 0 && deepEqualModuloNonAsciiMask(declaredParsed, liveParsed) || isCfnTemplateNonAsciiMask(v, live[k])) {
6029
+ findings.push({
6030
+ tier: "readGap",
6031
+ logicalId,
6032
+ resourceType,
6033
+ path: k,
6034
+ note: "declared value unverifiable — CloudFormation GetTemplate masks non-ASCII characters as \"?\""
6035
+ });
6036
+ continue;
6037
+ }
6010
6038
  findings.push({
6011
6039
  tier: "declared",
6012
6040
  logicalId,