@mp-lb/arcnet 0.5.5 → 0.5.6
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/README.md +2 -0
- package/dist/secrets/createSecretsCommands.d.ts.map +1 -1
- package/dist/secrets/createSecretsCommands.js +3 -4
- package/dist/secrets/createSecretsCommands.js.map +1 -1
- package/dist/secrets/isAllowedSecretsCiRef.d.ts +2 -0
- package/dist/secrets/isAllowedSecretsCiRef.d.ts.map +1 -0
- package/dist/secrets/isAllowedSecretsCiRef.js +12 -0
- package/dist/secrets/isAllowedSecretsCiRef.js.map +1 -0
- package/docs/public/llms-full.txt +2 -0
- package/package.json +1 -1
- package/src/secrets/createSecretsCommands.ts +8 -4
- package/src/secrets/isAllowedSecretsCiRef.ts +18 -0
package/README.md
CHANGED
|
@@ -15,4 +15,6 @@ The project file can contain `services` (Zap Arc service blocks), `vercel` (site
|
|
|
15
15
|
|
|
16
16
|
`arcnet secrets add --key KEY` attaches a Forum encrypted JSON source and provisions its GitHub decryption key. `arcnet secrets init --key KEY` creates a source. A new project's `arcnet.yaml` records only the key, Forum store/path, and consumer mappings. The committed ciphertext lives at `.arcnet/secrets/KEY.json.enc`; `arcnet secrets sync` refreshes it atomically. CI decrypts that file using the GitHub key and does not fetch from Forum. `arcnet env run --consumer publish -- <command>` gives a publish command only its selected credentials; the project release workflow must call it. Older source definitions with names and snapshot metadata remain readable.
|
|
17
17
|
|
|
18
|
+
In GitHub Actions, secret commands require the configured repository on `main`. A desktop release may also use `arcnet env export --consumer desktop` on a version tag (`v<major>.<minor>.<patch>`); other consumers remain restricted to `main`.
|
|
19
|
+
|
|
18
20
|
Domain ownership delegation is available through `arcnet environment domain-owner` after a human verifies the base domain. Declarative Vercel domain attachment and DNS reconciliation are supported; project domain add/remove CLI and full environment bootstrap/teardown remain unimplemented.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSecretsCommands.d.ts","sourceRoot":"","sources":["../../src/secrets/createSecretsCommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"createSecretsCommands.d.ts","sourceRoot":"","sources":["../../src/secrets/createSecretsCommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,eAAO,MAAM,qBAAqB,GAChC,KAAK,OAAO,EACZ,QAAQ,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,SA2LjC,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { selectSecrets } from "./selectSecrets.js";
|
|
|
7
7
|
import { syncSecrets } from "./syncSecrets.js";
|
|
8
8
|
import { writeSecretsWorkflow } from "./writeSecretsWorkflow.js";
|
|
9
9
|
import { promptPassword } from "./promptPassword.js";
|
|
10
|
+
import { isAllowedSecretsCiRef } from "./isAllowedSecretsCiRef.js";
|
|
10
11
|
export const createSecretsCommands = (cli, output) => {
|
|
11
12
|
const env = cli
|
|
12
13
|
.command("env")
|
|
@@ -29,10 +30,8 @@ export const createSecretsCommands = (cli, output) => {
|
|
|
29
30
|
const options = command.opts();
|
|
30
31
|
const root = realpathSync(cli.opts().root);
|
|
31
32
|
const config = readSecretsConfig(root, resolveSecretsConfigPath(root, options.config));
|
|
32
|
-
if (
|
|
33
|
-
(
|
|
34
|
-
process.env.GITHUB_REF !== "refs/heads/main"))
|
|
35
|
-
throw new Error("Secrets commands in CI require the configured repository main branch.");
|
|
33
|
+
if (!isAllowedSecretsCiRef(config.repository, action, options.consumer, process.env))
|
|
34
|
+
throw new Error("Secrets commands in CI require the configured repository main branch, or desktop export from a version tag.");
|
|
36
35
|
if (options.password && process.env.GITHUB_ACTIONS === "true")
|
|
37
36
|
throw new Error("Password decryption is local-only; CI must use file keys.");
|
|
38
37
|
if (action !== "check" && !options.consumer)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSecretsCommands.js","sourceRoot":"","sources":["../../src/secrets/createSecretsCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAyB,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"createSecretsCommands.js","sourceRoot":"","sources":["../../src/secrets/createSecretsCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAyB,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,GAAY,EACZ,MAAgC,EAChC,EAAE;IACF,MAAM,GAAG,GAAG,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AS,EAC5B,aAAa,MAAM,CAAC,UAAU,YAa/B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const isAllowedSecretsCiRef = (repository, action, consumer, environment) => {
|
|
2
|
+
if (environment.GITHUB_ACTIONS !== "true")
|
|
3
|
+
return true;
|
|
4
|
+
if (environment.GITHUB_REPOSITORY !== repository)
|
|
5
|
+
return false;
|
|
6
|
+
if (environment.GITHUB_REF === "refs/heads/main")
|
|
7
|
+
return true;
|
|
8
|
+
return (action === "export" &&
|
|
9
|
+
consumer === "desktop" &&
|
|
10
|
+
/^refs\/tags\/v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(environment.GITHUB_REF ?? ""));
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=isAllowedSecretsCiRef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isAllowedSecretsCiRef.js","sourceRoot":"","sources":["../../src/secrets/isAllowedSecretsCiRef.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,UAAkB,EAClB,MAAkC,EAClC,QAA4B,EAC5B,WAA8B,EAC9B,EAAE;IACF,IAAI,WAAW,CAAC,cAAc,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACvD,IAAI,WAAW,CAAC,iBAAiB,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IAC/D,IAAI,WAAW,CAAC,UAAU,KAAK,iBAAiB;QAAE,OAAO,IAAI,CAAC;IAE9D,OAAO,CACL,MAAM,KAAK,QAAQ;QACnB,QAAQ,KAAK,SAAS;QACtB,kDAAkD,CAAC,IAAI,CACrD,WAAW,CAAC,UAAU,IAAI,EAAE,CAC7B,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -15,6 +15,8 @@ The project file can contain `services` (Zap Arc service blocks), `vercel` (site
|
|
|
15
15
|
|
|
16
16
|
`arcnet secrets add --key KEY` attaches a Forum encrypted JSON source and provisions its GitHub decryption key. `arcnet secrets init --key KEY` creates a source. A new project's `arcnet.yaml` records only the key, Forum store/path, and consumer mappings. The committed ciphertext lives at `.arcnet/secrets/KEY.json.enc`; `arcnet secrets sync` refreshes it atomically. CI decrypts that file using the GitHub key and does not fetch from Forum. `arcnet env run --consumer publish -- <command>` gives a publish command only its selected credentials; the project release workflow must call it. Older source definitions with names and snapshot metadata remain readable.
|
|
17
17
|
|
|
18
|
+
In GitHub Actions, secret commands require the configured repository on `main`. A desktop release may also use `arcnet env export --consumer desktop` on a version tag (`v<major>.<minor>.<patch>`); other consumers remain restricted to `main`.
|
|
19
|
+
|
|
18
20
|
Domain ownership delegation is available through `arcnet environment domain-owner` after a human verifies the base domain. Declarative Vercel domain attachment and DNS reconciliation are supported; project domain add/remove CLI and full environment bootstrap/teardown remain unimplemented.
|
|
19
21
|
|
|
20
22
|
# ArcNet command reference
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import { selectSecrets } from "./selectSecrets.js";
|
|
|
8
8
|
import { syncSecrets } from "./syncSecrets.js";
|
|
9
9
|
import { writeSecretsWorkflow } from "./writeSecretsWorkflow.js";
|
|
10
10
|
import { promptPassword } from "./promptPassword.js";
|
|
11
|
+
import { isAllowedSecretsCiRef } from "./isAllowedSecretsCiRef.js";
|
|
11
12
|
|
|
12
13
|
export const createSecretsCommands = (
|
|
13
14
|
cli: Command,
|
|
@@ -59,12 +60,15 @@ export const createSecretsCommands = (
|
|
|
59
60
|
);
|
|
60
61
|
|
|
61
62
|
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
!isAllowedSecretsCiRef(
|
|
64
|
+
config.repository,
|
|
65
|
+
action,
|
|
66
|
+
options.consumer,
|
|
67
|
+
process.env,
|
|
68
|
+
)
|
|
65
69
|
)
|
|
66
70
|
throw new Error(
|
|
67
|
-
"Secrets commands in CI require the configured repository main branch.",
|
|
71
|
+
"Secrets commands in CI require the configured repository main branch, or desktop export from a version tag.",
|
|
68
72
|
);
|
|
69
73
|
if (options.password && process.env.GITHUB_ACTIONS === "true")
|
|
70
74
|
throw new Error(
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const isAllowedSecretsCiRef = (
|
|
2
|
+
repository: string,
|
|
3
|
+
action: "check" | "export" | "run",
|
|
4
|
+
consumer: string | undefined,
|
|
5
|
+
environment: NodeJS.ProcessEnv,
|
|
6
|
+
) => {
|
|
7
|
+
if (environment.GITHUB_ACTIONS !== "true") return true;
|
|
8
|
+
if (environment.GITHUB_REPOSITORY !== repository) return false;
|
|
9
|
+
if (environment.GITHUB_REF === "refs/heads/main") return true;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
action === "export" &&
|
|
13
|
+
consumer === "desktop" &&
|
|
14
|
+
/^refs\/tags\/v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(
|
|
15
|
+
environment.GITHUB_REF ?? "",
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
};
|