@hubble-ventures/infisicml 1.2.1 → 2.0.0
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 +66 -1
- package/README.md +94 -94
- package/dist/aliases.d.ts +11 -5
- package/dist/aliases.d.ts.map +1 -1
- package/dist/aliases.js +20 -12
- package/dist/aliases.js.map +1 -1
- package/dist/ci-skip.d.ts +32 -15
- package/dist/ci-skip.d.ts.map +1 -1
- package/dist/ci-skip.js +48 -39
- package/dist/ci-skip.js.map +1 -1
- package/dist/commands/export-gha.d.ts +16 -0
- package/dist/commands/export-gha.d.ts.map +1 -1
- package/dist/commands/export-gha.js +48 -39
- package/dist/commands/export-gha.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +17 -25
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/paths.d.ts.map +1 -1
- package/dist/commands/paths.js +11 -10
- package/dist/commands/paths.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +6 -3
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +1 -11
- package/dist/commands/validate.js.map +1 -1
- package/dist/github-env.js +1 -1
- package/dist/github-env.js.map +1 -1
- package/dist/include.d.ts +6 -43
- package/dist/include.d.ts.map +1 -1
- package/dist/include.js +11 -67
- package/dist/include.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +14 -35
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +26 -85
- package/dist/manifest.js.map +1 -1
- package/dist/pull.d.ts.map +1 -1
- package/dist/pull.js +11 -16
- package/dist/pull.js.map +1 -1
- package/dist/tree.d.ts +49 -0
- package/dist/tree.d.ts.map +1 -0
- package/dist/tree.js +190 -0
- package/dist/tree.js.map +1 -0
- package/package.json +4 -2
- package/schema/secrets.schema.json +49 -43
package/dist/ci-skip.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { applyAliases } from "./aliases.js";
|
|
2
|
+
import { enforceKnownKeys } from "./include.js";
|
|
3
3
|
export function mergeFolderSecrets(chunks) {
|
|
4
4
|
const merged = {};
|
|
5
5
|
for (const chunk of chunks) {
|
|
@@ -7,52 +7,61 @@ export function mergeFolderSecrets(chunks) {
|
|
|
7
7
|
}
|
|
8
8
|
return merged;
|
|
9
9
|
}
|
|
10
|
-
export async function fetchSecretsForPaths(provider, envName, paths) {
|
|
11
|
-
const chunks = [];
|
|
12
|
-
for (const folder of paths) {
|
|
13
|
-
chunks.push(await provider.exportFolder(envName, folder));
|
|
14
|
-
}
|
|
15
|
-
return mergeFolderSecrets(chunks);
|
|
16
|
-
}
|
|
17
10
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
11
|
+
* Fetch each compiled folder and select *that folder's* declared keys from it,
|
|
12
|
+
* honoring the resolved `fetch` mode. `keys` mode requests only the declared
|
|
13
|
+
* keys per folder (the tree names the exact canonical vault keys, so no
|
|
14
|
+
* allowlist reverse-map is needed — the alias *source* is the real key);
|
|
15
|
+
* `folder` mode reads the whole folder and picks the declared keys locally.
|
|
16
|
+
*
|
|
17
|
+
* Returns one {@link FolderSecrets} per folder so downstream steps keep folder
|
|
18
|
+
* provenance: two folders declaring the same key name are distinct entries here,
|
|
19
|
+
* and only collapse (last-wins) at the final merge — see {@link materializeSecrets}.
|
|
22
20
|
*/
|
|
23
|
-
export async function
|
|
24
|
-
const
|
|
25
|
-
for (const folder of
|
|
26
|
-
|
|
21
|
+
export async function fetchCompiledFolders(provider, envName, folders, fetchMode) {
|
|
22
|
+
const out = [];
|
|
23
|
+
for (const folder of folders) {
|
|
24
|
+
const declared = folder.keys.map((k) => k.key);
|
|
25
|
+
const raw = fetchMode === "keys"
|
|
26
|
+
? await provider.exportKeys(envName, folder.path, declared)
|
|
27
|
+
: await provider.exportFolder(envName, folder.path);
|
|
28
|
+
const selected = {};
|
|
29
|
+
for (const key of declared) {
|
|
30
|
+
if (key in raw)
|
|
31
|
+
selected[key] = raw[key];
|
|
32
|
+
}
|
|
33
|
+
out.push({ folder, selected });
|
|
27
34
|
}
|
|
28
|
-
return
|
|
35
|
+
return out;
|
|
29
36
|
}
|
|
30
37
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
38
|
+
* Turn per-folder fetched secrets into the final emit map, preserving folder
|
|
39
|
+
* provenance:
|
|
40
|
+
*
|
|
41
|
+
* - **Missing keys are checked per folder/key pair, before merging.** A key
|
|
42
|
+
* declared in `/a` but absent from `/a` is unknown even if a same-named key in
|
|
43
|
+
* `/b` was produced — so a genuine miss can't be masked by another folder.
|
|
44
|
+
* - **Aliases expand from the folder-local value.** `/a`'s `TOKEN -> A_TOKEN`
|
|
45
|
+
* uses `/a`'s `TOKEN`, and `/b`'s `TOKEN -> B_TOKEN` uses `/b`'s — the flat
|
|
46
|
+
* merge (which keeps only one `TOKEN`) can no longer route one folder's secret
|
|
47
|
+
* to another folder's alias.
|
|
35
48
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
49
|
+
* Folder-local aliased maps then merge in tree order (last-wins on a genuine
|
|
50
|
+
* cross-folder name collision). A declared key absent from its folder fails
|
|
51
|
+
* unless its name is in `optionalKeys` for the environment.
|
|
39
52
|
*/
|
|
40
|
-
export
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const where = profile
|
|
48
|
-
? `neither profile "${profile}" nor the manifest root defines one`
|
|
49
|
-
: "the manifest root does not define one";
|
|
50
|
-
throw new Error(`fetch: "keys" requires an include allowlist, but ${where}. ` +
|
|
51
|
-
"Add `include: [...]` naming exactly which keys to request from the vault.");
|
|
53
|
+
export function materializeSecrets(folderSecrets, optionalKeys) {
|
|
54
|
+
const unknown = [];
|
|
55
|
+
const chunks = [];
|
|
56
|
+
for (const { folder, selected } of folderSecrets) {
|
|
57
|
+
for (const key of folder.keys) {
|
|
58
|
+
if (!(key.key in selected))
|
|
59
|
+
unknown.push(key.key);
|
|
52
60
|
}
|
|
53
|
-
|
|
61
|
+
chunks.push(applyAliases(selected, [folder]));
|
|
54
62
|
}
|
|
55
|
-
|
|
63
|
+
enforceKnownKeys(unknown, optionalKeys);
|
|
64
|
+
return mergeFolderSecrets(chunks);
|
|
56
65
|
}
|
|
57
66
|
export function isCi() {
|
|
58
67
|
const ci = process.env.CI;
|
package/dist/ci-skip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-skip.js","sourceRoot":"","sources":["../src/ci-skip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ci-skip.js","sourceRoot":"","sources":["../src/ci-skip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAchD,MAAM,UAAU,kBAAkB,CAChC,MAAgC;IAEhC,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,QAAyB,EACzB,OAAe,EACf,OAAyB,EACzB,SAA4B;IAE5B,MAAM,GAAG,GAAoB,EAAE,CAAC;IAChC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,IAA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,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1B,OAAO,EAAE,KAAK,MAAM,IAAI,EAAE,KAAK,GAAG,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,QAAyB,EACzB,KAAc;IAEd,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,IAAI,CAAC,IAAI,EAAE;QAAE,OAAO,KAAK,CAAC;IAE1B,MAAM,EAAE,GAAG,QAAQ,CAAC,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;IAEtB,IAAI,EAAE,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE7B,MAAM,IAAI,GAAG,EAAE,CAAC,WAAW,IAAI,EAAE,CAAC;IAClC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACxB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,QAAyB;IACrD,OAAO,QAAQ,CAAC,EAAE,EAAE,WAAW,IAAI,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CompiledFolder } from "../tree.js";
|
|
1
2
|
export type ExportGhaOptions = {
|
|
2
3
|
packageId: string;
|
|
3
4
|
env: string;
|
|
@@ -7,5 +8,20 @@ export type ExportGhaOptions = {
|
|
|
7
8
|
projectSlug?: string;
|
|
8
9
|
identityId?: string;
|
|
9
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Canonical (pre-alias) key names to advertise, split runtime vs all.
|
|
13
|
+
*
|
|
14
|
+
* Classification is by **(path, key)** against the base tree, not by folder path
|
|
15
|
+
* alone: a profile can reuse a base folder path and add deploy-only keys, so a
|
|
16
|
+
* key counts as runtime only if the base tree declares *that key* under *that
|
|
17
|
+
* path*. This keeps a deploy-only credential in a shared folder out of the
|
|
18
|
+
* runtime-scoped advertise set (and thus out of runtime deploy forwarding).
|
|
19
|
+
* Only keys actually in `emitted` are advertised, so an absent optional key is
|
|
20
|
+
* never named.
|
|
21
|
+
*/
|
|
22
|
+
export declare function computeAdvertiseKeys(allFolders: CompiledFolder[], baseFolders: CompiledFolder[], emitted: Record<string, string>): {
|
|
23
|
+
runtimeKeys: string[];
|
|
24
|
+
allKeys: string[];
|
|
25
|
+
};
|
|
10
26
|
export declare function runExportGha(options: ExportGhaOptions): Promise<void>;
|
|
11
27
|
//# sourceMappingURL=export-gha.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-gha.d.ts","sourceRoot":"","sources":["../../src/commands/export-gha.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"export-gha.d.ts","sourceRoot":"","sources":["../../src/commands/export-gha.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,cAAc,EAAE,EAC5B,WAAW,EAAE,cAAc,EAAE,EAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B;IAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAiB9C;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuE3E"}
|
|
@@ -1,14 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fetchManifestSecrets } from "../ci-skip.js";
|
|
1
|
+
import { fetchCompiledFolders, materializeSecrets } from "../ci-skip.js";
|
|
3
2
|
import { loadConfig } from "../config.js";
|
|
4
3
|
import { normalizeEnvSlug } from "../env-slug.js";
|
|
5
4
|
import { appendSecretsToGithubEnv } from "../github-env.js";
|
|
6
5
|
import { runAdvertiseKeysHooks } from "../hooks.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { logMissingOptionalKeys, resolveOptionalKeys, } from "../optional-keys.js";
|
|
6
|
+
import { normalizeFolderPath, resolveCompiledFolders, resolveFetchMode, } from "../manifest.js";
|
|
7
|
+
import { resolveOptionalKeys } from "../optional-keys.js";
|
|
10
8
|
import { RemoteProvider } from "../providers/remote.js";
|
|
11
9
|
import { discoverManifests } from "../registry.js";
|
|
10
|
+
/**
|
|
11
|
+
* Canonical (pre-alias) key names to advertise, split runtime vs all.
|
|
12
|
+
*
|
|
13
|
+
* Classification is by **(path, key)** against the base tree, not by folder path
|
|
14
|
+
* alone: a profile can reuse a base folder path and add deploy-only keys, so a
|
|
15
|
+
* key counts as runtime only if the base tree declares *that key* under *that
|
|
16
|
+
* path*. This keeps a deploy-only credential in a shared folder out of the
|
|
17
|
+
* runtime-scoped advertise set (and thus out of runtime deploy forwarding).
|
|
18
|
+
* Only keys actually in `emitted` are advertised, so an absent optional key is
|
|
19
|
+
* never named.
|
|
20
|
+
*/
|
|
21
|
+
export function computeAdvertiseKeys(allFolders, baseFolders, emitted) {
|
|
22
|
+
const baseKeysByPath = new Map();
|
|
23
|
+
for (const f of baseFolders) {
|
|
24
|
+
baseKeysByPath.set(f.path, new Set(f.keys.map((k) => k.key)));
|
|
25
|
+
}
|
|
26
|
+
const runtimeKeys = new Set();
|
|
27
|
+
const allKeys = new Set();
|
|
28
|
+
for (const folder of allFolders) {
|
|
29
|
+
for (const key of folder.keys) {
|
|
30
|
+
if (emitted[key.key] === undefined)
|
|
31
|
+
continue;
|
|
32
|
+
allKeys.add(key.key);
|
|
33
|
+
if (baseKeysByPath.get(folder.path)?.has(key.key)) {
|
|
34
|
+
runtimeKeys.add(key.key);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return { runtimeKeys: [...runtimeKeys], allKeys: [...allKeys] };
|
|
39
|
+
}
|
|
12
40
|
export async function runExportGha(options) {
|
|
13
41
|
const config = await loadConfig(options.cwd);
|
|
14
42
|
const envName = normalizeEnvSlug(process.env.INFISICAL_ENV_SLUG ?? options.env);
|
|
@@ -25,13 +53,11 @@ export async function runExportGha(options) {
|
|
|
25
53
|
if (!manifest) {
|
|
26
54
|
throw new Error(`Unknown package id: ${options.packageId}`);
|
|
27
55
|
}
|
|
28
|
-
//
|
|
29
|
-
// replace
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const runtimePaths = basePaths.filter((p) => allPaths.includes(p));
|
|
34
|
-
const deployOnlyPaths = allPaths.filter((p) => !runtimePaths.includes(p));
|
|
56
|
+
// The base tree holds the app's runtime secrets; a profile (e.g. `deploy`)
|
|
57
|
+
// may replace it with a superset that also carries deploy-time credentials.
|
|
58
|
+
const allFolders = resolveCompiledFolders(manifest.config, options.profile);
|
|
59
|
+
const baseFolders = resolveCompiledFolders(manifest.config);
|
|
60
|
+
const fetchMode = resolveFetchMode(manifest.config, options.profile);
|
|
35
61
|
const identityId = options.identityId ?? process.env.INFISICAL_IDENTITY_ID;
|
|
36
62
|
if (!identityId) {
|
|
37
63
|
throw new Error("INFISICAL_IDENTITY_ID required — infisicml CI auth is GitHub OIDC only (no client-id/secret fallback). Set `permissions: id-token: write` on the job.");
|
|
@@ -42,38 +68,21 @@ export async function runExportGha(options) {
|
|
|
42
68
|
identityId,
|
|
43
69
|
oidcAudience: process.env.INFISICAL_OIDC_AUDIENCE ?? config.auth?.oidcAudience,
|
|
44
70
|
});
|
|
45
|
-
for (const folder of
|
|
46
|
-
console.log(`Loading Infisical path ${normalizeFolderPath(folder)} (${envName})`);
|
|
71
|
+
for (const folder of allFolders) {
|
|
72
|
+
console.log(`Loading Infisical path ${normalizeFolderPath(folder.path)} (${envName})`);
|
|
47
73
|
}
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
: {};
|
|
74
|
+
// One per-folder fetch (token cached across folders). Per-folder alias
|
|
75
|
+
// expansion + missing-key enforcement (before the merge) keeps provenance, so
|
|
76
|
+
// a key declared in two folders can't have one folder's miss masked by the
|
|
77
|
+
// other, nor one folder's value routed to the other's alias.
|
|
78
|
+
const folderSecrets = await fetchCompiledFolders(provider, envName, allFolders, fetchMode);
|
|
54
79
|
const optionalKeys = resolveOptionalKeys(manifest.config, envName);
|
|
55
|
-
const
|
|
56
|
-
// Default-deny key selection: emit only the allowlisted keys when `include`
|
|
57
|
-
// is set. Absent = emit all.
|
|
58
|
-
const include = resolveInclude(manifest.config, options.profile);
|
|
59
|
-
// Notice missing optional keys against the pre-include set — a key present in
|
|
60
|
-
// the folders but filtered out by `include` isn't "missing". Skip keys the
|
|
61
|
-
// allowlist governs: those get a single notice from selectEmittedSecrets'
|
|
62
|
-
// unknown-key check, so we don't emit two notices for the same absent key.
|
|
63
|
-
const includeSet = new Set(include ?? []);
|
|
64
|
-
logMissingOptionalKeys(aliased, optionalKeys.filter((k) => !includeSet.has(k)));
|
|
65
|
-
const merged = selectEmittedSecrets(aliased, include, optionalKeys);
|
|
80
|
+
const merged = materializeSecrets(folderSecrets, optionalKeys);
|
|
66
81
|
appendSecretsToGithubEnv(githubEnvPath, merged);
|
|
67
82
|
// Advertise CANONICAL (pre-alias) key names. Alias targets (e.g.
|
|
68
83
|
// NEXT_PUBLIC_*) are build-tool copies, not the names a server runtime reads,
|
|
69
84
|
// so they are intentionally not advertised — they still land in the job env
|
|
70
|
-
// via `merged` for build steps that need them.
|
|
71
|
-
|
|
72
|
-
// then in `merged`) so we never advertise a name not in the job env.
|
|
73
|
-
const emitted = (keys) => keys.filter((k) => merged[k] !== undefined);
|
|
74
|
-
runAdvertiseKeysHooks(githubEnvPath, config.hooks?.advertiseKeys, {
|
|
75
|
-
runtimeKeys: emitted(Object.keys(runtimeSecrets)),
|
|
76
|
-
allKeys: emitted(Object.keys({ ...runtimeSecrets, ...deployOnlySecrets })),
|
|
77
|
-
});
|
|
85
|
+
// via `merged` for build steps that need them.
|
|
86
|
+
runAdvertiseKeysHooks(githubEnvPath, config.hooks?.advertiseKeys, computeAdvertiseKeys(allFolders, baseFolders, merged));
|
|
78
87
|
}
|
|
79
88
|
//# sourceMappingURL=export-gha.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-gha.js","sourceRoot":"","sources":["../../src/commands/export-gha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"export-gha.js","sourceRoot":"","sources":["../../src/commands/export-gha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MA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qBAAqB,CAAC;IAC3E,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,uJAAuJ,CACxJ,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC;QAClC,MAAM,EAAE,MAAM,CAAC,eAAe;QAC9B,WAAW;QACX,UAAU;QACV,YAAY,EACV,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,MAAM,CAAC,IAAI,EAAE,YAAY;KACnE,CAAC,CAAC;IAEH,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE,CAAC;QAChC,OAAO,CAAC,GAAG,CACT,0BAA0B,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,OAAO,GAAG,CAC1E,CAAC;IACJ,CAAC;IAED,uEAAuE;IACvE,8EAA8E;IAC9E,2EAA2E;IAC3E,6DAA6D;IAC7D,MAAM,aAAa,GAAG,MAAM,oBAAoB,CAC9C,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,CACV,CAAC;IACF,MAAM,YAAY,GAAG,mBAAmB,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,kBAAkB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC/D,wBAAwB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAEhD,iEAAiE;IACjE,8EAA8E;IAC9E,4EAA4E;IAC5E,+CAA+C;IAC/C,qBAAqB,CACnB,aAAa,EACb,MAAM,CAAC,KAAK,EAAE,aAAa,EAC3B,oBAAoB,CAAC,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,CACtD,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAoBA,wBAAsB,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBzD"}
|
package/dist/commands/list.js
CHANGED
|
@@ -1,34 +1,26 @@
|
|
|
1
1
|
import { loadConfig } from "../config.js";
|
|
2
|
-
import { normalizeFolderPath } from "../manifest.js";
|
|
2
|
+
import { normalizeFolderPath, resolveCompiledFolders, resolveFetchMode, } from "../manifest.js";
|
|
3
3
|
import { discoverManifests } from "../registry.js";
|
|
4
|
+
function printFolders(folders, indent) {
|
|
5
|
+
for (const folder of folders) {
|
|
6
|
+
console.log(`${indent}${normalizeFolderPath(folder.path)}`);
|
|
7
|
+
for (const key of folder.keys) {
|
|
8
|
+
const alias = key.aliases.length > 0 ? ` → ${key.aliases.join(", ")}` : "";
|
|
9
|
+
console.log(`${indent} ${key.key}${alias}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
4
13
|
export async function runList(cwd) {
|
|
5
14
|
const config = await loadConfig(cwd);
|
|
6
15
|
const manifests = discoverManifests(config);
|
|
7
16
|
for (const { id, config: m } of manifests) {
|
|
8
|
-
const
|
|
9
|
-
console.log(` ${id}:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
if (m.profiles) {
|
|
17
|
-
for (const [name, profile] of Object.entries(m.profiles)) {
|
|
18
|
-
const profilePaths = profile.paths
|
|
19
|
-
.map((p) => normalizeFolderPath(p))
|
|
20
|
-
.join(", ");
|
|
21
|
-
console.log(` [${name}]: ${profilePaths}`);
|
|
22
|
-
// A profile include/fetch replaces the root value; show whichever applies.
|
|
23
|
-
const effectiveInclude = profile.include ?? m.include;
|
|
24
|
-
if (effectiveInclude) {
|
|
25
|
-
console.log(` include: ${effectiveInclude.join(", ")}`);
|
|
26
|
-
}
|
|
27
|
-
const effectiveFetch = profile.fetch ?? m.fetch;
|
|
28
|
-
if (effectiveFetch) {
|
|
29
|
-
console.log(` fetch: ${effectiveFetch}`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
17
|
+
const fetch = resolveFetchMode(m);
|
|
18
|
+
console.log(` ${id}${fetch === "keys" ? " (fetch: keys)" : ""}:`);
|
|
19
|
+
printFolders(resolveCompiledFolders(m), " ");
|
|
20
|
+
for (const name of Object.keys(m.profiles ?? {})) {
|
|
21
|
+
const profileFetch = resolveFetchMode(m, name);
|
|
22
|
+
console.log(` [${name}]${profileFetch === "keys" ? " (fetch: keys)" : ""}:`);
|
|
23
|
+
printFolders(resolveCompiledFolders(m, name), " ");
|
|
32
24
|
}
|
|
33
25
|
}
|
|
34
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnD,SAAS,YAAY,CAAC,OAAyB,EAAE,MAAc;IAC7D,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5D,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAC9B,MAAM,KAAK,GACT,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAA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.ts","sourceRoot":"","sources":["../../src/commands/paths.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAsB,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BnE"}
|
package/dist/commands/paths.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadConfig } from "../config.js";
|
|
2
|
-
import { normalizeFolderPath,
|
|
2
|
+
import { normalizeFolderPath, resolveCompiledFolders, resolveFetchMode, } from "../manifest.js";
|
|
3
3
|
import { discoverManifests } from "../registry.js";
|
|
4
4
|
export async function runPaths(options) {
|
|
5
5
|
const config = await loadConfig(options.cwd);
|
|
@@ -8,17 +8,18 @@ export async function runPaths(options) {
|
|
|
8
8
|
if (!manifest) {
|
|
9
9
|
throw new Error(`Unknown package id: ${options.packageId}`);
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
const normalized =
|
|
13
|
-
// `paths` feeds the infisical CLI, which fetches whole folders —
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
const folders = resolveCompiledFolders(manifest.config, options.profile);
|
|
12
|
+
const normalized = folders.map((f) => normalizeFolderPath(f.path));
|
|
13
|
+
// `paths` feeds the infisical CLI, which fetches whole folders — the tree's
|
|
14
|
+
// per-folder key selection happens later, in pull/export-gha. Note on stderr
|
|
15
|
+
// which keys each folder emits so the selection isn't invisible to someone
|
|
16
|
+
// reading only this folder list.
|
|
17
|
+
for (const folder of folders) {
|
|
18
|
+
const keys = folder.keys.map((k) => k.key).join(", ");
|
|
19
|
+
console.error(`# note: ${normalizeFolderPath(folder.path)} emits: ${keys}`);
|
|
19
20
|
}
|
|
20
21
|
if (resolveFetchMode(manifest.config, options.profile) === "keys") {
|
|
21
|
-
console.error(`# note: ${options.packageId} uses fetch: "keys" — only the
|
|
22
|
+
console.error(`# note: ${options.packageId} uses fetch: "keys" — only the declared keys are read, per-key from the vault (wire-level least privilege).`);
|
|
22
23
|
}
|
|
23
24
|
if (options.comma) {
|
|
24
25
|
console.log(normalized.map((p) => p.replace(/^\//, "")).join(","));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/commands/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/commands/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AASnD,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAAqB;IAClD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,SAAS,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACnE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,uBAAuB,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,OAAO,GAAG,sBAAsB,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACzE,MAAM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;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAsB,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAsB,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAmClE"}
|
package/dist/commands/run.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import { loadConfig } from "../config.js";
|
|
3
3
|
import { normalizeEnvSlug } from "../env-slug.js";
|
|
4
|
-
import { normalizeFolderPath,
|
|
4
|
+
import { normalizeFolderPath, resolveCompiledFolders } from "../manifest.js";
|
|
5
5
|
import { discoverManifests } from "../registry.js";
|
|
6
6
|
export async function runExec(options) {
|
|
7
7
|
const config = await loadConfig(options.cwd);
|
|
@@ -19,8 +19,11 @@ export async function runExec(options) {
|
|
|
19
19
|
});
|
|
20
20
|
return result.status ?? 1;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
const pathFlags =
|
|
22
|
+
const folders = resolveCompiledFolders(manifest.config, options.profile);
|
|
23
|
+
const pathFlags = folders.flatMap((f) => [
|
|
24
|
+
"--path",
|
|
25
|
+
normalizeFolderPath(f.path),
|
|
26
|
+
]);
|
|
24
27
|
const result = spawnSync("infisical", ["run", `--env=${envName}`, ...pathFlags, "--", ...options.command], { stdio: "inherit", cwd: repoRoot });
|
|
25
28
|
if (result.error) {
|
|
26
29
|
throw result.error;
|
package/dist/commands/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAUnD,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,OAAmB;IAC/C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjC,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAE3E,MAAM,SAAS,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CA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ourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAIA,wBAAsB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB7D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadConfig } from "../config.js";
|
|
2
|
-
import {
|
|
2
|
+
import { secretsManifestSchema } from "../manifest.js";
|
|
3
3
|
import { discoverManifests } from "../registry.js";
|
|
4
4
|
export async function runValidate(cwd) {
|
|
5
5
|
const config = await loadConfig(cwd);
|
|
@@ -13,16 +13,6 @@ export async function runValidate(cwd) {
|
|
|
13
13
|
console.error(` ${issue.path.join(".")}: ${issue.message}`);
|
|
14
14
|
}
|
|
15
15
|
errors += 1;
|
|
16
|
-
continue;
|
|
17
|
-
}
|
|
18
|
-
// Cross-field checks the schema can't express (depend on resolved profile).
|
|
19
|
-
const semanticIssues = checkFetchIncludeConsistency(result.data);
|
|
20
|
-
if (semanticIssues.length > 0) {
|
|
21
|
-
console.error(`❌ ${id} (${dir}/secrets.json):`);
|
|
22
|
-
for (const issue of semanticIssues) {
|
|
23
|
-
console.error(` ${issue}`);
|
|
24
|
-
}
|
|
25
|
-
errors += 1;
|
|
26
16
|
}
|
|
27
17
|
}
|
|
28
18
|
if (errors > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAY;IAC5C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,KAAK,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,SAAS,EAAE,CAAC;QAC/C,MAAM,MAAM,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,iBAAiB,CAAC,CAAC;YAChD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;gBACxC,OAAO,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAChE,CAAC;YACD,MAAM,IAAI,CAAC,CAAC;QACd,CAAC;IACH,CAAC;IAED,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,oBAAoB,MAAM,sBAAsB,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,MAAM,oBAAoB,CAAC,CAAC;AACzD,CAAC"}
|
package/dist/github-env.js
CHANGED
|
@@ -9,7 +9,7 @@ export function appendSecretToGithubEnv(githubEnvPath, key, value) {
|
|
|
9
9
|
const masked = line.replaceAll("%", "%25");
|
|
10
10
|
process.stdout.write(`::add-mask::${masked}\n`);
|
|
11
11
|
}
|
|
12
|
-
let delim = `
|
|
12
|
+
let delim = `INFISICML_${key}_${Date.now()}${process.hrtime.bigint()}`;
|
|
13
13
|
while (value.includes(delim)) {
|
|
14
14
|
delim = `${delim}_`;
|
|
15
15
|
}
|
package/dist/github-env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-env.js","sourceRoot":"","sources":["../src/github-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,UAAU,uBAAuB,CACrC,aAAqB,EACrB,GAAW,EACX,KAAa;IAEb,IAAI,CAAC,GAAG;QAAE,OAAO;IAEjB,mFAAmF;IACnF,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,IAAI;YAAE,SAAS;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,MAAM,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,IAAI,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"github-env.js","sourceRoot":"","sources":["../src/github-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,UAAU,uBAAuB,CACrC,aAAqB,EACrB,GAAW,EACX,KAAa;IAEb,IAAI,CAAC,GAAG;QAAE,OAAO;IAEjB,mFAAmF;IACnF,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,IAAI;YAAE,SAAS;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,MAAM,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,IAAI,KAAK,GAAG,aAAa,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;IACvE,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,KAAK,GAAG,GAAG,KAAK,GAAG,CAAC;IACtB,CAAC;IAED,cAAc,CAAC,aAAa,EAAE,GAAG,GAAG,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,aAAqB,EACrB,OAA+B;IAE/B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACnD,uBAAuB,CAAC,aAAa,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,aAAqB,EACrB,GAAW,EACX,KAAa;IAEb,IAAI,CAAC,GAAG;QAAE,OAAO;IACjB,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,sBAAsB,CAAC,CAAC;IAC3E,CAAC;IACD,cAAc,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC;AACrD,CAAC"}
|
package/dist/include.d.ts
CHANGED
|
@@ -1,46 +1,9 @@
|
|
|
1
|
-
import type { SecretsManifest } from "./manifest.js";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* (so the source value exists to materialize the target). Phantom entries — an
|
|
9
|
-
* alias target that isn't a real vault key — simply miss on fetch, which is
|
|
10
|
-
* harmless: the post-fetch {@link selectEmittedSecrets} still validates the
|
|
11
|
-
* emitted set against `include`, so a genuinely-missing key fails there exactly
|
|
12
|
-
* as in folder mode.
|
|
2
|
+
* A declared key (a tree `raw` entry or `aliased` source) that no folder
|
|
3
|
+
* produced is treated like a missing required key: fail, unless it's listed in
|
|
4
|
+
* the environment's `optionalKeys`, in which case it's downgraded to a
|
|
5
|
+
* `::notice::`. Enforced identically in `pull` and `export-gha` so the two
|
|
6
|
+
* surfaces stay consistent.
|
|
13
7
|
*/
|
|
14
|
-
export declare function
|
|
15
|
-
export type IncludeResult = {
|
|
16
|
-
/** The emitted map after allowlist filtering. */
|
|
17
|
-
filtered: Record<string, string>;
|
|
18
|
-
/** `include` names that no folder produced (absent from the input map). */
|
|
19
|
-
unknown: string[];
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Filter a materialized secret map down to the `include` allowlist.
|
|
23
|
-
*
|
|
24
|
-
* Runs *after* {@link applyAliases}, so it filters the final set of names: an
|
|
25
|
-
* alias whose source isn't listed still emits its target, and a canonical key
|
|
26
|
-
* not listed is dropped even when its alias target is kept.
|
|
27
|
-
*
|
|
28
|
-
* When `include` is `undefined` this is a pass-through (emit all keys) — the
|
|
29
|
-
* backward-compatible default. Returns a new object; the input is not mutated.
|
|
30
|
-
*/
|
|
31
|
-
export declare function applyInclude(merged: Record<string, string>, include: string[] | undefined): IncludeResult;
|
|
32
|
-
/**
|
|
33
|
-
* An `include` name that no folder produced is treated like a missing required
|
|
34
|
-
* key: fail, unless it's listed in the environment's `optionalKeys`, in which
|
|
35
|
-
* case it's downgraded to a `::notice::`. Enforced identically in `pull` and
|
|
36
|
-
* `export-gha` so the two surfaces stay consistent.
|
|
37
|
-
*/
|
|
38
|
-
export declare function enforceIncludeKnown(unknown: string[], optionalKeys: string[]): void;
|
|
39
|
-
/**
|
|
40
|
-
* Shared allowlist step for both emit surfaces: filter the aliased map to the
|
|
41
|
-
* (already-resolved) `include` and enforce the unknown-key policy. Callers
|
|
42
|
-
* resolve `include` once — with {@link resolveInclude} — so the value they use
|
|
43
|
-
* for headers/logging is the same one that governs the filter.
|
|
44
|
-
*/
|
|
45
|
-
export declare function selectEmittedSecrets(aliased: Record<string, string>, include: string[] | undefined, optionalKeys: string[]): Record<string, string>;
|
|
8
|
+
export declare function enforceKnownKeys(unknown: string[], optionalKeys: string[]): void;
|
|
46
9
|
//# sourceMappingURL=include.d.ts.map
|
package/dist/include.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"include.d.ts","sourceRoot":"","sources":["../src/include.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"include.d.ts","sourceRoot":"","sources":["../src/include.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,MAAM,EAAE,GACrB,IAAI,CAoBN"}
|