@run402/sdk 4.95.0 → 4.96.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/README.md +24 -24
- package/core-dist/keystore.d.ts +1 -1
- package/core-dist/keystore.js +1 -1
- package/dist/errors.d.ts +4 -4
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/namespaces/deploy.d.ts +5 -5
- package/dist/namespaces/deploy.d.ts.map +1 -1
- package/dist/namespaces/deploy.js +20 -20
- package/dist/namespaces/deploy.js.map +1 -1
- package/dist/namespaces/deploy.types.d.ts +17 -17
- package/dist/namespaces/deploy.types.d.ts.map +1 -1
- package/dist/namespaces/org.d.ts +2 -2
- package/dist/namespaces/org.js +2 -2
- package/dist/namespaces/org.types.d.ts +3 -3
- package/dist/namespaces/pay.js +1 -1
- package/dist/namespaces/{gitvault.d.ts → repos.d.ts} +436 -449
- package/dist/namespaces/repos.d.ts.map +1 -0
- package/dist/namespaces/{gitvault.js → repos.js} +451 -459
- package/dist/namespaces/repos.js.map +1 -0
- package/dist/namespaces/rooms.js +2 -2
- package/dist/namespaces/rooms.js.map +1 -1
- package/dist/namespaces/session.d.ts +2 -2
- package/dist/namespaces/session.d.ts.map +1 -1
- package/dist/namespaces/session.js +2 -2
- package/dist/namespaces/session.js.map +1 -1
- package/dist/namespaces/tier.d.ts +3 -3
- package/dist/namespaces/tier.d.ts.map +1 -1
- package/dist/namespaces/{gitvault.crypto.d.ts → vault.crypto.d.ts} +141 -141
- package/dist/namespaces/vault.crypto.d.ts.map +1 -0
- package/dist/namespaces/{gitvault.crypto.js → vault.crypto.js} +173 -173
- package/dist/namespaces/vault.crypto.js.map +1 -0
- package/dist/namespaces/{gitvault.types.d.ts → vault.types.d.ts} +136 -136
- package/dist/namespaces/vault.types.d.ts.map +1 -0
- package/dist/namespaces/{gitvault.types.js → vault.types.js} +4 -4
- package/dist/namespaces/vault.types.js.map +1 -0
- package/dist/node/bearer-redeem-key.d.ts +1 -1
- package/dist/node/bearer-redeem-key.js +5 -5
- package/dist/node/bearer-redeem-key.js.map +1 -1
- package/dist/node/http-dispatcher.js +5 -5
- package/dist/node/http-dispatcher.js.map +1 -1
- package/dist/node/index.d.ts +29 -29
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +39 -39
- package/dist/node/index.js.map +1 -1
- package/dist/node/{gitvault-address.d.ts → vault-address.d.ts} +42 -42
- package/dist/node/vault-address.d.ts.map +1 -0
- package/dist/node/{gitvault-address.js → vault-address.js} +43 -43
- package/dist/node/vault-address.js.map +1 -0
- package/dist/node/{gitvault-apply.d.ts → vault-apply.d.ts} +27 -27
- package/dist/node/vault-apply.d.ts.map +1 -0
- package/dist/node/{gitvault-apply.js → vault-apply.js} +38 -38
- package/dist/node/vault-apply.js.map +1 -0
- package/dist/node/vault-byo-config.d.ts +29 -0
- package/dist/node/vault-byo-config.d.ts.map +1 -0
- package/dist/node/{gitvault-byo-config.js → vault-byo-config.js} +18 -18
- package/dist/node/vault-byo-config.js.map +1 -0
- package/dist/node/vault-byo-probe.d.ts +20 -0
- package/dist/node/vault-byo-probe.d.ts.map +1 -0
- package/dist/node/vault-byo-probe.js +57 -0
- package/dist/node/vault-byo-probe.js.map +1 -0
- package/dist/node/{gitvault-creation-journal.d.ts → vault-creation-journal.d.ts} +69 -69
- package/dist/node/vault-creation-journal.d.ts.map +1 -0
- package/dist/node/{gitvault-creation-journal.js → vault-creation-journal.js} +54 -54
- package/dist/node/vault-creation-journal.js.map +1 -0
- package/dist/node/{gitvault-degraded-read.d.ts → vault-degraded-read.d.ts} +34 -34
- package/dist/node/vault-degraded-read.d.ts.map +1 -0
- package/dist/node/{gitvault-degraded-read.js → vault-degraded-read.js} +24 -24
- package/dist/node/vault-degraded-read.js.map +1 -0
- package/dist/node/{gitvault-deploy.d.ts → vault-deploy.d.ts} +67 -67
- package/dist/node/vault-deploy.d.ts.map +1 -0
- package/dist/node/{gitvault-deploy.js → vault-deploy.js} +27 -27
- package/dist/node/vault-deploy.js.map +1 -0
- package/dist/node/{gitvault-edge-fetch.d.ts → vault-edge-fetch.d.ts} +9 -9
- package/dist/node/vault-edge-fetch.d.ts.map +1 -0
- package/dist/node/{gitvault-edge-fetch.js → vault-edge-fetch.js} +11 -11
- package/dist/node/vault-edge-fetch.js.map +1 -0
- package/dist/node/{gitvault-handoff.d.ts → vault-handoff.d.ts} +9 -9
- package/dist/node/vault-handoff.d.ts.map +1 -0
- package/dist/node/{gitvault-handoff.js → vault-handoff.js} +24 -24
- package/dist/node/vault-handoff.js.map +1 -0
- package/dist/node/{gitvault-keystore.d.ts → vault-keystore.d.ts} +87 -77
- package/dist/node/vault-keystore.d.ts.map +1 -0
- package/dist/node/{gitvault-keystore.js → vault-keystore.js} +105 -68
- package/dist/node/vault-keystore.js.map +1 -0
- package/dist/node/{gitvault-member-bundle.d.ts → vault-member-bundle.d.ts} +17 -17
- package/dist/node/vault-member-bundle.d.ts.map +1 -0
- package/dist/node/{gitvault-member-bundle.js → vault-member-bundle.js} +11 -11
- package/dist/node/vault-member-bundle.js.map +1 -0
- package/dist/node/{gitvault-mirror-backend.d.ts → vault-mirror-backend.d.ts} +26 -26
- package/dist/node/vault-mirror-backend.d.ts.map +1 -0
- package/dist/node/{gitvault-mirror-backend.js → vault-mirror-backend.js} +25 -25
- package/dist/node/vault-mirror-backend.js.map +1 -0
- package/dist/node/{gitvault-mirror-config.d.ts → vault-mirror-config.d.ts} +23 -23
- package/dist/node/vault-mirror-config.d.ts.map +1 -0
- package/dist/node/{gitvault-mirror-config.js → vault-mirror-config.js} +16 -16
- package/dist/node/vault-mirror-config.js.map +1 -0
- package/dist/node/{gitvault-mirror.d.ts → vault-mirror.d.ts} +36 -36
- package/dist/node/vault-mirror.d.ts.map +1 -0
- package/dist/node/{gitvault-mirror.js → vault-mirror.js} +75 -75
- package/dist/node/vault-mirror.js.map +1 -0
- package/dist/node/{gitvault-native-crypto.d.ts → vault-native-crypto.d.ts} +10 -10
- package/dist/node/vault-native-crypto.d.ts.map +1 -0
- package/dist/node/{gitvault-native-crypto.js → vault-native-crypto.js} +16 -16
- package/dist/node/vault-native-crypto.js.map +1 -0
- package/dist/node/{gitvault-open-or-create.d.ts → vault-open-or-create.d.ts} +16 -16
- package/dist/node/vault-open-or-create.d.ts.map +1 -0
- package/dist/node/{gitvault-open-or-create.js → vault-open-or-create.js} +10 -10
- package/dist/node/vault-open-or-create.js.map +1 -0
- package/dist/node/{gitvault-prewarm.d.ts → vault-prewarm.d.ts} +13 -13
- package/dist/node/vault-prewarm.d.ts.map +1 -0
- package/dist/node/{gitvault-prewarm.js → vault-prewarm.js} +25 -25
- package/dist/node/vault-prewarm.js.map +1 -0
- package/dist/node/{gitvault-profile-scan.d.ts → vault-profile-scan.d.ts} +3 -3
- package/dist/node/vault-profile-scan.d.ts.map +1 -0
- package/dist/node/{gitvault-profile-scan.js → vault-profile-scan.js} +12 -12
- package/dist/node/vault-profile-scan.js.map +1 -0
- package/dist/node/{gitvault-prune.d.ts → vault-prune.d.ts} +61 -61
- package/dist/node/vault-prune.d.ts.map +1 -0
- package/dist/node/{gitvault-prune.js → vault-prune.js} +34 -34
- package/dist/node/vault-prune.js.map +1 -0
- package/dist/node/{gitvault-publication.d.ts → vault-publication.d.ts} +399 -399
- package/dist/node/vault-publication.d.ts.map +1 -0
- package/dist/node/{gitvault-publication.js → vault-publication.js} +584 -584
- package/dist/node/vault-publication.js.map +1 -0
- package/dist/node/{gitvault-push-to-create.d.ts → vault-push-to-create.d.ts} +16 -16
- package/dist/node/vault-push-to-create.d.ts.map +1 -0
- package/dist/node/{gitvault-push-to-create.js → vault-push-to-create.js} +9 -9
- package/dist/node/vault-push-to-create.js.map +1 -0
- package/dist/node/{gitvault-recover.d.ts → vault-recover.d.ts} +50 -50
- package/dist/node/vault-recover.d.ts.map +1 -0
- package/dist/node/{gitvault-recover.js → vault-recover.js} +84 -84
- package/dist/node/vault-recover.js.map +1 -0
- package/dist/node/{gitvault-restore.d.ts → vault-restore.d.ts} +8 -8
- package/dist/node/vault-restore.d.ts.map +1 -0
- package/dist/node/{gitvault-restore.js → vault-restore.js} +11 -11
- package/dist/node/vault-restore.js.map +1 -0
- package/dist/node/{gitvault-snapshot.d.ts → vault-snapshot.d.ts} +48 -48
- package/dist/node/vault-snapshot.d.ts.map +1 -0
- package/dist/node/{gitvault-snapshot.js → vault-snapshot.js} +61 -61
- package/dist/node/vault-snapshot.js.map +1 -0
- package/dist/node/{gitvault-writer-state.d.ts → vault-writer-state.d.ts} +8 -8
- package/dist/node/vault-writer-state.d.ts.map +1 -0
- package/dist/node/{gitvault-writer-state.js → vault-writer-state.js} +15 -15
- package/dist/node/vault-writer-state.js.map +1 -0
- package/dist/node/workflow-output.js +4 -4
- package/dist/node/workflow-output.js.map +1 -1
- package/package.json +1 -1
- package/dist/namespaces/gitvault.crypto.d.ts.map +0 -1
- package/dist/namespaces/gitvault.crypto.js.map +0 -1
- package/dist/namespaces/gitvault.d.ts.map +0 -1
- package/dist/namespaces/gitvault.js.map +0 -1
- package/dist/namespaces/gitvault.types.d.ts.map +0 -1
- package/dist/namespaces/gitvault.types.js.map +0 -1
- package/dist/node/gitvault-address.d.ts.map +0 -1
- package/dist/node/gitvault-address.js.map +0 -1
- package/dist/node/gitvault-apply.d.ts.map +0 -1
- package/dist/node/gitvault-apply.js.map +0 -1
- package/dist/node/gitvault-byo-config.d.ts +0 -29
- package/dist/node/gitvault-byo-config.d.ts.map +0 -1
- package/dist/node/gitvault-byo-config.js.map +0 -1
- package/dist/node/gitvault-byo-probe.d.ts +0 -20
- package/dist/node/gitvault-byo-probe.d.ts.map +0 -1
- package/dist/node/gitvault-byo-probe.js +0 -57
- package/dist/node/gitvault-byo-probe.js.map +0 -1
- package/dist/node/gitvault-creation-journal.d.ts.map +0 -1
- package/dist/node/gitvault-creation-journal.js.map +0 -1
- package/dist/node/gitvault-degraded-read.d.ts.map +0 -1
- package/dist/node/gitvault-degraded-read.js.map +0 -1
- package/dist/node/gitvault-deploy.d.ts.map +0 -1
- package/dist/node/gitvault-deploy.js.map +0 -1
- package/dist/node/gitvault-edge-fetch.d.ts.map +0 -1
- package/dist/node/gitvault-edge-fetch.js.map +0 -1
- package/dist/node/gitvault-handoff.d.ts.map +0 -1
- package/dist/node/gitvault-handoff.js.map +0 -1
- package/dist/node/gitvault-keystore.d.ts.map +0 -1
- package/dist/node/gitvault-keystore.js.map +0 -1
- package/dist/node/gitvault-member-bundle.d.ts.map +0 -1
- package/dist/node/gitvault-member-bundle.js.map +0 -1
- package/dist/node/gitvault-mirror-backend.d.ts.map +0 -1
- package/dist/node/gitvault-mirror-backend.js.map +0 -1
- package/dist/node/gitvault-mirror-config.d.ts.map +0 -1
- package/dist/node/gitvault-mirror-config.js.map +0 -1
- package/dist/node/gitvault-mirror.d.ts.map +0 -1
- package/dist/node/gitvault-mirror.js.map +0 -1
- package/dist/node/gitvault-native-crypto.d.ts.map +0 -1
- package/dist/node/gitvault-native-crypto.js.map +0 -1
- package/dist/node/gitvault-open-or-create.d.ts.map +0 -1
- package/dist/node/gitvault-open-or-create.js.map +0 -1
- package/dist/node/gitvault-prewarm.d.ts.map +0 -1
- package/dist/node/gitvault-prewarm.js.map +0 -1
- package/dist/node/gitvault-profile-scan.d.ts.map +0 -1
- package/dist/node/gitvault-profile-scan.js.map +0 -1
- package/dist/node/gitvault-prune.d.ts.map +0 -1
- package/dist/node/gitvault-prune.js.map +0 -1
- package/dist/node/gitvault-publication.d.ts.map +0 -1
- package/dist/node/gitvault-publication.js.map +0 -1
- package/dist/node/gitvault-push-to-create.d.ts.map +0 -1
- package/dist/node/gitvault-push-to-create.js.map +0 -1
- package/dist/node/gitvault-recover.d.ts.map +0 -1
- package/dist/node/gitvault-recover.js.map +0 -1
- package/dist/node/gitvault-restore.d.ts.map +0 -1
- package/dist/node/gitvault-restore.js.map +0 -1
- package/dist/node/gitvault-snapshot.d.ts.map +0 -1
- package/dist/node/gitvault-snapshot.js.map +0 -1
- package/dist/node/gitvault-writer-state.d.ts.map +0 -1
- package/dist/node/gitvault-writer-state.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The vault deploy lane, supplied at last (change `vault-deploy-lane`).
|
|
3
3
|
*
|
|
4
|
-
* `add-
|
|
5
|
-
* supplied one, so a project whose `
|
|
4
|
+
* `add-vault` 5.6 built `runVaultDeploy` with the lane INJECTED and never
|
|
5
|
+
* supplied one, so a project whose `vault_policy` is `required` could not be
|
|
6
6
|
* deployed by any published client. This module is that supplier, plus the
|
|
7
7
|
* entry point the CLI calls in place of a bare `apply()`:
|
|
8
8
|
*
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
* than reassembling it. Warning gating, CAS dedup, event emission, asset
|
|
13
13
|
* re-plan, and terminal polling are the same code every other deploy runs;
|
|
14
14
|
* the only difference is two extra wire fields.
|
|
15
|
-
* - {@link
|
|
15
|
+
* - {@link applyWithVault} decides whether any of that happens at all. A
|
|
16
16
|
* project that is not `required` takes the untouched path: no capture, no
|
|
17
17
|
* token, no extra refusal, one policy read.
|
|
18
18
|
*
|
|
19
|
-
* THE COROUTINE, because it is the non-obvious part. `
|
|
19
|
+
* THE COROUTINE, because it is the non-obvious part. `runVaultDeploy` wants
|
|
20
20
|
* two separable steps (plan, then commit) with the vault push running between
|
|
21
21
|
* them; `Deploy.apply()` is one call. The lane bridges them with a pair of
|
|
22
22
|
* deferreds: `apply()`'s `authorize` hook fires once the plan exists and its
|
|
@@ -46,7 +46,7 @@ export function createApplyDeployLane(options) {
|
|
|
46
46
|
async plan(input) {
|
|
47
47
|
applyPromise = options.engine.apply(options.spec, {
|
|
48
48
|
...(options.apply ?? {}),
|
|
49
|
-
|
|
49
|
+
vault: {
|
|
50
50
|
declaration: { capture_id: input.capture_id, snapshot_oid_hmac: input.snapshot_oid_hmac },
|
|
51
51
|
authorize: async (p) => {
|
|
52
52
|
if (!p.apply_plan_sha256) {
|
|
@@ -55,7 +55,7 @@ export function createApplyDeployLane(options) {
|
|
|
55
55
|
// inventing a placeholder: the capture still publishes (with a
|
|
56
56
|
// null digest, so nothing is mintable from it) and the outcome
|
|
57
57
|
// is an honest `DEPLOY_FAILED_VAULTED`.
|
|
58
|
-
const missing = new LocalError("the gateway accepted a capture-bearing plan but returned no apply_plan_sha256; no activation token can be minted for it", "planning a
|
|
58
|
+
const missing = new LocalError("the gateway accepted a capture-bearing plan but returned no apply_plan_sha256; no activation token can be minted for it", "planning a vault deploy", { code: "VAULT_PLAN_DIGEST_MISSING", details: { plan_id: p.plan_id, operation_id: p.operation_id } });
|
|
59
59
|
planned.reject(missing);
|
|
60
60
|
throw missing;
|
|
61
61
|
}
|
|
@@ -73,7 +73,7 @@ export function createApplyDeployLane(options) {
|
|
|
73
73
|
async commit(input) {
|
|
74
74
|
authorized.resolve(commitDeclaration(input));
|
|
75
75
|
if (!applyPromise)
|
|
76
|
-
throw new LocalError("commit was called before plan", "committing
|
|
76
|
+
throw new LocalError("commit was called before plan", "committing vault deploy", { code: "VAULT_LANE_OUT_OF_ORDER" });
|
|
77
77
|
result = await applyPromise;
|
|
78
78
|
return result;
|
|
79
79
|
},
|
|
@@ -82,7 +82,7 @@ export function createApplyDeployLane(options) {
|
|
|
82
82
|
return;
|
|
83
83
|
authorized.reject(reason instanceof Error
|
|
84
84
|
? reason
|
|
85
|
-
: new LocalError("the
|
|
85
|
+
: new LocalError("the vault deploy was abandoned before commit", "committing vault deploy", { code: "VAULT_DEPLOY_ABANDONED", details: { reason } }));
|
|
86
86
|
},
|
|
87
87
|
result: () => result,
|
|
88
88
|
};
|
|
@@ -93,25 +93,25 @@ function commitDeclaration(input) {
|
|
|
93
93
|
return { allow_unvaulted: true, override_reason: input.allow_unvaulted.reason };
|
|
94
94
|
const tokenId = input.activation_token?.object_id;
|
|
95
95
|
if (!tokenId) {
|
|
96
|
-
throw new LocalError("a vaulted commit needs an activation token and none was minted", "committing
|
|
96
|
+
throw new LocalError("a vaulted commit needs an activation token and none was minted", "committing vault deploy", { code: "VAULT_ACTIVATION_TOKEN_MISSING" });
|
|
97
97
|
}
|
|
98
98
|
return { activation_token_id: tokenId };
|
|
99
99
|
}
|
|
100
100
|
/** `run402 repos policy required` — the offer D3 attaches to every ungated deploy. */
|
|
101
|
-
export function
|
|
101
|
+
export function vaultPolicyRequiredNextAction(repoId) {
|
|
102
102
|
return {
|
|
103
|
-
type: "
|
|
103
|
+
type: "vault_policy_required",
|
|
104
104
|
command: "run402 repos policy required",
|
|
105
|
-
why: `vault ${repoId} exists but
|
|
105
|
+
why: `vault ${repoId} exists but vault_policy was never set, so this deploy ran without requiring a vaulted capture. Set it to require one, or run \`run402 repos policy grandfathered --reason <why>\` to explicitly accept the current state.`,
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
/** The standing `warnings[]` entry D3 attaches to every ungated deploy, until the policy is set either way. */
|
|
109
|
-
export function
|
|
109
|
+
export function vaultUngatedWarning(repoId) {
|
|
110
110
|
return {
|
|
111
|
-
code: "
|
|
111
|
+
code: "VAULT_POLICY_UNSET",
|
|
112
112
|
severity: "low",
|
|
113
113
|
requires_confirmation: false,
|
|
114
|
-
message: `vault ${repoId} is not gated:
|
|
114
|
+
message: `vault ${repoId} is not gated: vault_policy was never set, so a deploy can activate without a vaulted capture. Run \`run402 repos policy required\` (or \`grandfathered --reason <why>\` to explicitly accept this) to clear the drift.`,
|
|
115
115
|
affected: [repoId],
|
|
116
116
|
};
|
|
117
117
|
}
|
|
@@ -119,12 +119,12 @@ export function gitvaultUngatedWarning(repoId) {
|
|
|
119
119
|
function decorateUngatedResult(result, repoId) {
|
|
120
120
|
return {
|
|
121
121
|
...result,
|
|
122
|
-
warnings: [...(result.warnings ?? []),
|
|
123
|
-
next_actions: [...(result.next_actions ?? []),
|
|
122
|
+
warnings: [...(result.warnings ?? []), vaultUngatedWarning(repoId)],
|
|
123
|
+
next_actions: [...(result.next_actions ?? []), vaultPolicyRequiredNextAction(repoId)],
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
|
-
* Deploy, taking the project's `
|
|
127
|
+
* Deploy, taking the project's `vault_policy` into account.
|
|
128
128
|
*
|
|
129
129
|
* NOT `required` — no vault, an unreadable policy, a Core target, or an
|
|
130
130
|
* explicit `grandfathered` — runs `apply()` with the caller's own options and
|
|
@@ -132,7 +132,7 @@ function decorateUngatedResult(result, repoId) {
|
|
|
132
132
|
* user's deploy, and the only cost this function may add to it is the single
|
|
133
133
|
* policy read that determines the project is not `required`.
|
|
134
134
|
*/
|
|
135
|
-
export async function
|
|
135
|
+
export async function applyWithVault(options) {
|
|
136
136
|
const applyOpts = {
|
|
137
137
|
...(options.apply ?? {}),
|
|
138
138
|
...(options.target ? { target: options.target } : {}),
|
|
@@ -140,32 +140,32 @@ export async function applyWithGitvault(options) {
|
|
|
140
140
|
const plain = async (mode) => ({
|
|
141
141
|
mode,
|
|
142
142
|
deploy: await options.sdk._applyEngine.apply(options.spec, applyOpts),
|
|
143
|
-
|
|
143
|
+
vault: null,
|
|
144
144
|
});
|
|
145
145
|
// A self-hosted Core gateway has no vault gate; never spend a round trip.
|
|
146
146
|
if (options.target === "core")
|
|
147
147
|
return plain({ kind: "none", reason: "no_vault" });
|
|
148
|
-
const record = await readVaultRecord(options.sdk.
|
|
148
|
+
const record = await readVaultRecord(options.sdk.repos, options.spec.project_id);
|
|
149
149
|
if (!record)
|
|
150
150
|
return plain({ kind: "none", reason: "policy_unreadable" });
|
|
151
|
-
if (record.
|
|
151
|
+
if (record.vault_policy === "grandfathered") {
|
|
152
152
|
return plain({ kind: "grandfathered", repo_id: record.repo_id });
|
|
153
153
|
}
|
|
154
|
-
if (record.
|
|
155
|
-
// D3: allocation no longer sets `
|
|
154
|
+
if (record.vault_policy !== "required") {
|
|
155
|
+
// D3: allocation no longer sets `vault_policy`, so a vault whose
|
|
156
156
|
// policy is `null` is the ORDINARY shape, not a weakened one — the
|
|
157
157
|
// deploy is never blocked or interactively prompted on this. It still
|
|
158
|
-
// runs the untouched plain path (same options object, no
|
|
158
|
+
// runs the untouched plain path (same options object, no vault hooks);
|
|
159
159
|
// the only difference from `grandfathered` is that the result carries an
|
|
160
160
|
// offer to gate, plus a standing warning naming the drift until the
|
|
161
161
|
// policy is set either way (spec scenario "Ungated drift stays visible").
|
|
162
162
|
const deploy = await options.sdk._applyEngine.apply(options.spec, applyOpts);
|
|
163
|
-
return { mode: { kind: "ungated", repo_id: record.repo_id }, deploy: decorateUngatedResult(deploy, record.repo_id),
|
|
163
|
+
return { mode: { kind: "ungated", repo_id: record.repo_id }, deploy: decorateUngatedResult(deploy, record.repo_id), vault: null };
|
|
164
164
|
}
|
|
165
165
|
const lane = createApplyDeployLane({ engine: options.sdk._applyEngine, spec: options.spec, apply: applyOpts });
|
|
166
|
-
let
|
|
166
|
+
let vault;
|
|
167
167
|
try {
|
|
168
|
-
|
|
168
|
+
vault = await options.sdk.repos.deploy({
|
|
169
169
|
lane,
|
|
170
170
|
repo_id: record.repo_id,
|
|
171
171
|
repo_dir: options.repo_dir ?? process.cwd(),
|
|
@@ -185,9 +185,9 @@ export async function applyWithGitvault(options) {
|
|
|
185
185
|
throw enrichCaptureRefusal(err, record.repo_id);
|
|
186
186
|
}
|
|
187
187
|
finally {
|
|
188
|
-
lane.abandon(new LocalError("the deploy ended without committing this plan", "committing
|
|
188
|
+
lane.abandon(new LocalError("the deploy ended without committing this plan", "committing vault deploy", { code: "VAULT_DEPLOY_ABANDONED" }));
|
|
189
189
|
}
|
|
190
|
-
return { mode: { kind: "vaulted", repo_id: record.repo_id }, deploy: lane.result(),
|
|
190
|
+
return { mode: { kind: "vaulted", repo_id: record.repo_id }, deploy: lane.result(), vault };
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
193
|
* Read the vault record, or `null` when it cannot be read.
|
|
@@ -197,9 +197,9 @@ export async function applyWithGitvault(options) {
|
|
|
197
197
|
* genuinely required. Turning a transient control-plane blip into a failed
|
|
198
198
|
* deploy for a project that has no vault at all would be the worse trade.
|
|
199
199
|
*/
|
|
200
|
-
async function readVaultRecord(
|
|
200
|
+
async function readVaultRecord(repos, projectId) {
|
|
201
201
|
try {
|
|
202
|
-
return await
|
|
202
|
+
return await repos.forProject(projectId);
|
|
203
203
|
}
|
|
204
204
|
catch {
|
|
205
205
|
return null;
|
|
@@ -208,23 +208,23 @@ async function readVaultRecord(gitvault, projectId) {
|
|
|
208
208
|
/**
|
|
209
209
|
* A `required` project whose keystore this machine does not hold cannot
|
|
210
210
|
* capture. The protocol's own code is PRESERVED (`KEYSTORE_MISSING` /
|
|
211
|
-
* `
|
|
211
|
+
* `VAULT_REPO_STATE_MISSING` — surfacing the typed outcome rather than
|
|
212
212
|
* substituting one), with actions prepended that actually resolve it.
|
|
213
213
|
*/
|
|
214
214
|
function enrichCaptureRefusal(err, repoId) {
|
|
215
215
|
if (!isRun402Error(err))
|
|
216
216
|
return err;
|
|
217
217
|
const e = err;
|
|
218
|
-
if (e.code !== "KEYSTORE_MISSING" && e.code !== "
|
|
218
|
+
if (e.code !== "KEYSTORE_MISSING" && e.code !== "VAULT_REPO_STATE_MISSING")
|
|
219
219
|
return err;
|
|
220
|
-
return new LocalError(`${e.message} — this project's
|
|
220
|
+
return new LocalError(`${e.message} — this project's vault_policy is \`required\`, so a deploy from this machine needs the vault keystore`, "capturing for a vault-required deploy", {
|
|
221
221
|
code: e.code,
|
|
222
222
|
details: { repo_id: repoId, ...(e.details && typeof e.details === "object" ? e.details : {}) },
|
|
223
223
|
next_actions: [
|
|
224
|
-
{ action: "restore the
|
|
224
|
+
{ action: "restore the vault keystore onto this machine (run402 repos view prints keystore.root; back it up from the machine that holds it)" },
|
|
225
225
|
{ action: 'run402 repos policy grandfathered --reason "<why>" — un-gate the project so deploys activate without a capture (owner + step-up, audited, doctor-persistent advisory)' },
|
|
226
226
|
...(Array.isArray(e.next_actions) ? e.next_actions : []),
|
|
227
227
|
],
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
//# sourceMappingURL=
|
|
230
|
+
//# sourceMappingURL=vault-apply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault-apply.js","sourceRoot":"","sources":["../../src/node/vault-apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAmB,MAAM,cAAc,CAAC;AA2B1E,SAAS,QAAQ;IACf,IAAI,OAA4B,CAAC;IACjC,IAAI,MAAkC,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,GAAG,OAAO,GAAG,GAAG,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/E,6EAA6E;IAC7E,6EAA6E;IAC7E,2CAA2C;IAC3C,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC/B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC;AAqBD,MAAM,UAAU,qBAAqB,CAAC,OAA+B;IACnE,MAAM,OAAO,GAAG,QAAQ,EAAuB,CAAC;IAChD,MAAM,UAAU,GAAG,QAAQ,EAA0B,CAAC;IACtD,IAAI,YAAY,GAAiC,IAAI,CAAC;IACtD,IAAI,MAAM,GAAwB,IAAI,CAAC;IACvC,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,MAAM,IAAI,GAAoB;QAC5B,KAAK,CAAC,IAAI,CAAC,KAAK;YACd,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE;gBAChD,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;gBACxB,KAAK,EAAE;oBACL,WAAW,EAAE,EAAE,UAAU,EA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SAAiB;IAC5D,IAAI,CAAC;QACH,OAAO,MAAM,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,oBAAoB,CAAC,GAAY,EAAE,MAAc;IACxD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACpC,MAAM,CAAC,GAAG,GAAsF,CAAC;IACjG,IAAI,CAAC,CAAC,IAAI,KAAK,kBAAkB,IAAI,CAAC,CAAC,IAAI,KAAK,0BAA0B;QAAE,OAAO,GAAG,CAAC;IACvF,OAAO,IAAI,UAAU,CACnB,GAAG,CAAC,CAAC,OAAO,wGAAwG,EACpH,uCAAuC,EACvC;QACE,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;QAC9F,YAAY,EAAE;YACZ,EAAE,MAAM,EAAE,kIAAkI,EAAE;YAC9I,EAAE,MAAM,EAAE,uKAAuK,EAAE;YACnL,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;SACzD;KACF,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { VaultKeystore } from "./vault-keystore.js";
|
|
2
|
+
import type { VaultMirrorCredential, VaultMirrorDestination } from "./vault-mirror-config.js";
|
|
3
|
+
/** `byo/<repo_id>.json` — where THIS machine writes a BYO vault's payload objects, and which credential NAME resolves it at use time. */
|
|
4
|
+
export interface VaultByoConfig {
|
|
5
|
+
version: 1;
|
|
6
|
+
repo_id: string;
|
|
7
|
+
destination: VaultMirrorDestination;
|
|
8
|
+
/** Present only for an `s3` destination — a directory destination needs no credential. */
|
|
9
|
+
credential?: VaultMirrorCredential;
|
|
10
|
+
created_at: string;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function byoConfigDir(keystore: VaultKeystore): string;
|
|
14
|
+
export declare function byoConfigPath(keystore: VaultKeystore, repoId: string): string;
|
|
15
|
+
/** Read the local BYO write-credential config for one vault, or `null` when none is configured on this machine. */
|
|
16
|
+
export declare function readByoConfig(keystore: VaultKeystore, repoId: string): VaultByoConfig | null;
|
|
17
|
+
/** Every repo id with a local BYO write config on this machine. */
|
|
18
|
+
export declare function listByoConfiguredRepoIds(keystore: VaultKeystore): string[];
|
|
19
|
+
/** Set (create or replace) the local BYO write-credential config for one vault. */
|
|
20
|
+
export declare function saveByoConfig(keystore: VaultKeystore, input: {
|
|
21
|
+
repo_id: string;
|
|
22
|
+
destination: VaultMirrorDestination;
|
|
23
|
+
credential?: VaultMirrorCredential;
|
|
24
|
+
}, now?: () => Date): VaultByoConfig;
|
|
25
|
+
/** Remove the local BYO write-credential config for one vault. Never touches the customer bucket's own bytes — this only stops THIS machine from writing/reading it as the vault's primary destination. */
|
|
26
|
+
export declare function removeByoConfig(keystore: VaultKeystore, repoId: string): {
|
|
27
|
+
removed: boolean;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=vault-byo-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault-byo-config.d.ts","sourceRoot":"","sources":["../../src/node/vault-byo-config.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,aAAa,EAAyC,MAAM,qBAAqB,CAAC;AAC3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAM9F,yIAAyI;AACzI,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,sBAAsB,CAAC;IACpC,0FAA0F;IAC1F,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAE5D;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAG7E;AAED,mHAAmH;AACnH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAa5F;AAED,mEAAmE;AACnE,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,EAAE,CAQ1E;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,sBAAsB,CAAC;IAAC,UAAU,CAAC,EAAE,qBAAqB,CAAA;CAAE,EACnG,GAAG,GAAE,MAAM,IAAuB,GACjC,cAAc,CAehB;AAED,2MAA2M;AAC3M,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAS7F"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* (design D2, task 3.1/3.2). Parallels `
|
|
2
|
+
* vault-byo-primary-bucket — local per-vault BYO credential config
|
|
3
|
+
* (design D2, task 3.1/3.2). Parallels `vault-mirror-config.ts` exactly,
|
|
4
4
|
* on purpose: same file shape, same "beside the keystore, never in
|
|
5
5
|
* `run402.config.json`, never a raw secret value" reasoning.
|
|
6
6
|
*
|
|
7
7
|
* A BYO vault's `storage_profile`/`byo_destination` are recorded on the
|
|
8
8
|
* GATEWAY's vault record (the destination ADDRESS only — see
|
|
9
|
-
* `
|
|
9
|
+
* `vault-creation-journal.ts`'s allocation request). This file carries
|
|
10
10
|
* the ONE thing that must stay purely local, per D2: the credential NAME
|
|
11
11
|
* (an AWS profile, or the ambient environment chain) that resolves to the
|
|
12
12
|
* customer bucket's actual secret at USE time — resolved by
|
|
13
|
-
* `
|
|
13
|
+
* `vault-mirror-backend.ts`, never read or cached here, never
|
|
14
14
|
* transmitted to run402 in any request. The destination's `region`/
|
|
15
15
|
* `endpoint` are ALSO local-only (the server-side address string carries
|
|
16
|
-
* neither), so this config persists the full `
|
|
16
|
+
* neither), so this config persists the full `VaultMirrorDestination`,
|
|
17
17
|
* not just the credential.
|
|
18
18
|
*
|
|
19
19
|
* Written once by `repos create --byo` (or, for a fresh machine re-linking
|
|
20
|
-
* to an already-BYO vault, `
|
|
20
|
+
* to an already-BYO vault, `Repos.byoConfigSet`), keyed by `repo_id` —
|
|
21
21
|
* `repo_id` only exists AFTER allocation, so this file's existence for a
|
|
22
22
|
* given repo is itself the local "this machine can write this vault's
|
|
23
|
-
* payload objects directly" fact `
|
|
24
|
-
* `
|
|
23
|
+
* payload objects directly" fact `vault-mirror.ts`'s dual-push hook and
|
|
24
|
+
* `vault-degraded-read.ts`'s fallback resolution both gate on.
|
|
25
25
|
*/
|
|
26
26
|
import { existsSync, readdirSync, unlinkSync } from "node:fs";
|
|
27
27
|
import { join } from "node:path";
|
|
28
28
|
import { LocalError } from "../errors.js";
|
|
29
|
-
import {
|
|
30
|
-
import { readFileNoFollow, writeFileAtomic0600 } from "./
|
|
29
|
+
import { VAULT_SRC_RE } from "../namespaces/vault.crypto.js";
|
|
30
|
+
import { readFileNoFollow, writeFileAtomic0600 } from "./vault-keystore.js";
|
|
31
31
|
function fail(code, message, context, details, nextActions) {
|
|
32
32
|
throw new LocalError(message, context, { code, details, ...(nextActions ? { next_actions: nextActions } : {}) });
|
|
33
33
|
}
|
|
@@ -35,8 +35,8 @@ export function byoConfigDir(keystore) {
|
|
|
35
35
|
return join(keystore.rootDir, "byo");
|
|
36
36
|
}
|
|
37
37
|
export function byoConfigPath(keystore, repoId) {
|
|
38
|
-
if (!
|
|
39
|
-
fail("
|
|
38
|
+
if (!VAULT_SRC_RE.test(repoId))
|
|
39
|
+
fail("VAULT_BAD_REPO_ID", `not a src_ id: ${repoId}`, "resolving vault byo config path");
|
|
40
40
|
return join(byoConfigDir(keystore), `${repoId}.json`);
|
|
41
41
|
}
|
|
42
42
|
/** Read the local BYO write-credential config for one vault, or `null` when none is configured on this machine. */
|
|
@@ -49,10 +49,10 @@ export function readByoConfig(keystore, repoId) {
|
|
|
49
49
|
parsed = JSON.parse(text);
|
|
50
50
|
}
|
|
51
51
|
catch (e) {
|
|
52
|
-
fail("
|
|
52
|
+
fail("VAULT_BYO_CONFIG_CORRUPT", `byo config for ${repoId} is not valid JSON: ${e.message}`, "reading vault byo config", { repo_id: repoId });
|
|
53
53
|
}
|
|
54
54
|
if (parsed.version !== 1 || parsed.repo_id !== repoId || !parsed.destination) {
|
|
55
|
-
fail("
|
|
55
|
+
fail("VAULT_BYO_CONFIG_CORRUPT", `byo config for ${repoId} is not a version-1 vault byo config`, "reading vault byo config", { repo_id: repoId });
|
|
56
56
|
}
|
|
57
57
|
return parsed;
|
|
58
58
|
}
|
|
@@ -64,13 +64,13 @@ export function listByoConfiguredRepoIds(keystore) {
|
|
|
64
64
|
return readdirSync(dir)
|
|
65
65
|
.filter((n) => n.endsWith(".json"))
|
|
66
66
|
.map((n) => n.slice(0, -5))
|
|
67
|
-
.filter((id) =>
|
|
67
|
+
.filter((id) => VAULT_SRC_RE.test(id))
|
|
68
68
|
.sort();
|
|
69
69
|
}
|
|
70
70
|
/** Set (create or replace) the local BYO write-credential config for one vault. */
|
|
71
71
|
export function saveByoConfig(keystore, input, now = () => new Date()) {
|
|
72
72
|
if (input.destination.kind === "s3" && !input.credential) {
|
|
73
|
-
fail("
|
|
73
|
+
fail("VAULT_MIRROR_CREDENTIAL_REQUIRED", "an s3 byo destination needs a credential — pass --profile <name> or --ambient", "configuring vault byo credential");
|
|
74
74
|
}
|
|
75
75
|
const existing = readByoConfig(keystore, input.repo_id);
|
|
76
76
|
const full = {
|
|
@@ -93,8 +93,8 @@ export function removeByoConfig(keystore, repoId) {
|
|
|
93
93
|
unlinkSync(path);
|
|
94
94
|
}
|
|
95
95
|
catch (e) {
|
|
96
|
-
fail("
|
|
96
|
+
fail("VAULT_BYO_CONFIG_REMOVE_FAILED", `could not remove byo config for ${repoId}: ${e.message}`, "removing vault byo config", { repo_id: repoId });
|
|
97
97
|
}
|
|
98
98
|
return { removed: true };
|
|
99
99
|
}
|
|
100
|
-
//# sourceMappingURL=
|
|
100
|
+
//# sourceMappingURL=vault-byo-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault-byo-config.js","sourceRoot":"","sources":["../../src/node/vault-byo-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAiB,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG3F,SAAS,IAAI,CAAC,IAAY,EAAE,OAAe,EAAE,OAAe,EAAE,OAAiB,EAAE,WAAuB;IACtG,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,E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AAG,EAAE,CAAC,WAAW,EAAE;KAChC,CAAC;IACF,mBAAmB,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3F,OAAO,IAAI,CAAC;AACd,CAAC;AAED,2MAA2M;AAC3M,MAAM,UAAU,eAAe,CAAC,QAAuB,EAAE,MAAc;IACrE,MAAM,IAAI,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACjD,IAAI,CAAC;QACH,UAAU,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,gCAAgC,EAAE,mCAAmC,MAAM,KAAM,CAAW,CAAC,OAAO,EAAE,EAAE,2BAA2B,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACjK,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { VaultBucketProbeResult } from "./vault-mirror-backend.js";
|
|
2
|
+
import type { VaultMirrorCredential, VaultMirrorDestination } from "./vault-mirror-config.js";
|
|
3
|
+
/**
|
|
4
|
+
* The failing properties, named — never a bundled "the probe failed". Every
|
|
5
|
+
* entry maps 1:1 to one of {@link VaultBucketProbeResult}'s three
|
|
6
|
+
* booleans, so a caller (or a test) can assert on exactly what broke.
|
|
7
|
+
*/
|
|
8
|
+
export declare function vaultByoProbeFailingProperties(result: VaultBucketProbeResult): string[];
|
|
9
|
+
/**
|
|
10
|
+
* `repos create --byo`'s pre-allocation gate: open a root-scoped backend at
|
|
11
|
+
* `destination` (no `repo_id` — the probe never collides with any vault's
|
|
12
|
+
* own `source/<repo_id>/` prefix, since it writes under `_byo-probe/`
|
|
13
|
+
* instead) and run {@link VaultMirrorBackend.probeWritePolicy}. A failed
|
|
14
|
+
* property (or a thrown transport error) refuses with
|
|
15
|
+
* `VAULT_BYO_BUCKET_PROBE_FAILED`, naming exactly which propert(y/ies)
|
|
16
|
+
* failed and the underlying fact — the caller MUST NOT proceed to
|
|
17
|
+
* allocation on a failed probe.
|
|
18
|
+
*/
|
|
19
|
+
export declare function probeVaultByoDestination(destination: VaultMirrorDestination, credential?: VaultMirrorCredential): Promise<VaultBucketProbeResult>;
|
|
20
|
+
//# sourceMappingURL=vault-byo-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault-byo-probe.d.ts","sourceRoot":"","sources":["../../src/node/vault-byo-probe.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAO9F;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,EAAE,CAMvF;AAED;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,sBAAsB,EAAE,UAAU,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA0BvJ"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vault-byo-primary-bucket — the allocation-time bucket-policy probe
|
|
3
|
+
* (design D6, task 3.1). Runs BEFORE the allocation request ever reaches
|
|
4
|
+
* the gateway, against the DESTINATION's own root (no `repo_id` exists yet
|
|
5
|
+
* — allocation is what mints one) — so a failed probe means "no vault
|
|
6
|
+
* half-exists", never a partially-created one.
|
|
7
|
+
*
|
|
8
|
+
* Reuses the shipped mirror backend's SigV4 client — no second S3 client.
|
|
9
|
+
*/
|
|
10
|
+
import { LocalError } from "../errors.js";
|
|
11
|
+
import { openVaultDestinationBackend } from "./vault-mirror-backend.js";
|
|
12
|
+
import { formatMirrorDestination } from "./vault-mirror-config.js";
|
|
13
|
+
function fail(code, message, context, details, nextActions) {
|
|
14
|
+
throw new LocalError(message, context, { code, details, ...(nextActions ? { next_actions: nextActions } : {}) });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The failing properties, named — never a bundled "the probe failed". Every
|
|
18
|
+
* entry maps 1:1 to one of {@link VaultBucketProbeResult}'s three
|
|
19
|
+
* booleans, so a caller (or a test) can assert on exactly what broke.
|
|
20
|
+
*/
|
|
21
|
+
export function vaultByoProbeFailingProperties(result) {
|
|
22
|
+
const failing = [];
|
|
23
|
+
if (!result.write_permitted)
|
|
24
|
+
failing.push("write_permitted");
|
|
25
|
+
if (!result.create_only_honored)
|
|
26
|
+
failing.push("create_only_honored");
|
|
27
|
+
if (!result.versioning_off)
|
|
28
|
+
failing.push("versioning_off");
|
|
29
|
+
return failing;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `repos create --byo`'s pre-allocation gate: open a root-scoped backend at
|
|
33
|
+
* `destination` (no `repo_id` — the probe never collides with any vault's
|
|
34
|
+
* own `source/<repo_id>/` prefix, since it writes under `_byo-probe/`
|
|
35
|
+
* instead) and run {@link VaultMirrorBackend.probeWritePolicy}. A failed
|
|
36
|
+
* property (or a thrown transport error) refuses with
|
|
37
|
+
* `VAULT_BYO_BUCKET_PROBE_FAILED`, naming exactly which propert(y/ies)
|
|
38
|
+
* failed and the underlying fact — the caller MUST NOT proceed to
|
|
39
|
+
* allocation on a failed probe.
|
|
40
|
+
*/
|
|
41
|
+
export async function probeVaultByoDestination(destination, credential) {
|
|
42
|
+
const backend = openVaultDestinationBackend(destination, credential);
|
|
43
|
+
let result;
|
|
44
|
+
try {
|
|
45
|
+
result = await backend.probeWritePolicy();
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
49
|
+
fail("VAULT_BYO_BUCKET_PROBE_FAILED", `the bucket-policy probe against ${formatMirrorDestination(destination)} failed before any property could be confirmed: ${message}`, "probing the BYO destination before allocation", { destination: formatMirrorDestination(destination), failing_properties: ["write_permitted", "create_only_honored", "versioning_off"] }, [{ action: "confirm the destination and credential are correct, and that the bucket policy grants PutObject + GetBucketVersioning to this credential, then retry" }]);
|
|
50
|
+
}
|
|
51
|
+
const failing = vaultByoProbeFailingProperties(result);
|
|
52
|
+
if (failing.length > 0) {
|
|
53
|
+
fail("VAULT_BYO_BUCKET_PROBE_FAILED", `${formatMirrorDestination(destination)} does not satisfy the BYO bucket-policy profile (versioning disabled, create-only if-none-match writes honored, write permitted) — failing: ${failing.join(", ")}${result.detail ? ` (${result.detail})` : ""}`, "probing the BYO destination before allocation", { destination: formatMirrorDestination(destination), failing_properties: failing, probe: result }, [{ action: "disable bucket versioning, confirm the bucket policy enforces s3:if-none-match create-only writes, and confirm PutObject is permitted for this credential, then retry" }]);
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=vault-byo-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault-byo-probe.js","sourceRoot":"","sources":["../../src/node/vault-byo-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,SAAS,IAAI,CAAC,IAAY,EAAE,OAAe,EAAE,OAAe,EAAE,OAAiB,EAAE,WAAuB;IACtG,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,YAAY,EA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