@hubble-ventures/infisicml 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -0
- package/LICENSE +21 -0
- package/README.md +316 -0
- package/dist/aliases.d.ts +20 -0
- package/dist/aliases.d.ts.map +1 -0
- package/dist/aliases.js +35 -0
- package/dist/aliases.js.map +1 -0
- package/dist/ci-skip.d.ts +27 -0
- package/dist/ci-skip.d.ts.map +1 -0
- package/dist/ci-skip.js +82 -0
- package/dist/ci-skip.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +150 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/export-gha.d.ts +11 -0
- package/dist/commands/export-gha.d.ts.map +1 -0
- package/dist/commands/export-gha.js +79 -0
- package/dist/commands/export-gha.js.map +1 -0
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +35 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/paths.d.ts +8 -0
- package/dist/commands/paths.d.ts.map +1 -0
- package/dist/commands/paths.js +30 -0
- package/dist/commands/paths.js.map +1 -0
- package/dist/commands/pull.d.ts +11 -0
- package/dist/commands/pull.d.ts.map +1 -0
- package/dist/commands/pull.js +65 -0
- package/dist/commands/pull.js.map +1 -0
- package/dist/commands/run.d.ts +9 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +30 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/validate.d.ts +2 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +33 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/config.d.ts +58 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +68 -0
- package/dist/config.js.map +1 -0
- package/dist/dotenv.d.ts +6 -0
- package/dist/dotenv.d.ts.map +1 -0
- package/dist/dotenv.js +31 -0
- package/dist/dotenv.js.map +1 -0
- package/dist/env-slug.d.ts +3 -0
- package/dist/env-slug.d.ts.map +1 -0
- package/dist/env-slug.js +7 -0
- package/dist/env-slug.js.map +1 -0
- package/dist/github-env.d.ts +10 -0
- package/dist/github-env.d.ts.map +1 -0
- package/dist/github-env.js +37 -0
- package/dist/github-env.js.map +1 -0
- package/dist/hooks.d.ts +17 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +19 -0
- package/dist/hooks.js.map +1 -0
- package/dist/include.d.ts +46 -0
- package/dist/include.d.ts.map +1 -0
- package/dist/include.js +82 -0
- package/dist/include.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.d.ts +105 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +153 -0
- package/dist/manifest.js.map +1 -0
- package/dist/optional-keys.d.ts +4 -0
- package/dist/optional-keys.d.ts.map +1 -0
- package/dist/optional-keys.js +11 -0
- package/dist/optional-keys.js.map +1 -0
- package/dist/providers/local.d.ts +38 -0
- package/dist/providers/local.d.ts.map +1 -0
- package/dist/providers/local.js +76 -0
- package/dist/providers/local.js.map +1 -0
- package/dist/providers/remote.d.ts +52 -0
- package/dist/providers/remote.d.ts.map +1 -0
- package/dist/providers/remote.js +166 -0
- package/dist/providers/remote.js.map +1 -0
- package/dist/providers/types.d.ts +14 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +2 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/pull.d.ts +15 -0
- package/dist/pull.d.ts.map +1 -0
- package/dist/pull.js +67 -0
- package/dist/pull.js.map +1 -0
- package/dist/registry.d.ts +14 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +35 -0
- package/dist/registry.js.map +1 -0
- package/package.json +66 -0
- package/schema/secrets.schema.json +105 -0
package/dist/pull.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { existsSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { relative } from "node:path";
|
|
3
|
+
import { applyAliases } from "./aliases.js";
|
|
4
|
+
import { fetchManifestSecrets, keysForCiStub, shouldSkipInfisicalPull, } from "./ci-skip.js";
|
|
5
|
+
import { serializeDotenv } from "./dotenv.js";
|
|
6
|
+
import { selectEmittedSecrets } from "./include.js";
|
|
7
|
+
import { normalizeFolderPath, resolveFetchMode, resolveInclude, resolvePaths, resolveSecretsOutputPath, } from "./manifest.js";
|
|
8
|
+
import { resolveOptionalKeys } from "./optional-keys.js";
|
|
9
|
+
export function writeInjectedSecretsStub(outputPath, manifest, keys) {
|
|
10
|
+
const fromEnv = {};
|
|
11
|
+
for (const key of keys) {
|
|
12
|
+
const value = process.env[key];
|
|
13
|
+
if (value)
|
|
14
|
+
fromEnv[key] = value;
|
|
15
|
+
}
|
|
16
|
+
const header = [
|
|
17
|
+
"# Skipped Infisical pull — required build env vars already injected.",
|
|
18
|
+
`# Package: ${manifest.id}`,
|
|
19
|
+
"# Source: process.env (CI / workflow build-env-vars)",
|
|
20
|
+
`# Generated: ${new Date().toISOString()}`,
|
|
21
|
+
"",
|
|
22
|
+
].join("\n");
|
|
23
|
+
writeFileSync(outputPath, header + serializeDotenv(fromEnv));
|
|
24
|
+
}
|
|
25
|
+
export async function pullManifest(options) {
|
|
26
|
+
const { manifest, repoRoot, envName, profile, force = false, turboMode = false, provider, } = options;
|
|
27
|
+
const outputName = manifest.config.output ?? ".env.secrets";
|
|
28
|
+
const outputPath = resolveSecretsOutputPath(manifest.dir, outputName);
|
|
29
|
+
const rel = relative(repoRoot, outputPath);
|
|
30
|
+
if (!turboMode && existsSync(outputPath) && !force) {
|
|
31
|
+
console.log(`⏭️ ${manifest.id}: ${rel} exists (use --force to refresh)`);
|
|
32
|
+
return "skipped";
|
|
33
|
+
}
|
|
34
|
+
if (shouldSkipInfisicalPull(manifest.config, force)) {
|
|
35
|
+
const keys = keysForCiStub(manifest.config);
|
|
36
|
+
writeInjectedSecretsStub(outputPath, manifest, keys);
|
|
37
|
+
console.log(`⏭️ ${manifest.id}: skipped Infisical pull (injected env → ${rel})`);
|
|
38
|
+
return "skipped";
|
|
39
|
+
}
|
|
40
|
+
const paths = resolvePaths(manifest.config, profile);
|
|
41
|
+
const fetchMode = resolveFetchMode(manifest.config, profile);
|
|
42
|
+
const aliased = applyAliases(await fetchManifestSecrets(provider, envName, paths, manifest.config, profile), manifest.config);
|
|
43
|
+
// Default-deny key selection: emit only the allowlisted keys when `include`
|
|
44
|
+
// is set (after aliases). Absent = emit all.
|
|
45
|
+
const include = resolveInclude(manifest.config, profile);
|
|
46
|
+
const merged = selectEmittedSecrets(aliased, include, resolveOptionalKeys(manifest.config, envName));
|
|
47
|
+
// filter(Boolean) drops the optional Profile/Include lines when absent. It
|
|
48
|
+
// would also drop a trailing "" sentinel, so append the trailing newline
|
|
49
|
+
// explicitly — otherwise the first secret gets glued onto the "# Generated"
|
|
50
|
+
// line.
|
|
51
|
+
const header = `${[
|
|
52
|
+
"# Pulled from Infisical — do not edit. Refresh: infisicml pull",
|
|
53
|
+
`# Package: ${manifest.id}`,
|
|
54
|
+
`# Environment: ${envName}`,
|
|
55
|
+
profile ? `# Profile: ${profile}` : "",
|
|
56
|
+
`# Paths: ${paths.map((p) => normalizeFolderPath(p)).join(", ")}`,
|
|
57
|
+
fetchMode === "keys" ? "# Fetch: keys (per-key least-privilege read)" : "",
|
|
58
|
+
include ? `# Include: ${include.join(", ")}` : "",
|
|
59
|
+
`# Generated: ${new Date().toISOString()}`,
|
|
60
|
+
]
|
|
61
|
+
.filter(Boolean)
|
|
62
|
+
.join("\n")}\n`;
|
|
63
|
+
writeFileSync(outputPath, header + serializeDotenv(merged));
|
|
64
|
+
console.log(`✅ ${manifest.id}: wrote ${rel} (${Object.keys(merged).length} vars)`);
|
|
65
|
+
return "pulled";
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=pull.js.map
|
package/dist/pull.js.map
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"./config.js";
|
|
2
|
+
import { type SecretsManifest } from "./manifest.js";
|
|
3
|
+
export type PackageManifest = {
|
|
4
|
+
id: string;
|
|
5
|
+
dir: string;
|
|
6
|
+
config: SecretsManifest;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Discover every `secrets.json` in the repo, driven entirely by
|
|
10
|
+
* `config.discovery` — no repo-specific directory constants. Explicit
|
|
11
|
+
* `packages` win over `roots`-discovered entries at the same directory.
|
|
12
|
+
*/
|
|
13
|
+
export declare function discoverManifests(config: ResolvedConfig): PackageManifest[];
|
|
14
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,eAAe,EAAE,CA4B3E"}
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
import { loadManifestJson } from "./manifest.js";
|
|
4
|
+
/**
|
|
5
|
+
* Discover every `secrets.json` in the repo, driven entirely by
|
|
6
|
+
* `config.discovery` — no repo-specific directory constants. Explicit
|
|
7
|
+
* `packages` win over `roots`-discovered entries at the same directory.
|
|
8
|
+
*/
|
|
9
|
+
export function discoverManifests(config) {
|
|
10
|
+
const { repoRoot } = config;
|
|
11
|
+
const byDir = new Map();
|
|
12
|
+
const scanDir = (dir, id) => {
|
|
13
|
+
const manifestPath = join(dir, "secrets.json");
|
|
14
|
+
if (!existsSync(manifestPath))
|
|
15
|
+
return;
|
|
16
|
+
const parsed = loadManifestJson(JSON.parse(readFileSync(manifestPath, "utf8")));
|
|
17
|
+
byDir.set(resolve(dir), { dir, id, config: parsed });
|
|
18
|
+
};
|
|
19
|
+
for (const root of config.discovery.roots ?? []) {
|
|
20
|
+
const rootAbs = join(repoRoot, root);
|
|
21
|
+
if (!existsSync(rootAbs))
|
|
22
|
+
continue;
|
|
23
|
+
for (const entry of readdirSync(rootAbs, { withFileTypes: true })) {
|
|
24
|
+
if (!entry.isDirectory())
|
|
25
|
+
continue;
|
|
26
|
+
scanDir(join(rootAbs, entry.name), entry.name);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// Explicit packages last so a custom id/dir overrides a roots-discovered one.
|
|
30
|
+
for (const { id, dir } of config.discovery.packages ?? []) {
|
|
31
|
+
scanDir(join(repoRoot, dir), id);
|
|
32
|
+
}
|
|
33
|
+
return [...byDir.values()].sort((a, b) => a.id.localeCompare(b.id));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAwB,MAAM,eAAe,CAAC;AAQvE;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAsB;IACtD,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAC5B,MAAM,KAAK,GAAG,IAAI,GAAG,EAA2B,CAAC;IAEjD,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,EAAU,EAAE,EAAE;QAC1C,MA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AC,CAAC,EAAE,CAAC,CAAC,CAAC;AACtE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hubble-ventures/infisicml",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Infisical Secret Orchestration — federated per-package secret manifests for monorepos, unified across local dev and CI.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"infisical",
|
|
7
|
+
"secrets",
|
|
8
|
+
"monorepo",
|
|
9
|
+
"dotenv",
|
|
10
|
+
"github-actions",
|
|
11
|
+
"ci",
|
|
12
|
+
"env"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "Hubble Ventures",
|
|
16
|
+
"homepage": "https://github.com/hubble-ventures/infisicml#readme",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/hubble-ventures/infisicml.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/hubble-ventures/infisicml/issues"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"bin": {
|
|
29
|
+
"infisicml": "./dist/cli.js"
|
|
30
|
+
},
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./schema": "./schema/secrets.schema.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"schema",
|
|
43
|
+
"README.md",
|
|
44
|
+
"CHANGELOG.md",
|
|
45
|
+
"LICENSE"
|
|
46
|
+
],
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=20"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsc",
|
|
52
|
+
"clean": "rm -rf dist",
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"test:watch": "vitest",
|
|
55
|
+
"smoke": "npm run build && bash scripts/smoke.sh",
|
|
56
|
+
"type-check": "tsc --noEmit"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"zod": "^3.23.8"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@types/node": "^22.10.0",
|
|
63
|
+
"typescript": "^5.7.0",
|
|
64
|
+
"vitest": "^2.1.0"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@hubble-ventures/infisicml@1/schema/secrets.schema.json",
|
|
4
|
+
"title": "Infisicml secrets manifest",
|
|
5
|
+
"description": "Declares which Infisical vault folders to pull into a gitignored .env.secrets file next to this manifest.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["paths"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"$schema": { "type": "string" },
|
|
11
|
+
"paths": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"minItems": 1,
|
|
14
|
+
"items": { "type": "string", "pattern": "^[a-z0-9_/-]+$" },
|
|
15
|
+
"description": "Infisical folder paths (without leading slash), e.g. clerk, vendor/app"
|
|
16
|
+
},
|
|
17
|
+
"profiles": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"additionalProperties": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"required": ["paths"],
|
|
23
|
+
"properties": {
|
|
24
|
+
"paths": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"minItems": 1,
|
|
27
|
+
"items": { "type": "string", "pattern": "^[a-z0-9_/-]+$" }
|
|
28
|
+
},
|
|
29
|
+
"include": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"minItems": 1,
|
|
32
|
+
"items": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" },
|
|
33
|
+
"description": "Key allowlist for this profile; replaces the root include when set"
|
|
34
|
+
},
|
|
35
|
+
"fetch": {
|
|
36
|
+
"enum": ["folder", "keys"],
|
|
37
|
+
"description": "Read strategy for this profile; replaces the root fetch when set"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"description": "Named path sets; profile paths replace default paths when --profile is set"
|
|
42
|
+
},
|
|
43
|
+
"ci": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"properties": {
|
|
47
|
+
"skipWhenEnv": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": { "type": "string" },
|
|
50
|
+
"description": "Skip Infisical in CI when all listed env vars are already set"
|
|
51
|
+
},
|
|
52
|
+
"stubInCi": {
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"description": "When true, write a stub .env.secrets in CI without calling Infisical"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"output": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"default": ".env.secrets",
|
|
61
|
+
"pattern": "^[^/\\\\]+$",
|
|
62
|
+
"description": "Output filename only (no path separators), relative to this manifest directory"
|
|
63
|
+
},
|
|
64
|
+
"aliases": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"description": "Copy a pulled secret to extra env var name(s) a build/runtime expects (e.g. CLERK_PUBLISHABLE_KEY -> VITE_CLERK_PUBLISHABLE_KEY).",
|
|
67
|
+
"additionalProperties": {
|
|
68
|
+
"oneOf": [
|
|
69
|
+
{ "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" },
|
|
70
|
+
{
|
|
71
|
+
"type": "array",
|
|
72
|
+
"minItems": 1,
|
|
73
|
+
"items": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" }
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"include": {
|
|
79
|
+
"type": "array",
|
|
80
|
+
"minItems": 1,
|
|
81
|
+
"items": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" },
|
|
82
|
+
"description": "Emit only these env var names from whatever the folders yielded (after aliases). Omit to emit all keys. Lets a client pull a shared vendor folder but emit only its public key, keeping server secrets out of client builds and GITHUB_ENV."
|
|
83
|
+
},
|
|
84
|
+
"fetch": {
|
|
85
|
+
"enum": ["folder", "keys"],
|
|
86
|
+
"default": "folder",
|
|
87
|
+
"description": "Read strategy. 'folder' (default) pulls whole folders and filters locally. 'keys' fetches only the keys 'include' resolves to; in CI the vault transmits nothing else (per-key REST reads), locally the CLI fetches the folder and selects them. Requires 'include'. A per-profile 'fetch' replaces this one."
|
|
88
|
+
},
|
|
89
|
+
"environments": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"additionalProperties": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"additionalProperties": false,
|
|
94
|
+
"properties": {
|
|
95
|
+
"optionalKeys": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": { "type": "string" },
|
|
98
|
+
"description": "Keys allowed to be absent in this environment; export-gha logs a notice instead of failing"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"description": "Per-environment policy keyed by Infisical env slug (development, preview, production)"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|