@hubble-ventures/infisicml 1.2.1 → 2.1.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 +103 -1
- package/README.md +123 -118
- 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 +52 -43
- 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 +15 -14
- package/dist/commands/paths.js.map +1 -1
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +12 -9
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +10 -7
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +3 -13
- package/dist/commands/validate.js.map +1 -1
- package/dist/config.d.ts +4 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/github-env.js +1 -1
- package/dist/github-env.js.map +1 -1
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +2 -2
- 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 +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +59 -35
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +95 -86
- 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/registry.d.ts +28 -5
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +38 -13
- package/dist/registry.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 +5 -2
- package/schema/secrets.schema.json +49 -43
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,CAqClE"}
|
package/dist/commands/run.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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,
|
|
5
|
-
import {
|
|
4
|
+
import { normalizeFolderPath, resolveCompiledFolders } from "../manifest.js";
|
|
5
|
+
import { discoverPackages, loadPackage } from "../registry.js";
|
|
6
6
|
export async function runExec(options) {
|
|
7
7
|
const config = await loadConfig(options.cwd);
|
|
8
8
|
const repoRoot = config.repoRoot;
|
|
9
9
|
const envName = normalizeEnvSlug(process.env.INFISICAL_ENV ?? options.env);
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
if (!manifest) {
|
|
10
|
+
const ref = discoverPackages(config).find((p) => p.id === options.packageId);
|
|
11
|
+
if (!ref) {
|
|
13
12
|
throw new Error(`Unknown package id: ${options.packageId}`);
|
|
14
13
|
}
|
|
14
|
+
const manifest = loadPackage(ref);
|
|
15
15
|
if (process.env.INFISICAL_DISABLE === "1") {
|
|
16
16
|
const result = spawnSync(options.command[0], options.command.slice(1), {
|
|
17
17
|
stdio: "inherit",
|
|
@@ -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,EAA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rE,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE,QAAQ;SACd,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,OAAO,GAAG,sBAAsB,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACzE,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACvC,QAAQ;QACR,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC;KAC5B,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,SAAS,CACtB,WAAW,EACX,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,GAAG,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,EACnE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,CACpC,CAAC;IAEF,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,MAAM,MAAM,CAAC,KAAK,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAIA,wBAAsB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB7D"}
|
|
@@ -1,28 +1,18 @@
|
|
|
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);
|
|
6
6
|
const manifests = discoverManifests(config);
|
|
7
7
|
let errors = 0;
|
|
8
|
-
for (const { id,
|
|
8
|
+
for (const { id, config: m, file } of manifests) {
|
|
9
9
|
const result = secretsManifestSchema.safeParse(m);
|
|
10
10
|
if (!result.success) {
|
|
11
|
-
console.error(`❌ ${id} (${
|
|
11
|
+
console.error(`❌ ${id} (${file.path}):`);
|
|
12
12
|
for (const issue of result.error.issues) {
|
|
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,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,SAAS,EAAE,CAAC;QAChD,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,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;YACzC,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/config.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* How Infisicml discovers per-package
|
|
3
|
-
* driven entirely by config, so no repo layout is
|
|
2
|
+
* How Infisicml discovers per-package secrets manifests (`secrets.yaml`, or
|
|
3
|
+
* `secrets.json`). Discovery is driven entirely by config, so no repo layout is
|
|
4
|
+
* baked into the tool.
|
|
4
5
|
*/
|
|
5
6
|
export type DiscoveryConfig = {
|
|
6
7
|
/**
|
|
7
8
|
* Parent directories scanned one level deep. Any immediate child directory
|
|
8
|
-
* containing a
|
|
9
|
+
* containing a secrets manifest becomes a package whose id is the child dir
|
|
9
10
|
* name (e.g. `roots: ["nextjs-apps", "vite-apps"]`).
|
|
10
11
|
*/
|
|
11
12
|
roots?: string[];
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,eAAe,CAAC;IAC3B,IAAI,CAAC,EAAE;QACL,wDAAwD;QACxD,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAC;KACrC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,eAAe,GAAG;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,iEAAiE;AACjE,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAErE;AAqDD,wBAAsB,UAAU,CAAC,GAAG,SAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAY7E"}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA0D1C,iEAAiE;AACjE,MAAM,UAAU,YAAY,CAAC,MAAuB;IAClD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,gBAAgB,GAAG;IACvB,uBAAuB;IACvB,sBAAsB;IACtB,qBAAqB;CACtB,CAAC;AAEF,SAAS,cAAc,CAAC,QAAgB;IACtC,IAAI,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5B,OAAO,IAAI,EAAE,CAAC;QACZ,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;YACpC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAClC,IAAI,UAAU,CAAC,SAAS,CAAC;gBAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC7D,CA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AAoB;gBAAE,OAAO,MAAM,CAAC,oBAAoB,CAAC;QACtE,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CACb,iHAAiH,CAClH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;IAClD,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC;IAC1C,4EAA4E;IAC5E,wEAAwE;IACxE,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,CAAC;QACH,SAAS,GAAG,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,SAAS,GAAG,EAAE,CAAC;IACjB,CAAC;IACD,OAAO,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;AACjD,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;QAA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A+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/hooks.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export declare function keysForScope(hook: AdvertiseKeysHook, input: AdvertiseIn
|
|
|
10
10
|
* Write each configured `advertiseKeys` hook's key list to GITHUB_ENV as a
|
|
11
11
|
* plain (unmasked, non-secret) comma-separated var. Key NAMES only — values are
|
|
12
12
|
* never advertised. A deploy step forwards exactly these keys by value from the
|
|
13
|
-
* job env, so
|
|
14
|
-
* the app (no hand-maintained allowlist in the workflow).
|
|
13
|
+
* job env, so the secrets manifest stays the single source of truth for what
|
|
14
|
+
* lands on the app (no hand-maintained allowlist in the workflow).
|
|
15
15
|
*/
|
|
16
16
|
export declare function runAdvertiseKeysHooks(githubEnvPath: string, hooks: AdvertiseKeysHook[] | undefined, input: AdvertiseInput): void;
|
|
17
17
|
//# sourceMappingURL=hooks.d.ts.map
|
package/dist/hooks.js
CHANGED
|
@@ -7,8 +7,8 @@ export function keysForScope(hook, input) {
|
|
|
7
7
|
* Write each configured `advertiseKeys` hook's key list to GITHUB_ENV as a
|
|
8
8
|
* plain (unmasked, non-secret) comma-separated var. Key NAMES only — values are
|
|
9
9
|
* never advertised. A deploy step forwards exactly these keys by value from the
|
|
10
|
-
* job env, so
|
|
11
|
-
* the app (no hand-maintained allowlist in the workflow).
|
|
10
|
+
* job env, so the secrets manifest stays the single source of truth for what
|
|
11
|
+
* lands on the app (no hand-maintained allowlist in the workflow).
|
|
12
12
|
*/
|
|
13
13
|
export function runAdvertiseKeysHooks(githubEnvPath, hooks, input) {
|
|
14
14
|
for (const hook of hooks ?? []) {
|
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"}
|
package/dist/include.js
CHANGED
|
@@ -1,82 +1,26 @@
|
|
|
1
|
-
import { resolveAliases } from "./aliases.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 function
|
|
15
|
-
const aliases = resolveAliases(manifest);
|
|
16
|
-
const keys = new Set();
|
|
17
|
-
for (const name of include) {
|
|
18
|
-
keys.add(name);
|
|
19
|
-
for (const { source, targets } of aliases) {
|
|
20
|
-
if (targets.includes(name))
|
|
21
|
-
keys.add(source);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return [...keys];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Filter a materialized secret map down to the `include` allowlist.
|
|
28
|
-
*
|
|
29
|
-
* Runs *after* {@link applyAliases}, so it filters the final set of names: an
|
|
30
|
-
* alias whose source isn't listed still emits its target, and a canonical key
|
|
31
|
-
* not listed is dropped even when its alias target is kept.
|
|
32
|
-
*
|
|
33
|
-
* When `include` is `undefined` this is a pass-through (emit all keys) — the
|
|
34
|
-
* backward-compatible default. Returns a new object; the input is not mutated.
|
|
35
|
-
*/
|
|
36
|
-
export function applyInclude(merged, include) {
|
|
37
|
-
if (include === undefined) {
|
|
38
|
-
return { filtered: { ...merged }, unknown: [] };
|
|
39
|
-
}
|
|
40
|
-
const allow = new Set(include);
|
|
41
|
-
const filtered = {};
|
|
42
|
-
for (const [key, value] of Object.entries(merged)) {
|
|
43
|
-
if (allow.has(key))
|
|
44
|
-
filtered[key] = value;
|
|
45
|
-
}
|
|
46
|
-
const unknown = include.filter((name) => !(name in merged));
|
|
47
|
-
return { filtered, unknown };
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* An `include` name that no folder produced is treated like a missing required
|
|
51
|
-
* key: fail, unless it's listed in the environment's `optionalKeys`, in which
|
|
52
|
-
* case it's downgraded to a `::notice::`. Enforced identically in `pull` and
|
|
53
|
-
* `export-gha` so the two surfaces stay consistent.
|
|
54
|
-
*/
|
|
55
|
-
export function enforceIncludeKnown(unknown, optionalKeys) {
|
|
8
|
+
export function enforceKnownKeys(unknown, optionalKeys) {
|
|
56
9
|
const optional = new Set(optionalKeys);
|
|
57
10
|
const missing = [];
|
|
58
|
-
|
|
11
|
+
// Dedupe: the same key name can be declared-and-absent in more than one
|
|
12
|
+
// folder, which would otherwise notice/report it twice.
|
|
13
|
+
for (const name of new Set(unknown)) {
|
|
59
14
|
if (optional.has(name)) {
|
|
60
|
-
console.log(`::notice::
|
|
15
|
+
console.log(`::notice::declared key ${name} not produced by its folder (optional for this environment)`);
|
|
61
16
|
}
|
|
62
17
|
else {
|
|
63
18
|
missing.push(name);
|
|
64
19
|
}
|
|
65
20
|
}
|
|
66
21
|
if (missing.length > 0) {
|
|
67
|
-
throw new Error(`
|
|
22
|
+
throw new Error(`tree declares key(s) not produced by any pulled folder: ${missing.join(", ")}. ` +
|
|
68
23
|
"Fix the name, add the folder, or list the key in environments.<slug>.optionalKeys to allow absence.");
|
|
69
24
|
}
|
|
70
25
|
}
|
|
71
|
-
/**
|
|
72
|
-
* Shared allowlist step for both emit surfaces: filter the aliased map to the
|
|
73
|
-
* (already-resolved) `include` and enforce the unknown-key policy. Callers
|
|
74
|
-
* resolve `include` once — with {@link resolveInclude} — so the value they use
|
|
75
|
-
* for headers/logging is the same one that governs the filter.
|
|
76
|
-
*/
|
|
77
|
-
export function selectEmittedSecrets(aliased, include, optionalKeys) {
|
|
78
|
-
const { filtered, unknown } = applyInclude(aliased, include);
|
|
79
|
-
enforceIncludeKnown(unknown, optionalKeys);
|
|
80
|
-
return filtered;
|
|
81
|
-
}
|
|
82
26
|
//# sourceMappingURL=include.js.map
|
package/dist/include.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"include.js","sourceRoot":"","sources":["../src/include.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"include.js","sourceRoot":"","sources":["../src/include.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAiB,EACjB,YAAsB;IAEtB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;IACvC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,wEAAwE;IACxE,wDAAwD;IACxD,KAAK,MAAM,IAAI,IAAI,IAAI,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACpC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CACT,0BAA0B,IAAI,6DAA6D,CAC5F,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,2DAA2D,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAC/E,qGAAqG,CACxG,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
export { applyAliases, type ResolvedAlias, resolveAliases, } from "./aliases.js";
|
|
2
|
-
export {
|
|
2
|
+
export { fetchCompiledFolders, type FolderSecrets, isCi, keysForCiStub, materializeSecrets, mergeFolderSecrets, shouldSkipInfisicalPull, } from "./ci-skip.js";
|
|
3
3
|
export { type AdvertiseKeysHook, defineConfig, type DiscoveryConfig, type InfisicmlConfig, loadConfig, type ResolvedConfig, } from "./config.js";
|
|
4
4
|
export { parseDotenv, serializeDotenv } from "./dotenv.js";
|
|
5
5
|
export { normalizeEnvSlug } from "./env-slug.js";
|
|
6
6
|
export { appendPlainToGithubEnv, appendSecretsToGithubEnv, appendSecretToGithubEnv, } from "./github-env.js";
|
|
7
7
|
export { type AdvertiseInput, keysForScope, runAdvertiseKeysHooks, } from "./hooks.js";
|
|
8
|
-
export {
|
|
9
|
-
export { loadManifestJson, normalizeFolderPath,
|
|
8
|
+
export { enforceKnownKeys } from "./include.js";
|
|
9
|
+
export { findManifestFile, hasManifestFile, loadManifestFromDir, loadManifestJson, MANIFEST_FILENAMES, MANIFEST_LABEL, type ManifestFile, type ManifestFormat, normalizeFolderPath, parseManifestFile, resolveCompiledFolders, resolveFetchMode, resolveSecretsOutputPath, type SecretsManifest, secretsManifestSchema, } from "./manifest.js";
|
|
10
10
|
export { logMissingOptionalKeys, resolveOptionalKeys, } from "./optional-keys.js";
|
|
11
11
|
export { commandExists, LocalProvider } from "./providers/local.js";
|
|
12
12
|
export { RemoteProvider } from "./providers/remote.js";
|
|
13
13
|
export type { SecretsProvider } from "./providers/types.js";
|
|
14
14
|
export { type PullResult, pullManifest, writeInjectedSecretsStub, } from "./pull.js";
|
|
15
|
-
export { discoverManifests, type PackageManifest } from "./registry.js";
|
|
15
|
+
export { discoverManifests, discoverPackages, loadPackage, type PackageManifest, type PackageRef, } from "./registry.js";
|
|
16
|
+
export { type CompiledFolder, type CompiledKey, compileTree, type FolderArray, type FolderEntry, type SecretsTree, treeSchema, } from "./tree.js";
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,aAAa,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oBAAoB,EACpB,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,cAAc,EACnB,YAAY,EACZ,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,aAAa,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oBAAoB,EACpB,KAAK,aAAa,EAClB,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,cAAc,EACnB,YAAY,EACZ,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,KAAK,eAAe,EACpB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,KAAK,UAAU,EACf,YAAY,EACZ,wBAAwB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,UAAU,GACX,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
export { applyAliases, resolveAliases, } from "./aliases.js";
|
|
2
|
-
export {
|
|
2
|
+
export { fetchCompiledFolders, isCi, keysForCiStub, materializeSecrets, mergeFolderSecrets, shouldSkipInfisicalPull, } from "./ci-skip.js";
|
|
3
3
|
export { defineConfig, loadConfig, } from "./config.js";
|
|
4
4
|
export { parseDotenv, serializeDotenv } from "./dotenv.js";
|
|
5
5
|
export { normalizeEnvSlug } from "./env-slug.js";
|
|
6
6
|
export { appendPlainToGithubEnv, appendSecretsToGithubEnv, appendSecretToGithubEnv, } from "./github-env.js";
|
|
7
7
|
export { keysForScope, runAdvertiseKeysHooks, } from "./hooks.js";
|
|
8
|
-
export {
|
|
9
|
-
export { loadManifestJson, normalizeFolderPath,
|
|
8
|
+
export { enforceKnownKeys } from "./include.js";
|
|
9
|
+
export { findManifestFile, hasManifestFile, loadManifestFromDir, loadManifestJson, MANIFEST_FILENAMES, MANIFEST_LABEL, normalizeFolderPath, parseManifestFile, resolveCompiledFolders, resolveFetchMode, resolveSecretsOutputPath, secretsManifestSchema, } from "./manifest.js";
|
|
10
10
|
export { logMissingOptionalKeys, resolveOptionalKeys, } from "./optional-keys.js";
|
|
11
11
|
export { commandExists, LocalProvider } from "./providers/local.js";
|
|
12
12
|
export { RemoteProvider } from "./providers/remote.js";
|
|
13
13
|
export { pullManifest, writeInjectedSecretsStub, } from "./pull.js";
|
|
14
|
-
export { discoverManifests } from "./registry.js";
|
|
14
|
+
export { discoverManifests, discoverPackages, loadPackage, } from "./registry.js";
|
|
15
|
+
export { compileTree, treeSchema, } from "./tree.js";
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oBAAoB,EAEpB,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,YAAY,EAGZ,UAAU,GAEX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,YAAY,EACZ,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EAGd,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EAExB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAEL,YAAY,EACZ,wBAAwB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,GAGZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,WAAW,EAIX,UAAU,GACX,MAAM,WAAW,CAAC"}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { type CompiledFolder } from "./tree.js";
|
|
2
3
|
export declare const secretsManifestSchema: z.ZodObject<{
|
|
3
4
|
$schema: z.ZodOptional<z.ZodString>;
|
|
4
|
-
|
|
5
|
+
secrets: z.ZodType<import("./tree.js").SecretsTree, z.ZodTypeDef, import("./tree.js").SecretsTree>;
|
|
5
6
|
profiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
6
|
-
|
|
7
|
-
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
secrets: z.ZodType<import("./tree.js").SecretsTree, z.ZodTypeDef, import("./tree.js").SecretsTree>;
|
|
8
8
|
fetch: z.ZodOptional<z.ZodEnum<["folder", "keys"]>>;
|
|
9
9
|
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
|
|
11
|
-
include?: string[] | undefined;
|
|
10
|
+
secrets: import("./tree.js").SecretsTree;
|
|
12
11
|
fetch?: "keys" | "folder" | undefined;
|
|
13
12
|
}, {
|
|
14
|
-
|
|
15
|
-
include?: string[] | undefined;
|
|
13
|
+
secrets: import("./tree.js").SecretsTree;
|
|
16
14
|
fetch?: "keys" | "folder" | undefined;
|
|
17
15
|
}>>>;
|
|
18
16
|
ci: z.ZodOptional<z.ZodObject<{
|
|
@@ -26,8 +24,6 @@ export declare const secretsManifestSchema: z.ZodObject<{
|
|
|
26
24
|
stubInCi?: boolean | undefined;
|
|
27
25
|
}>>;
|
|
28
26
|
output: z.ZodOptional<z.ZodString>;
|
|
29
|
-
aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
30
|
-
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
31
27
|
fetch: z.ZodOptional<z.ZodEnum<["folder", "keys"]>>;
|
|
32
28
|
environments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
33
29
|
optionalKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -37,13 +33,11 @@ export declare const secretsManifestSchema: z.ZodObject<{
|
|
|
37
33
|
optionalKeys?: string[] | undefined;
|
|
38
34
|
}>>>;
|
|
39
35
|
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
|
|
36
|
+
secrets: import("./tree.js").SecretsTree;
|
|
41
37
|
$schema?: string | undefined;
|
|
42
|
-
include?: string[] | undefined;
|
|
43
38
|
fetch?: "keys" | "folder" | undefined;
|
|
44
39
|
profiles?: Record<string, {
|
|
45
|
-
|
|
46
|
-
include?: string[] | undefined;
|
|
40
|
+
secrets: import("./tree.js").SecretsTree;
|
|
47
41
|
fetch?: "keys" | "folder" | undefined;
|
|
48
42
|
}> | undefined;
|
|
49
43
|
ci?: {
|
|
@@ -51,18 +45,15 @@ export declare const secretsManifestSchema: z.ZodObject<{
|
|
|
51
45
|
stubInCi?: boolean | undefined;
|
|
52
46
|
} | undefined;
|
|
53
47
|
output?: string | undefined;
|
|
54
|
-
aliases?: Record<string, string | string[]> | undefined;
|
|
55
48
|
environments?: Record<string, {
|
|
56
49
|
optionalKeys?: string[] | undefined;
|
|
57
50
|
}> | undefined;
|
|
58
51
|
}, {
|
|
59
|
-
|
|
52
|
+
secrets: import("./tree.js").SecretsTree;
|
|
60
53
|
$schema?: string | undefined;
|
|
61
|
-
include?: string[] | undefined;
|
|
62
54
|
fetch?: "keys" | "folder" | undefined;
|
|
63
55
|
profiles?: Record<string, {
|
|
64
|
-
|
|
65
|
-
include?: string[] | undefined;
|
|
56
|
+
secrets: import("./tree.js").SecretsTree;
|
|
66
57
|
fetch?: "keys" | "folder" | undefined;
|
|
67
58
|
}> | undefined;
|
|
68
59
|
ci?: {
|
|
@@ -70,36 +61,69 @@ export declare const secretsManifestSchema: z.ZodObject<{
|
|
|
70
61
|
stubInCi?: boolean | undefined;
|
|
71
62
|
} | undefined;
|
|
72
63
|
output?: string | undefined;
|
|
73
|
-
aliases?: Record<string, string | string[]> | undefined;
|
|
74
64
|
environments?: Record<string, {
|
|
75
65
|
optionalKeys?: string[] | undefined;
|
|
76
66
|
}> | undefined;
|
|
77
67
|
}>;
|
|
78
68
|
export type SecretsManifest = z.infer<typeof secretsManifestSchema>;
|
|
79
69
|
export declare function loadManifestJson(raw: unknown): SecretsManifest;
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
export declare const MANIFEST_FILENAMES: readonly ["secrets.yaml", "secrets.yml", "secrets.json"];
|
|
71
|
+
/** A generic name for the manifest, for messages that shouldn't hardcode an extension. */
|
|
72
|
+
export declare const MANIFEST_LABEL = "secrets manifest";
|
|
73
|
+
export type ManifestFormat = "yaml" | "json";
|
|
74
|
+
export type ManifestFile = {
|
|
75
|
+
/** Absolute (or as-passed) path to the manifest file. */
|
|
76
|
+
path: string;
|
|
77
|
+
/** Bare filename, e.g. `secrets.yaml`. */
|
|
78
|
+
filename: string;
|
|
79
|
+
format: ManifestFormat;
|
|
80
|
+
};
|
|
82
81
|
/**
|
|
83
|
-
*
|
|
84
|
-
* `
|
|
85
|
-
*
|
|
82
|
+
* Locate the manifest file in `dir`, preferring YAML over JSON
|
|
83
|
+
* ({@link MANIFEST_FILENAMES}). Returns `null` when no manifest exists.
|
|
84
|
+
*
|
|
85
|
+
* A directory with more than one manifest file is a hard error: picking a winner
|
|
86
|
+
* by preference order would let a stale or experimental `secrets.yaml` left next
|
|
87
|
+
* to the intended `secrets.json` (or vice versa) silently change which secret
|
|
88
|
+
* tree is pulled — and non-interactive lanes (the GitHub Action's `export-gha`)
|
|
89
|
+
* would write it into `GITHUB_ENV` and still succeed. Refuse instead of guessing;
|
|
90
|
+
* the operator removes the extra file to resolve.
|
|
86
91
|
*/
|
|
87
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Cheap presence check: does `dir` hold at least one manifest file? Used to
|
|
94
|
+
* enumerate package directories without parsing or resolving ambiguity, so
|
|
95
|
+
* discovery never throws on a manifest a command won't actually load.
|
|
96
|
+
*/
|
|
97
|
+
export declare function hasManifestFile(dir: string): boolean;
|
|
98
|
+
export declare function findManifestFile(dir: string): ManifestFile | null;
|
|
99
|
+
/**
|
|
100
|
+
* Parse a manifest file's contents into the raw object, dispatching on format.
|
|
101
|
+
* YAML is a superset of JSON, but we parse each with its own reader so error
|
|
102
|
+
* messages point at the right syntax. Does not validate against the schema —
|
|
103
|
+
* call {@link loadManifestJson} for that.
|
|
104
|
+
*/
|
|
105
|
+
export declare function parseManifestFile(file: ManifestFile): unknown;
|
|
106
|
+
/**
|
|
107
|
+
* Find, read, parse, and schema-validate the manifest in `dir`. Returns the
|
|
108
|
+
* validated manifest plus the file it came from, or `null` when no manifest
|
|
109
|
+
* file exists.
|
|
110
|
+
*/
|
|
111
|
+
export declare function loadManifestFromDir(dir: string): {
|
|
112
|
+
manifest: SecretsManifest;
|
|
113
|
+
file: ManifestFile;
|
|
114
|
+
} | null;
|
|
115
|
+
/**
|
|
116
|
+
* Compile the effective folder tree into an ordered {@link CompiledFolder} list.
|
|
117
|
+
* A profile's `tree` replaces the root `tree` when a profile is set (same
|
|
118
|
+
* replace-not-merge as v1 `paths`). Throws on an unknown profile name.
|
|
119
|
+
*/
|
|
120
|
+
export declare function resolveCompiledFolders(manifest: SecretsManifest, profile?: string): CompiledFolder[];
|
|
88
121
|
/**
|
|
89
122
|
* Resolve the effective fetch mode. A profile's `fetch` replaces the root
|
|
90
123
|
* `fetch` when the profile defines it; otherwise the root `fetch` applies.
|
|
91
|
-
* Defaults to `"folder"` (whole-folder read + local
|
|
124
|
+
* Defaults to `"folder"` (whole-folder read + local select) when unset.
|
|
92
125
|
*/
|
|
93
126
|
export declare function resolveFetchMode(manifest: SecretsManifest, profile?: string): "folder" | "keys";
|
|
94
|
-
/**
|
|
95
|
-
* Cross-field rule: `fetch: "keys"` requires an `include` allowlist, because
|
|
96
|
-
* key mode fetches exactly the keys `include` names. The check spans the root
|
|
97
|
-
* and every profile (a profile's `fetch`/`include` each replace the root's), so
|
|
98
|
-
* every runnable combination is covered. Returns human-readable issue strings
|
|
99
|
-
* (empty when consistent) for `validate` to surface. Zod can't express this —
|
|
100
|
-
* the requirement depends on the resolved profile.
|
|
101
|
-
*/
|
|
102
|
-
export declare function checkFetchIncludeConsistency(manifest: SecretsManifest): string[];
|
|
103
127
|
export declare function normalizeFolderPath(folder: string): string;
|
|
104
128
|
export declare function resolveSecretsOutputPath(manifestDir: string, outputName: string): string;
|
|
105
129
|
//# sourceMappingURL=manifest.d.ts.map
|
package/dist/manifest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,WAAW,CAAC;AASnB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyChC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAE9D;AAMD,eAAO,MAAM,kBAAkB,0DAIrB,CAAC;AAEX,0FAA0F;AAC1F,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG;IACzB,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;GAUG;AACH;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAkBjE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAG7D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,GACV;IAAE,QAAQ,EAAE,eAAe,CA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