@dreamlake/dreamlake-cli 0.88.1 → 0.90.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/dist/api/access.d.ts +83 -0
- package/dist/api/access.js +77 -0
- package/dist/api/agent.d.ts +156 -0
- package/dist/api/agent.js +111 -0
- package/dist/api/browser.d.ts +90 -0
- package/dist/api/browser.js +102 -0
- package/dist/api/client.d.ts +54 -0
- package/dist/api/client.js +102 -0
- package/dist/api/common.d.ts +28 -0
- package/dist/api/common.js +16 -0
- package/dist/api/content.d.ts +195 -0
- package/dist/api/content.js +147 -0
- package/dist/api/execution.d.ts +84 -0
- package/dist/api/execution.js +73 -0
- package/dist/api/http.d.ts +19 -0
- package/dist/api/http.js +66 -0
- package/dist/api/index.d.ts +2362 -0
- package/dist/api/index.js +116 -0
- package/dist/api/infra.d.ts +2 -0
- package/dist/api/infra.js +2 -0
- package/dist/api/jobs.d.ts +2 -0
- package/dist/api/jobs.js +2 -0
- package/dist/api/layout.d.ts +2 -0
- package/dist/api/layout.js +2 -0
- package/dist/api/library-edit.d.ts +3 -0
- package/dist/api/library-edit.js +3 -0
- package/dist/api/library-manifest.d.ts +2 -0
- package/dist/api/library-manifest.js +2 -0
- package/dist/api/note-character-plan.d.ts +2 -0
- package/dist/api/note-character-plan.js +2 -0
- package/dist/api/note-editing.d.ts +2 -0
- package/dist/api/note-editing.js +2 -0
- package/dist/api/note-edits.d.ts +21 -0
- package/dist/api/note-edits.js +10 -0
- package/dist/api/note-events.d.ts +5 -0
- package/dist/api/note-events.js +11 -0
- package/dist/api/note-files.d.ts +102 -0
- package/dist/api/note-files.js +107 -0
- package/dist/api/note-html-read.d.ts +2 -0
- package/dist/api/note-html-read.js +2 -0
- package/dist/api/note-html.d.ts +2 -0
- package/dist/api/note-html.js +2 -0
- package/dist/api/note-linger.d.ts +83 -0
- package/dist/api/note-linger.js +270 -0
- package/dist/api/note-presence.d.ts +82 -0
- package/dist/api/note-presence.js +72 -0
- package/dist/api/note-toc.d.ts +2 -0
- package/dist/api/note-toc.js +2 -0
- package/dist/api/notes.d.ts +329 -0
- package/dist/api/notes.js +209 -0
- package/dist/api/open-resources.d.ts +27 -0
- package/dist/api/open-resources.js +102 -0
- package/dist/api/ownership.d.ts +12 -0
- package/dist/api/ownership.js +24 -0
- package/dist/api/platform.d.ts +83 -0
- package/dist/api/platform.js +56 -0
- package/dist/api/presigned-transfer.d.ts +2 -0
- package/dist/api/presigned-transfer.js +2 -0
- package/dist/api/registered-runs.d.ts +48 -0
- package/dist/api/registered-runs.js +33 -0
- package/dist/api/sessions.d.ts +299 -0
- package/dist/api/sessions.js +105 -0
- package/dist/api/storage.d.ts +46 -0
- package/dist/api/storage.js +34 -0
- package/dist/api/streams.d.ts +18 -0
- package/dist/api/streams.js +70 -0
- package/dist/api/vault.d.ts +93 -0
- package/dist/api/vault.js +79 -0
- package/dist/api/workspace.d.ts +180 -0
- package/dist/api/workspace.js +146 -0
- package/dist/cli/agent-identity.d.ts +4 -0
- package/dist/cli/agent-identity.js +21 -0
- package/dist/cli/agents/identity.d.ts +50 -0
- package/dist/cli/agents/identity.js +105 -0
- package/dist/cli/agents/index.d.ts +31 -0
- package/dist/cli/agents/index.js +580 -0
- package/dist/cli/agents/manage.d.ts +43 -0
- package/dist/cli/agents/manage.js +376 -0
- package/dist/cli/agents/spec.d.ts +104 -0
- package/dist/cli/agents/spec.js +280 -0
- package/dist/cli/agents/web.d.ts +7 -0
- package/dist/cli/agents/web.js +109 -0
- package/dist/cli/artifact/incremental.d.ts +21 -0
- package/dist/cli/artifact/incremental.js +80 -0
- package/dist/cli/artifact/index.d.ts +52 -0
- package/dist/cli/artifact/index.js +405 -0
- package/dist/cli/artifact/meta.d.ts +69 -0
- package/dist/cli/artifact/meta.js +189 -0
- package/dist/cli/auth/commands.d.ts +29 -0
- package/dist/cli/auth/commands.js +327 -0
- package/dist/cli/auth/constants.d.ts +13 -0
- package/dist/cli/auth/constants.js +18 -0
- package/dist/cli/auth/credentials.d.ts +37 -0
- package/dist/cli/auth/credentials.js +155 -0
- package/dist/cli/auth/device-flow.d.ts +32 -0
- package/dist/cli/auth/device-flow.js +154 -0
- package/dist/cli/auth/device-secret.d.ts +6 -0
- package/dist/cli/auth/device-secret.js +26 -0
- package/dist/cli/auth/machine.d.ts +15 -0
- package/dist/cli/auth/machine.js +126 -0
- package/dist/cli/auth/materialized.d.ts +32 -0
- package/dist/cli/auth/materialized.js +102 -0
- package/dist/cli/auth/migrate.d.ts +10 -0
- package/dist/cli/auth/migrate.js +75 -0
- package/dist/cli/client.d.ts +102 -0
- package/dist/cli/client.js +206 -0
- package/dist/cli/collection-list.d.ts +3 -0
- package/dist/cli/collection-list.js +25 -0
- package/dist/cli/compat/ctx.d.ts +26 -0
- package/dist/cli/compat/ctx.js +76 -0
- package/dist/cli/compat/dreamdb-wasm-embedded.d.ts +2 -0
- package/dist/cli/compat/dreamdb-wasm-embedded.js +8 -0
- package/dist/cli/compat/dreamdb-wasm.d.ts +1 -0
- package/dist/cli/compat/dreamdb-wasm.js +26 -0
- package/dist/cli/compat/dreamdb.d.ts +112 -0
- package/dist/cli/compat/dreamdb.js +219 -0
- package/dist/cli/compat/flags.d.ts +2 -0
- package/dist/cli/compat/flags.js +13 -0
- package/dist/cli/compat/http.d.ts +23 -0
- package/dist/cli/compat/http.js +137 -0
- package/dist/cli/compat/presignedTransfer.d.ts +139 -0
- package/dist/cli/compat/presignedTransfer.js +580 -0
- package/dist/cli/compat/s3-backend.d.ts +73 -0
- package/dist/cli/compat/s3-backend.js +132 -0
- package/dist/cli/config.d.ts +22 -0
- package/dist/cli/config.js +96 -0
- package/dist/cli/connection/dto.d.ts +159 -0
- package/dist/cli/connection/dto.js +497 -0
- package/dist/cli/connection/index.d.ts +50 -0
- package/dist/cli/connection/index.js +413 -0
- package/dist/cli/connection/oauth.d.ts +23 -0
- package/dist/cli/connection/oauth.js +290 -0
- package/dist/cli/connection/write.d.ts +47 -0
- package/dist/cli/connection/write.js +573 -0
- package/dist/cli/create/index.d.ts +19 -0
- package/dist/cli/create/index.js +209 -0
- package/dist/cli/declare/index.d.ts +29 -0
- package/dist/cli/declare/index.js +304 -0
- package/dist/cli/delete/index.d.ts +18 -0
- package/dist/cli/delete/index.js +232 -0
- package/dist/cli/download/index.d.ts +9 -0
- package/dist/cli/download/index.js +128 -0
- package/dist/cli/env/compose.d.ts +88 -0
- package/dist/cli/env/compose.js +402 -0
- package/dist/cli/env/index.d.ts +176 -0
- package/dist/cli/env/index.js +1011 -0
- package/dist/cli/experiments/index.d.ts +11 -0
- package/dist/cli/experiments/index.js +168 -0
- package/dist/cli/glob.d.ts +1 -0
- package/dist/cli/glob.js +45 -0
- package/dist/cli/graphql-helpers.d.ts +23 -0
- package/dist/cli/graphql-helpers.js +42 -0
- package/dist/cli/graphql.d.ts +10 -0
- package/dist/cli/graphql.js +47 -0
- package/dist/cli/help-examples.generated.d.ts +1 -0
- package/dist/cli/help-examples.generated.js +192 -0
- package/dist/cli/helpers.d.ts +8 -0
- package/dist/cli/helpers.js +106 -0
- package/dist/cli/hosts/api.d.ts +29 -0
- package/dist/cli/hosts/api.js +54 -0
- package/dist/cli/hosts/bootstrap-source.d.ts +1 -0
- package/dist/cli/hosts/bootstrap-source.js +2 -0
- package/dist/cli/hosts/catalog.d.ts +26 -0
- package/dist/cli/hosts/catalog.js +55 -0
- package/dist/cli/hosts/config.d.ts +45 -0
- package/dist/cli/hosts/config.js +179 -0
- package/dist/cli/hosts/credentials.d.ts +19 -0
- package/dist/cli/hosts/credentials.js +173 -0
- package/dist/cli/hosts/enroll.d.ts +17 -0
- package/dist/cli/hosts/enroll.js +109 -0
- package/dist/cli/hosts/enrollments.d.ts +25 -0
- package/dist/cli/hosts/enrollments.js +54 -0
- package/dist/cli/hosts/index.d.ts +6 -0
- package/dist/cli/hosts/index.js +279 -0
- package/dist/cli/hosts/inventory.d.ts +40 -0
- package/dist/cli/hosts/inventory.js +91 -0
- package/dist/cli/hosts/lifecycle.d.ts +15 -0
- package/dist/cli/hosts/lifecycle.js +108 -0
- package/dist/cli/hosts/metrics-source.d.ts +12 -0
- package/dist/cli/hosts/metrics-source.js +89 -0
- package/dist/cli/hosts/observations.d.ts +39 -0
- package/dist/cli/hosts/observations.js +102 -0
- package/dist/cli/hosts/remote.d.ts +5 -0
- package/dist/cli/hosts/remote.js +66 -0
- package/dist/cli/hosts/ssh.d.ts +63 -0
- package/dist/cli/hosts/ssh.js +276 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +288 -0
- package/dist/cli/infra/api.d.ts +95 -0
- package/dist/cli/infra/api.js +291 -0
- package/dist/cli/infra/index.d.ts +5 -0
- package/dist/cli/infra/index.js +102 -0
- package/dist/cli/infra/move.d.ts +15 -0
- package/dist/cli/infra/move.js +123 -0
- package/dist/cli/infra/transfer.d.ts +15 -0
- package/dist/cli/infra/transfer.js +280 -0
- package/dist/cli/jobs/api.d.ts +69 -0
- package/dist/cli/jobs/api.js +121 -0
- package/dist/cli/jobs/index.d.ts +5 -0
- package/dist/cli/jobs/index.js +140 -0
- package/dist/cli/lakeshore/index.d.ts +98 -0
- package/dist/cli/lakeshore/index.js +502 -0
- package/dist/cli/launch/index.d.ts +43 -0
- package/dist/cli/launch/index.js +270 -0
- package/dist/cli/layout/index.d.ts +2 -0
- package/dist/cli/layout/index.js +44 -0
- package/dist/cli/layout/transport.d.ts +12 -0
- package/dist/cli/layout/transport.js +70 -0
- package/dist/cli/library/add.d.ts +60 -0
- package/dist/cli/library/add.js +348 -0
- package/dist/cli/library/cache.d.ts +26 -0
- package/dist/cli/library/cache.js +88 -0
- package/dist/cli/library/config.d.ts +75 -0
- package/dist/cli/library/config.js +198 -0
- package/dist/cli/library/digest.d.ts +5 -0
- package/dist/cli/library/digest.js +19 -0
- package/dist/cli/library/discover.d.ts +87 -0
- package/dist/cli/library/discover.js +534 -0
- package/dist/cli/library/freshness.d.ts +35 -0
- package/dist/cli/library/freshness.js +109 -0
- package/dist/cli/library/generation.d.ts +35 -0
- package/dist/cli/library/generation.js +211 -0
- package/dist/cli/library/index.d.ts +2 -0
- package/dist/cli/library/index.js +36 -0
- package/dist/cli/library/info.d.ts +69 -0
- package/dist/cli/library/info.js +311 -0
- package/dist/cli/library/list.d.ts +33 -0
- package/dist/cli/library/list.js +86 -0
- package/dist/cli/library/manifest.d.ts +81 -0
- package/dist/cli/library/manifest.js +200 -0
- package/dist/cli/library/manifestCache.d.ts +45 -0
- package/dist/cli/library/manifestCache.js +169 -0
- package/dist/cli/library/pull.d.ts +30 -0
- package/dist/cli/library/pull.js +438 -0
- package/dist/cli/library/push.d.ts +72 -0
- package/dist/cli/library/push.js +642 -0
- package/dist/cli/library/rm.d.ts +31 -0
- package/dist/cli/library/rm.js +200 -0
- package/dist/cli/library/search.d.ts +18 -0
- package/dist/cli/library/search.js +181 -0
- package/dist/cli/library/stat.d.ts +15 -0
- package/dist/cli/library/stat.js +127 -0
- package/dist/cli/library/tools.d.ts +104 -0
- package/dist/cli/library/tools.js +163 -0
- package/dist/cli/library/wire.d.ts +47 -0
- package/dist/cli/library/wire.js +120 -0
- package/dist/cli/list/index.d.ts +26 -0
- package/dist/cli/list/index.js +256 -0
- package/dist/cli/notes/api-transport.d.ts +5 -0
- package/dist/cli/notes/api-transport.js +20 -0
- package/dist/cli/notes/character-plan.d.ts +22 -0
- package/dist/cli/notes/character-plan.js +232 -0
- package/dist/cli/notes/document.d.ts +73 -0
- package/dist/cli/notes/document.js +306 -0
- package/dist/cli/notes/edit-commands.d.ts +106 -0
- package/dist/cli/notes/edit-commands.js +623 -0
- package/dist/cli/notes/editing.d.ts +81 -0
- package/dist/cli/notes/editing.js +305 -0
- package/dist/cli/notes/events.d.ts +36 -0
- package/dist/cli/notes/events.js +54 -0
- package/dist/cli/notes/files-commands.d.ts +97 -0
- package/dist/cli/notes/files-commands.js +548 -0
- package/dist/cli/notes/html-read.d.ts +9 -0
- package/dist/cli/notes/html-read.js +90 -0
- package/dist/cli/notes/html.d.ts +73 -0
- package/dist/cli/notes/html.js +381 -0
- package/dist/cli/notes/index.d.ts +123 -0
- package/dist/cli/notes/index.js +1300 -0
- package/dist/cli/notes/linger.d.ts +4 -0
- package/dist/cli/notes/linger.js +96 -0
- package/dist/cli/notes/media-commands.d.ts +5 -0
- package/dist/cli/notes/media-commands.js +51 -0
- package/dist/cli/notes/move-command.d.ts +83 -0
- package/dist/cli/notes/move-command.js +259 -0
- package/dist/cli/notes/rm-command.d.ts +22 -0
- package/dist/cli/notes/rm-command.js +110 -0
- package/dist/cli/notes/select-command.d.ts +12 -0
- package/dist/cli/notes/select-command.js +63 -0
- package/dist/cli/notes/suggest-diff.d.ts +56 -0
- package/dist/cli/notes/suggest-diff.js +311 -0
- package/dist/cli/notes/toc.d.ts +38 -0
- package/dist/cli/notes/toc.js +144 -0
- package/dist/cli/notes/transfer-command.d.ts +6 -0
- package/dist/cli/notes/transfer-command.js +9 -0
- package/dist/cli/notes/version-commands.d.ts +19 -0
- package/dist/cli/notes/version-commands.js +178 -0
- package/dist/cli/nymph/index.d.ts +74 -0
- package/dist/cli/nymph/index.js +349 -0
- package/dist/cli/org/index.d.ts +34 -0
- package/dist/cli/org/index.js +341 -0
- package/dist/cli/ownership/index.d.ts +12 -0
- package/dist/cli/ownership/index.js +122 -0
- package/dist/cli/ownership/metadata-transfer.d.ts +20 -0
- package/dist/cli/ownership/metadata-transfer.js +159 -0
- package/dist/cli/page/index.d.ts +58 -0
- package/dist/cli/page/index.js +387 -0
- package/dist/cli/pipeline/index.d.ts +69 -0
- package/dist/cli/pipeline/index.js +604 -0
- package/dist/cli/progress.d.ts +60 -0
- package/dist/cli/progress.js +276 -0
- package/dist/cli/project/attachments.d.ts +10 -0
- package/dist/cli/project/attachments.js +39 -0
- package/dist/cli/project/grants.d.ts +10 -0
- package/dist/cli/project/grants.js +39 -0
- package/dist/cli/project/index.d.ts +8 -0
- package/dist/cli/project/index.js +92 -0
- package/dist/cli/project/move.d.ts +57 -0
- package/dist/cli/project/move.js +242 -0
- package/dist/cli/project/output.d.ts +2 -0
- package/dist/cli/project/output.js +29 -0
- package/dist/cli/project/stream.d.ts +55 -0
- package/dist/cli/project/stream.js +207 -0
- package/dist/cli/project/transfer-preview.d.ts +8 -0
- package/dist/cli/project/transfer-preview.js +10 -0
- package/dist/cli/prompt.d.ts +1 -0
- package/dist/cli/prompt.js +17 -0
- package/dist/cli/provider/dreamdir.d.ts +52 -0
- package/dist/cli/provider/dreamdir.js +138 -0
- package/dist/cli/provider/index.d.ts +4 -0
- package/dist/cli/provider/index.js +419 -0
- package/dist/cli/provider/jump-worker.d.ts +9 -0
- package/dist/cli/provider/jump-worker.js +141 -0
- package/dist/cli/provider/lifecycle.d.ts +149 -0
- package/dist/cli/provider/lifecycle.js +1390 -0
- package/dist/cli/provider/machine.d.ts +17 -0
- package/dist/cli/provider/machine.js +116 -0
- package/dist/cli/provider/ssh.d.ts +105 -0
- package/dist/cli/provider/ssh.js +305 -0
- package/dist/cli/provider/terraform.d.ts +140 -0
- package/dist/cli/provider/terraform.js +288 -0
- package/dist/cli/providers/index.d.ts +18 -0
- package/dist/cli/providers/index.js +422 -0
- package/dist/cli/python.d.ts +61 -0
- package/dist/cli/python.js +255 -0
- package/dist/cli/queues/index.d.ts +33 -0
- package/dist/cli/queues/index.js +248 -0
- package/dist/cli/queues/slurm.d.ts +10 -0
- package/dist/cli/queues/slurm.js +134 -0
- package/dist/cli/resources.d.ts +72 -0
- package/dist/cli/resources.js +137 -0
- package/dist/cli/run/index.d.ts +15 -0
- package/dist/cli/run/index.js +163 -0
- package/dist/cli/run/input.d.ts +34 -0
- package/dist/cli/run/input.js +135 -0
- package/dist/cli/run/recovery.d.ts +2 -0
- package/dist/cli/run/recovery.js +18 -0
- package/dist/cli/run/setup.d.ts +3 -0
- package/dist/cli/run/setup.js +62 -0
- package/dist/cli/runconfig/index.d.ts +12 -0
- package/dist/cli/runconfig/index.js +130 -0
- package/dist/cli/runnable/index.d.ts +35 -0
- package/dist/cli/runnable/index.js +575 -0
- package/dist/cli/runnable/path.d.ts +115 -0
- package/dist/cli/runnable/path.js +288 -0
- package/dist/cli/runnable/run.d.ts +91 -0
- package/dist/cli/runnable/run.js +239 -0
- package/dist/cli/runnable/upload.d.ts +43 -0
- package/dist/cli/runnable/upload.js +342 -0
- package/dist/cli/runnable/worker.d.ts +1 -0
- package/dist/cli/runnable/worker.js +44 -0
- package/dist/cli/schemas/workflow-spec.schema.json +335 -0
- package/dist/cli/self-update/index.d.ts +5 -0
- package/dist/cli/self-update/index.js +107 -0
- package/dist/cli/self-update/install.d.ts +60 -0
- package/dist/cli/self-update/install.js +428 -0
- package/dist/cli/self-update/paths.d.ts +40 -0
- package/dist/cli/self-update/paths.js +87 -0
- package/dist/cli/self-update/releases.d.ts +41 -0
- package/dist/cli/self-update/releases.js +153 -0
- package/dist/cli/self-update/settings.d.ts +16 -0
- package/dist/cli/self-update/settings.js +68 -0
- package/dist/cli/self-update/update.d.ts +18 -0
- package/dist/cli/self-update/update.js +241 -0
- package/dist/cli/service-accounts/index.d.ts +3 -0
- package/dist/cli/service-accounts/index.js +149 -0
- package/dist/cli/session-affiliation.d.ts +26 -0
- package/dist/cli/session-affiliation.js +135 -0
- package/dist/cli/sessions/affiliation.d.ts +8 -0
- package/dist/cli/sessions/affiliation.js +66 -0
- package/dist/cli/sessions/api.d.ts +55 -0
- package/dist/cli/sessions/api.js +88 -0
- package/dist/cli/sessions/control.d.ts +6 -0
- package/dist/cli/sessions/control.js +159 -0
- package/dist/cli/sessions/conversation.d.ts +15 -0
- package/dist/cli/sessions/conversation.js +118 -0
- package/dist/cli/sessions/index.d.ts +2 -0
- package/dist/cli/sessions/index.js +209 -0
- package/dist/cli/sessions/managed.d.ts +39 -0
- package/dist/cli/sessions/managed.js +63 -0
- package/dist/cli/sessions/redaction.d.ts +2 -0
- package/dist/cli/sessions/redaction.js +11 -0
- package/dist/cli/sessions/runner/exec.d.ts +108 -0
- package/dist/cli/sessions/runner/exec.js +335 -0
- package/dist/cli/sessions/runner/journal.d.ts +26 -0
- package/dist/cli/sessions/runner/journal.js +49 -0
- package/dist/cli/sessions/runner/native.d.ts +48 -0
- package/dist/cli/sessions/runner/native.js +170 -0
- package/dist/cli/sessions/runner/pod.d.ts +30 -0
- package/dist/cli/sessions/runner/pod.js +129 -0
- package/dist/cli/sessions/runner/serve.d.ts +85 -0
- package/dist/cli/sessions/runner/serve.js +558 -0
- package/dist/cli/sessions/sync.d.ts +47 -0
- package/dist/cli/sessions/sync.js +80 -0
- package/dist/cli/sessions/transport.d.ts +14 -0
- package/dist/cli/sessions/transport.js +116 -0
- package/dist/cli/share.d.ts +15 -0
- package/dist/cli/share.js +139 -0
- package/dist/cli/skill/catalog.d.ts +141 -0
- package/dist/cli/skill/catalog.js +442 -0
- package/dist/cli/skill/files.d.ts +89 -0
- package/dist/cli/skill/files.js +264 -0
- package/dist/cli/skill/index.d.ts +268 -0
- package/dist/cli/skill/index.js +1216 -0
- package/dist/cli/skill/manifest.d.ts +30 -0
- package/dist/cli/skill/manifest.js +101 -0
- package/dist/cli/skill/prefs.d.ts +9 -0
- package/dist/cli/skill/prefs.js +32 -0
- package/dist/cli/skill/reminders.d.ts +15 -0
- package/dist/cli/skill/reminders.js +105 -0
- package/dist/cli/skill/tar.d.ts +17 -0
- package/dist/cli/skill/tar.js +195 -0
- package/dist/cli/snapshot/index.d.ts +24 -0
- package/dist/cli/snapshot/index.js +146 -0
- package/dist/cli/source/access.d.ts +45 -0
- package/dist/cli/source/access.js +563 -0
- package/dist/cli/source/control.d.ts +103 -0
- package/dist/cli/source/control.js +546 -0
- package/dist/cli/source/delete.d.ts +89 -0
- package/dist/cli/source/delete.js +463 -0
- package/dist/cli/source/index.d.ts +288 -0
- package/dist/cli/source/index.js +1348 -0
- package/dist/cli/source/share.d.ts +65 -0
- package/dist/cli/source/share.js +530 -0
- package/dist/cli/source/upload.d.ts +62 -0
- package/dist/cli/source/upload.js +258 -0
- package/dist/cli/source/write.d.ts +77 -0
- package/dist/cli/source/write.js +335 -0
- package/dist/cli/spawn.d.ts +28 -0
- package/dist/cli/spawn.js +81 -0
- package/dist/cli/target.d.ts +22 -0
- package/dist/cli/target.js +85 -0
- package/dist/cli/tasks/index.d.ts +38 -0
- package/dist/cli/tasks/index.js +365 -0
- package/dist/cli/team/index.d.ts +37 -0
- package/dist/cli/team/index.js +407 -0
- package/dist/cli/telemetry.d.ts +23 -0
- package/dist/cli/telemetry.js +262 -0
- package/dist/cli/telemetryJournal.d.ts +26 -0
- package/dist/cli/telemetryJournal.js +104 -0
- package/dist/cli/update/index.d.ts +21 -0
- package/dist/cli/update/index.js +284 -0
- package/dist/cli/upload/index.d.ts +11 -0
- package/dist/cli/upload/index.js +261 -0
- package/dist/cli/upload/kinds.d.ts +10 -0
- package/dist/cli/upload/kinds.js +85 -0
- package/dist/cli/upload/multipart.d.ts +21 -0
- package/dist/cli/upload/multipart.js +248 -0
- package/dist/cli/vault/affected-preview.d.ts +15 -0
- package/dist/cli/vault/affected-preview.js +38 -0
- package/dist/cli/vault/cloud.d.ts +55 -0
- package/dist/cli/vault/cloud.js +287 -0
- package/dist/cli/vault/format.d.ts +18 -0
- package/dist/cli/vault/format.js +104 -0
- package/dist/cli/vault/hostCredentials.d.ts +21 -0
- package/dist/cli/vault/hostCredentials.js +71 -0
- package/dist/cli/vault/hostSupersessions.d.ts +18 -0
- package/dist/cli/vault/hostSupersessions.js +68 -0
- package/dist/cli/vault/import.d.ts +3 -0
- package/dist/cli/vault/import.js +79 -0
- package/dist/cli/vault/index.d.ts +14 -0
- package/dist/cli/vault/index.js +225 -0
- package/dist/cli/vault/keys.d.ts +5 -0
- package/dist/cli/vault/keys.js +165 -0
- package/dist/cli/vault/kms.d.ts +6 -0
- package/dist/cli/vault/kms.js +169 -0
- package/dist/cli/vault/list.d.ts +13 -0
- package/dist/cli/vault/list.js +60 -0
- package/dist/cli/vault/listView.d.ts +21 -0
- package/dist/cli/vault/listView.js +123 -0
- package/dist/cli/vault/managementMetadata.d.ts +2 -0
- package/dist/cli/vault/managementMetadata.js +23 -0
- package/dist/cli/vault/mutations.d.ts +8 -0
- package/dist/cli/vault/mutations.js +151 -0
- package/dist/cli/vault/otp.d.ts +6 -0
- package/dist/cli/vault/otp.js +62 -0
- package/dist/cli/vault/otpIntent.d.ts +23 -0
- package/dist/cli/vault/otpIntent.js +76 -0
- package/dist/cli/vault/passImport.d.ts +25 -0
- package/dist/cli/vault/passImport.js +129 -0
- package/dist/cli/vault/passOtp.d.ts +51 -0
- package/dist/cli/vault/passOtp.js +101 -0
- package/dist/cli/vault/passStore.d.ts +26 -0
- package/dist/cli/vault/passStore.js +134 -0
- package/dist/cli/vault/passwordCommand.d.ts +39 -0
- package/dist/cli/vault/passwordCommand.js +101 -0
- package/dist/cli/vault/passwordProbe.d.ts +27 -0
- package/dist/cli/vault/passwordProbe.js +282 -0
- package/dist/cli/vault/passwordRotation.d.ts +9 -0
- package/dist/cli/vault/passwordRotation.js +273 -0
- package/dist/cli/vault/rotationApi.d.ts +13 -0
- package/dist/cli/vault/rotationApi.js +58 -0
- package/dist/cli/vault/rotationCommand.d.ts +2 -0
- package/dist/cli/vault/rotationCommand.js +75 -0
- package/dist/cli/vault/rotationEngine.d.ts +19 -0
- package/dist/cli/vault/rotationEngine.js +65 -0
- package/dist/cli/vault/rotationHelperSource.d.ts +2 -0
- package/dist/cli/vault/rotationHelperSource.js +3 -0
- package/dist/cli/vault/rotationInput.d.ts +11 -0
- package/dist/cli/vault/rotationInput.js +48 -0
- package/dist/cli/vault/rotationJournal.d.ts +16 -0
- package/dist/cli/vault/rotationJournal.js +183 -0
- package/dist/cli/vault/rotationKeys.d.ts +4 -0
- package/dist/cli/vault/rotationKeys.js +48 -0
- package/dist/cli/vault/rotationPrepare.d.ts +17 -0
- package/dist/cli/vault/rotationPrepare.js +108 -0
- package/dist/cli/vault/rotationRemote.d.ts +33 -0
- package/dist/cli/vault/rotationRemote.js +156 -0
- package/dist/cli/vault/rotationState.d.ts +42 -0
- package/dist/cli/vault/rotationState.js +115 -0
- package/dist/cli/vault/rotationTransport.d.ts +18 -0
- package/dist/cli/vault/rotationTransport.js +71 -0
- package/dist/cli/vault/sshSource.d.ts +18 -0
- package/dist/cli/vault/sshSource.js +196 -0
- package/dist/cli/vault/sshSync.d.ts +17 -0
- package/dist/cli/vault/sshSync.js +224 -0
- package/dist/cli/vault/sshTransfer.d.ts +22 -0
- package/dist/cli/vault/sshTransfer.js +140 -0
- package/dist/cli/vault/terraformState.d.ts +66 -0
- package/dist/cli/vault/terraformState.js +252 -0
- package/dist/cli/vault/terraformStateCommand.d.ts +2 -0
- package/dist/cli/vault/terraformStateCommand.js +61 -0
- package/dist/cli/vault/tree.d.ts +43 -0
- package/dist/cli/vault/tree.js +292 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.js +9 -0
- package/dist/cli/workflow/index.d.ts +76 -0
- package/dist/cli/workflow/index.js +826 -0
- package/dist/cli/workflow/validate.d.ts +19 -0
- package/dist/cli/workflow/validate.js +353 -0
- package/dist/package.json +1 -0
- package/package.json +28 -10
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { splitSshArguments } from '../hosts/config.js';
|
|
2
|
+
import { rotationSshConfig } from './rotationTransport.js';
|
|
3
|
+
/** Explicit endpoint grammar, normalized before any key or network access.
|
|
4
|
+
* Keys come from the selected binding, never an ambient SSH configuration. */
|
|
5
|
+
export function rotationEndpoint(input, knownHostsFile) {
|
|
6
|
+
if (typeof input !== 'string' || input.length > 8192 || /[\0\r]/.test(input))
|
|
7
|
+
throw new Error('Invalid SSH endpoint');
|
|
8
|
+
const args = splitSshArguments(input);
|
|
9
|
+
let user, port = 22, sawPort = false;
|
|
10
|
+
while (args.length > 1) {
|
|
11
|
+
const flag = args.shift();
|
|
12
|
+
const value = args.shift();
|
|
13
|
+
if (!value || value.startsWith('-'))
|
|
14
|
+
throw new Error('SSH option requires an explicit value');
|
|
15
|
+
if (flag === '-l' && user === undefined)
|
|
16
|
+
user = value;
|
|
17
|
+
else if (flag === '-p' && !sawPort && /^\d+$/.test(value)) {
|
|
18
|
+
port = Number(value);
|
|
19
|
+
sawPort = true;
|
|
20
|
+
}
|
|
21
|
+
else
|
|
22
|
+
throw new Error('Rotation accepts only -l and -p before the destination; use explicit jump and known-hosts options');
|
|
23
|
+
}
|
|
24
|
+
const destination = args[0] ?? '';
|
|
25
|
+
const match = /^(?:([A-Za-z0-9_][A-Za-z0-9_.-]*)@)?(\[[A-Fa-f0-9:]+\]|[A-Za-z0-9][A-Za-z0-9.:-]*)$/.exec(destination);
|
|
26
|
+
if (!match || user !== undefined && match[1] !== undefined)
|
|
27
|
+
throw new Error('Invalid or duplicate SSH user');
|
|
28
|
+
user ??= match[1];
|
|
29
|
+
if (!user)
|
|
30
|
+
throw new Error('Rotation requires an explicit SSH user');
|
|
31
|
+
const host = match[2].replace(/^\[|\]$/g, '');
|
|
32
|
+
const endpoint = { host, user, port, knownHostsFile };
|
|
33
|
+
rotationSshConfig(endpoint, '/rotation-validation-only');
|
|
34
|
+
return endpoint;
|
|
35
|
+
}
|
|
36
|
+
export function rotationTransportInput(options) {
|
|
37
|
+
const target = rotationEndpoint(options.ssh, options.knownHosts);
|
|
38
|
+
if (options.jumpSsh === undefined) {
|
|
39
|
+
if (options.jumpIdentity !== undefined || options.jumpKnownHosts !== undefined)
|
|
40
|
+
throw new Error('Jump options require --jump-ssh');
|
|
41
|
+
return target;
|
|
42
|
+
}
|
|
43
|
+
if (!options.jumpIdentity)
|
|
44
|
+
throw new Error('Jump transport requires a separate identity');
|
|
45
|
+
const profile = { ...target, jump: { ...rotationEndpoint(options.jumpSsh, options.jumpKnownHosts ?? options.knownHosts), identityFile: options.jumpIdentity } };
|
|
46
|
+
rotationSshConfig(profile, '/rotation-validation-only');
|
|
47
|
+
return profile;
|
|
48
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const rotationPhases: readonly ["prepared", "replacement_saved", "new_key_installed", "new_login_verified", "binding_superseded", "old_key_removed", "old_login_denied_and_new_verified", "cleanup_confirmed"];
|
|
2
|
+
export type RotationPhase = typeof rotationPhases[number];
|
|
3
|
+
export type JournalState = {
|
|
4
|
+
operationId: string;
|
|
5
|
+
phase: RotationPhase;
|
|
6
|
+
};
|
|
7
|
+
export type JournalSnapshot<T> = {
|
|
8
|
+
state: T;
|
|
9
|
+
sha256: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function canonicalJson(value: unknown): string;
|
|
12
|
+
export declare function readRotationRecord(path: string): Promise<Buffer>;
|
|
13
|
+
/** Complete immutable publication; never truncate or overwrite a winner. */
|
|
14
|
+
export declare function publishRotationRecord(path: string, bytes: Buffer): Promise<Buffer>;
|
|
15
|
+
export declare function loadRotationJournal<T extends JournalState>(file: string, validate: (value: unknown) => T, transition?: (previous: T, next: T) => void): Promise<JournalSnapshot<T>>;
|
|
16
|
+
export declare function appendRotationPhase<T extends JournalState>(file: string, current: JournalSnapshot<T>, next: T, validate: (value: unknown) => T, transition?: (previous: T, next: T) => void): Promise<JournalSnapshot<T>>;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { constants } from 'node:fs';
|
|
2
|
+
import { open, lstat, realpath, readdir, unlink, link, mkdir } from 'node:fs/promises';
|
|
3
|
+
import { dirname, resolve, join } from 'node:path';
|
|
4
|
+
import { randomUUID, createHash } from 'node:crypto';
|
|
5
|
+
export const rotationPhases = ['prepared', 'replacement_saved', 'new_key_installed',
|
|
6
|
+
'new_login_verified', 'binding_superseded', 'old_key_removed',
|
|
7
|
+
'old_login_denied_and_new_verified', 'cleanup_confirmed'];
|
|
8
|
+
const MAX_BYTES = 65536;
|
|
9
|
+
const temporaryName = /^\.rotation-publish-[0-9a-f-]{36}$/;
|
|
10
|
+
const hash = (bytes) => createHash('sha256').update(bytes).digest('hex');
|
|
11
|
+
export function canonicalJson(value) {
|
|
12
|
+
if (value === null || typeof value !== 'object') {
|
|
13
|
+
const encoded = JSON.stringify(value);
|
|
14
|
+
if (encoded === undefined || typeof value === 'number' && !Number.isFinite(value))
|
|
15
|
+
throw new Error('Invalid journal value');
|
|
16
|
+
return encoded;
|
|
17
|
+
}
|
|
18
|
+
if (Array.isArray(value))
|
|
19
|
+
return '[' + value.map(canonicalJson).join(',') + ']';
|
|
20
|
+
return '{' + Object.keys(value).sort().map(key => JSON.stringify(key) + ':' +
|
|
21
|
+
canonicalJson(value[key])).join(',') + '}';
|
|
22
|
+
}
|
|
23
|
+
async function checkedDirectory(path, privateOnly = false) {
|
|
24
|
+
if (await realpath(path) !== resolve(path))
|
|
25
|
+
throw new Error('Symlinked rotation directory');
|
|
26
|
+
const stat = await lstat(path);
|
|
27
|
+
if (!stat.isDirectory() || stat.uid !== process.getuid?.() ||
|
|
28
|
+
(stat.mode & (privateOnly ? 0o077 : 0o022)) !== 0)
|
|
29
|
+
throw new Error('Unsafe rotation directory');
|
|
30
|
+
}
|
|
31
|
+
async function syncDirectory(path) {
|
|
32
|
+
const handle = await open(path, constants.O_RDONLY | constants.O_DIRECTORY | constants.O_NOFOLLOW);
|
|
33
|
+
try {
|
|
34
|
+
await handle.sync();
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
await handle.close();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Recover only our own same-directory publication link after a process crash.
|
|
41
|
+
* Unknown hard links still fail closed, including links outside this directory. */
|
|
42
|
+
async function recoverPublicationLinks(path, dev, ino) {
|
|
43
|
+
for (const name of await readdir(dirname(path))) {
|
|
44
|
+
if (!temporaryName.test(name))
|
|
45
|
+
continue;
|
|
46
|
+
const candidate = join(dirname(path), name);
|
|
47
|
+
try {
|
|
48
|
+
const stat = await lstat(candidate);
|
|
49
|
+
if (stat.isFile() && stat.uid === process.getuid?.() && (stat.mode & 0o777) === 0o600 && stat.dev === dev && stat.ino === ino) {
|
|
50
|
+
await unlink(candidate);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
if (error.code !== 'ENOENT')
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export async function readRotationRecord(path) {
|
|
60
|
+
await checkedDirectory(dirname(path));
|
|
61
|
+
const handle = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
62
|
+
try {
|
|
63
|
+
let stat = await handle.stat();
|
|
64
|
+
if (!stat.isFile() || stat.uid !== process.getuid?.() || (stat.mode & 0o777) !== 0o600 || stat.size > MAX_BYTES)
|
|
65
|
+
throw new Error('Unsafe rotation record');
|
|
66
|
+
if (stat.nlink > 1) {
|
|
67
|
+
await recoverPublicationLinks(path, stat.dev, stat.ino);
|
|
68
|
+
stat = await handle.stat();
|
|
69
|
+
}
|
|
70
|
+
if (stat.nlink !== 1)
|
|
71
|
+
throw new Error('Shared rotation record');
|
|
72
|
+
const buffer = Buffer.alloc(MAX_BYTES + 1);
|
|
73
|
+
const { bytesRead } = await handle.read(buffer, 0, buffer.length, 0);
|
|
74
|
+
const after = await handle.stat();
|
|
75
|
+
if (bytesRead !== stat.size || after.size !== stat.size || after.mtimeMs !== stat.mtimeMs)
|
|
76
|
+
throw new Error('Rotation record changed');
|
|
77
|
+
const current = await lstat(path);
|
|
78
|
+
if (current.dev !== stat.dev || current.ino !== stat.ino)
|
|
79
|
+
throw new Error('Rotation record replaced');
|
|
80
|
+
await handle.sync();
|
|
81
|
+
await syncDirectory(dirname(path));
|
|
82
|
+
return buffer.subarray(0, bytesRead);
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
await handle.close();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Complete immutable publication; never truncate or overwrite a winner. */
|
|
89
|
+
export async function publishRotationRecord(path, bytes) {
|
|
90
|
+
if (!bytes.length || bytes.length > MAX_BYTES)
|
|
91
|
+
throw new Error('Rotation record size invalid');
|
|
92
|
+
await checkedDirectory(dirname(path));
|
|
93
|
+
const temporary = join(dirname(path), '.rotation-publish-' + randomUUID());
|
|
94
|
+
const handle = await open(temporary, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 0o600);
|
|
95
|
+
try {
|
|
96
|
+
await handle.chmod(0o600);
|
|
97
|
+
await handle.writeFile(bytes);
|
|
98
|
+
await handle.sync();
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
await handle.close();
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
try {
|
|
105
|
+
await link(temporary, path);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
if (error.code !== 'EEXIST')
|
|
109
|
+
throw error;
|
|
110
|
+
}
|
|
111
|
+
await syncDirectory(dirname(path));
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
await unlink(temporary).catch((error) => { if (error.code !== 'ENOENT')
|
|
115
|
+
throw error; });
|
|
116
|
+
}
|
|
117
|
+
return readRotationRecord(path);
|
|
118
|
+
}
|
|
119
|
+
export async function loadRotationJournal(file, validate, transition) {
|
|
120
|
+
let bytes = await readRotationRecord(file);
|
|
121
|
+
let state = validate(JSON.parse(bytes.toString('utf8')));
|
|
122
|
+
if (state.phase !== 'prepared')
|
|
123
|
+
throw new Error('Invalid rotation genesis');
|
|
124
|
+
const operationId = state.operationId;
|
|
125
|
+
const folder = file + '.records';
|
|
126
|
+
try {
|
|
127
|
+
await checkedDirectory(folder, true);
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
if (error.code === 'ENOENT')
|
|
131
|
+
return { state, sha256: hash(bytes) };
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
let missing = false;
|
|
135
|
+
for (let index = 1; index < rotationPhases.length; index++) {
|
|
136
|
+
const phase = rotationPhases[index];
|
|
137
|
+
const path = join(folder, `${index * 10}-${phase}.json`);
|
|
138
|
+
let next;
|
|
139
|
+
try {
|
|
140
|
+
next = await readRotationRecord(path);
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
if (error.code === 'ENOENT') {
|
|
144
|
+
missing = true;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
throw error;
|
|
148
|
+
}
|
|
149
|
+
if (missing)
|
|
150
|
+
throw new Error('Rotation journal phase gap');
|
|
151
|
+
const record = JSON.parse(next.toString('utf8'));
|
|
152
|
+
if (record.schema !== 'dreamlake.host-key-rotation/phase-v1' || record.operationId !== operationId ||
|
|
153
|
+
record.phase !== phase || record.previousSha256 !== hash(bytes) ||
|
|
154
|
+
Object.keys(record).sort().join(',') !== 'operationId,phase,previousSha256,schema,state')
|
|
155
|
+
throw new Error('Invalid rotation phase chain');
|
|
156
|
+
const nextState = validate(record.state);
|
|
157
|
+
transition?.(state, nextState);
|
|
158
|
+
state = nextState;
|
|
159
|
+
if (state.phase !== phase || state.operationId !== operationId)
|
|
160
|
+
throw new Error('Mismatched rotation phase');
|
|
161
|
+
bytes = next;
|
|
162
|
+
}
|
|
163
|
+
return { state, sha256: hash(bytes) };
|
|
164
|
+
}
|
|
165
|
+
export async function appendRotationPhase(file, current, next, validate, transition) {
|
|
166
|
+
const index = rotationPhases.indexOf(current.state.phase) + 1;
|
|
167
|
+
if (next.operationId !== current.state.operationId || next.phase !== rotationPhases[index])
|
|
168
|
+
throw new Error('Invalid rotation transition');
|
|
169
|
+
validate(next);
|
|
170
|
+
transition?.(current.state, next);
|
|
171
|
+
const latest = await loadRotationJournal(file, validate, transition);
|
|
172
|
+
if (latest.sha256 !== current.sha256)
|
|
173
|
+
return latest;
|
|
174
|
+
const folder = file + '.records';
|
|
175
|
+
await mkdir(folder, { mode: 0o700 }).catch((error) => { if (error.code !== 'EEXIST')
|
|
176
|
+
throw error; });
|
|
177
|
+
await checkedDirectory(folder, true);
|
|
178
|
+
await syncDirectory(dirname(folder));
|
|
179
|
+
const record = { schema: 'dreamlake.host-key-rotation/phase-v1', operationId: next.operationId,
|
|
180
|
+
phase: next.phase, previousSha256: current.sha256, state: next };
|
|
181
|
+
await publishRotationRecord(join(folder, `${index * 10}-${next.phase}.json`), Buffer.from(canonicalJson(record) + '\n'));
|
|
182
|
+
return loadRotationJournal(file, validate, transition);
|
|
183
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type RotationState } from './rotationState.js';
|
|
2
|
+
export declare function rotationPublicKey(path: string): Promise<string>;
|
|
3
|
+
export declare function rotationRemoteStep(state: RotationState, key: 'old' | 'new', action: 'inspect' | 'install' | 'remove_old', expectDenied?: boolean): Promise<import("./rotationRemote.js").RotationHelperReply | "publickey-denied">;
|
|
4
|
+
export declare function removeRotationLocalKeys(state: RotationState): Promise<void>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import { lstat, unlink } from 'node:fs/promises';
|
|
4
|
+
import { readRotationRecord } from './rotationJournal.js';
|
|
5
|
+
import { publicFingerprint } from './rotationState.js';
|
|
6
|
+
import { runRotationHelper } from './rotationRemote.js';
|
|
7
|
+
import { dirname, join } from 'node:path';
|
|
8
|
+
const execute = promisify(execFile);
|
|
9
|
+
export async function rotationPublicKey(path) {
|
|
10
|
+
const bytes = await readRotationRecord(path);
|
|
11
|
+
bytes.fill(0);
|
|
12
|
+
try {
|
|
13
|
+
const { stdout } = await execute('ssh-keygen', ['-y', '-P', '', '-f', path], { encoding: 'utf8', timeout: 10000, maxBuffer: 8192, env: { ...process.env, LC_ALL: 'C' } });
|
|
14
|
+
const publicKey = stdout.trim().split(/\s+/).slice(0, 2).join(' ');
|
|
15
|
+
publicFingerprint(publicKey);
|
|
16
|
+
return publicKey;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
throw new Error('Selected private key is unavailable or unsupported; retain recovery files');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export async function rotationRemoteStep(state, key, action, expectDenied = false) {
|
|
23
|
+
const path = key === 'old' ? state.oldKeyPath : state.newKeyPath;
|
|
24
|
+
const expected = key === 'old' ? state.oldPublicKey : state.newPublicKey;
|
|
25
|
+
if (await rotationPublicKey(path) !== expected)
|
|
26
|
+
throw new Error('Selected private key changed');
|
|
27
|
+
return runRotationHelper({ profile: state.sshProfile, selectedKey: path, configFile: join(dirname(path), key + '-ssh-config'),
|
|
28
|
+
request: { action, operationId: state.operationId, oldPublicKey: state.oldPublicKey, newPublicKey: state.newPublicKey, expectedIdentity: state.remoteIdentity }, expectDenied });
|
|
29
|
+
}
|
|
30
|
+
export async function removeRotationLocalKeys(state) {
|
|
31
|
+
if (state.phase !== 'cleanup_confirmed')
|
|
32
|
+
throw new Error('Cleanup is not confirmed');
|
|
33
|
+
for (const [path, publicKey] of [[state.oldKeyPath, state.oldPublicKey], [state.newKeyPath, state.newPublicKey]]) {
|
|
34
|
+
try {
|
|
35
|
+
const before = await lstat(path);
|
|
36
|
+
if (await rotationPublicKey(path) !== publicKey)
|
|
37
|
+
throw new Error('Local recovery key changed');
|
|
38
|
+
const after = await lstat(path);
|
|
39
|
+
if (before.dev !== after.dev || before.ino !== after.ino)
|
|
40
|
+
throw new Error('Local recovery key replaced');
|
|
41
|
+
await unlink(path);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (error.code !== 'ENOENT')
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type RotationState } from './rotationState.js';
|
|
2
|
+
import { type RotationTransport } from './rotationTransport.js';
|
|
3
|
+
import type { VaultCall } from './sshTransfer.js';
|
|
4
|
+
export declare class RotationPreparationError extends Error {
|
|
5
|
+
readonly stage: 'binding lookup' | 'secret read' | 'key generation' | 'key validation' | 'initial SSH' | 'manifest validation';
|
|
6
|
+
constructor(stage: 'binding lookup' | 'secret read' | 'key generation' | 'key validation' | 'initial SSH' | 'manifest validation');
|
|
7
|
+
}
|
|
8
|
+
export interface RotationIntent {
|
|
9
|
+
bindingId: string;
|
|
10
|
+
newEntry: string;
|
|
11
|
+
operationFile: string;
|
|
12
|
+
profile: RotationTransport;
|
|
13
|
+
origin: string;
|
|
14
|
+
account: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function checkRotationIntent(state: RotationState, intent: RotationIntent): void;
|
|
17
|
+
export declare function prepareRotation(call: VaultCall, intent: RotationIntent): Promise<RotationState>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { execFile } from 'node:child_process';
|
|
3
|
+
import { promisify, isDeepStrictEqual } from 'node:util';
|
|
4
|
+
import { mkdir, lstat, realpath, rm } from 'node:fs/promises';
|
|
5
|
+
import { dirname, join, resolve } from 'node:path';
|
|
6
|
+
import { bindingView } from './hostCredentials.js';
|
|
7
|
+
import { currentRotationBinding, liveRotationEntry } from './rotationApi.js';
|
|
8
|
+
import { publishRotationRecord, canonicalJson, readRotationRecord } from './rotationJournal.js';
|
|
9
|
+
import { rotationPublicKey } from './rotationKeys.js';
|
|
10
|
+
import { publicFingerprint, validateRotationState } from './rotationState.js';
|
|
11
|
+
import { runRotationHelper } from './rotationRemote.js';
|
|
12
|
+
import { rotationSshConfig } from './rotationTransport.js';
|
|
13
|
+
const execute = promisify(execFile);
|
|
14
|
+
export class RotationPreparationError extends Error {
|
|
15
|
+
stage;
|
|
16
|
+
constructor(stage) {
|
|
17
|
+
super('Rotation preparation failed during ' + stage);
|
|
18
|
+
this.stage = stage;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async function preparationStep(stage, action) {
|
|
22
|
+
try {
|
|
23
|
+
return await action();
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
throw new RotationPreparationError(stage);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function checkRotationIntent(state, intent) {
|
|
30
|
+
const directory = join(dirname(resolve(intent.operationFile)), '.rotation-' + state.operationId);
|
|
31
|
+
if (state.oldKeyPath !== join(directory, 'old-key') || state.newKeyPath !== join(directory, 'new-key'))
|
|
32
|
+
throw new Error('Recovery keys are outside this operation directory');
|
|
33
|
+
if (state.bindingId !== intent.bindingId || state.replacementEntryName !== intent.newEntry || state.origin !== intent.origin || state.account !== intent.account || !isDeepStrictEqual(state.sshProfile, intent.profile))
|
|
34
|
+
throw new Error('Saved rotation belongs to different arguments or account');
|
|
35
|
+
}
|
|
36
|
+
export async function prepareRotation(call, intent) {
|
|
37
|
+
if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(intent.bindingId))
|
|
38
|
+
throw new Error('Invalid binding identity');
|
|
39
|
+
const path = resolve(intent.operationFile);
|
|
40
|
+
const parent = dirname(path);
|
|
41
|
+
const stat = await lstat(parent);
|
|
42
|
+
if (await realpath(parent) !== parent || !stat.isDirectory() || stat.uid !== process.getuid?.() || (stat.mode & 0o022) !== 0)
|
|
43
|
+
throw new Error('Unsafe operation directory');
|
|
44
|
+
rotationSshConfig(intent.profile, '/rotation-validation-only');
|
|
45
|
+
try {
|
|
46
|
+
const existing = validateRotationState(JSON.parse((await readRotationRecord(path)).toString('utf8')));
|
|
47
|
+
checkRotationIntent(existing, intent);
|
|
48
|
+
return existing;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
if (error.code !== 'ENOENT')
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
const result = await preparationStep('binding lookup', () => call('/v1/vault/host-credentials/' + encodeURIComponent(intent.bindingId)));
|
|
55
|
+
const binding = bindingView(result?.binding), old = result?.entry;
|
|
56
|
+
if (binding.id !== intent.bindingId || binding.kind !== 'private_key' || binding.releasedAt != null || !old || old.name === intent.newEntry)
|
|
57
|
+
throw new Error('Selected binding is not a live private key');
|
|
58
|
+
liveRotationEntry(old, binding.entryId, binding.entryRevision, old.name);
|
|
59
|
+
const operationId = randomUUID();
|
|
60
|
+
const folder = join(parent, '.rotation-' + operationId);
|
|
61
|
+
await mkdir(folder, { mode: 0o700 });
|
|
62
|
+
let retain = false;
|
|
63
|
+
try {
|
|
64
|
+
const oldKeyPath = join(folder, 'old-key'), newKeyPath = join(folder, 'new-key');
|
|
65
|
+
const read = await preparationStep('secret read', () => call('/v1/vault/entries/read', { selectors: [old.name] }, 'POST'));
|
|
66
|
+
if (!Array.isArray(read?.entries) || read.entries.length !== 1 || typeof read.entries[0].value !== 'string')
|
|
67
|
+
throw new Error('Private key must be a string');
|
|
68
|
+
liveRotationEntry(read.entries[0], old.id, old.revision, old.name);
|
|
69
|
+
const bytes = Buffer.from(read.entries[0].value);
|
|
70
|
+
read.entries[0].value = undefined;
|
|
71
|
+
try {
|
|
72
|
+
const saved = await publishRotationRecord(oldKeyPath, bytes);
|
|
73
|
+
saved.fill(0);
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
bytes.fill(0);
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
await execute('ssh-keygen', ['-q', '-t', 'ed25519', '-N', '', '-f', newKeyPath], { timeout: 10000, maxBuffer: 8192 });
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
throw new RotationPreparationError('key generation');
|
|
83
|
+
}
|
|
84
|
+
const oldPublicKey = await preparationStep('key validation', () => rotationPublicKey(oldKeyPath)), newPublicKey = await preparationStep('key validation', () => rotationPublicKey(newKeyPath));
|
|
85
|
+
const state = { schema: 'dreamlake.host-key-rotation/v1', operationId, origin: intent.origin, account: intent.account, bindingId: intent.bindingId,
|
|
86
|
+
...Object.fromEntries(['hostId', 'enrollmentId', 'role', 'endpoint', 'kind'].map(k => [k, binding[k]])),
|
|
87
|
+
expectedEntryId: old.id, expectedEntryRevision: old.revision, oldEntryName: old.name, replacementEntryName: intent.newEntry,
|
|
88
|
+
writeRequestId: 'rotate_' + operationId.replace(/-/g, ''), sshProfile: structuredClone(intent.profile), oldKeyPath, newKeyPath,
|
|
89
|
+
oldPublicKey, newPublicKey, oldFingerprint: publicFingerprint(oldPublicKey), newFingerprint: publicFingerprint(newPublicKey),
|
|
90
|
+
phase: 'prepared', timestamps: { prepared: new Date().toISOString() }, verification: {} };
|
|
91
|
+
await currentRotationBinding(call, state, 'old');
|
|
92
|
+
const reply = await preparationStep('initial SSH', () => runRotationHelper({ profile: intent.profile, selectedKey: oldKeyPath, configFile: join(folder, 'old-ssh-config'),
|
|
93
|
+
request: { action: 'inspect', operationId, oldPublicKey, newPublicKey } }));
|
|
94
|
+
if (reply === 'publickey-denied' || !reply.oldPresent || reply.newPresent)
|
|
95
|
+
throw new Error('Remote authorization is not uniquely prepared');
|
|
96
|
+
state.remoteIdentity = reply.identity;
|
|
97
|
+
await preparationStep('manifest validation', async () => validateRotationState(state));
|
|
98
|
+
retain = true; // A publication failure may follow a committed manifest.
|
|
99
|
+
const winner = validateRotationState(JSON.parse((await publishRotationRecord(path, Buffer.from(canonicalJson(state) + '\n'))).toString('utf8')));
|
|
100
|
+
retain = winner.operationId === operationId;
|
|
101
|
+
checkRotationIntent(winner, intent);
|
|
102
|
+
return winner;
|
|
103
|
+
}
|
|
104
|
+
finally {
|
|
105
|
+
if (!retain)
|
|
106
|
+
await rm(folder, { recursive: true, force: true });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type RotationTransport } from './rotationTransport.js';
|
|
2
|
+
export interface RemoteIdentity {
|
|
3
|
+
uid: number;
|
|
4
|
+
home: string;
|
|
5
|
+
machineId: string;
|
|
6
|
+
sshDirectoryDevice: number;
|
|
7
|
+
sshDirectoryInode: number;
|
|
8
|
+
}
|
|
9
|
+
export interface RotationHelperRequest {
|
|
10
|
+
action: 'inspect' | 'install' | 'remove_old' | 'remove_new';
|
|
11
|
+
operationId: string;
|
|
12
|
+
oldPublicKey: string;
|
|
13
|
+
newPublicKey: string;
|
|
14
|
+
expectedIdentity?: RemoteIdentity;
|
|
15
|
+
}
|
|
16
|
+
export interface RotationHelperReply {
|
|
17
|
+
identity: RemoteIdentity;
|
|
18
|
+
oldPresent: boolean;
|
|
19
|
+
newPresent: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function remoteIdentity(value: any): RemoteIdentity;
|
|
22
|
+
export declare function validateHelperRequest(value: RotationHelperRequest): void;
|
|
23
|
+
/** Only an explicit publickey-auth failure counts as old-key rejection.
|
|
24
|
+
* Network, host-key, timeout and helper failures remain unknown outcomes. */
|
|
25
|
+
export declare function publicKeyDenied(error: unknown, profile: RotationTransport, localAuthLog?: string): boolean;
|
|
26
|
+
export declare function runRotationHelper(options: {
|
|
27
|
+
profile: RotationTransport;
|
|
28
|
+
selectedKey: string;
|
|
29
|
+
configFile: string;
|
|
30
|
+
request: RotationHelperRequest;
|
|
31
|
+
expectDenied?: boolean;
|
|
32
|
+
executable?: string;
|
|
33
|
+
}): Promise<RotationHelperReply | 'publickey-denied'>;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { constants, fstatSync } from 'node:fs';
|
|
2
|
+
import { open, lstat, unlink } from 'node:fs/promises';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { randomUUID } from 'node:crypto';
|
|
5
|
+
import { execFile } from 'node:child_process';
|
|
6
|
+
import { ROTATION_HELPER_SOURCE } from './rotationHelperSource.js';
|
|
7
|
+
import { rotationSshConfig, verifyRotationKey } from './rotationTransport.js';
|
|
8
|
+
import { publishRotationRecord } from './rotationJournal.js';
|
|
9
|
+
export function remoteIdentity(value) {
|
|
10
|
+
const keys = ['home', 'machineId', 'sshDirectoryDevice', 'sshDirectoryInode', 'uid'];
|
|
11
|
+
if (!value || Object.keys(value).sort().join(',') !== keys.join(',') ||
|
|
12
|
+
!['uid', 'sshDirectoryDevice', 'sshDirectoryInode'].every(key => Number.isSafeInteger(value[key]) && value[key] >= 0) ||
|
|
13
|
+
typeof value.home !== 'string' || !value.home.startsWith('/') || value.home.length > 4096 || /[\r\n\0]/.test(value.home) || value.home.split('/').some((part) => part === '.' || part === '..') ||
|
|
14
|
+
typeof value.machineId !== 'string' || !/^[A-Za-z0-9_-]{1,128}$/.test(value.machineId))
|
|
15
|
+
throw new Error('Invalid remote identity');
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
export function validateHelperRequest(value) {
|
|
19
|
+
const allowed = new Set(['action', 'operationId', 'oldPublicKey', 'newPublicKey', 'expectedIdentity']);
|
|
20
|
+
if (!value || Object.keys(value).some(key => !allowed.has(key)) ||
|
|
21
|
+
!['inspect', 'install', 'remove_old', 'remove_new'].includes(value.action) ||
|
|
22
|
+
typeof value.operationId !== 'string' ||
|
|
23
|
+
!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value.operationId)) {
|
|
24
|
+
throw new Error('Invalid remote operation metadata');
|
|
25
|
+
}
|
|
26
|
+
for (const key of [value.oldPublicKey, value.newPublicKey]) {
|
|
27
|
+
if (typeof key !== 'string' || key.length > 8192 ||
|
|
28
|
+
!/^(ssh-ed25519|ssh-rsa|ecdsa-sha2-nistp(?:256|384|521)) [A-Za-z0-9+/]+={0,2}$/.test(key)) {
|
|
29
|
+
throw new Error('Invalid public key metadata');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (value.expectedIdentity !== undefined)
|
|
33
|
+
remoteIdentity(value.expectedIdentity);
|
|
34
|
+
else if (value.action !== 'inspect')
|
|
35
|
+
throw new Error('Remote mutation requires pinned identity');
|
|
36
|
+
}
|
|
37
|
+
function helperReply(value, expected) {
|
|
38
|
+
if (!value || Object.keys(value).sort().join(',') !== 'identity,newPresent,oldPresent' ||
|
|
39
|
+
typeof value.oldPresent !== 'boolean' || typeof value.newPresent !== 'boolean')
|
|
40
|
+
throw new Error('Invalid remote reply');
|
|
41
|
+
const identity = remoteIdentity(value.identity);
|
|
42
|
+
if (expected && Object.keys(expected).some(key => identity[key] !== expected[key])) {
|
|
43
|
+
throw new Error('Remote identity changed');
|
|
44
|
+
}
|
|
45
|
+
return { identity, oldPresent: value.oldPresent, newPresent: value.newPresent };
|
|
46
|
+
}
|
|
47
|
+
/** Only an explicit publickey-auth failure counts as old-key rejection.
|
|
48
|
+
* Network, host-key, timeout and helper failures remain unknown outcomes. */
|
|
49
|
+
export function publicKeyDenied(error, profile, localAuthLog) {
|
|
50
|
+
const failure = error;
|
|
51
|
+
if (failure?.code !== 255 || failure.killed || failure.signal || typeof localAuthLog !== 'string')
|
|
52
|
+
return false;
|
|
53
|
+
const lines = localAuthLog.split(/\r?\n/);
|
|
54
|
+
return !lines.some(line => /^(?:debug[123]: )?(?:Authenticated to |Authentication succeeded\b)/.test(line)) &&
|
|
55
|
+
lines.includes('debug1: No more authentication methods to try.') &&
|
|
56
|
+
lines.includes(`${profile.user}@${profile.host}: Permission denied (publickey).`);
|
|
57
|
+
}
|
|
58
|
+
/** Only the parent client's -E log supplies denial evidence. Remote stderr and
|
|
59
|
+
* a ProxyJump child's diagnostics cannot impersonate this file's auth state. */
|
|
60
|
+
async function authLog(path, handle, initial) {
|
|
61
|
+
const before = await handle.stat();
|
|
62
|
+
const current = await lstat(path);
|
|
63
|
+
if (!before.isFile() || before.nlink !== 1 || before.uid !== process.getuid?.() ||
|
|
64
|
+
(before.mode & 0o777) !== 0o600 || before.size > 65536 ||
|
|
65
|
+
current.dev !== initial.dev || current.ino !== initial.ino)
|
|
66
|
+
throw new Error('Invalid local authentication log');
|
|
67
|
+
const bytes = Buffer.alloc(65537);
|
|
68
|
+
const { bytesRead } = await handle.read(bytes, 0, bytes.length, 0);
|
|
69
|
+
const after = await handle.stat();
|
|
70
|
+
if (bytesRead !== before.size || after.size !== before.size || after.mtimeMs !== before.mtimeMs)
|
|
71
|
+
throw new Error('Authentication log changed');
|
|
72
|
+
return new TextDecoder('utf-8', { fatal: true }).decode(bytes.subarray(0, bytesRead));
|
|
73
|
+
}
|
|
74
|
+
export async function runRotationHelper(options) {
|
|
75
|
+
validateHelperRequest(options.request);
|
|
76
|
+
await verifyRotationKey(options.selectedKey);
|
|
77
|
+
if (options.profile.jump)
|
|
78
|
+
await verifyRotationKey(options.profile.jump.identityFile);
|
|
79
|
+
const config = Buffer.from(rotationSshConfig(options.profile, options.selectedKey));
|
|
80
|
+
const stored = await publishRotationRecord(options.configFile, config);
|
|
81
|
+
if (!stored.equals(config))
|
|
82
|
+
throw new Error('Rotation transport intent changed');
|
|
83
|
+
// The remote shell parses only a fixed, bundled helper program. Public
|
|
84
|
+
// operation metadata travels on stdin; private keys never leave local files.
|
|
85
|
+
const program = "'" + ROTATION_HELPER_SOURCE.replace(/'/g, "'\\''") + "'";
|
|
86
|
+
const logPath = options.expectDenied ? join(dirname(options.configFile), '.rotation-auth-' + randomUUID() + '.log') : undefined;
|
|
87
|
+
const log = logPath ? await open(logPath, constants.O_RDWR | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 0o600) : undefined;
|
|
88
|
+
const initial = log ? await log.stat() : undefined;
|
|
89
|
+
let failure;
|
|
90
|
+
let stdout = '';
|
|
91
|
+
try {
|
|
92
|
+
try {
|
|
93
|
+
stdout = await new Promise((resolve, reject) => {
|
|
94
|
+
let monitor;
|
|
95
|
+
let invalidLog = false;
|
|
96
|
+
const argv = ['-F', options.configFile, ...(logPath ? ['-v', '-E', logPath] : []), 'rotation-target', 'python3', '-c', program];
|
|
97
|
+
const child = execFile(options.executable ?? 'ssh', argv, {
|
|
98
|
+
encoding: 'utf8', timeout: 30000, maxBuffer: 65536,
|
|
99
|
+
env: { ...process.env, LC_ALL: 'C' },
|
|
100
|
+
}, (error, output) => {
|
|
101
|
+
if (monitor)
|
|
102
|
+
clearInterval(monitor);
|
|
103
|
+
if (invalidLog)
|
|
104
|
+
reject(new Error('Authentication log limit exceeded'));
|
|
105
|
+
else if (error)
|
|
106
|
+
reject(error);
|
|
107
|
+
else
|
|
108
|
+
resolve(output);
|
|
109
|
+
});
|
|
110
|
+
if (log)
|
|
111
|
+
monitor = setInterval(() => {
|
|
112
|
+
try {
|
|
113
|
+
if (fstatSync(log.fd).size <= 65536)
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
catch { /* fail closed */ }
|
|
117
|
+
invalidLog = true;
|
|
118
|
+
child.kill('SIGKILL');
|
|
119
|
+
}, 25);
|
|
120
|
+
child.stdin?.on('error', () => { });
|
|
121
|
+
child.stdin?.end(JSON.stringify(options.request));
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
failure = error;
|
|
126
|
+
}
|
|
127
|
+
if (options.expectDenied) {
|
|
128
|
+
const evidence = await authLog(logPath, log, initial);
|
|
129
|
+
if (publicKeyDenied(failure, options.profile, evidence))
|
|
130
|
+
return 'publickey-denied';
|
|
131
|
+
throw new Error('Old credential rejection unconfirmed');
|
|
132
|
+
}
|
|
133
|
+
if (failure)
|
|
134
|
+
throw failure;
|
|
135
|
+
return helperReply(JSON.parse(stdout), options.request.expectedIdentity);
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
throw new Error('Remote rotation step unconfirmed; retain the operation and retry');
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
if (log && logPath && initial) {
|
|
142
|
+
try {
|
|
143
|
+
const current = await lstat(logPath);
|
|
144
|
+
if (current.dev === initial.dev && current.ino === initial.ino)
|
|
145
|
+
await unlink(logPath);
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
if (error.code !== 'ENOENT')
|
|
149
|
+
throw new Error('Owned authentication log cleanup failed');
|
|
150
|
+
}
|
|
151
|
+
finally {
|
|
152
|
+
await log.close();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type RemoteIdentity } from './rotationRemote.js';
|
|
2
|
+
import { type RotationTransport } from './rotationTransport.js';
|
|
3
|
+
import { type RotationPhase } from './rotationJournal.js';
|
|
4
|
+
export interface RotationState {
|
|
5
|
+
schema: 'dreamlake.host-key-rotation/v1';
|
|
6
|
+
operationId: string;
|
|
7
|
+
origin: string;
|
|
8
|
+
account: string;
|
|
9
|
+
bindingId: string;
|
|
10
|
+
hostId: string;
|
|
11
|
+
enrollmentId: string;
|
|
12
|
+
role: 'target' | 'jump';
|
|
13
|
+
endpoint: string;
|
|
14
|
+
kind: 'private_key';
|
|
15
|
+
expectedEntryId: string;
|
|
16
|
+
expectedEntryRevision: number;
|
|
17
|
+
oldEntryName: string;
|
|
18
|
+
replacementEntryName: string;
|
|
19
|
+
replacementEntryId?: string;
|
|
20
|
+
replacementEntryRevision?: number;
|
|
21
|
+
writeRequestId: string;
|
|
22
|
+
sshProfile: RotationTransport;
|
|
23
|
+
oldKeyPath: string;
|
|
24
|
+
newKeyPath: string;
|
|
25
|
+
oldPublicKey: string;
|
|
26
|
+
newPublicKey: string;
|
|
27
|
+
oldFingerprint: string;
|
|
28
|
+
newFingerprint: string;
|
|
29
|
+
remoteIdentity: RemoteIdentity;
|
|
30
|
+
phase: RotationPhase;
|
|
31
|
+
timestamps: Partial<Record<RotationPhase, string>>;
|
|
32
|
+
verification: {
|
|
33
|
+
newLoginVerifiedAt?: string;
|
|
34
|
+
oldLoginDeniedAt?: string;
|
|
35
|
+
replacementReverifiedAt?: string;
|
|
36
|
+
};
|
|
37
|
+
receipt?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
export declare function publicFingerprint(key: string): string;
|
|
40
|
+
export declare function validateRotationState(value: unknown): RotationState;
|
|
41
|
+
/** Validate every adjacent pair, including immutable evidence already recorded. */
|
|
42
|
+
export declare function validateRotationTransition(previous: RotationState, next: RotationState): void;
|