@intentius/chant 0.124.96 → 0.124.98
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/audit/core.d.ts +29 -0
- package/dist/audit/core.d.ts.map +1 -1
- package/dist/audit/core.js +48 -11
- package/dist/audit/identity.d.ts +27 -0
- package/dist/audit/identity.d.ts.map +1 -0
- package/dist/audit/identity.js +36 -0
- package/dist/audit/report-html.d.ts +3 -1
- package/dist/audit/report-html.d.ts.map +1 -1
- package/dist/audit/report-html.js +1 -1
- package/dist/audit/report-model.d.ts +16 -0
- package/dist/audit/report-model.d.ts.map +1 -1
- package/dist/audit/report-model.js +5 -1
- package/dist/change-set-graph.d.ts +3 -1
- package/dist/change-set-graph.d.ts.map +1 -1
- package/dist/change-set-graph.js +7 -1
- package/dist/change-set.d.ts +5 -2
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +6 -3
- package/dist/ci-agent.d.ts +17 -0
- package/dist/ci-agent.d.ts.map +1 -1
- package/dist/ci-agent.js +32 -0
- package/dist/ci-comment-allow.d.ts +88 -0
- package/dist/ci-comment-allow.d.ts.map +1 -0
- package/dist/ci-comment-allow.js +178 -0
- package/dist/ci-comment-commands.d.ts +12 -0
- package/dist/ci-comment-commands.d.ts.map +1 -1
- package/dist/ci-comment-commands.js +22 -0
- package/dist/ci-control.d.ts +6 -1
- package/dist/ci-control.d.ts.map +1 -1
- package/dist/ci-control.js +6 -1
- package/dist/ci-product.d.ts +3 -0
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +3 -0
- package/dist/cli/commands/audit.d.ts +3 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +23 -6
- package/dist/cli/commands/import.d.ts +8 -1
- package/dist/cli/commands/import.d.ts.map +1 -1
- package/dist/cli/commands/import.js +31 -6
- package/dist/cli/handlers/agent.d.ts.map +1 -1
- package/dist/cli/handlers/agent.js +12 -2
- package/dist/cli/handlers/pr-comment.d.ts +6 -0
- package/dist/cli/handlers/pr-comment.d.ts.map +1 -1
- package/dist/cli/handlers/pr-comment.js +12 -0
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +53 -6
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +29 -6
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +23 -0
- package/dist/cli/registry.d.ts +8 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cloud-lister/mask.d.ts +30 -1
- package/dist/cloud-lister/mask.d.ts.map +1 -1
- package/dist/cloud-lister/mask.js +66 -3
- package/dist/components/driver.d.ts +8 -1
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +1 -0
- package/dist/components/product-pipeline.d.ts +23 -1
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +40 -7
- package/dist/components/product-plan.d.ts +20 -0
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +11 -1
- package/dist/control/applied.d.ts +8 -1
- package/dist/control/applied.d.ts.map +1 -1
- package/dist/control/applied.js +18 -2
- package/dist/control/dispatch.d.ts +52 -0
- package/dist/control/dispatch.d.ts.map +1 -1
- package/dist/control/dispatch.js +140 -4
- package/dist/control/train.d.ts +198 -0
- package/dist/control/train.d.ts.map +1 -0
- package/dist/control/train.js +294 -0
- package/dist/deep-observation.js +2 -2
- package/dist/floor-table.data.d.ts.map +1 -1
- package/dist/floor-table.data.js +7 -1
- package/dist/graph-detail.d.ts +9 -0
- package/dist/graph-detail.d.ts.map +1 -1
- package/dist/graph-detail.js +38 -13
- package/dist/graph-refs.d.ts +233 -3
- package/dist/graph-refs.d.ts.map +1 -1
- package/dist/graph-refs.js +106 -15
- package/dist/lint/post-synth.d.ts +22 -0
- package/dist/lint/post-synth.d.ts.map +1 -1
- package/dist/lint/rules/declarable-naming-convention.d.ts +12 -0
- package/dist/lint/rules/declarable-naming-convention.d.ts.map +1 -1
- package/dist/lint/rules/declarable-naming-convention.js +38 -8
- package/dist/lint/rules/imported-source.d.ts +20 -0
- package/dist/lint/rules/imported-source.d.ts.map +1 -0
- package/dist/lint/rules/imported-source.js +27 -0
- package/dist/lint/rules/no-unused-declarable.d.ts.map +1 -1
- package/dist/lint/rules/no-unused-declarable.js +3 -0
- package/dist/op/gate.d.ts +2 -0
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +8 -1
- package/dist/pr-forge-reads.d.ts +17 -0
- package/dist/pr-forge-reads.d.ts.map +1 -1
- package/dist/pr-forge-reads.js +55 -0
- package/dist/reconcile.d.ts +9 -0
- package/dist/reconcile.d.ts.map +1 -1
- package/dist/release-floors.d.ts +9 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +10 -2
- package/dist/repo-path.d.ts +29 -0
- package/dist/repo-path.d.ts.map +1 -0
- package/dist/repo-path.js +81 -0
- package/dist/sensitive-key.d.ts +23 -0
- package/dist/sensitive-key.d.ts.map +1 -1
- package/dist/sensitive-key.js +37 -0
- package/dist/terraform/hcl2json.d.ts +7 -0
- package/dist/terraform/hcl2json.d.ts.map +1 -1
- package/dist/terraform/hcl2json.js +7 -0
- package/dist/wave-runtime.mjs +352 -345
- package/dist/workspace/catalog-edges.d.ts +147 -0
- package/dist/workspace/catalog-edges.d.ts.map +1 -0
- package/dist/workspace/catalog-edges.js +461 -0
- package/dist/workspace/compose-graph.d.ts +73 -3
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/declaration.d.ts +2 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +1 -0
- package/dist/workspace/declaration.schema.json +6 -0
- package/dist/workspace/discover.d.ts +134 -0
- package/dist/workspace/discover.d.ts.map +1 -0
- package/dist/workspace/discover.js +372 -0
- package/dist/workspace/graph-cli.d.ts +20 -0
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/graph-cli.js +178 -20
- package/dist/workspace/graph.schema.json +195 -2
- package/dist/workspace/release-train.d.ts +214 -3
- package/dist/workspace/release-train.d.ts.map +1 -1
- package/dist/workspace/release-train.js +552 -16
- package/dist/workspace/repo-ref.d.ts +14 -0
- package/dist/workspace/repo-ref.d.ts.map +1 -1
- package/dist/workspace/repo-ref.js +26 -1
- package/dist/workspace/workspace-gates.d.ts +24 -0
- package/dist/workspace/workspace-gates.d.ts.map +1 -1
- package/dist/workspace/workspace-gates.js +29 -5
- package/dist/workspace/workspace-ledger.d.ts +31 -5
- package/dist/workspace/workspace-ledger.d.ts.map +1 -1
- package/dist/workspace/workspace-ledger.js +2 -1
- package/dist/workspace/workspace-run.d.ts +14 -0
- package/dist/workspace/workspace-run.d.ts.map +1 -1
- package/dist/workspace/workspace-run.js +2 -2
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +33 -8
- package/package.json +1 -1
- package/src/audit/core.test.ts +64 -1
- package/src/audit/core.ts +75 -10
- package/src/audit/identity.test.ts +31 -0
- package/src/audit/identity.ts +43 -0
- package/src/audit/report-html.ts +4 -2
- package/src/audit/report-model.ts +21 -1
- package/src/change-set-graph.test.ts +33 -1
- package/src/change-set-graph.ts +7 -1
- package/src/change-set.ts +6 -3
- package/src/ci-agent.test.ts +32 -0
- package/src/ci-agent.ts +42 -0
- package/src/ci-comment-allow.test.ts +380 -0
- package/src/ci-comment-allow.ts +184 -0
- package/src/ci-comment-commands.ts +25 -0
- package/src/ci-control.ts +42 -0
- package/src/ci-product.ts +3 -0
- package/src/cli/commands/audit-parser-notice.test.ts +74 -0
- package/src/cli/commands/audit.test.ts +12 -0
- package/src/cli/commands/audit.ts +25 -7
- package/src/cli/commands/import-layout.test.ts +2 -1
- package/src/cli/commands/import.ts +29 -6
- package/src/cli/handlers/agent.ts +13 -2
- package/src/cli/handlers/pr-before-merge.test.ts +18 -0
- package/src/cli/handlers/pr-comment.ts +12 -0
- package/src/cli/handlers/promote.test.ts +68 -0
- package/src/cli/handlers/promote.ts +52 -6
- package/src/cli/main.test.ts +5 -0
- package/src/cli/main.ts +29 -6
- package/src/cli/parse-args.ts +18 -0
- package/src/cli/registry.ts +8 -0
- package/src/cloud-lister/kubernetes.k3d.e2e.test.ts +104 -0
- package/src/cloud-lister/mask-references.test.ts +132 -0
- package/src/cloud-lister/mask.ts +68 -3
- package/src/components/driver.ts +9 -1
- package/src/components/product-pipeline.ts +57 -7
- package/src/components/product-plan.ts +27 -2
- package/src/control/applied.ts +33 -3
- package/src/control/dispatch.ts +156 -5
- package/src/control/train.test.ts +215 -0
- package/src/control/train.ts +413 -0
- package/src/deep-observation.ts +2 -2
- package/src/floor-table.data.ts +7 -1
- package/src/graph-detail.ts +37 -12
- package/src/graph-refs.test.ts +45 -1
- package/src/graph-refs.ts +321 -14
- package/src/lint/post-synth.ts +20 -0
- package/src/lint/rules/declarable-naming-convention.test.ts +35 -1
- package/src/lint/rules/declarable-naming-convention.ts +35 -8
- package/src/lint/rules/imported-source.test.ts +22 -0
- package/src/lint/rules/imported-source.ts +31 -0
- package/src/lint/rules/no-unused-declarable.test.ts +16 -0
- package/src/lint/rules/no-unused-declarable.ts +7 -0
- package/src/op/gate.ts +10 -2
- package/src/pr-forge-reads.ts +62 -0
- package/src/reconcile.ts +9 -0
- package/src/release-floors.ts +14 -2
- package/src/repo-path.test.ts +72 -0
- package/src/repo-path.ts +103 -0
- package/src/sensitive-key.ts +38 -0
- package/src/terraform/hcl2json.ts +8 -0
- package/src/workspace/application-set.e2e.test.ts +405 -0
- package/src/workspace/catalog-edges.ts +507 -0
- package/src/workspace/ci-green-workflow.test.ts +2 -2
- package/src/workspace/cluster-join.e2e.test.ts +150 -0
- package/src/workspace/compose-graph.ts +74 -5
- package/src/workspace/declaration.schema.json +6 -0
- package/src/workspace/declaration.ts +3 -0
- package/src/workspace/discover.e2e.test.ts +122 -0
- package/src/workspace/discover.test.ts +225 -0
- package/src/workspace/discover.ts +406 -0
- package/src/workspace/drift-reader.test.ts +3 -3
- package/src/workspace/external-secret-catalog.e2e.test.ts +98 -0
- package/src/workspace/external-secret-catalog.test.ts +142 -0
- package/src/workspace/graph-cli.ts +207 -21
- package/src/workspace/graph-contract.test.ts +92 -0
- package/src/workspace/graph.schema.json +195 -2
- package/src/workspace/helm-references.e2e.test.ts +135 -0
- package/src/workspace/identity-annotation-catalog.e2e.test.ts +91 -0
- package/src/workspace/identity-annotation-catalog.test.ts +139 -0
- package/src/workspace/release-train-repos.test.ts +304 -0
- package/src/workspace/release-train.test.ts +296 -0
- package/src/workspace/release-train.ts +631 -16
- package/src/workspace/repo-ref.ts +26 -1
- package/src/workspace/runs-on.test.ts +45 -0
- package/src/workspace/workspace-gates.ts +48 -5
- package/src/workspace/workspace-ledger.ts +28 -5
- package/src/workspace/workspace-run.test.ts +1 -1
- package/src/workspace/workspace-run.ts +2 -2
- package/src/yaml.test.ts +96 -8
- package/src/yaml.ts +36 -8
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a path a manifest names lives (#5109): an Argo CD Application's
|
|
3
|
+
* `spec.source.path` is a path inside the repository its `repoURL` names, not
|
|
4
|
+
* inside whatever directory a command was started from.
|
|
5
|
+
*
|
|
6
|
+
* Given the directory of a tree that is being read (the root `chant audit`
|
|
7
|
+
* walks), {@link resolveRepoPath} finds the checkout the tree is in and
|
|
8
|
+
* answers one of three things:
|
|
9
|
+
*
|
|
10
|
+
* - `found` or `missing`: the repository is this one, or no `origin` remote
|
|
11
|
+
* says otherwise, and the path is (or is not) a directory or file below the
|
|
12
|
+
* checkout's root.
|
|
13
|
+
* - `elsewhere`: the checkout's `origin` remote names a different repository
|
|
14
|
+
* than `repoURL`, so the path is in a tree that is not on disk and nothing
|
|
15
|
+
* can be said about it.
|
|
16
|
+
*
|
|
17
|
+
* A tree outside any checkout (an extracted archive) has no remote to compare,
|
|
18
|
+
* and resolves against the directory itself. `requireOrigin` turns that case
|
|
19
|
+
* into `elsewhere`, for a caller that wants a path read only when a remote
|
|
20
|
+
* says the repository is the workspace's own.
|
|
21
|
+
*
|
|
22
|
+
* Reading the remote runs `git`, once per directory.
|
|
23
|
+
*/
|
|
24
|
+
import { execFileSync } from "node:child_process";
|
|
25
|
+
import { statSync } from "node:fs";
|
|
26
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
27
|
+
import { remoteHost, remoteRepoPath } from "./forge-remote.js";
|
|
28
|
+
const trees = new Map();
|
|
29
|
+
function git(cwd, args) {
|
|
30
|
+
try {
|
|
31
|
+
return execFileSync("git", args, { cwd, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim() || undefined;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** The checkout `dir` is in, read once per directory. */
|
|
38
|
+
export function repoTreeOf(dir) {
|
|
39
|
+
const abs = resolve(dir);
|
|
40
|
+
const known = trees.get(abs);
|
|
41
|
+
if (known)
|
|
42
|
+
return known;
|
|
43
|
+
const top = git(abs, ["rev-parse", "--show-toplevel"]);
|
|
44
|
+
const tree = top ? { root: top, origin: git(abs, ["remote", "get-url", "origin"]) } : { root: abs };
|
|
45
|
+
if (tree.origin === undefined)
|
|
46
|
+
delete tree.origin;
|
|
47
|
+
trees.set(abs, tree);
|
|
48
|
+
return tree;
|
|
49
|
+
}
|
|
50
|
+
/** Whether two repository URLs name the same repository: the same host and path, whatever the scheme, user, case or `.git` suffix. */
|
|
51
|
+
export function sameRepository(a, b) {
|
|
52
|
+
const pa = remoteRepoPath(a);
|
|
53
|
+
const pb = remoteRepoPath(b);
|
|
54
|
+
if (!pa || !pb)
|
|
55
|
+
return false;
|
|
56
|
+
return pa.toLowerCase() === pb.toLowerCase() && remoteHost(a) === remoteHost(b);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Resolve `path`, which a manifest in the tree at `dir` names inside the
|
|
60
|
+
* repository `repoURL`. See the module comment for the three answers.
|
|
61
|
+
*/
|
|
62
|
+
export function resolveRepoPath(dir, repoURL, path, opts = {}) {
|
|
63
|
+
const tree = repoTreeOf(dir);
|
|
64
|
+
if (tree.origin === undefined ? opts.requireOrigin : repoURL !== undefined && repoURL !== "" && !sameRepository(tree.origin, repoURL)) {
|
|
65
|
+
return { status: "elsewhere", path };
|
|
66
|
+
}
|
|
67
|
+
// A path in a repository is relative to its root, with or without a leading slash.
|
|
68
|
+
const full = resolve(tree.root, path.replace(/^\/+/, ""));
|
|
69
|
+
const rel = relative(tree.root, full);
|
|
70
|
+
if (isAbsolute(rel) || rel === ".." || rel.startsWith(`..${sep}`))
|
|
71
|
+
return { status: "missing", path };
|
|
72
|
+
const shown = rel === "" ? "." : rel.split(sep).join("/");
|
|
73
|
+
try {
|
|
74
|
+
const stat = statSync(full);
|
|
75
|
+
const ok = (opts.type ?? "dir") === "dir" ? stat.isDirectory() : stat.isFile();
|
|
76
|
+
return { status: ok ? "found" : "missing", path: shown };
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return { status: "missing", path: shown };
|
|
80
|
+
}
|
|
81
|
+
}
|
package/dist/sensitive-key.d.ts
CHANGED
|
@@ -20,4 +20,27 @@
|
|
|
20
20
|
export declare const SENSITIVE_KEY_PATTERNS: readonly RegExp[];
|
|
21
21
|
/** True when a property name looks secret-bearing (see {@link SENSITIVE_KEY_PATTERNS}). */
|
|
22
22
|
export declare function isSensitiveKey(key: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Reference fields: keys that match {@link SENSITIVE_KEY_PATTERNS} only because
|
|
25
|
+
* the word "secret" is in the name, and whose value names another object
|
|
26
|
+
* instead of holding a secret. `spec.secretStoreRef` on an ExternalSecret is
|
|
27
|
+
* `{ name, kind }`, the pointer to a SecretStore; a joined graph needs it.
|
|
28
|
+
*
|
|
29
|
+
* This is an exact-key allowlist, and the value must also have the shape of a
|
|
30
|
+
* pointer (see {@link isReferenceField}). A key outside the list stays masked
|
|
31
|
+
* by the patterns, so a new field is masked until someone adds it here.
|
|
32
|
+
* `secretKeyRef` is not on the list: its `key` names an entry inside a Secret
|
|
33
|
+
* and the paths that read a masked value (chant import) treat it as one.
|
|
34
|
+
*/
|
|
35
|
+
export declare const REFERENCE_KEYS: ReadonlySet<string>;
|
|
36
|
+
/**
|
|
37
|
+
* True when `key` is a reference key and `value` is a pointer to an object:
|
|
38
|
+
* a plain object whose every field is a string named `name`, `namespace`,
|
|
39
|
+
* `kind` or `apiVersion` (or a list of such objects, for `imagePullSecrets`).
|
|
40
|
+
* Anything else under the same key, a string, a number, an object with a
|
|
41
|
+
* `key` or `value` field, a nested object, is not a pointer and stays masked.
|
|
42
|
+
* The value is not a secret, but the check is on shape so that a value that
|
|
43
|
+
* could be one never passes on the strength of its key.
|
|
44
|
+
*/
|
|
45
|
+
export declare function isReferenceField(key: string, value: unknown): boolean;
|
|
23
46
|
//# sourceMappingURL=sensitive-key.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sensitive-key.d.ts","sourceRoot":"","sources":["../src/sensitive-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAOnD,CAAC;AAEF,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD"}
|
|
1
|
+
{"version":3,"file":"sensitive-key.d.ts","sourceRoot":"","sources":["../src/sensitive-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAOnD,CAAC;AAEF,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAGD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAAgE,CAAC;AAWhH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAIrE"}
|
package/dist/sensitive-key.js
CHANGED
|
@@ -29,3 +29,40 @@ export const SENSITIVE_KEY_PATTERNS = [
|
|
|
29
29
|
export function isSensitiveKey(key) {
|
|
30
30
|
return SENSITIVE_KEY_PATTERNS.some((p) => p.test(key));
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Reference fields: keys that match {@link SENSITIVE_KEY_PATTERNS} only because
|
|
34
|
+
* the word "secret" is in the name, and whose value names another object
|
|
35
|
+
* instead of holding a secret. `spec.secretStoreRef` on an ExternalSecret is
|
|
36
|
+
* `{ name, kind }`, the pointer to a SecretStore; a joined graph needs it.
|
|
37
|
+
*
|
|
38
|
+
* This is an exact-key allowlist, and the value must also have the shape of a
|
|
39
|
+
* pointer (see {@link isReferenceField}). A key outside the list stays masked
|
|
40
|
+
* by the patterns, so a new field is masked until someone adds it here.
|
|
41
|
+
* `secretKeyRef` is not on the list: its `key` names an entry inside a Secret
|
|
42
|
+
* and the paths that read a masked value (chant import) treat it as one.
|
|
43
|
+
*/
|
|
44
|
+
export const REFERENCE_KEYS = new Set(["secretStoreRef", "secretRef", "imagePullSecrets"]);
|
|
45
|
+
/** The only fields a pointer may carry. `key`, `value`, `data` and the like are not here. */
|
|
46
|
+
const REFERENCE_FIELDS = new Set(["name", "namespace", "kind", "apiVersion"]);
|
|
47
|
+
function isPointer(value) {
|
|
48
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
49
|
+
return false;
|
|
50
|
+
const entries = Object.entries(value);
|
|
51
|
+
return entries.every(([k, v]) => REFERENCE_FIELDS.has(k) && typeof v === "string");
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* True when `key` is a reference key and `value` is a pointer to an object:
|
|
55
|
+
* a plain object whose every field is a string named `name`, `namespace`,
|
|
56
|
+
* `kind` or `apiVersion` (or a list of such objects, for `imagePullSecrets`).
|
|
57
|
+
* Anything else under the same key, a string, a number, an object with a
|
|
58
|
+
* `key` or `value` field, a nested object, is not a pointer and stays masked.
|
|
59
|
+
* The value is not a secret, but the check is on shape so that a value that
|
|
60
|
+
* could be one never passes on the strength of its key.
|
|
61
|
+
*/
|
|
62
|
+
export function isReferenceField(key, value) {
|
|
63
|
+
if (!REFERENCE_KEYS.has(key))
|
|
64
|
+
return false;
|
|
65
|
+
if (Array.isArray(value))
|
|
66
|
+
return value.length > 0 && value.every(isPointer);
|
|
67
|
+
return isPointer(value);
|
|
68
|
+
}
|
|
@@ -17,6 +17,13 @@ export interface Hcl2Json {
|
|
|
17
17
|
}>>;
|
|
18
18
|
}
|
|
19
19
|
export declare class Hcl2JsonNotInstalled extends Error {
|
|
20
|
+
/**
|
|
21
|
+
* The npm package that is missing. `chant audit` reads this property on any
|
|
22
|
+
* error an entities parser throws (see `parserPackageOf` in `audit/core`),
|
|
23
|
+
* so a lexicon reports a missing optional parser by setting it, with no
|
|
24
|
+
* import of this class.
|
|
25
|
+
*/
|
|
26
|
+
readonly parserPackage = "@cdktn/hcl2json";
|
|
20
27
|
constructor(cause: unknown);
|
|
21
28
|
}
|
|
22
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hcl2json.d.ts","sourceRoot":"","sources":["../../src/terraform/hcl2json.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,wDAAwD;AACxD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAChE,yFAAyF;IACzF,yBAAyB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;CACxG;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,KAAK,EAAE,OAAO,EAOzB;CACF;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAE3D,2EAA2E;AAC3E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAkBD;;;GAGG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,QAAQ,CAAC,CAStD"}
|
|
1
|
+
{"version":3,"file":"hcl2json.d.ts","sourceRoot":"","sources":["../../src/terraform/hcl2json.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,wDAAwD;AACxD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAChE,yFAAyF;IACzF,yBAAyB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;CACxG;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,qBAAqB;IAE3C,YAAY,KAAK,EAAE,OAAO,EAOzB;CACF;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAE3D,2EAA2E;AAC3E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAkBD;;;GAGG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,QAAQ,CAAC,CAStD"}
|
|
@@ -13,6 +13,13 @@ export class Hcl2JsonNotInstalled extends Error {
|
|
|
13
13
|
super("Terraform carve-out needs the HCL parser, which is not installed.\n" +
|
|
14
14
|
" Install it once: npm install -D @cdktn/hcl2json\n" +
|
|
15
15
|
`(underlying error: ${cause instanceof Error ? cause.message : String(cause)})`);
|
|
16
|
+
/**
|
|
17
|
+
* The npm package that is missing. `chant audit` reads this property on any
|
|
18
|
+
* error an entities parser throws (see `parserPackageOf` in `audit/core`),
|
|
19
|
+
* so a lexicon reports a missing optional parser by setting it, with no
|
|
20
|
+
* import of this class.
|
|
21
|
+
*/
|
|
22
|
+
this.parserPackage = "@cdktn/hcl2json";
|
|
16
23
|
this.name = "Hcl2JsonNotInstalled";
|
|
17
24
|
}
|
|
18
25
|
}
|