@homeflare/alchemy 0.5.0 → 0.7.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 +68 -55
- package/dist/caddy/admin-calls.d.ts +48 -0
- package/dist/caddy/admin-calls.d.ts.map +1 -0
- package/dist/caddy/admin-guard.d.ts +40 -0
- package/dist/caddy/admin-guard.d.ts.map +1 -0
- package/dist/caddy/admin.d.ts +73 -0
- package/dist/caddy/admin.d.ts.map +1 -0
- package/dist/caddy/caddyfile-tripwire.d.ts +5 -0
- package/dist/caddy/caddyfile-tripwire.d.ts.map +1 -0
- package/dist/caddy/config-form.d.ts +27 -0
- package/dist/caddy/config-form.d.ts.map +1 -0
- package/dist/caddy/config-lifecycle.d.ts +45 -0
- package/dist/caddy/config-lifecycle.d.ts.map +1 -0
- package/dist/caddy/config.d.ts +30 -0
- package/dist/caddy/config.d.ts.map +1 -0
- package/dist/caddy/digest.d.ts +7 -0
- package/dist/caddy/digest.d.ts.map +1 -0
- package/dist/caddy/fake-caddy.d.ts +43 -0
- package/dist/caddy/fake-caddy.d.ts.map +1 -0
- package/dist/caddy/index.d.ts +21 -0
- package/dist/caddy/index.d.ts.map +1 -0
- package/dist/caddy/index.js +912 -0
- package/dist/caddy/index.js.map +28 -0
- package/dist/caddy/local-admin.d.ts +45 -0
- package/dist/caddy/local-admin.d.ts.map +1 -0
- package/dist/caddy/providers.d.ts +14 -0
- package/dist/caddy/providers.d.ts.map +1 -0
- package/dist/caddy/with-file.d.ts +47 -0
- package/dist/caddy/with-file.d.ts.map +1 -0
- package/dist/cloudflare/fake-mesh.d.ts +58 -0
- package/dist/cloudflare/fake-mesh.d.ts.map +1 -0
- package/dist/cloudflare/index.d.ts +9 -3
- package/dist/cloudflare/index.d.ts.map +1 -1
- package/dist/cloudflare/index.js +218 -7
- package/dist/cloudflare/index.js.map +9 -4
- package/dist/cloudflare/mesh-node-api.d.ts +75 -0
- package/dist/cloudflare/mesh-node-api.d.ts.map +1 -0
- package/dist/cloudflare/mesh-node-form.d.ts +82 -0
- package/dist/cloudflare/mesh-node-form.d.ts.map +1 -0
- package/dist/cloudflare/mesh-node-harness.d.ts +46 -0
- package/dist/cloudflare/mesh-node-harness.d.ts.map +1 -0
- package/dist/cloudflare/mesh-node-lifecycle.d.ts +22 -0
- package/dist/cloudflare/mesh-node-lifecycle.d.ts.map +1 -0
- package/dist/cloudflare/mesh-node-token.d.ts +23 -0
- package/dist/cloudflare/mesh-node-token.d.ts.map +1 -0
- package/dist/cloudflare/mesh-node.d.ts +48 -0
- package/dist/cloudflare/mesh-node.d.ts.map +1 -0
- package/dist/cloudflare/providers.d.ts +1 -12
- package/dist/cloudflare/providers.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/launchd/fake-runner.d.ts +36 -0
- package/dist/launchd/fake-runner.d.ts.map +1 -0
- package/dist/launchd/host-effect.d.ts +19 -0
- package/dist/launchd/host-effect.d.ts.map +1 -0
- package/dist/launchd/host-file-form.d.ts +24 -0
- package/dist/launchd/host-file-form.d.ts.map +1 -0
- package/dist/launchd/host-file-lifecycle.d.ts +29 -0
- package/dist/launchd/host-file-lifecycle.d.ts.map +1 -0
- package/dist/launchd/host-file.d.ts +25 -0
- package/dist/launchd/host-file.d.ts.map +1 -0
- package/dist/launchd/host-lookup.d.ts +27 -0
- package/dist/launchd/host-lookup.d.ts.map +1 -0
- package/dist/launchd/index.d.ts +21 -0
- package/dist/launchd/index.d.ts.map +1 -0
- package/dist/launchd/index.js +969 -0
- package/dist/launchd/index.js.map +25 -0
- package/dist/launchd/job-form.d.ts +90 -0
- package/dist/launchd/job-form.d.ts.map +1 -0
- package/dist/launchd/job-lifecycle.d.ts +34 -0
- package/dist/launchd/job-lifecycle.d.ts.map +1 -0
- package/dist/launchd/job-preflight.d.ts +50 -0
- package/dist/launchd/job-preflight.d.ts.map +1 -0
- package/dist/launchd/job-validate.d.ts +25 -0
- package/dist/launchd/job-validate.d.ts.map +1 -0
- package/dist/launchd/job.d.ts +34 -0
- package/dist/launchd/job.d.ts.map +1 -0
- package/dist/launchd/launchctl.d.ts +62 -0
- package/dist/launchd/launchctl.d.ts.map +1 -0
- package/dist/launchd/local-runner.d.ts +7 -0
- package/dist/launchd/local-runner.d.ts.map +1 -0
- package/dist/launchd/plist.d.ts +41 -0
- package/dist/launchd/plist.d.ts.map +1 -0
- package/dist/launchd/providers.d.ts +15 -0
- package/dist/launchd/providers.d.ts.map +1 -0
- package/dist/launchd/runner.d.ts +91 -0
- package/dist/launchd/runner.d.ts.map +1 -0
- package/dist/launchd/secret-tripwire.d.ts +24 -0
- package/dist/launchd/secret-tripwire.d.ts.map +1 -0
- package/dist/openbao/auth-method-form.d.ts +7 -0
- package/dist/openbao/auth-method-form.d.ts.map +1 -1
- package/dist/openbao/auth-method-reconcile.d.ts +15 -0
- package/dist/openbao/auth-method-reconcile.d.ts.map +1 -0
- package/dist/openbao/auth-method.d.ts +6 -0
- package/dist/openbao/auth-method.d.ts.map +1 -1
- package/dist/openbao/auth-role-form.d.ts +9 -0
- package/dist/openbao/auth-role-form.d.ts.map +1 -1
- package/dist/openbao/auth-role.d.ts.map +1 -1
- package/dist/openbao/auth-token-form.d.ts +48 -0
- package/dist/openbao/auth-token-form.d.ts.map +1 -0
- package/dist/openbao/bao-identity.d.ts +81 -0
- package/dist/openbao/bao-identity.d.ts.map +1 -0
- package/dist/openbao/bao-namespace.d.ts +20 -0
- package/dist/openbao/bao-namespace.d.ts.map +1 -0
- package/dist/openbao/cloudflare-role.d.ts.map +1 -1
- package/dist/openbao/cloudflare-roles-expand.d.ts.map +1 -1
- package/dist/openbao/fake-engines.d.ts +30 -0
- package/dist/openbao/fake-engines.d.ts.map +1 -0
- package/dist/openbao/fake-stack.d.ts +29 -0
- package/dist/openbao/fake-stack.d.ts.map +1 -0
- package/dist/openbao/host-approles.d.ts +62 -0
- package/dist/openbao/host-approles.d.ts.map +1 -0
- package/dist/openbao/index.d.ts +19 -0
- package/dist/openbao/index.d.ts.map +1 -1
- package/dist/openbao/index.js +1518 -310
- package/dist/openbao/index.js.map +40 -17
- package/dist/openbao/jwt-config-form.d.ts +51 -0
- package/dist/openbao/jwt-config-form.d.ts.map +1 -0
- package/dist/openbao/jwt-config.d.ts +25 -0
- package/dist/openbao/jwt-config.d.ts.map +1 -0
- package/dist/openbao/jwt-role-form.d.ts +91 -0
- package/dist/openbao/jwt-role-form.d.ts.map +1 -0
- package/dist/openbao/jwt-role.d.ts +31 -0
- package/dist/openbao/jwt-role.d.ts.map +1 -0
- package/dist/openbao/kubernetes-role-form.d.ts +68 -0
- package/dist/openbao/kubernetes-role-form.d.ts.map +1 -0
- package/dist/openbao/kubernetes-role.d.ts +25 -0
- package/dist/openbao/kubernetes-role.d.ts.map +1 -0
- package/dist/openbao/mfa-enforcement-form.d.ts +46 -0
- package/dist/openbao/mfa-enforcement-form.d.ts.map +1 -0
- package/dist/openbao/mfa-enforcement.d.ts +41 -0
- package/dist/openbao/mfa-enforcement.d.ts.map +1 -0
- package/dist/openbao/mfa-totp-form.d.ts +52 -0
- package/dist/openbao/mfa-totp-form.d.ts.map +1 -0
- package/dist/openbao/mfa-totp.d.ts +33 -0
- package/dist/openbao/mfa-totp.d.ts.map +1 -0
- package/dist/openbao/mfa-wire.d.ts +63 -0
- package/dist/openbao/mfa-wire.d.ts.map +1 -0
- package/dist/openbao/mount-form.d.ts +7 -0
- package/dist/openbao/mount-form.d.ts.map +1 -1
- package/dist/openbao/mount-move.d.ts +49 -0
- package/dist/openbao/mount-move.d.ts.map +1 -0
- package/dist/openbao/mount-path.d.ts +8 -4
- package/dist/openbao/mount-path.d.ts.map +1 -1
- package/dist/openbao/mount-reconcile.d.ts +16 -0
- package/dist/openbao/mount-reconcile.d.ts.map +1 -0
- package/dist/openbao/mount.d.ts +9 -0
- package/dist/openbao/mount.d.ts.map +1 -1
- package/dist/openbao/pki-role-canonical.d.ts +46 -0
- package/dist/openbao/pki-role-canonical.d.ts.map +1 -0
- package/dist/openbao/pki-role-form.d.ts +38 -30
- package/dist/openbao/pki-role-form.d.ts.map +1 -1
- package/dist/openbao/pki-role.d.ts.map +1 -1
- package/dist/openbao/policy.d.ts +2 -0
- package/dist/openbao/policy.d.ts.map +1 -1
- package/dist/openbao/proxmox-role-form.d.ts +18 -8
- package/dist/openbao/proxmox-role-form.d.ts.map +1 -1
- package/dist/openbao/proxmox-role-wire.d.ts +18 -0
- package/dist/openbao/proxmox-role-wire.d.ts.map +1 -0
- package/dist/openbao/proxmox-role.d.ts.map +1 -1
- package/dist/openbao/remount-wire.d.ts +44 -0
- package/dist/openbao/remount-wire.d.ts.map +1 -0
- package/dist/openbao/rename.d.ts +106 -0
- package/dist/openbao/rename.d.ts.map +1 -0
- package/dist/openbao/role-reconcile.d.ts +40 -0
- package/dist/openbao/role-reconcile.d.ts.map +1 -0
- package/docs/caddy.md +180 -0
- package/docs/launchd.md +167 -0
- package/docs/mesh-node.md +188 -0
- package/package.json +12 -2
- package/src/caddy/admin-calls.ts +128 -0
- package/src/caddy/admin-guard.ts +170 -0
- package/src/caddy/admin.ts +74 -0
- package/src/caddy/caddyfile-tripwire.ts +133 -0
- package/src/caddy/config-form.ts +64 -0
- package/src/caddy/config-lifecycle.test.ts +218 -0
- package/src/caddy/config-lifecycle.ts +148 -0
- package/src/caddy/config.ts +116 -0
- package/src/caddy/digest.ts +44 -0
- package/src/caddy/fake-caddy.ts +160 -0
- package/src/caddy/guards.test.ts +156 -0
- package/src/caddy/index.ts +25 -0
- package/src/caddy/local-admin.test.ts +160 -0
- package/src/caddy/local-admin.ts +189 -0
- package/src/caddy/providers.test.ts +244 -0
- package/src/caddy/providers.ts +17 -0
- package/src/caddy/with-file.ts +62 -0
- package/src/cloudflare/fake-mesh.ts +181 -0
- package/src/cloudflare/index.ts +9 -3
- package/src/cloudflare/mesh-node-api.ts +127 -0
- package/src/cloudflare/mesh-node-edges.test.ts +103 -0
- package/src/cloudflare/mesh-node-form.test.ts +80 -0
- package/src/cloudflare/mesh-node-form.ts +115 -0
- package/src/cloudflare/mesh-node-harness.ts +124 -0
- package/src/cloudflare/mesh-node-lifecycle.ts +187 -0
- package/src/cloudflare/mesh-node-policy.test.ts +151 -0
- package/src/cloudflare/mesh-node-token.test.ts +117 -0
- package/src/cloudflare/mesh-node-token.ts +125 -0
- package/src/cloudflare/mesh-node.test.ts +172 -0
- package/src/cloudflare/mesh-node.ts +120 -0
- package/src/cloudflare/providers.ts +20 -2
- package/src/index.ts +2 -0
- package/src/launchd/fake-runner.ts +176 -0
- package/src/launchd/host-effect.ts +28 -0
- package/src/launchd/host-file-form.ts +71 -0
- package/src/launchd/host-file-lifecycle.test.ts +198 -0
- package/src/launchd/host-file-lifecycle.ts +164 -0
- package/src/launchd/host-file.ts +64 -0
- package/src/launchd/host-lookup.test.ts +92 -0
- package/src/launchd/host-lookup.ts +94 -0
- package/src/launchd/index.ts +26 -0
- package/src/launchd/job-form.test.ts +171 -0
- package/src/launchd/job-form.ts +180 -0
- package/src/launchd/job-identity.test.ts +147 -0
- package/src/launchd/job-lifecycle.test.ts +220 -0
- package/src/launchd/job-lifecycle.ts +194 -0
- package/src/launchd/job-preflight.ts +152 -0
- package/src/launchd/job-validate.ts +134 -0
- package/src/launchd/job.ts +96 -0
- package/src/launchd/launchctl.test.ts +181 -0
- package/src/launchd/launchctl.ts +188 -0
- package/src/launchd/local-runner.test.ts +125 -0
- package/src/launchd/local-runner.ts +143 -0
- package/src/launchd/plist.test.ts +186 -0
- package/src/launchd/plist.ts +156 -0
- package/src/launchd/providers.test.ts +222 -0
- package/src/launchd/providers.ts +21 -0
- package/src/launchd/runner.ts +95 -0
- package/src/launchd/secret-tripwire.test.ts +110 -0
- package/src/launchd/secret-tripwire.ts +81 -0
- package/src/openbao/README.md +181 -0
- package/src/openbao/REPLACE.md +163 -0
- package/src/openbao/auth-method-form.ts +7 -0
- package/src/openbao/auth-method-reconcile.ts +74 -0
- package/src/openbao/auth-method.ts +20 -41
- package/src/openbao/auth-role-form.test.ts +16 -1
- package/src/openbao/auth-role-form.ts +11 -0
- package/src/openbao/auth-role.ts +12 -0
- package/src/openbao/auth-token-form.ts +161 -0
- package/src/openbao/bao-identity.test.ts +131 -0
- package/src/openbao/bao-identity.ts +188 -0
- package/src/openbao/bao-namespace.ts +32 -0
- package/src/openbao/cloudflare-role-wire.test.ts +8 -34
- package/src/openbao/cloudflare-role.ts +30 -8
- package/src/openbao/cloudflare-roles-expand.ts +2 -5
- package/src/openbao/fake-engines.ts +119 -0
- package/src/openbao/fake-stack.ts +112 -0
- package/src/openbao/host-approles.test.ts +121 -0
- package/src/openbao/host-approles.ts +126 -0
- package/src/openbao/index.ts +19 -0
- package/src/openbao/jwt-config-form.ts +161 -0
- package/src/openbao/jwt-config.ts +85 -0
- package/src/openbao/jwt-role-form.test.ts +130 -0
- package/src/openbao/jwt-role-form.ts +231 -0
- package/src/openbao/jwt-role.ts +102 -0
- package/src/openbao/kubernetes-role-form.test.ts +82 -0
- package/src/openbao/kubernetes-role-form.ts +149 -0
- package/src/openbao/kubernetes-role.ts +94 -0
- package/src/openbao/mfa-enforcement-form.ts +147 -0
- package/src/openbao/mfa-enforcement.ts +143 -0
- package/src/openbao/mfa-totp-form.ts +155 -0
- package/src/openbao/mfa-totp.ts +118 -0
- package/src/openbao/mfa-wire.ts +117 -0
- package/src/openbao/mfa.test.ts +200 -0
- package/src/openbao/mount-form.ts +9 -1
- package/src/openbao/mount-move.test.ts +164 -0
- package/src/openbao/mount-move.ts +113 -0
- package/src/openbao/mount-path.test.ts +11 -1
- package/src/openbao/mount-path.ts +17 -11
- package/src/openbao/mount-reconcile.ts +75 -0
- package/src/openbao/mount.ts +26 -43
- package/src/openbao/pki-role-canonical.ts +163 -0
- package/src/openbao/pki-role-form.test.ts +112 -0
- package/src/openbao/pki-role-form.ts +76 -110
- package/src/openbao/pki-role.ts +12 -27
- package/src/openbao/policy-rename.test.ts +112 -0
- package/src/openbao/policy-wire.test.ts +7 -26
- package/src/openbao/policy.ts +27 -4
- package/src/openbao/proxmox-role-form.ts +27 -8
- package/src/openbao/proxmox-role-wire.ts +24 -0
- package/src/openbao/proxmox-role.ts +62 -37
- package/src/openbao/remount-wire.test.ts +87 -0
- package/src/openbao/remount-wire.ts +112 -0
- package/src/openbao/rename-occupied.test.ts +166 -0
- package/src/openbao/rename.ts +162 -0
- package/src/openbao/role-reconcile.test.ts +104 -0
- package/src/openbao/role-reconcile.ts +84 -0
- package/src/openbao/role-rename.test.ts +205 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount-form.d.ts","sourceRoot":"","sources":["../../src/openbao/mount-form.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mount-form.d.ts","sourceRoot":"","sources":["../../src/openbao/mount-form.ts"],"names":[],"mappings":"AAGA,0FAA0F;AAC1F,eAAO,MAAM,SAAS,SAAU,MAAM,WAA8B,CAAC;AAIrE,qEAAqE;AACrE,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,MAAM,GAAG,SAkBrD,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,UAAU,UAAW,OAAO,KAAG,MAAM,GAAG,SAIpD,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,sGAAsG;IACtG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kGAAkG;IAClG,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB;AAiBD,eAAO,MAAM,YAAY,UAChB,aAAa,QACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,kBAYF,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,QAAQ,SAAU,MAAM,WAAoC,CAAC;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,SAAU,MAAM,WAA6B,CAAC;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,UAAW,aAAa,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CACsB,CAAC;AAE/F;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,UAAW,aAAa,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAMpE,CAAC;AASF,6EAA6E;AAC7E,eAAO,MAAM,OAAO,eAAgB,kBAAkB,SAAS,aAAa,YAIxB,CAAC;AAErD,eAAO,MAAM,SAAS,UAAW,aAAa,YAGb,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a changed path means for Bao.Mount and Bao.AuthMethod — and the move, when one is declared.
|
|
3
|
+
*
|
|
4
|
+
* ⛔ A CHANGED PATH USED TO PLAN `update` AND ENABLE AN EMPTY MOUNT AT THE NEW PATH. diff read the
|
|
5
|
+
* new path, found nothing, answered `update`, and reconcile ran `enable` there: a fresh, empty
|
|
6
|
+
* `kv2/` beside the retained `kv/` that still held every secret, with Alchemy's state now naming
|
|
7
|
+
* only the empty one. Nothing failed, so nothing said so (site-config plan, Guards).
|
|
8
|
+
* ★ NOW A CHANGED PATH FAILS AT PLAN TIME, unless the declaration says where it came from:
|
|
9
|
+
* `remountFrom: '<old path>'` moves the mount with `sys/remount` (remount-wire.ts), which keeps
|
|
10
|
+
* every secret. A genuinely new, empty mount is a new resource id, never an edited path.
|
|
11
|
+
* ★ THE MOVE IS DECIDED BY LIVE STATE, SO A RE-RUN CONVERGES. Source present and target absent is
|
|
12
|
+
* a move; target present and source absent is a move that already happened; both present, or
|
|
13
|
+
* neither, is a refusal — "neither" in particular is exactly the empty-mount failure above.
|
|
14
|
+
*/
|
|
15
|
+
import * as Effect from 'effect/Effect';
|
|
16
|
+
import type * as HttpClient from 'effect/unstable/http/HttpClient';
|
|
17
|
+
import type { BaoError } from './bao-status.ts';
|
|
18
|
+
import { type RemountError, type RemountOptions } from './remount-wire.ts';
|
|
19
|
+
export type Move = {
|
|
20
|
+
readonly kind: 'stay';
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: 'move';
|
|
23
|
+
readonly from: string;
|
|
24
|
+
} | {
|
|
25
|
+
readonly kind: 'refuse';
|
|
26
|
+
readonly message: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* @param family `Bao.Mount` or `Bao.AuthMethod`, for the message.
|
|
30
|
+
* @param stated the path Alchemy's state holds, or undefined on a first reconcile.
|
|
31
|
+
* @param path the declared path.
|
|
32
|
+
* @param remountFrom the declared source, if any.
|
|
33
|
+
*/
|
|
34
|
+
export declare const planMove: (family: string, stated: string | undefined, path: string, remountFrom: string | undefined) => Move;
|
|
35
|
+
export interface MoveTarget {
|
|
36
|
+
readonly family: string;
|
|
37
|
+
/** Declared path, bare. */
|
|
38
|
+
readonly path: string;
|
|
39
|
+
readonly type: string;
|
|
40
|
+
/** Read one path's live entry — undefined when absent. */
|
|
41
|
+
readonly read: (path: string) => Effect.Effect<{
|
|
42
|
+
readonly type: string;
|
|
43
|
+
} | undefined, BaoError, HttpClient.HttpClient>;
|
|
44
|
+
/** The path as sys/remount takes it: the bare path for secrets, `auth/<path>` for auth. */
|
|
45
|
+
readonly wire: (path: string) => string;
|
|
46
|
+
}
|
|
47
|
+
/** Perform a planned move, deciding by live state. Returns once the target is in place. */
|
|
48
|
+
export declare const performMove: (target: MoveTarget, from: string, options?: RemountOptions) => Effect.Effect<void, BaoError | RemountError, HttpClient.HttpClient>;
|
|
49
|
+
//# sourceMappingURL=mount-move.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount-move.d.ts","sourceRoot":"","sources":["../../src/openbao/mount-move.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAkB,MAAM,mBAAmB,CAAC;AAE3F,MAAM,MAAM,IAAI,GACZ;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,WACX,MAAM,UACN,MAAM,GAAG,SAAS,QACpB,MAAM,eACC,MAAM,GAAG,SAAS,KAC9B,IAyBF,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,CACb,IAAI,EAAE,MAAM,KACT,MAAM,CAAC,MAAM,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAC3F,2FAA2F;IAC3F,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC;AAID,2FAA2F;AAC3F,eAAO,MAAM,WAAW,WACd,UAAU,QACZ,MAAM,YACF,cAAc,KACvB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,GAAG,YAAY,EAAE,UAAU,CAAC,UAAU,CA6BjE,CAAC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Trimming runs of one character from caller-supplied paths and names.
|
|
3
3
|
*
|
|
4
|
-
* ★ LOOPS, NOT `/^\/+|\/+$/g
|
|
5
|
-
* of
|
|
6
|
-
*
|
|
4
|
+
* ★ LOOPS, NOT `/^\/+|\/+$/g`, `/\/+$/` OR `/^-+|-+$/g`. A trailing `x+$` backtracks polynomially
|
|
5
|
+
* on a long run of `x` followed by anything else (CodeQL js/polynomial-redos), and mount paths,
|
|
6
|
+
* namespaces and slugs are caller input. Every loop here is linear in the input length.
|
|
7
7
|
*/
|
|
8
|
+
/** `text` without a trailing run of `char` (one UTF-16 unit). */
|
|
9
|
+
export declare const trimTrailing: (text: string, char: string) => string;
|
|
10
|
+
/** `text` without a leading or trailing run of `char` (one UTF-16 unit). */
|
|
11
|
+
export declare const trimRuns: (text: string, char: string) => string;
|
|
8
12
|
/** `text` without trailing `/`. */
|
|
9
13
|
export declare const trimTrailingSlashes: (text: string) => string;
|
|
10
14
|
/** `text` without leading or trailing `/`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount-path.d.ts","sourceRoot":"","sources":["../../src/openbao/mount-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,mCAAmC;AACnC,eAAO,MAAM,mBAAmB,SAAU,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"mount-path.d.ts","sourceRoot":"","sources":["../../src/openbao/mount-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,iEAAiE;AACjE,eAAO,MAAM,YAAY,SAAU,MAAM,QAAQ,MAAM,KAAG,MAIzD,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,QAAQ,SAAU,MAAM,QAAQ,MAAM,KAAG,MAIrD,CAAC;AAEF,mCAAmC;AACnC,eAAO,MAAM,mBAAmB,SAAU,MAAM,KAAG,MAAiC,CAAC;AAErF,8CAA8C;AAC9C,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,MAA6B,CAAC;AAEzE,kFAAkF;AAClF,eAAO,MAAM,UAAU,UAAW,MAAM,GAAG,SAAS,KAAG,MAClB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bao.Mount's read and reconcile as plain effects — split from mount.ts so the move (and its
|
|
3
|
+
* refusals) run against a fake server, not only in a reviewer's head.
|
|
4
|
+
*/
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import type * as HttpClient from 'effect/unstable/http/HttpClient';
|
|
7
|
+
import type { BaoError } from './bao-status.ts';
|
|
8
|
+
import { type BaoMountAttributes, type BaoMountProps } from './mount-form.ts';
|
|
9
|
+
import type { RemountError, RemountOptions } from './remount-wire.ts';
|
|
10
|
+
export declare const readMount: (props: BaoMountProps) => Effect.Effect<BaoMountAttributes | undefined, BaoError, HttpClient.HttpClient>;
|
|
11
|
+
/**
|
|
12
|
+
* Converge one mount. `stated` is the path in Alchemy's state (undefined on a first reconcile).
|
|
13
|
+
* Dies on a refusal; fails with OpenBao's own error on a refused call.
|
|
14
|
+
*/
|
|
15
|
+
export declare const reconcileMount: (news: BaoMountProps, stated: string | undefined, options?: RemountOptions) => Effect.Effect<BaoMountAttributes, BaoError | RemountError, HttpClient.HttpClient>;
|
|
16
|
+
//# sourceMappingURL=mount-reconcile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount-reconcile.d.ts","sourceRoot":"","sources":["../../src/openbao/mount-reconcile.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAKnB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEtE,eAAO,MAAM,SAAS,UACb,aAAa,KACnB,MAAM,CAAC,MAAM,CAAC,kBAAkB,GAAG,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,UAAU,CAK5E,CAAC;AAUL;;;GAGG;AACH,eAAO,MAAM,cAAc,SACnB,aAAa,UACX,MAAM,GAAG,SAAS,YAChB,cAAc,KACvB,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,QAAQ,GAAG,YAAY,EAAE,UAAU,CAAC,UAAU,CA8B/E,CAAC"}
|
package/dist/openbao/mount.d.ts
CHANGED
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
*
|
|
8
8
|
* ★ `defaultRemovalPolicy: 'retain'` — disabling a mount destroys every secret under it.
|
|
9
9
|
* Opt in with `.pipe(RemovalPolicy.destroy())`; see resource.ts in house/proxmox.
|
|
10
|
+
*
|
|
11
|
+
* ★ REPLACE SEMANTICS (audited 2026-09-21, see src/openbao/REPLACE.md):
|
|
12
|
+
* · `type` changed → plans `replace`, and the APPLY FAILS, destroying nothing: the new
|
|
13
|
+
* generation's path is the old one's, still occupied, so its reconcile dies "type is
|
|
14
|
+
* immutable" before any write (mount-reconcile.ts). Change a type by hand. ⛔ Not `deleteFirst`
|
|
15
|
+
* on purpose — under `destroy` that would disable the mount, every secret with it, on a typo.
|
|
16
|
+
* · `path` changed → FAILS the plan unless `remountFrom` names the old path, which is an
|
|
17
|
+
* in-place `update` that moves the mount and its data (mount-move.ts). It used to be an
|
|
18
|
+
* `update` that enabled an EMPTY mount at the new path.
|
|
10
19
|
*/
|
|
11
20
|
import { Resource } from 'alchemy';
|
|
12
21
|
import * as Provider from 'alchemy/Provider';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/openbao/mount.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/openbao/mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,aAAa,EAAW,MAAM,iBAAiB,CAAC;AAKvF,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAC;AAElD,MAAM,WAAW,QAAS,SAAQ,QAAQ,CACxC,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,KAAK,EACL,UAAU,CAAC,UAAU,CACtB;CAAG;AAEJ,eAAO,MAAM,QAAQ,2CAEnB,CAAC;AAEH,eAAO,MAAM,gBAAgB,+FAuE1B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { BaoPkiRoleProps } from './pki-role-form.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The managed field set, normalised so both sides of a diff are byte-comparable.
|
|
4
|
+
*
|
|
5
|
+
* ⚠️ KEY ORDER IS THE DIGEST. The props side and the live side are both built by the single
|
|
6
|
+
* canonical() literal below, so `JSON.stringify` emits the same key order for each. Two
|
|
7
|
+
* hand-written object literals would drift apart and produce a forever-diff nobody could
|
|
8
|
+
* read from the plan output.
|
|
9
|
+
*/
|
|
10
|
+
export interface BaoPkiRoleCanonical {
|
|
11
|
+
allowBareDomains: boolean;
|
|
12
|
+
allowGlobDomains: boolean;
|
|
13
|
+
allowIpSans: boolean;
|
|
14
|
+
allowLocalhost: boolean;
|
|
15
|
+
allowSubdomains: boolean;
|
|
16
|
+
allowWildcardCertificates: boolean;
|
|
17
|
+
allowedDomains: readonly string[];
|
|
18
|
+
allowedDomainsTemplate: boolean;
|
|
19
|
+
clientFlag: boolean;
|
|
20
|
+
cnValidations: readonly string[];
|
|
21
|
+
enforceHostnames: boolean;
|
|
22
|
+
extKeyUsage: readonly string[];
|
|
23
|
+
generateLease: boolean;
|
|
24
|
+
keyBits: number;
|
|
25
|
+
keyType: string;
|
|
26
|
+
keyUsage: readonly string[];
|
|
27
|
+
/** ⚠️ `-1` means the duration prop did not parse — reconcile refuses rather than writing it. */
|
|
28
|
+
maxTtlSeconds: number;
|
|
29
|
+
noStore: boolean;
|
|
30
|
+
requireCn: boolean;
|
|
31
|
+
serverFlag: boolean;
|
|
32
|
+
signatureBits: number;
|
|
33
|
+
ttlSeconds: number;
|
|
34
|
+
}
|
|
35
|
+
/** ★ OpenBao's own `key_usage` default (path_roles.go:697-698) — what an omitted field becomes. */
|
|
36
|
+
export declare const DEFAULT_KEY_USAGE: readonly string[];
|
|
37
|
+
export declare const canonicalFromProps: (props: BaoPkiRoleProps) => BaoPkiRoleCanonical;
|
|
38
|
+
/**
|
|
39
|
+
* ⚠️ AN ABSENT NEW FIELD READS AS ITS ZERO VALUE, NOT ITS SCHEMA DEFAULT. A role read always carries
|
|
40
|
+
* the six new fields (ToResponseData, path_roles.go:1720-1780; `generate_lease` only when set,
|
|
41
|
+
* and getRole upgrades a missing one to false at :1034), so the fallback only answers a body
|
|
42
|
+
* that is not OpenBao's — and then "false"/"none" reads as drift rather than a false noop.
|
|
43
|
+
*/
|
|
44
|
+
export declare const canonicalFromLive: (live: Record<string, unknown>) => BaoPkiRoleCanonical;
|
|
45
|
+
export declare const digestOf: (form: BaoPkiRoleCanonical) => string;
|
|
46
|
+
//# sourceMappingURL=pki-role-canonical.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pki-role-canonical.d.ts","sourceRoot":"","sources":["../../src/openbao/pki-role-canonical.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,yBAAyB,EAAE,OAAO,CAAC;IACnC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,sBAAsB,EAAE,OAAO,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,gGAAgG;IAChG,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,mGAAmG;AACnG,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAI9C,CAAC;AAqCF,eAAO,MAAM,kBAAkB,UAAW,eAAe,KAAG,mBAwBxD,CAAC;AAYL;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,SAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,mBAwB9D,CAAC;AAEL,eAAO,MAAM,QAAQ,SAAU,mBAAmB,KAAG,MAAsC,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type BaoPkiRoleCanonical } from './pki-role-canonical.ts';
|
|
2
|
+
export type { BaoPkiRoleCanonical };
|
|
1
3
|
/** ★ MEASURED: the OpenAPI enum for `key_type` is exactly these four, lowercase. */
|
|
2
4
|
export type BaoPkiKeyType = 'any' | 'ec' | 'ed25519' | 'rsa';
|
|
3
5
|
/** ★ MEASURED: live roles carry `["hostname"]` or the default `["email","hostname"]`. */
|
|
@@ -51,33 +53,29 @@ export interface BaoPkiRoleProps {
|
|
|
51
53
|
cnValidations?: readonly BaoPkiCnValidation[];
|
|
52
54
|
/** Signature hash bits; `0` auto-detects from key length. One live role pins 256. */
|
|
53
55
|
signatureBits?: number;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
maxTtlSeconds: number;
|
|
78
|
-
serverFlag: boolean;
|
|
79
|
-
signatureBits: number;
|
|
80
|
-
ttlSeconds: number;
|
|
56
|
+
/**
|
|
57
|
+
* ★ THE SIX BELOW (added 2026-09-21) default to OpenBao's OWN values, not closed ones — a role this
|
|
58
|
+
* resource wrote before they were props carries exactly those, so it still plans `noop`. The
|
|
59
|
+
* write already sent them implicitly; see the header of pki-role-canonical.ts.
|
|
60
|
+
*/
|
|
61
|
+
/** A request must carry a common_name. Default true. */
|
|
62
|
+
requireCn?: boolean;
|
|
63
|
+
/** Only valid host names in the CN and DNS SANs. Default true. */
|
|
64
|
+
enforceHostnames?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Key usages minus the `KeyUsage` prefix. Default `DigitalSignature, KeyAgreement,
|
|
67
|
+
* KeyEncipherment`. ⚠️ `[]` is a real value — it removes every key usage — and is sent as such.
|
|
68
|
+
*/
|
|
69
|
+
keyUsage?: readonly string[];
|
|
70
|
+
/** Allowed domains may use identity templates (`{{identity.entity.name}}`). Default false. */
|
|
71
|
+
allowedDomainsTemplate?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Do not store issued certificates. Default false. ⛔ They can then be neither listed nor
|
|
74
|
+
* revoked. ⚠️ Implies `generateLease: false`; declaring both true is refused (see problems).
|
|
75
|
+
*/
|
|
76
|
+
noStore?: boolean;
|
|
77
|
+
/** Attach an OpenBao lease to every issued certificate. Default false — leases slow startup. */
|
|
78
|
+
generateLease?: boolean;
|
|
81
79
|
}
|
|
82
80
|
export interface BaoPkiRoleAttributes extends BaoPkiRoleCanonical {
|
|
83
81
|
name: string;
|
|
@@ -88,9 +86,6 @@ export interface BaoPkiRoleAttributes extends BaoPkiRoleCanonical {
|
|
|
88
86
|
/** SHA-256 of the canonical form — safe to persist; see policy.ts. */
|
|
89
87
|
digest: string;
|
|
90
88
|
}
|
|
91
|
-
export declare const canonicalFromProps: (props: BaoPkiRoleProps) => BaoPkiRoleCanonical;
|
|
92
|
-
export declare const canonicalFromLive: (live: Record<string, unknown>) => BaoPkiRoleCanonical;
|
|
93
|
-
export declare const digestOf: (form: BaoPkiRoleCanonical) => string;
|
|
94
89
|
export declare const rolePath: (props: {
|
|
95
90
|
name: string;
|
|
96
91
|
mount?: string;
|
|
@@ -109,10 +104,23 @@ export declare const attributesOf: (props: BaoPkiRoleProps, live: Record<string,
|
|
|
109
104
|
* ★ `ext_key_usage` is OMITTED when empty rather than sent as `ext_key_usage=`. The write
|
|
110
105
|
* replaces the whole role, so an absent field already lands on the `[]` default, and
|
|
111
106
|
* omitting sidesteps how an empty value would be encoded.
|
|
107
|
+
* ⚠️ `key_usage` CANNOT BE OMITTED THAT WAY — its default is NOT empty — so it is always sent, and
|
|
108
|
+
* an empty declaration goes over as `""`. That encoding is now READ, not guessed: for a
|
|
109
|
+
* comma-string-slice field, go-secure-stdlib parseutil.ParseCommaStringSlice (:389-392)
|
|
110
|
+
* answers `""` with an empty list.
|
|
112
111
|
*
|
|
113
112
|
* ★ THE BODY FOR `PUT <mount>/roles/<name>`, ALL STRINGS — the same `k=v` pairs `bao write` sent.
|
|
114
113
|
*/
|
|
115
114
|
export declare const writeBody: (props: BaoPkiRoleProps) => Record<string, string>;
|
|
116
115
|
/** True when live already matches the declaration on every managed field. */
|
|
117
116
|
export declare const matches: (attributes: BaoPkiRoleAttributes, props: BaoPkiRoleProps) => boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Declarations reconcile must refuse rather than write. diff routes any of these to `update` so the
|
|
119
|
+
* refusal is seen on the next deploy, never hidden behind a `noop`.
|
|
120
|
+
*
|
|
121
|
+
* ⚠️ `noStore` WITH `generateLease` IS NOT AN ERROR ON THE SERVER — pathRoleCreate stores
|
|
122
|
+
* generate_lease false and adds a warning (path_roles.go:1250-1256) — so the role would read back
|
|
123
|
+
* different from its declaration and plan `update` forever. Refused here instead.
|
|
124
|
+
*/
|
|
125
|
+
export declare const problems: (props: BaoPkiRoleProps) => readonly string[];
|
|
118
126
|
//# sourceMappingURL=pki-role-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pki-role-form.d.ts","sourceRoot":"","sources":["../../src/openbao/pki-role-form.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pki-role-form.d.ts","sourceRoot":"","sources":["../../src/openbao/pki-role-form.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,mBAAmB,EAKzB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC,oFAAoF;AACpF,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC;AAE7D,yFAAyF;AACzF,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,oDAAoD;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;OAMG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oGAAoG;IACpG,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,gGAAgG;IAChG,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iEAAiE;IACjE,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,8FAA8F;IAC9F,aAAa,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC9C,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,8FAA8F;IAC9F,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gGAAgG;IAChG,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,0FAA0F;IAC1F,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB;AAWD,eAAO,MAAM,QAAQ,UAAW;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,WACN,CAAC;AAE3D,eAAO,MAAM,YAAY,UAChB,eAAe,QAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,oBAUF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,SAAS,UAAW,eAAe,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CA4BvE,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,OAAO,eAAgB,oBAAoB,SAAS,eAAe,YACrB,CAAC;AAE5D;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,UAAW,eAAe,KAAG,SAAS,MAAM,EAuBhE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pki-role.d.ts","sourceRoot":"","sources":["../../src/openbao/pki-role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAGnE,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"pki-role.d.ts","sourceRoot":"","sources":["../../src/openbao/pki-role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAGnE,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EAMrB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,CAAC;AAEtD,MAAM,WAAW,UAAW,SAAQ,QAAQ,CAC1C,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,KAAK,EACL,UAAU,CAAC,UAAU,CACtB;CAAG;AAEJ,eAAO,MAAM,UAAU,6CAErB,CAAC;AASH,eAAO,MAAM,kBAAkB,iGA4G5B,CAAC"}
|
package/dist/openbao/policy.d.ts
CHANGED
|
@@ -77,6 +77,8 @@ export interface BaoPolicy extends Resource<'Bao.Policy', BaoPolicyProps, BaoPol
|
|
|
77
77
|
* orphaned resource; a caller that means it opts in with `.pipe(RemovalPolicy.destroy())`. This
|
|
78
78
|
* is Terraform's `prevent_destroy`, not a stubbed operation — a delete that silently did nothing
|
|
79
79
|
* would lie to whoever read the plan.
|
|
80
|
+
* ⚠️ `retain` ALSO KEEPS THE OLD GENERATION OF A RENAME. A new `name` plans `replace`, and under
|
|
81
|
+
* `retain` the old policy is left live and unmanaged (rename.ts, REPLACE.md).
|
|
80
82
|
*/
|
|
81
83
|
export declare const BaoPolicy: import("alchemy").ResourceClass<BaoPolicy>;
|
|
82
84
|
export declare const BaoPolicyProvider: () => import("effect/Layer").Layer<Provider.Provider<BaoPolicy>, never, FileSystem.FileSystem | HttpClient.HttpClient | Path.Path>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/openbao/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/openbao/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAMnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAU,SAAQ,QAAQ,CACzC,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAC1D;CAAG;AAEJ;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,SAAS,4CAEpB,CAAC;AAYH,eAAO,MAAM,iBAAiB,oIA2H3B,CAAC"}
|
|
@@ -63,18 +63,18 @@ export interface BaoProxmoxRoleAttributes {
|
|
|
63
63
|
}
|
|
64
64
|
/** `proxmox-tb4/roles/read` — read, write and delete all address the role here. */
|
|
65
65
|
export declare const rolePath: (mount: string, name: string) => string;
|
|
66
|
-
export declare const attributesOf: (props: BaoProxmoxRoleProps, live: Record<string, unknown>) => BaoProxmoxRoleAttributes;
|
|
66
|
+
export declare const attributesOf: (props: Pick<BaoProxmoxRoleProps, 'mount' | 'name'>, live: Record<string, unknown>) => BaoProxmoxRoleAttributes;
|
|
67
67
|
/**
|
|
68
68
|
* The body for `PUT <mount>/roles/<name>` — all strings, the `k=v` pairs `bao write` sent — or
|
|
69
69
|
* the prop names whose duration would not parse.
|
|
70
70
|
*
|
|
71
|
-
* ⛔
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
71
|
+
* ⛔ EVERY WRITE CARRIES ALL THREE FIELDS, and both TTLs are required props, so `matches` covers
|
|
72
|
+
* the whole role and no field is left unmanaged behind a green plan.
|
|
73
|
+
* ⚠️ CORRECTED 2026-09-21 FROM THE PLUGIN SOURCE. This said a write REPLACES the role and resets an
|
|
74
|
+
* omitted TTL to zero. The port in homeflare-openbao-plugins (secrets/proxmox/path_roles.go,
|
|
75
|
+
* pathRolesWrite, commit 0e79154) MERGES: it loads the stored role and sets only the fields
|
|
76
|
+
* present (`d.GetOk`). An omitted TTL would keep its old value, which is still a value this
|
|
77
|
+
* resource would not be managing. The build running live was not re-checked against that source.
|
|
78
78
|
*
|
|
79
79
|
* ⚠️ Seconds go on the wire as integers, not as `1h`. The schema declares both TTLs
|
|
80
80
|
* `"format": "seconds"`, and an integer is accepted unambiguously by every path that reads
|
|
@@ -87,6 +87,16 @@ export declare const writeBody: (props: BaoProxmoxRoleProps) => {
|
|
|
87
87
|
ok: false;
|
|
88
88
|
bad: string[];
|
|
89
89
|
};
|
|
90
|
+
/**
|
|
91
|
+
* Why moving the role's mint user from `before` to the declared one must be refused, or undefined.
|
|
92
|
+
* The ⛔ on reconcile in proxmox-role.ts says why a re-scope needs `allowMintUserChange`.
|
|
93
|
+
*
|
|
94
|
+
* ★ ONE DEFINITION FOR BOTH PLACES THAT ASK. Reconcile asks it of the live role at the same path.
|
|
95
|
+
* The diff asks it across a rename, where `before` is the role being replaced: a rename writes a
|
|
96
|
+
* brand-new role, so reconcile alone would see nothing to re-scope, and a rename would become the
|
|
97
|
+
* way around the guard.
|
|
98
|
+
*/
|
|
99
|
+
export declare const rescopeRefusal: (before: string, mintUser: string, allowMintUserChange: string | undefined) => string | undefined;
|
|
90
100
|
/** True when the live role already matches the declaration on every field the plugin stores. */
|
|
91
101
|
export declare const matches: (attributes: BaoProxmoxRoleAttributes, props: BaoProxmoxRoleProps) => boolean;
|
|
92
102
|
//# sourceMappingURL=proxmox-role-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxmox-role-form.d.ts","sourceRoot":"","sources":["../../src/openbao/proxmox-role-form.ts"],"names":[],"mappings":"AAyBA,MAAM,WAAW,mBAAmB;IAClC,8FAA8F;IAC9F,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,yFAAyF;IACzF,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;OASG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB;AAmBD,mFAAmF;AACnF,eAAO,MAAM,QAAQ,UAAW,MAAM,QAAQ,MAAM,WAAwC,CAAC;AAE7F,eAAO,MAAM,YAAY,UAChB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"proxmox-role-form.d.ts","sourceRoot":"","sources":["../../src/openbao/proxmox-role-form.ts"],"names":[],"mappings":"AAyBA,MAAM,WAAW,mBAAmB;IAClC,8FAA8F;IAC9F,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,yFAAyF;IACzF,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;OASG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB;AAmBD,mFAAmF;AACnF,eAAO,MAAM,QAAQ,UAAW,MAAM,QAAQ,MAAM,WAAwC,CAAC;AAE7F,eAAO,MAAM,YAAY,UAChB,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,MAAM,CAAC,QAC5C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,wBAYF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,SAAS,UACb,mBAAmB,KACzB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,EAAE,CAAA;CAWzE,CAAC;AAaF;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,WACjB,MAAM,YACJ,MAAM,uBACK,MAAM,GAAG,SAAS,KACtC,MAAM,GAAG,SAIyF,CAAC;AAEtG,gGAAgG;AAChG,eAAO,MAAM,OAAO,eAAgB,wBAAwB,SAAS,mBAAmB,YAG9C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The read Bao.ProxmoxRole makes of `<mount>/roles/<name>`, split from proxmox-role.ts so the diff,
|
|
3
|
+
* reconcile and the rename's re-scope check share one definition of "the live role".
|
|
4
|
+
*/
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import { type BaoProxmoxRoleProps } from './proxmox-role-form.ts';
|
|
7
|
+
/**
|
|
8
|
+
* The live role, or undefined when OpenBao answers 404.
|
|
9
|
+
*
|
|
10
|
+
* ⚠️ A missing MOUNT and a missing ROLE both read as undefined here, because both answer 404:
|
|
11
|
+
* an absent role is a read that found nothing, and a path under no mount is OpenBao's
|
|
12
|
+
* unsupported-path error, which is also a 404 (sdk/logical/response_util.go). They are not the
|
|
13
|
+
* same failure — one is a typo in `mount`, the other is a role that has yet to be created — so
|
|
14
|
+
* reconcile lets OpenBao's own `errors` through on the write rather than inventing a message.
|
|
15
|
+
* A bad mount says "no handler for route".
|
|
16
|
+
*/
|
|
17
|
+
export declare const readRole: (props: Pick<BaoProxmoxRoleProps, 'mount' | 'name'>) => Effect.Effect<import("./proxmox-role-form.ts").BaoProxmoxRoleAttributes | undefined, import("./bao-status.ts").BaoError, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
18
|
+
//# sourceMappingURL=proxmox-role-wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxmox-role-wire.d.ts","sourceRoot":"","sources":["../../src/openbao/proxmox-role-wire.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,mBAAmB,EAA0B,MAAM,wBAAwB,CAAC;AAE1F;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,UAAW,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,MAAM,CAAC,mLAKvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxmox-role.d.ts","sourceRoot":"","sources":["../../src/openbao/proxmox-role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EAKzB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"proxmox-role.d.ts","sourceRoot":"","sources":["../../src/openbao/proxmox-role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EAKzB,MAAM,wBAAwB,CAAC;AAYhC,YAAY,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,CAAC;AAE9D,MAAM,WAAW,cAAe,SAAQ,QAAQ,CAC9C,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,EACL,UAAU,CAAC,UAAU,CACtB;CAAG;AAEJ,eAAO,MAAM,cAAc,iDAEzB,CAAC;AAEH,eAAO,MAAM,sBAAsB,qGAkKhC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sys/remount` — move a secrets engine or auth method to a new path WITH its data — and the status
|
|
3
|
+
* polling it needs, because the move finishes after the call returns.
|
|
4
|
+
*
|
|
5
|
+
* ★ READ FROM openbao v2.6.2, NOT RECALLED:
|
|
6
|
+
* · api/sys_mounts.go:95-191 — the CLI's `bao secrets move` POSTs `{from, to}` to sys/remount,
|
|
7
|
+
* takes `data.migration_id`, then GETs sys/remount/status/<id> once a second until
|
|
8
|
+
* `migration_info.status` is `success` or `failure`. This is that loop, bounded.
|
|
9
|
+
* · vault/logical_system.go:1257-1357 — the handler validates, records the migration and
|
|
10
|
+
* answers AT ONCE; a goroutine does the move. So a 200 means "queued", never "moved".
|
|
11
|
+
* · vault/mount.go:630-735 — the mount keeps its UUID, and storage lives under the UUID, so every
|
|
12
|
+
* secret stays. ⛔ BUT EVERY LEASE UNDER THE SOURCE IS REVOKED (`RevokePrefix`, :684): a move of
|
|
13
|
+
* a dynamic-secrets mount kills every credential it has issued. KV has no leases.
|
|
14
|
+
* · vault/logical_system.go:67-69 — `remount` is a sudo path. The status path is not.
|
|
15
|
+
* ⚠️ THE STATUS TRACKER IS IN MEMORY (vault/mount.go:2303-2336, a sync.Map on the active node). A
|
|
16
|
+
* restart or leader change mid-move loses it, and the status read then answers 404. That is not a
|
|
17
|
+
* failure and not a success; `confirm` settles it from the mount tables, or the call fails.
|
|
18
|
+
* ⛔ POLICIES ARE NOT REWRITTEN. Every ACL path naming the old mount keeps naming it.
|
|
19
|
+
*/
|
|
20
|
+
import * as Effect from 'effect/Effect';
|
|
21
|
+
import type * as HttpClient from 'effect/unstable/http/HttpClient';
|
|
22
|
+
import type { BaoError } from './bao-status.ts';
|
|
23
|
+
/** A move OpenBao reported failed, or one this could not confirm. Never carries a token. */
|
|
24
|
+
export declare class RemountError extends Error {
|
|
25
|
+
constructor(message: string);
|
|
26
|
+
}
|
|
27
|
+
export interface RemountOptions {
|
|
28
|
+
/** Milliseconds between status reads. Default 1000 — the CLI's own pace. */
|
|
29
|
+
readonly intervalMillis?: number;
|
|
30
|
+
/** Status reads before giving up. Default 120, so about two minutes. */
|
|
31
|
+
readonly attempts?: number;
|
|
32
|
+
}
|
|
33
|
+
/** POST sys/remount and return the migration id. `from`/`to` are full paths (`auth/x` for auth). */
|
|
34
|
+
export declare const startRemount: (from: string, to: string) => Effect.Effect<string, BaoError | RemountError, HttpClient.HttpClient>;
|
|
35
|
+
/** `in-progress`, `success`, `failure` — or undefined when the server no longer knows the id. */
|
|
36
|
+
export declare const remountStatus: (id: string) => Effect.Effect<string | undefined, BaoError, HttpClient.HttpClient>;
|
|
37
|
+
/**
|
|
38
|
+
* Move `from` to `to` and wait until OpenBao says it is done.
|
|
39
|
+
*
|
|
40
|
+
* @param confirm answers "does the mount table show the move finished?" — asked only when the
|
|
41
|
+
* status tracker has forgotten the id. True is success; false fails.
|
|
42
|
+
*/
|
|
43
|
+
export declare const remountAndWait: (from: string, to: string, confirm: Effect.Effect<boolean, BaoError, HttpClient.HttpClient>, options?: RemountOptions) => Effect.Effect<void, BaoError | RemountError, HttpClient.HttpClient>;
|
|
44
|
+
//# sourceMappingURL=remount-wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remount-wire.d.ts","sourceRoot":"","sources":["../../src/openbao/remount-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,4FAA4F;AAC5F,qBAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAOD,oGAAoG;AACpG,eAAO,MAAM,YAAY,SACjB,MAAM,MACR,MAAM,KACT,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,YAAY,EAAE,UAAU,CAAC,UAAU,CAMnE,CAAC;AAEL,iGAAiG;AACjG,eAAO,MAAM,aAAa,OACpB,MAAM,KACT,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,UAAU,CAKhE,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,cAAc,SACnB,MAAM,MACR,MAAM,WACD,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,YACvD,cAAc,KACtB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,GAAG,YAAY,EAAE,UAAU,CAAC,UAAU,CAkCjE,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rename safety for the families whose identity is a name, or a mount and a name: Bao.Policy,
|
|
3
|
+
* Bao.CloudflareRole and Bao.ProxmoxRole. REPLACE.md has the audit and what each answer does.
|
|
4
|
+
*
|
|
5
|
+
* ⛔ THE BUG THIS CLOSES, REPRODUCED 2026-09-21 AGAINST alchemy@2.0.0-beta.79's OWN PLAN AND APPLY
|
|
6
|
+
* (fake-stack.ts): a Bao.Policy deployed as `old`, then redeclared as `new` under
|
|
7
|
+
* `RemovalPolicy.destroy()`, planned `update` and left BOTH policies live. diff read the NEW
|
|
8
|
+
* path, found nothing, answered `update`, and reconcile wrote the new object. The old one stayed
|
|
9
|
+
* live under no state record, so no later plan would mention it, and not even `destroy` could
|
|
10
|
+
* remove it.
|
|
11
|
+
* ★ A CHANGED IDENTITY IS A DIFFERENT OBJECT, SO THE ANSWER IS `replace`. Create-first
|
|
12
|
+
* (`deleteFirst` false): the new path never collides with the old, the new generation is written,
|
|
13
|
+
* dependents are updated in the same graph, and only then is the old generation deleted. The
|
|
14
|
+
* engine hands that delete the OLD generation's attributes (Apply.ts deleteOldGenerations and the
|
|
15
|
+
* GC pass both pass `output: old.attr`), and every delete here reads `output`, never `news`.
|
|
16
|
+
* ⛔ A new path that collides with ANOTHER live object is refused at plan instead (`judgeMove`).
|
|
17
|
+
* ⚠️ UNDER `retain` THE OLD OBJECT STAYS LIVE. Apply.ts:2164-2173 skips the old generation's delete
|
|
18
|
+
* and logs "Retaining replaced resource (removal policy: retain)". The plan still says `replace`
|
|
19
|
+
* and the apply says what it kept, so it is no longer silent, but the old object is unmanaged
|
|
20
|
+
* from then on. Remove it by hand, or opt into `RemovalPolicy.destroy()`.
|
|
21
|
+
*/
|
|
22
|
+
import * as Effect from 'effect/Effect';
|
|
23
|
+
/**
|
|
24
|
+
* A string prop of a diff's `news`, once that one prop is resolved; `undefined` while it is still an
|
|
25
|
+
* Output of a changing upstream (a function-typed proxy) or an Effect.
|
|
26
|
+
*
|
|
27
|
+
* ★ THE IDENTITY IS JUDGED BEFORE `isResolved(news)`. That guard returns `undefined` when ANY prop is
|
|
28
|
+
* pending, and the engine then falls back to `update` (Plan.ts, `havePropsChanged`). A rename that
|
|
29
|
+
* lands in the same deploy as a pending `fragments` or `policies` Output would slip through as
|
|
30
|
+
* `update`, which is the orphan again. launchd/host-effect.ts reads its identity the same way.
|
|
31
|
+
*/
|
|
32
|
+
export declare const declaredString: (news: unknown, key: string) => string | undefined;
|
|
33
|
+
/** True while an optional prop is declared but is not yet a value: an Output of a changing upstream. */
|
|
34
|
+
export declare const isPendingProp: (news: unknown, key: string) => boolean;
|
|
35
|
+
/** A role's API path from a diff's `news`, once both `mount` and `name` are resolved. */
|
|
36
|
+
export declare const declaredRolePath: (news: unknown, rolePath: (mount: string, name: string) => string) => string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* How OpenBao keys an ACL policy: trimmed and lowercased. openbao v2.6.2
|
|
39
|
+
* vault/policy/policy_store.go:698-700 (`sanitizeName`), applied by SetPolicy (:268), GetPolicy
|
|
40
|
+
* (:378) and DeletePolicy (:562).
|
|
41
|
+
*
|
|
42
|
+
* ⛔ SO `Admin` → `admin` IS THE SAME POLICY, NOT A RENAME. A `replace` there would write it, and then,
|
|
43
|
+
* under `destroy`, delete the old generation, which is that same policy. Every grant it carries
|
|
44
|
+
* would be revoked by a change of case.
|
|
45
|
+
*/
|
|
46
|
+
export declare const policyKey: (name: string) => string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the declared identity names a different object than the one in state: `true` → moved (the
|
|
49
|
+
* diff asks `judgeMove`, which also reads the target); `false` → the same object; `undefined` → not
|
|
50
|
+
* knowable yet, because the declared side is still an Output. `key` is how the SERVER keys the object (`policyKey`); the default is exact,
|
|
51
|
+
* which is right for a mount path (vault/routing/router.go folds no case) and for both plugins'
|
|
52
|
+
* roles (each stores `roles/<name>` verbatim).
|
|
53
|
+
*
|
|
54
|
+
* ⛔ NEVER `replace` ON AN UNKNOWN IDENTITY. The Output may resolve to the same path, and a replace
|
|
55
|
+
* onto the same path deletes, under `destroy`, the object it has just written. The diff defers
|
|
56
|
+
* instead. If the engine then plans `update` and the identity turns out to have changed,
|
|
57
|
+
* `refuseMovedUpdate` stops reconcile before it writes anything.
|
|
58
|
+
*/
|
|
59
|
+
export declare const isMoved: (stored: string, declared: string | undefined, key?: (identity: string) => string) => boolean | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* The role path a resource last wrote, or last tried to: its attributes once a write finished, else
|
|
62
|
+
* the props of the create or replacement that did not (`output` is undefined for both).
|
|
63
|
+
*/
|
|
64
|
+
export declare const triedRolePath: (output: {
|
|
65
|
+
readonly mount: string;
|
|
66
|
+
readonly name: string;
|
|
67
|
+
} | undefined, olds: unknown, rolePath: (mount: string, name: string) => string) => string | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* The diff's first question, asked before `isResolved(news)`: the move from the identity this
|
|
70
|
+
* resource last wrote or tried (`tried`) to the declared one, or undefined when both name the same
|
|
71
|
+
* object or either is still unknown. `pathOf` is the API path an identity is read at.
|
|
72
|
+
*
|
|
73
|
+
* ⛔ A MOVE ONTO AN OBJECT THAT ALREADY EXISTS FAILS THE PLAN. MEASURED 2026-09-21 through the engine
|
|
74
|
+
* (rename-occupied.test.ts): two policies that swapped names under `RemovalPolicy.destroy()` each
|
|
75
|
+
* planned `replace`, each new generation wrote over the other's live policy, and each old
|
|
76
|
+
* generation's delete then removed the name the other had just written. The deploy was green and
|
|
77
|
+
* both policies were gone, every grant revoked. A shift (a → b while b → c), and a move onto the
|
|
78
|
+
* name of a resource leaving the stack, were measured ending the same way. So was reverting a
|
|
79
|
+
* move whose new generation failed: the old generation still holds the name, and its delete runs
|
|
80
|
+
* after the revert has rewritten it. That is why `tried` falls back to the props of an unfinished
|
|
81
|
+
* write.
|
|
82
|
+
* ⚠️ THE DIFF CANNOT SEE THE REMOVAL POLICY, SO THIS REFUSES UNDER `retain` TOO, where a swap, or a
|
|
83
|
+
* move back onto a retained old generation, would have been harmless. The cost is a move in two
|
|
84
|
+
* deploys through a free name, or removing the target by hand. The alternative is a green deploy
|
|
85
|
+
* that deletes what it has just written.
|
|
86
|
+
* ★ ONE PLAN-TIME READ, OF A PATH THE NEW GENERATION'S RECONCILE READS ANYWAY. A 404, a missing mount
|
|
87
|
+
* included, is free; a refused read fails the plan, as any other diff read does.
|
|
88
|
+
*/
|
|
89
|
+
export declare const judgeMove: (family: string, tried: string | undefined, declared: string | undefined, pathOf: (identity: string) => string, key?: (identity: string) => string) => Effect.Effect<{
|
|
90
|
+
from: string;
|
|
91
|
+
to: string;
|
|
92
|
+
} | undefined, import("./bao-status.ts").BaoError, import("effect/unstable/http/HttpClient").HttpClient>;
|
|
93
|
+
/**
|
|
94
|
+
* Reconcile's guard: an `update` whose prior attributes name another object.
|
|
95
|
+
*
|
|
96
|
+
* ★ REACHED ONLY WHEN THE DIFF COULD NOT SEE THE NEW IDENTITY at plan time. A fresh create, and the
|
|
97
|
+
* new generation of a `replace`, both reach reconcile with `output` undefined (Apply.ts passes
|
|
98
|
+
* `output: attr`, which is empty for a new generation). An `update` reaches it with the previous
|
|
99
|
+
* generation's attributes.
|
|
100
|
+
* ★ THE FAILED DEPLOY SETTLES ITSELF. Apply has already committed the row as `updating`, with the new
|
|
101
|
+
* props and the OLD attributes. By the next plan the upstream Output has landed, so the diff sees
|
|
102
|
+
* both names and answers `replace` (or refuses, if the new name is already taken: `judgeMove`).
|
|
103
|
+
* The old object is then deleted, or retained, by the removal policy, with no hand repair.
|
|
104
|
+
*/
|
|
105
|
+
export declare const refuseMovedUpdate: (family: string, from: string, to: string) => Effect.Effect<never, never, never>;
|
|
106
|
+
//# sourceMappingURL=rename.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rename.d.ts","sourceRoot":"","sources":["../../src/openbao/rename.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,SAAU,OAAO,OAAO,MAAM,KAAG,MAAM,GAAG,SAIpE,CAAC;AAEF,wGAAwG;AACxG,eAAO,MAAM,aAAa,SAAU,OAAO,OAAO,MAAM,KAAG,OAI1D,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,SACrB,OAAO,YACH,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,KAChD,MAAM,GAAG,SAIX,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,SAAU,MAAM,KAAG,MAAmC,CAAC;AAE7E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,WACV,MAAM,YACJ,MAAM,GAAG,SAAS,QACvB,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,KAChC,OAAO,GAAG,SAAiF,CAAC;AAE/F;;;GAGG;AACH,eAAO,MAAM,aAAa,WAChB;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,QAC/D,OAAO,YACH,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,KAChD,MAAM,GAAG,SACmF,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS,WACZ,MAAM,SACP,MAAM,GAAG,SAAS,YACf,MAAM,GAAG,SAAS,UACpB,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,QAC/B,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM;;;wGAgB/B,CAAC;AAEL;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,WAAY,MAAM,QAAQ,MAAM,MAAM,MAAM,uCAOvE,CAAC"}
|