@mesh-tech/mesh-cli 0.20.1 → 0.20.3
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 +6 -5
- package/dist/bin/mesh.d.ts +0 -12
- package/dist/bin/mesh.js +99 -50
- package/dist/bin/mesh.js.map +2 -3
- package/dist/build-info.json +2 -2
- package/dist/src/commands/agent-api-client.d.ts +0 -70
- package/dist/src/commands/agent-api-client.js +0 -80
- package/dist/src/commands/app-check.d.ts +0 -56
- package/dist/src/commands/app-check.js +0 -72
- package/dist/src/commands/artifacts.d.ts +0 -11
- package/dist/src/commands/artifacts.js +0 -33
- package/dist/src/commands/cluster.d.ts +0 -39
- package/dist/src/commands/cluster.js +0 -73
- package/dist/src/commands/conversations.d.ts +0 -36
- package/dist/src/commands/conversations.js +0 -59
- package/dist/src/commands/create-app.d.ts +4 -88
- package/dist/src/commands/create-app.js +16 -155
- package/dist/src/commands/db/connect.d.ts +0 -7
- package/dist/src/commands/db/connect.js +0 -9
- package/dist/src/commands/db/credentials.d.ts +0 -7
- package/dist/src/commands/db/credentials.js +0 -10
- package/dist/src/commands/db/env.d.ts +0 -6
- package/dist/src/commands/db/env.js +0 -14
- package/dist/src/commands/db/exec.d.ts +0 -43
- package/dist/src/commands/db/exec.js +0 -69
- package/dist/src/commands/db/index.d.ts +0 -10
- package/dist/src/commands/db/index.js +0 -10
- package/dist/src/commands/db/psql.d.ts +0 -7
- package/dist/src/commands/db/psql.js +0 -18
- package/dist/src/commands/deploy.d.ts +0 -38
- package/dist/src/commands/deploy.js +1 -76
- package/dist/src/commands/dev-doctor.d.ts +0 -82
- package/dist/src/commands/dev-doctor.js +3 -132
- package/dist/src/commands/dev-launch.d.ts +0 -52
- package/dist/src/commands/dev-launch.js +0 -56
- package/dist/src/commands/dev-token-server.d.ts +0 -18
- package/dist/src/commands/dev-token-server.js +1 -24
- package/dist/src/commands/dev.d.ts +0 -246
- package/dist/src/commands/dev.js +5 -963
- package/dist/src/commands/docs.d.ts +0 -1
- package/dist/src/commands/docs.js +0 -12
- package/dist/src/commands/hub/index.d.ts +0 -60
- package/dist/src/commands/hub/index.js +2 -139
- package/dist/src/commands/init/wizard.d.ts +5 -116
- package/dist/src/commands/init/wizard.js +42 -110
- package/dist/src/commands/init.d.ts +0 -55
- package/dist/src/commands/init.js +0 -70
- package/dist/src/commands/install-shim.d.ts +0 -23
- package/dist/src/commands/install-shim.js +2 -29
- package/dist/src/commands/local/auth-provision.d.ts +0 -80
- package/dist/src/commands/local/auth-provision.js +0 -109
- package/dist/src/commands/local/dev-local.d.ts +0 -91
- package/dist/src/commands/local/dev-local.js +0 -147
- package/dist/src/commands/local/docker-runner.d.ts +0 -22
- package/dist/src/commands/local/docker-runner.js +2 -35
- package/dist/src/commands/local/helpers.d.ts +0 -14
- package/dist/src/commands/local/helpers.js +0 -13
- package/dist/src/commands/local/hub-local.d.ts +0 -96
- package/dist/src/commands/local/hub-local.js +0 -111
- package/dist/src/commands/local/index.d.ts +0 -14
- package/dist/src/commands/local/index.js +0 -86
- package/dist/src/commands/local/mocks.d.ts +0 -269
- package/dist/src/commands/local/mocks.js +1 -274
- package/dist/src/commands/local/seed-hub-catalog.d.ts +0 -25
- package/dist/src/commands/local/seed-hub-catalog.js +0 -41
- package/dist/src/commands/local/seed-zitadel.d.ts +0 -82
- package/dist/src/commands/local/seed-zitadel.js +0 -158
- package/dist/src/commands/local/seed.d.ts +0 -64
- package/dist/src/commands/local/seed.js +0 -78
- package/dist/src/commands/local/stack.d.ts +0 -141
- package/dist/src/commands/local/stack.js +0 -153
- package/dist/src/commands/login.d.ts +0 -265
- package/dist/src/commands/login.js +4 -418
- package/dist/src/commands/peer-addressing.d.ts +0 -39
- package/dist/src/commands/peer-addressing.js +0 -37
- package/dist/src/commands/port-ownership.d.ts +0 -44
- package/dist/src/commands/port-ownership.js +0 -47
- package/dist/src/commands/registry-publish.d.ts +0 -1
- package/dist/src/commands/registry-publish.js +0 -46
- package/dist/src/commands/registry.d.ts +4 -237
- package/dist/src/commands/registry.js +2 -316
- package/dist/src/commands/secrets/exec.d.ts +0 -16
- package/dist/src/commands/secrets/exec.js +0 -24
- package/dist/src/commands/secrets/index.d.ts +0 -9
- package/dist/src/commands/secrets/index.js +0 -10
- package/dist/src/commands/secrets/migrate-config.d.ts +0 -17
- package/dist/src/commands/secrets/migrate-config.js +0 -40
- package/dist/src/commands/secrets/reindex.d.ts +0 -38
- package/dist/src/commands/secrets/reindex.js +0 -39
- package/dist/src/commands/secrets/set.d.ts +0 -47
- package/dist/src/commands/secrets/set.js +0 -107
- package/dist/src/commands/site.d.ts +0 -1
- package/dist/src/commands/site.js +0 -61
- package/dist/src/commands/skills.d.ts +0 -61
- package/dist/src/commands/skills.js +0 -83
- package/dist/src/commands/stack.d.ts +0 -15
- package/dist/src/commands/stack.js +1 -128
- package/dist/src/commands/temporal.d.ts +0 -30
- package/dist/src/commands/temporal.js.map +0 -1
- package/dist/src/commands/tenant.d.ts +0 -31
- package/dist/src/commands/tenant.js +0 -55
- package/dist/src/commands/tunnel/index.d.ts +0 -40
- package/dist/src/commands/tunnel/index.js +0 -141
- package/dist/src/commands/vcs/clone.d.ts +0 -1
- package/dist/src/commands/vcs/clone.js +0 -4
- package/dist/src/commands/vcs/common.d.ts +0 -32
- package/dist/src/commands/vcs/common.js +0 -41
- package/dist/src/commands/vcs/drafts.d.ts +0 -1
- package/dist/src/commands/vcs/drafts.js +0 -1
- package/dist/src/commands/vcs/get.d.ts +0 -1
- package/dist/src/commands/vcs/get.js +0 -11
- package/dist/src/commands/vcs/index.d.ts +0 -1
- package/dist/src/commands/vcs/index.js +0 -1
- package/dist/src/commands/vcs/propose.d.ts +0 -26
- package/dist/src/commands/vcs/propose.js +3 -34
- package/dist/src/commands/vcs/review.d.ts +0 -1
- package/dist/src/commands/vcs/review.js +0 -1
- package/dist/src/commands/vcs/rm.d.ts +0 -11
- package/dist/src/commands/vcs/rm.js +0 -14
- package/dist/src/commands/vcs-enrich.d.ts +0 -12
- package/dist/src/commands/vcs-enrich.js +0 -12
- package/dist/src/commands/vpn/index.d.ts +0 -17
- package/dist/src/commands/vpn/index.js +0 -102
- package/dist/src/commands/vpn/tunnel.d.ts +0 -9
- package/dist/src/commands/vpn/tunnel.js +0 -37
- package/dist/src/commands/workflow.d.ts +0 -22
- package/dist/src/commands/workflow.js +0 -80
- package/dist/src/docs/assemble.d.ts +0 -117
- package/dist/src/docs/assemble.js +0 -142
- package/dist/src/docs/cli-reference.d.ts +0 -58
- package/dist/src/docs/cli-reference.js +0 -77
- package/dist/src/docs/discover.d.ts +0 -40
- package/dist/src/docs/discover.js +2 -60
- package/dist/src/docs/portal.d.ts +0 -44
- package/dist/src/docs/portal.js +0 -49
- package/dist/src/docs/registry-docs.d.ts +0 -29
- package/dist/src/docs/registry-docs.js +0 -40
- package/dist/src/docs/schema.d.ts +0 -36
- package/dist/src/docs/schema.js +0 -52
- package/dist/src/docs/serve.d.ts +0 -18
- package/dist/src/docs/serve.js +2 -30
- package/dist/src/docs/start.d.ts +0 -42
- package/dist/src/docs/start.js +0 -70
- package/dist/src/eval/agent-eval.d.mts +0 -12
- package/dist/src/eval/agent-eval.mjs +0 -22
- package/dist/src/index.d.ts +0 -6
- package/dist/src/index.js.map +0 -1
- package/dist/src/program.d.ts +0 -20
- package/dist/src/program.js +0 -24
- package/dist/src/utils/auth-preflight.d.ts +0 -137
- package/dist/src/utils/auth-preflight.js +0 -149
- package/dist/src/utils/aws-auth.d.ts +0 -163
- package/dist/src/utils/aws-auth.js +3 -232
- package/dist/src/utils/bastion.d.ts +0 -27
- package/dist/src/utils/bastion.js +0 -28
- package/dist/src/utils/build-info.d.ts +0 -22
- package/dist/src/utils/build-info.js +0 -27
- package/dist/src/utils/cache-home.d.ts +0 -23
- package/dist/src/utils/cache-home.js +0 -25
- package/dist/src/utils/capture-history.d.ts +0 -54
- package/dist/src/utils/capture-history.js +1 -55
- package/dist/src/utils/context.d.ts +0 -23
- package/dist/src/utils/context.js +0 -43
- package/dist/src/utils/credentials.d.ts +0 -38
- package/dist/src/utils/credentials.js +0 -39
- package/dist/src/utils/deploy-preflight.d.ts +0 -38
- package/dist/src/utils/deploy-preflight.js +1 -71
- package/dist/src/utils/errors.d.ts +0 -53
- package/dist/src/utils/errors.js +0 -49
- package/dist/src/utils/first-party-contexts.d.ts +0 -38
- package/dist/src/utils/first-party-contexts.js +0 -44
- package/dist/src/utils/index.d.ts +0 -4
- package/dist/src/utils/index.js +0 -4
- package/dist/src/utils/kubeconfig.d.ts +0 -40
- package/dist/src/utils/kubeconfig.js +0 -44
- package/dist/src/utils/log.d.ts +0 -20
- package/dist/src/utils/log.js +0 -20
- package/dist/src/utils/mesh-json.d.ts +0 -46
- package/dist/src/utils/mesh-json.js +0 -39
- package/dist/src/utils/pid.d.ts +0 -42
- package/dist/src/utils/pid.js +0 -48
- package/dist/src/utils/pulumi-run.d.ts +0 -14
- package/dist/src/utils/pulumi-run.js +0 -42
- package/dist/src/utils/pulumi.d.ts +0 -34
- package/dist/src/utils/pulumi.js +0 -38
- package/dist/src/utils/reachability.d.ts +0 -27
- package/dist/src/utils/reachability.js +0 -40
- package/dist/src/utils/recover-conversation.d.ts +0 -110
- package/dist/src/utils/recover-conversation.js +0 -108
- package/dist/src/utils/registry-broker.d.ts +5 -84
- package/dist/src/utils/registry-broker.js +0 -62
- package/dist/src/utils/registry-identity.d.ts +0 -149
- package/dist/src/utils/registry-identity.js +0 -143
- package/dist/src/utils/scaffold-versions.d.ts +0 -41
- package/dist/src/utils/scaffold-versions.js +0 -42
- package/dist/src/utils/socks-forward.d.ts +0 -24
- package/dist/src/utils/socks-forward.js +2 -25
- package/dist/src/utils/stack-flag.d.ts +0 -13
- package/dist/src/utils/stack-flag.js +0 -21
- package/dist/src/utils/tailscale-targets.d.ts +0 -37
- package/dist/src/utils/tailscale-targets.js +0 -33
- package/dist/src/utils/tailscale.d.ts +0 -177
- package/dist/src/utils/tailscale.js +6 -337
- package/dist/src/utils/temporal-auth.d.ts +0 -41
- package/dist/src/utils/temporal-auth.js +0 -52
- package/dist/src/utils/temporal-codec.d.ts +0 -89
- package/dist/src/utils/temporal-codec.js.map +0 -1
- package/dist/src/utils/tunnel-ownership.d.ts +0 -79
- package/dist/src/utils/tunnel-ownership.js +0 -74
- package/dist/src/utils/vpn-join.d.ts +0 -16
- package/dist/src/utils/vpn-join.js +0 -17
- package/dist/src/utils/vpn.d.ts +0 -42
- package/dist/src/utils/vpn.js +0 -52
- package/dist/src/utils/workflow-fingerprint.d.ts +0 -39
- package/dist/src/utils/workflow-fingerprint.js +1 -63
- package/dist/src/utils/worktree-identity.d.ts +0 -62
- package/dist/src/utils/worktree-identity.js +0 -88
- package/package.json +1 -1
- package/skills/core/SKILL.md +10 -11
- package/templates/api-auth/api/src/index.ts.hbs +1 -1
- package/templates/api-auth/api/src/spicedb-http-provider.ts.hbs +2 -2
- package/templates/api-role-gating/api/src/authn.ts.hbs +2 -2
- package/templates/api-role-gating/index.ts.hbs +1 -1
- package/templates/api-role-gating/skills/develop/SKILL.md.hbs +1 -1
- package/templates/platform-repo/core/Pulumi.{{tenant}}-{{env}}.yaml.hbs +2 -2
- package/templates/platform-repo/platform/index.ts +1 -1
- package/dist/bin/mesh.d.ts.map +0 -1
- package/dist/src/commands/agent-api-client.d.ts.map +0 -1
- package/dist/src/commands/agent-api-client.js.map +0 -1
- package/dist/src/commands/app-check.d.ts.map +0 -1
- package/dist/src/commands/app-check.js.map +0 -1
- package/dist/src/commands/artifacts.d.ts.map +0 -1
- package/dist/src/commands/artifacts.js.map +0 -1
- package/dist/src/commands/cluster.d.ts.map +0 -1
- package/dist/src/commands/cluster.js.map +0 -1
- package/dist/src/commands/conversations.d.ts.map +0 -1
- package/dist/src/commands/conversations.js.map +0 -1
- package/dist/src/commands/create-app.d.ts.map +0 -1
- package/dist/src/commands/create-app.js.map +0 -1
- package/dist/src/commands/db/connect.d.ts.map +0 -1
- package/dist/src/commands/db/connect.js.map +0 -1
- package/dist/src/commands/db/credentials.d.ts.map +0 -1
- package/dist/src/commands/db/credentials.js.map +0 -1
- package/dist/src/commands/db/env.d.ts.map +0 -1
- package/dist/src/commands/db/env.js.map +0 -1
- package/dist/src/commands/db/exec.d.ts.map +0 -1
- package/dist/src/commands/db/exec.js.map +0 -1
- package/dist/src/commands/db/index.d.ts.map +0 -1
- package/dist/src/commands/db/index.js.map +0 -1
- package/dist/src/commands/db/psql.d.ts.map +0 -1
- package/dist/src/commands/db/psql.js.map +0 -1
- package/dist/src/commands/deploy.d.ts.map +0 -1
- package/dist/src/commands/deploy.js.map +0 -1
- package/dist/src/commands/dev-doctor.d.ts.map +0 -1
- package/dist/src/commands/dev-doctor.js.map +0 -1
- package/dist/src/commands/dev-launch.d.ts.map +0 -1
- package/dist/src/commands/dev-launch.js.map +0 -1
- package/dist/src/commands/dev-token-server.d.ts.map +0 -1
- package/dist/src/commands/dev-token-server.js.map +0 -1
- package/dist/src/commands/dev.d.ts.map +0 -1
- package/dist/src/commands/dev.js.map +0 -1
- package/dist/src/commands/docs.d.ts.map +0 -1
- package/dist/src/commands/docs.js.map +0 -1
- package/dist/src/commands/hub/index.d.ts.map +0 -1
- package/dist/src/commands/hub/index.js.map +0 -1
- package/dist/src/commands/init/wizard.d.ts.map +0 -1
- package/dist/src/commands/init/wizard.js.map +0 -1
- package/dist/src/commands/init.d.ts.map +0 -1
- package/dist/src/commands/init.js.map +0 -1
- package/dist/src/commands/install-shim.d.ts.map +0 -1
- package/dist/src/commands/install-shim.js.map +0 -1
- package/dist/src/commands/local/auth-provision.d.ts.map +0 -1
- package/dist/src/commands/local/auth-provision.js.map +0 -1
- package/dist/src/commands/local/dev-local.d.ts.map +0 -1
- package/dist/src/commands/local/dev-local.js.map +0 -1
- package/dist/src/commands/local/docker-runner.d.ts.map +0 -1
- package/dist/src/commands/local/docker-runner.js.map +0 -1
- package/dist/src/commands/local/helpers.d.ts.map +0 -1
- package/dist/src/commands/local/helpers.js.map +0 -1
- package/dist/src/commands/local/hub-local.d.ts.map +0 -1
- package/dist/src/commands/local/hub-local.js.map +0 -1
- package/dist/src/commands/local/index.d.ts.map +0 -1
- package/dist/src/commands/local/index.js.map +0 -1
- package/dist/src/commands/local/mocks.d.ts.map +0 -1
- package/dist/src/commands/local/mocks.js.map +0 -1
- package/dist/src/commands/local/seed-hub-catalog.d.ts.map +0 -1
- package/dist/src/commands/local/seed-hub-catalog.js.map +0 -1
- package/dist/src/commands/local/seed-zitadel.d.ts.map +0 -1
- package/dist/src/commands/local/seed-zitadel.js.map +0 -1
- package/dist/src/commands/local/seed.d.ts.map +0 -1
- package/dist/src/commands/local/seed.js.map +0 -1
- package/dist/src/commands/local/stack.d.ts.map +0 -1
- package/dist/src/commands/local/stack.js.map +0 -1
- package/dist/src/commands/login.d.ts.map +0 -1
- package/dist/src/commands/login.js.map +0 -1
- package/dist/src/commands/peer-addressing.d.ts.map +0 -1
- package/dist/src/commands/peer-addressing.js.map +0 -1
- package/dist/src/commands/port-ownership.d.ts.map +0 -1
- package/dist/src/commands/port-ownership.js.map +0 -1
- package/dist/src/commands/registry-publish.d.ts.map +0 -1
- package/dist/src/commands/registry-publish.js.map +0 -1
- package/dist/src/commands/registry.d.ts.map +0 -1
- package/dist/src/commands/registry.js.map +0 -1
- package/dist/src/commands/secrets/exec.d.ts.map +0 -1
- package/dist/src/commands/secrets/exec.js.map +0 -1
- package/dist/src/commands/secrets/index.d.ts.map +0 -1
- package/dist/src/commands/secrets/index.js.map +0 -1
- package/dist/src/commands/secrets/migrate-config.d.ts.map +0 -1
- package/dist/src/commands/secrets/migrate-config.js.map +0 -1
- package/dist/src/commands/secrets/reindex.d.ts.map +0 -1
- package/dist/src/commands/secrets/reindex.js.map +0 -1
- package/dist/src/commands/secrets/set.d.ts.map +0 -1
- package/dist/src/commands/secrets/set.js.map +0 -1
- package/dist/src/commands/site.d.ts.map +0 -1
- package/dist/src/commands/site.js.map +0 -1
- package/dist/src/commands/skills.d.ts.map +0 -1
- package/dist/src/commands/skills.js.map +0 -1
- package/dist/src/commands/stack.d.ts.map +0 -1
- package/dist/src/commands/stack.js.map +0 -1
- package/dist/src/commands/temporal.d.ts.map +0 -1
- package/dist/src/commands/tenant.d.ts.map +0 -1
- package/dist/src/commands/tenant.js.map +0 -1
- package/dist/src/commands/tunnel/index.d.ts.map +0 -1
- package/dist/src/commands/tunnel/index.js.map +0 -1
- package/dist/src/commands/vcs/clone.d.ts.map +0 -1
- package/dist/src/commands/vcs/clone.js.map +0 -1
- package/dist/src/commands/vcs/common.d.ts.map +0 -1
- package/dist/src/commands/vcs/common.js.map +0 -1
- package/dist/src/commands/vcs/drafts.d.ts.map +0 -1
- package/dist/src/commands/vcs/drafts.js.map +0 -1
- package/dist/src/commands/vcs/get.d.ts.map +0 -1
- package/dist/src/commands/vcs/get.js.map +0 -1
- package/dist/src/commands/vcs/index.d.ts.map +0 -1
- package/dist/src/commands/vcs/index.js.map +0 -1
- package/dist/src/commands/vcs/propose.d.ts.map +0 -1
- package/dist/src/commands/vcs/propose.js.map +0 -1
- package/dist/src/commands/vcs/review.d.ts.map +0 -1
- package/dist/src/commands/vcs/review.js.map +0 -1
- package/dist/src/commands/vcs/rm.d.ts.map +0 -1
- package/dist/src/commands/vcs/rm.js.map +0 -1
- package/dist/src/commands/vcs-enrich.d.ts.map +0 -1
- package/dist/src/commands/vcs-enrich.js.map +0 -1
- package/dist/src/commands/vpn/index.d.ts.map +0 -1
- package/dist/src/commands/vpn/index.js.map +0 -1
- package/dist/src/commands/vpn/tunnel.d.ts.map +0 -1
- package/dist/src/commands/vpn/tunnel.js.map +0 -1
- package/dist/src/commands/workflow.d.ts.map +0 -1
- package/dist/src/commands/workflow.js.map +0 -1
- package/dist/src/docs/assemble.d.ts.map +0 -1
- package/dist/src/docs/assemble.js.map +0 -1
- package/dist/src/docs/cli-reference.d.ts.map +0 -1
- package/dist/src/docs/cli-reference.js.map +0 -1
- package/dist/src/docs/discover.d.ts.map +0 -1
- package/dist/src/docs/discover.js.map +0 -1
- package/dist/src/docs/portal.d.ts.map +0 -1
- package/dist/src/docs/portal.js.map +0 -1
- package/dist/src/docs/registry-docs.d.ts.map +0 -1
- package/dist/src/docs/registry-docs.js.map +0 -1
- package/dist/src/docs/schema.d.ts.map +0 -1
- package/dist/src/docs/schema.js.map +0 -1
- package/dist/src/docs/serve.d.ts.map +0 -1
- package/dist/src/docs/serve.js.map +0 -1
- package/dist/src/docs/start.d.ts.map +0 -1
- package/dist/src/docs/start.js.map +0 -1
- package/dist/src/eval/agent-eval.d.mts.map +0 -1
- package/dist/src/eval/agent-eval.mjs.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/program.d.ts.map +0 -1
- package/dist/src/program.js.map +0 -1
- package/dist/src/utils/auth-preflight.d.ts.map +0 -1
- package/dist/src/utils/auth-preflight.js.map +0 -1
- package/dist/src/utils/aws-auth.d.ts.map +0 -1
- package/dist/src/utils/aws-auth.js.map +0 -1
- package/dist/src/utils/bastion.d.ts.map +0 -1
- package/dist/src/utils/bastion.js.map +0 -1
- package/dist/src/utils/build-info.d.ts.map +0 -1
- package/dist/src/utils/build-info.js.map +0 -1
- package/dist/src/utils/cache-home.d.ts.map +0 -1
- package/dist/src/utils/cache-home.js.map +0 -1
- package/dist/src/utils/capture-history.d.ts.map +0 -1
- package/dist/src/utils/capture-history.js.map +0 -1
- package/dist/src/utils/context.d.ts.map +0 -1
- package/dist/src/utils/context.js.map +0 -1
- package/dist/src/utils/credentials.d.ts.map +0 -1
- package/dist/src/utils/credentials.js.map +0 -1
- package/dist/src/utils/deploy-preflight.d.ts.map +0 -1
- package/dist/src/utils/deploy-preflight.js.map +0 -1
- package/dist/src/utils/errors.d.ts.map +0 -1
- package/dist/src/utils/errors.js.map +0 -1
- package/dist/src/utils/first-party-contexts.d.ts.map +0 -1
- package/dist/src/utils/first-party-contexts.js.map +0 -1
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/index.js.map +0 -1
- package/dist/src/utils/kubeconfig.d.ts.map +0 -1
- package/dist/src/utils/kubeconfig.js.map +0 -1
- package/dist/src/utils/log.d.ts.map +0 -1
- package/dist/src/utils/log.js.map +0 -1
- package/dist/src/utils/mesh-json.d.ts.map +0 -1
- package/dist/src/utils/mesh-json.js.map +0 -1
- package/dist/src/utils/pid.d.ts.map +0 -1
- package/dist/src/utils/pid.js.map +0 -1
- package/dist/src/utils/pulumi-run.d.ts.map +0 -1
- package/dist/src/utils/pulumi-run.js.map +0 -1
- package/dist/src/utils/pulumi.d.ts.map +0 -1
- package/dist/src/utils/pulumi.js.map +0 -1
- package/dist/src/utils/reachability.d.ts.map +0 -1
- package/dist/src/utils/reachability.js.map +0 -1
- package/dist/src/utils/recover-conversation.d.ts.map +0 -1
- package/dist/src/utils/recover-conversation.js.map +0 -1
- package/dist/src/utils/registry-broker.d.ts.map +0 -1
- package/dist/src/utils/registry-broker.js.map +0 -1
- package/dist/src/utils/registry-identity.d.ts.map +0 -1
- package/dist/src/utils/registry-identity.js.map +0 -1
- package/dist/src/utils/scaffold-versions.d.ts.map +0 -1
- package/dist/src/utils/scaffold-versions.js.map +0 -1
- package/dist/src/utils/socks-forward.d.ts.map +0 -1
- package/dist/src/utils/socks-forward.js.map +0 -1
- package/dist/src/utils/stack-flag.d.ts.map +0 -1
- package/dist/src/utils/stack-flag.js.map +0 -1
- package/dist/src/utils/tailscale-targets.d.ts.map +0 -1
- package/dist/src/utils/tailscale-targets.js.map +0 -1
- package/dist/src/utils/tailscale.d.ts.map +0 -1
- package/dist/src/utils/tailscale.js.map +0 -1
- package/dist/src/utils/temporal-auth.d.ts.map +0 -1
- package/dist/src/utils/temporal-auth.js.map +0 -1
- package/dist/src/utils/temporal-codec.d.ts.map +0 -1
- package/dist/src/utils/tunnel-ownership.d.ts.map +0 -1
- package/dist/src/utils/tunnel-ownership.js.map +0 -1
- package/dist/src/utils/vpn-join.d.ts.map +0 -1
- package/dist/src/utils/vpn-join.js.map +0 -1
- package/dist/src/utils/vpn.d.ts.map +0 -1
- package/dist/src/utils/vpn.js.map +0 -1
- package/dist/src/utils/workflow-fingerprint.d.ts.map +0 -1
- package/dist/src/utils/workflow-fingerprint.js.map +0 -1
- package/dist/src/utils/worktree-identity.d.ts.map +0 -1
- package/dist/src/utils/worktree-identity.js.map +0 -1
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh secrets - Commands for working with AWS Secrets Manager
|
|
3
|
-
*
|
|
4
|
-
* Commands:
|
|
5
|
-
* mesh secrets exec - Run command with secrets injected as environment variables
|
|
6
|
-
* mesh secrets set - Set credentials for an external service
|
|
7
|
-
* mesh secrets reindex - Rebuild a keyed service's instance index from Secrets Manager
|
|
8
|
-
*/
|
|
9
1
|
import { Command } from "commander";
|
|
10
2
|
export declare function registerSecretsCommands(program: Command): void;
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh secrets - Commands for working with AWS Secrets Manager
|
|
3
|
-
*
|
|
4
|
-
* Commands:
|
|
5
|
-
* mesh secrets exec - Run command with secrets injected as environment variables
|
|
6
|
-
* mesh secrets set - Set credentials for an external service
|
|
7
|
-
* mesh secrets reindex - Rebuild a keyed service's instance index from Secrets Manager
|
|
8
|
-
*/
|
|
9
1
|
import { Option } from "commander";
|
|
10
2
|
import { execCommand } from "./exec.js";
|
|
11
3
|
import { setCommand } from "./set.js";
|
|
@@ -20,7 +12,6 @@ export function registerSecretsCommands(program) {
|
|
|
20
12
|
.description("Run command with secrets as environment variables")
|
|
21
13
|
.allowUnknownOption(true)
|
|
22
14
|
.action(async (_opts, cmd) => {
|
|
23
|
-
// Get all args after "secrets exec"
|
|
24
15
|
const args = cmd.args;
|
|
25
16
|
await execCommand(args);
|
|
26
17
|
});
|
|
@@ -58,4 +49,3 @@ export function registerSecretsCommands(program) {
|
|
|
58
49
|
await migrateConfigCommand(opts);
|
|
59
50
|
});
|
|
60
51
|
}
|
|
61
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh secrets migrate-config — Backfill .config mirror secrets.
|
|
3
|
-
*
|
|
4
|
-
* For each external service discovered in SSM, reads the main secret from
|
|
5
|
-
* Secrets Manager, extracts non-secret fields using the credential schema,
|
|
6
|
-
* and writes them to {secretPrefix}/.config.
|
|
7
|
-
*
|
|
8
|
-
* Idempotent: skips services where .config already exists (unless --force).
|
|
9
|
-
* Handles multi-instance services by iterating instance keys.
|
|
10
|
-
*
|
|
11
|
-
* Usage:
|
|
12
|
-
* mesh secrets migrate-config # migrate all services
|
|
13
|
-
* mesh secrets migrate-config --force # overwrite existing .config
|
|
14
|
-
* mesh secrets migrate-config --dry-run # show what would be written
|
|
15
|
-
* mesh secrets migrate-config --stage dev # override stage detection
|
|
16
|
-
*/
|
|
17
1
|
export declare function migrateConfigCommand(opts: {
|
|
18
2
|
force?: boolean;
|
|
19
3
|
dryRun?: boolean;
|
|
@@ -21,4 +5,3 @@ export declare function migrateConfigCommand(opts: {
|
|
|
21
5
|
stage?: string;
|
|
22
6
|
region?: string;
|
|
23
7
|
}): Promise<void>;
|
|
24
|
-
//# sourceMappingURL=migrate-config.d.ts.map
|
|
@@ -1,27 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh secrets migrate-config — Backfill .config mirror secrets.
|
|
3
|
-
*
|
|
4
|
-
* For each external service discovered in SSM, reads the main secret from
|
|
5
|
-
* Secrets Manager, extracts non-secret fields using the credential schema,
|
|
6
|
-
* and writes them to {secretPrefix}/.config.
|
|
7
|
-
*
|
|
8
|
-
* Idempotent: skips services where .config already exists (unless --force).
|
|
9
|
-
* Handles multi-instance services by iterating instance keys.
|
|
10
|
-
*
|
|
11
|
-
* Usage:
|
|
12
|
-
* mesh secrets migrate-config # migrate all services
|
|
13
|
-
* mesh secrets migrate-config --force # overwrite existing .config
|
|
14
|
-
* mesh secrets migrate-config --dry-run # show what would be written
|
|
15
|
-
* mesh secrets migrate-config --stage dev # override stage detection
|
|
16
|
-
*/
|
|
17
1
|
import { SSMClient, GetParametersByPathCommand, } from "@aws-sdk/client-ssm";
|
|
18
2
|
import { SecretsManagerClient, GetSecretValueCommand, PutSecretValueCommand, CreateSecretCommand, ListSecretsCommand, } from "@aws-sdk/client-secrets-manager";
|
|
19
3
|
import { detectContext } from "../../utils/context.js";
|
|
20
4
|
import { logInfo, logSuccess, logError } from "../../utils/log.js";
|
|
21
5
|
import { resolveStackOption } from "../../utils/stack-flag.js";
|
|
22
|
-
// =============================================================================
|
|
23
|
-
// Schema normalization (same as set.ts)
|
|
24
|
-
// =============================================================================
|
|
25
6
|
function normalizeEntry(raw) {
|
|
26
7
|
if (raw.type === "group" && raw.fields) {
|
|
27
8
|
return {
|
|
@@ -42,9 +23,6 @@ function normalizeEntry(raw) {
|
|
|
42
23
|
function normalizeFields(raw) {
|
|
43
24
|
return Object.fromEntries(Object.entries(raw).map(([key, value]) => [key, normalizeEntry(value)]));
|
|
44
25
|
}
|
|
45
|
-
// =============================================================================
|
|
46
|
-
// Discovery (same logic as set.ts)
|
|
47
|
-
// =============================================================================
|
|
48
26
|
async function discoverExternalServices(ssmClient, tenant, platformEnv) {
|
|
49
27
|
const services = new Map();
|
|
50
28
|
const basePath = `/mesh-platform/${tenant}/${platformEnv}`;
|
|
@@ -86,9 +64,6 @@ async function discoverExternalServices(ssmClient, tenant, platformEnv) {
|
|
|
86
64
|
} while (nextToken);
|
|
87
65
|
return services;
|
|
88
66
|
}
|
|
89
|
-
// =============================================================================
|
|
90
|
-
// Non-secret field extraction
|
|
91
|
-
// =============================================================================
|
|
92
67
|
function extractNonSecretFields(fields, values) {
|
|
93
68
|
const result = {};
|
|
94
69
|
for (const [key, entry] of Object.entries(fields)) {
|
|
@@ -105,9 +80,6 @@ function extractNonSecretFields(fields, values) {
|
|
|
105
80
|
}
|
|
106
81
|
return result;
|
|
107
82
|
}
|
|
108
|
-
// =============================================================================
|
|
109
|
-
// SM helpers
|
|
110
|
-
// =============================================================================
|
|
111
83
|
function isResourceNotFound(err) {
|
|
112
84
|
const e = err;
|
|
113
85
|
return (e?.name === "ResourceNotFoundException" ||
|
|
@@ -178,9 +150,6 @@ async function listInstanceKeys(client, secretPrefix) {
|
|
|
178
150
|
} while (nextToken);
|
|
179
151
|
return keys;
|
|
180
152
|
}
|
|
181
|
-
// =============================================================================
|
|
182
|
-
// Migration logic
|
|
183
|
-
// =============================================================================
|
|
184
153
|
async function migrateService(smClient, meta, schema, opts) {
|
|
185
154
|
let migrated = 0;
|
|
186
155
|
let skipped = 0;
|
|
@@ -188,7 +157,6 @@ async function migrateService(smClient, meta, schema, opts) {
|
|
|
188
157
|
async function migrateOneSecret(secretId, label) {
|
|
189
158
|
const configId = `${secretId}/.config`;
|
|
190
159
|
try {
|
|
191
|
-
// Check if .config already exists
|
|
192
160
|
if (!opts.force) {
|
|
193
161
|
const exists = await secretExists(smClient, configId);
|
|
194
162
|
if (exists) {
|
|
@@ -197,14 +165,12 @@ async function migrateService(smClient, meta, schema, opts) {
|
|
|
197
165
|
return;
|
|
198
166
|
}
|
|
199
167
|
}
|
|
200
|
-
// Read the main secret
|
|
201
168
|
const values = await readSecret(smClient, secretId);
|
|
202
169
|
if (!values) {
|
|
203
170
|
logInfo(` SKIP ${label} — main secret empty or missing`);
|
|
204
171
|
skipped++;
|
|
205
172
|
return;
|
|
206
173
|
}
|
|
207
|
-
// Extract non-secret fields
|
|
208
174
|
const configValues = extractNonSecretFields(schema.fields, values);
|
|
209
175
|
if (opts.dryRun) {
|
|
210
176
|
const fieldCount = Object.keys(configValues).length;
|
|
@@ -222,9 +188,7 @@ async function migrateService(smClient, meta, schema, opts) {
|
|
|
222
188
|
errors++;
|
|
223
189
|
}
|
|
224
190
|
}
|
|
225
|
-
// Migrate the base secret
|
|
226
191
|
await migrateOneSecret(meta.secretPrefix, meta.name);
|
|
227
|
-
// Migrate multi-instance keys
|
|
228
192
|
if (schema.keyedBy) {
|
|
229
193
|
const keys = await listInstanceKeys(smClient, meta.secretPrefix);
|
|
230
194
|
for (const key of keys) {
|
|
@@ -233,9 +197,6 @@ async function migrateService(smClient, meta, schema, opts) {
|
|
|
233
197
|
}
|
|
234
198
|
return { migrated, skipped, errors };
|
|
235
199
|
}
|
|
236
|
-
// =============================================================================
|
|
237
|
-
// Main command
|
|
238
|
-
// =============================================================================
|
|
239
200
|
export async function migrateConfigCommand(opts) {
|
|
240
201
|
const context = detectContext(resolveStackOption(opts));
|
|
241
202
|
const region = opts.region ?? process.env.AWS_REGION ?? "us-east-2";
|
|
@@ -274,4 +235,3 @@ export async function migrateConfigCommand(opts) {
|
|
|
274
235
|
process.exit(1);
|
|
275
236
|
}
|
|
276
237
|
}
|
|
277
|
-
//# sourceMappingURL=migrate-config.js.map
|
|
@@ -1,35 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh secrets reindex — Rebuild a keyed external service's instance index.
|
|
3
|
-
*
|
|
4
|
-
* The instance index (`{secretPrefix}/.index`) is what `listInstances()`
|
|
5
|
-
* reads, and it is only as correct as its writers: `mesh secrets set --key`
|
|
6
|
-
* and the Hub maintain it as they create and delete instance secrets, but a
|
|
7
|
-
* per-key secret created or deleted OUT OF BAND (the AWS console, a raw SDK
|
|
8
|
-
* call) leaves it stale — the instance exists but is invisible, or is listed
|
|
9
|
-
* but gone. This command is the repair: it scans the real per-key secrets
|
|
10
|
-
* under the prefix with `secretsmanager:ListSecrets` (an operator-credential
|
|
11
|
-
* call — pods cannot make it, which is why the index exists at all) and
|
|
12
|
-
* rewrites the index to match.
|
|
13
|
-
*
|
|
14
|
-
* Usage:
|
|
15
|
-
* mesh secrets reindex external/symitar
|
|
16
|
-
* mesh secrets reindex external/symitar --dry-run
|
|
17
|
-
*
|
|
18
|
-
* The command detects tenant/stage from Pulumi config in the current
|
|
19
|
-
* directory, like `mesh secrets set`.
|
|
20
|
-
*/
|
|
21
1
|
import { SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
|
|
22
|
-
/**
|
|
23
|
-
* Scan the per-key secrets actually present under the prefix. Uses the shared
|
|
24
|
-
* `instanceKeyFromSecretName` filter, so "which secrets are instances" cannot
|
|
25
|
-
* drift from what `mesh secrets set` and the Hub consider an instance.
|
|
26
|
-
*/
|
|
27
2
|
export declare function scanInstanceKeys(client: SecretsManagerClient, secretPrefix: string): Promise<string[]>;
|
|
28
|
-
/**
|
|
29
|
-
* Whether the index can be left untouched. A malformed index never counts as
|
|
30
|
-
* matching — even when the diff is empty (zero per-key secrets): the whole
|
|
31
|
-
* point of the repair is to leave a well-formed index behind.
|
|
32
|
-
*/
|
|
33
3
|
export declare function indexAlreadyMatches(missing: string[], stale: string[], indexExists: boolean, malformed: boolean): boolean;
|
|
34
4
|
export declare function reindexCommand(servicePath: string | undefined, opts: {
|
|
35
5
|
stack?: string;
|
|
@@ -37,12 +7,4 @@ export declare function reindexCommand(servicePath: string | undefined, opts: {
|
|
|
37
7
|
region?: string;
|
|
38
8
|
dryRun?: boolean;
|
|
39
9
|
}): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Write the canonical index value for `keys`, creating the index secret when
|
|
42
|
-
* it does not exist. The create path warns that the secret is not
|
|
43
|
-
* stack-managed: the declaring stack also declares it, and created here
|
|
44
|
-
* first it is not in the stack's state, so the stack's next deploy fails on
|
|
45
|
-
* the name collision until the secret is imported or deleted.
|
|
46
|
-
*/
|
|
47
10
|
export declare function writeInstanceIndex(client: SecretsManagerClient, secretPrefix: string, serviceName: string, keys: string[]): Promise<void>;
|
|
48
|
-
//# sourceMappingURL=reindex.d.ts.map
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh secrets reindex — Rebuild a keyed external service's instance index.
|
|
3
|
-
*
|
|
4
|
-
* The instance index (`{secretPrefix}/.index`) is what `listInstances()`
|
|
5
|
-
* reads, and it is only as correct as its writers: `mesh secrets set --key`
|
|
6
|
-
* and the Hub maintain it as they create and delete instance secrets, but a
|
|
7
|
-
* per-key secret created or deleted OUT OF BAND (the AWS console, a raw SDK
|
|
8
|
-
* call) leaves it stale — the instance exists but is invisible, or is listed
|
|
9
|
-
* but gone. This command is the repair: it scans the real per-key secrets
|
|
10
|
-
* under the prefix with `secretsmanager:ListSecrets` (an operator-credential
|
|
11
|
-
* call — pods cannot make it, which is why the index exists at all) and
|
|
12
|
-
* rewrites the index to match.
|
|
13
|
-
*
|
|
14
|
-
* Usage:
|
|
15
|
-
* mesh secrets reindex external/symitar
|
|
16
|
-
* mesh secrets reindex external/symitar --dry-run
|
|
17
|
-
*
|
|
18
|
-
* The command detects tenant/stage from Pulumi config in the current
|
|
19
|
-
* directory, like `mesh secrets set`.
|
|
20
|
-
*/
|
|
21
1
|
import { SSMClient } from "@aws-sdk/client-ssm";
|
|
22
2
|
import { SecretsManagerClient, ListSecretsCommand, GetSecretValueCommand, PutSecretValueCommand, CreateSecretCommand, } from "@aws-sdk/client-secrets-manager";
|
|
23
3
|
import { buildInstanceIndexValue, instanceIndexSecretId, instanceKeyFromSecretName, parseInstanceIndex, } from "@mesh-tech/secrets";
|
|
@@ -25,11 +5,6 @@ import { detectContext } from "../../utils/context.js";
|
|
|
25
5
|
import { logInfo, logSuccess, logError } from "../../utils/log.js";
|
|
26
6
|
import { resolveStackOption } from "../../utils/stack-flag.js";
|
|
27
7
|
import { discoverExternalServices, ensureAwsCredentialsForStack, isResourceNotFound, } from "./set.js";
|
|
28
|
-
/**
|
|
29
|
-
* Scan the per-key secrets actually present under the prefix. Uses the shared
|
|
30
|
-
* `instanceKeyFromSecretName` filter, so "which secrets are instances" cannot
|
|
31
|
-
* drift from what `mesh secrets set` and the Hub consider an instance.
|
|
32
|
-
*/
|
|
33
8
|
export async function scanInstanceKeys(client, secretPrefix) {
|
|
34
9
|
const keys = [];
|
|
35
10
|
let nextToken;
|
|
@@ -47,11 +22,6 @@ export async function scanInstanceKeys(client, secretPrefix) {
|
|
|
47
22
|
} while (nextToken);
|
|
48
23
|
return keys;
|
|
49
24
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Whether the index can be left untouched. A malformed index never counts as
|
|
52
|
-
* matching — even when the diff is empty (zero per-key secrets): the whole
|
|
53
|
-
* point of the repair is to leave a well-formed index behind.
|
|
54
|
-
*/
|
|
55
25
|
export function indexAlreadyMatches(missing, stale, indexExists, malformed) {
|
|
56
26
|
return missing.length === 0 && stale.length === 0 && indexExists && !malformed;
|
|
57
27
|
}
|
|
@@ -85,7 +55,6 @@ export async function reindexCommand(servicePath, opts) {
|
|
|
85
55
|
}
|
|
86
56
|
const secretPrefix = svc.meta.secretPrefix;
|
|
87
57
|
const indexId = instanceIndexSecretId(secretPrefix);
|
|
88
|
-
// What the account actually holds vs what the index claims.
|
|
89
58
|
const actual = [...new Set(await scanInstanceKeys(smClient, secretPrefix))].sort();
|
|
90
59
|
let listed = [];
|
|
91
60
|
let indexExists = true;
|
|
@@ -124,13 +93,6 @@ export async function reindexCommand(servicePath, opts) {
|
|
|
124
93
|
await writeInstanceIndex(smClient, secretPrefix, serviceName, actual);
|
|
125
94
|
logSuccess(`Index rebuilt: ${indexId} now lists ${actual.length} instance(s).`);
|
|
126
95
|
}
|
|
127
|
-
/**
|
|
128
|
-
* Write the canonical index value for `keys`, creating the index secret when
|
|
129
|
-
* it does not exist. The create path warns that the secret is not
|
|
130
|
-
* stack-managed: the declaring stack also declares it, and created here
|
|
131
|
-
* first it is not in the stack's state, so the stack's next deploy fails on
|
|
132
|
-
* the name collision until the secret is imported or deleted.
|
|
133
|
-
*/
|
|
134
96
|
export async function writeInstanceIndex(client, secretPrefix, serviceName, keys) {
|
|
135
97
|
const indexId = instanceIndexSecretId(secretPrefix);
|
|
136
98
|
const secretString = buildInstanceIndexValue(keys);
|
|
@@ -154,4 +116,3 @@ export async function writeInstanceIndex(client, secretPrefix, serviceName, keys
|
|
|
154
116
|
`secret into the stack before its next deploy.`);
|
|
155
117
|
}
|
|
156
118
|
}
|
|
157
|
-
//# sourceMappingURL=reindex.js.map
|
|
@@ -1,34 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh secrets set — Set credentials for an external service.
|
|
3
|
-
*
|
|
4
|
-
* Reads the credential field schema from SSM (written by ExternalService),
|
|
5
|
-
* prompts interactively for each field, and writes to Secrets Manager.
|
|
6
|
-
*
|
|
7
|
-
* Supports nested credential schemas: groups render as sections with headers,
|
|
8
|
-
* and the stored JSON mirrors the nested structure exactly.
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* mesh secrets set external/symitar # single-instance
|
|
12
|
-
* mesh secrets set external/symitar --key=12345 # multi-instance (specific key)
|
|
13
|
-
* mesh secrets set external/symitar --all # include optional fields
|
|
14
|
-
* mesh secrets set external/symitar --non-interactive --json='{"baseUrl":"..."}'
|
|
15
|
-
*
|
|
16
|
-
* The command detects tenant/stage from Pulumi config in the current directory.
|
|
17
|
-
*/
|
|
18
1
|
import { SSMClient } from "@aws-sdk/client-ssm";
|
|
19
2
|
import { SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
|
|
20
|
-
/**
|
|
21
|
-
* Ensure AWS credentials are available for the SSM/Secrets Manager calls. If the
|
|
22
|
-
* environment has none, assume the stack's `mesh:deployerRole` — which triggers
|
|
23
|
-
* `mesh login` automatically when there's no active session. No-op when
|
|
24
|
-
* credentials are already present or the stack/role can't be resolved.
|
|
25
|
-
*
|
|
26
|
-
* The stack is the locally-detected stage (from the `Pulumi.<stage>.yaml`
|
|
27
|
-
* filename) — NOT `pulumi stack --show-name`, which would itself need creds to
|
|
28
|
-
* read the backend (the chicken-and-egg this is meant to avoid).
|
|
29
|
-
*/
|
|
30
3
|
export declare function ensureAwsCredentialsForStack(stack: string | undefined): Promise<void>;
|
|
31
|
-
/** Leaf field in the credential schema */
|
|
32
4
|
interface SchemaField {
|
|
33
5
|
type: "field";
|
|
34
6
|
name: string;
|
|
@@ -36,14 +8,12 @@ interface SchemaField {
|
|
|
36
8
|
secret: boolean;
|
|
37
9
|
optional: boolean;
|
|
38
10
|
}
|
|
39
|
-
/** Group of fields (may nest further) */
|
|
40
11
|
interface SchemaGroup {
|
|
41
12
|
type: "group";
|
|
42
13
|
name: string;
|
|
43
14
|
description: string;
|
|
44
15
|
fields: Record<string, SchemaField | SchemaGroup>;
|
|
45
16
|
}
|
|
46
|
-
/** A schema entry is either a leaf field or a nested group */
|
|
47
17
|
type SchemaEntry = SchemaField | SchemaGroup;
|
|
48
18
|
export interface CredentialSchema {
|
|
49
19
|
fields: Record<string, SchemaEntry>;
|
|
@@ -68,22 +38,5 @@ export declare function setCommand(servicePath: string | undefined, opts: {
|
|
|
68
38
|
region?: string;
|
|
69
39
|
}): Promise<void>;
|
|
70
40
|
export declare function isResourceNotFound(err: unknown): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Add an instance key to the service's instance index at
|
|
73
|
-
* `{secretPrefix}/.index` — the list `listInstances()` reads. Read-modify-
|
|
74
|
-
* write: a MISSING index is created from just this key (the deploy normally
|
|
75
|
-
* seeds an empty one), an already-listed key is a no-op. A MALFORMED index
|
|
76
|
-
* is deliberately left alone (warn only): rebuilding it from just this key
|
|
77
|
-
* would silently drop the rest of the fleet from the list, so the full
|
|
78
|
-
* repair belongs to `mesh secrets reindex`. The read-modify-write itself is
|
|
79
|
-
* unguarded — Secrets Manager has no conditional put — so two concurrent
|
|
80
|
-
* writers to the same service can drop a key; same repair.
|
|
81
|
-
*
|
|
82
|
-
* Non-fatal by design, like the `.config` mirror: the credential itself is
|
|
83
|
-
* already written, so failing the whole command here would report a write
|
|
84
|
-
* that succeeded as failed. The cost of skipping is an instance invisible to
|
|
85
|
-
* `listInstances()` until repaired — the warning names the repair.
|
|
86
|
-
*/
|
|
87
41
|
export declare function addKeyToInstanceIndex(client: SecretsManagerClient, secretPrefix: string, key: string, serviceName: string): Promise<void>;
|
|
88
42
|
export {};
|
|
89
|
-
//# sourceMappingURL=set.d.ts.map
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh secrets set — Set credentials for an external service.
|
|
3
|
-
*
|
|
4
|
-
* Reads the credential field schema from SSM (written by ExternalService),
|
|
5
|
-
* prompts interactively for each field, and writes to Secrets Manager.
|
|
6
|
-
*
|
|
7
|
-
* Supports nested credential schemas: groups render as sections with headers,
|
|
8
|
-
* and the stored JSON mirrors the nested structure exactly.
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* mesh secrets set external/symitar # single-instance
|
|
12
|
-
* mesh secrets set external/symitar --key=12345 # multi-instance (specific key)
|
|
13
|
-
* mesh secrets set external/symitar --all # include optional fields
|
|
14
|
-
* mesh secrets set external/symitar --non-interactive --json='{"baseUrl":"..."}'
|
|
15
|
-
*
|
|
16
|
-
* The command detects tenant/stage from Pulumi config in the current directory.
|
|
17
|
-
*/
|
|
18
1
|
import { SSMClient, GetParametersByPathCommand, } from "@aws-sdk/client-ssm";
|
|
19
2
|
import { SecretsManagerClient, GetSecretValueCommand, PutSecretValueCommand, CreateSecretCommand, } from "@aws-sdk/client-secrets-manager";
|
|
20
3
|
import input from "@inquirer/input";
|
|
@@ -25,16 +8,6 @@ import { logInfo, logSuccess, logError } from "../../utils/log.js";
|
|
|
25
8
|
import { resolveStackOption } from "../../utils/stack-flag.js";
|
|
26
9
|
import { findAppRoot, readStackConfig } from "../../utils/pulumi.js";
|
|
27
10
|
import { resolveAwsCredentials } from "../../utils/aws-auth.js";
|
|
28
|
-
/**
|
|
29
|
-
* Ensure AWS credentials are available for the SSM/Secrets Manager calls. If the
|
|
30
|
-
* environment has none, assume the stack's `mesh:deployerRole` — which triggers
|
|
31
|
-
* `mesh login` automatically when there's no active session. No-op when
|
|
32
|
-
* credentials are already present or the stack/role can't be resolved.
|
|
33
|
-
*
|
|
34
|
-
* The stack is the locally-detected stage (from the `Pulumi.<stage>.yaml`
|
|
35
|
-
* filename) — NOT `pulumi stack --show-name`, which would itself need creds to
|
|
36
|
-
* read the backend (the chicken-and-egg this is meant to avoid).
|
|
37
|
-
*/
|
|
38
11
|
export async function ensureAwsCredentialsForStack(stack) {
|
|
39
12
|
if (process.env.AWS_ACCESS_KEY_ID || process.env.AWS_SESSION_TOKEN)
|
|
40
13
|
return;
|
|
@@ -52,14 +25,6 @@ export async function ensureAwsCredentialsForStack(stack) {
|
|
|
52
25
|
delete process.env.AWS_PROFILE;
|
|
53
26
|
}
|
|
54
27
|
}
|
|
55
|
-
// =============================================================================
|
|
56
|
-
// Schema compatibility
|
|
57
|
-
// =============================================================================
|
|
58
|
-
/**
|
|
59
|
-
* Normalize a schema entry from SSM. Handles both:
|
|
60
|
-
* - New format: `{ type: "field"|"group", ... }`
|
|
61
|
-
* - Legacy format: `{ name, description, secret, optional }` (no type marker)
|
|
62
|
-
*/
|
|
63
28
|
function normalizeEntry(raw) {
|
|
64
29
|
if (raw.type === "group" && raw.fields) {
|
|
65
30
|
return {
|
|
@@ -69,7 +34,6 @@ function normalizeEntry(raw) {
|
|
|
69
34
|
fields: normalizeFields(raw.fields),
|
|
70
35
|
};
|
|
71
36
|
}
|
|
72
|
-
// Leaf field (explicit type: "field" or legacy without type)
|
|
73
37
|
return {
|
|
74
38
|
type: "field",
|
|
75
39
|
name: raw.name ?? "",
|
|
@@ -81,9 +45,6 @@ function normalizeEntry(raw) {
|
|
|
81
45
|
function normalizeFields(raw) {
|
|
82
46
|
return Object.fromEntries(Object.entries(raw).map(([key, value]) => [key, normalizeEntry(value)]));
|
|
83
47
|
}
|
|
84
|
-
// =============================================================================
|
|
85
|
-
// SSM discovery
|
|
86
|
-
// =============================================================================
|
|
87
48
|
export async function discoverExternalServices(ssmClient, tenant, platformEnv) {
|
|
88
49
|
const services = new Map();
|
|
89
50
|
const basePath = `/mesh-platform/${tenant}/${platformEnv}`;
|
|
@@ -97,7 +58,6 @@ export async function discoverExternalServices(ssmClient, tenant, platformEnv) {
|
|
|
97
58
|
for (const param of response.Parameters ?? []) {
|
|
98
59
|
if (!param.Name || !param.Value)
|
|
99
60
|
continue;
|
|
100
|
-
// Match: .../external-services/{name}/meta
|
|
101
61
|
const metaMatch = param.Name.match(/\/external-services\/([^/]+)\/meta$/);
|
|
102
62
|
if (metaMatch?.[1]) {
|
|
103
63
|
const serviceName = metaMatch[1];
|
|
@@ -105,7 +65,6 @@ export async function discoverExternalServices(ssmClient, tenant, platformEnv) {
|
|
|
105
65
|
const existing = services.get(serviceName);
|
|
106
66
|
services.set(serviceName, { ...existing, meta });
|
|
107
67
|
}
|
|
108
|
-
// Match: .../external-services/{name}/credentials
|
|
109
68
|
const credMatch = param.Name.match(/\/external-services\/([^/]+)\/credentials$/);
|
|
110
69
|
if (credMatch?.[1]) {
|
|
111
70
|
const serviceName = credMatch[1];
|
|
@@ -127,31 +86,18 @@ export async function discoverExternalServices(ssmClient, tenant, platformEnv) {
|
|
|
127
86
|
} while (nextToken);
|
|
128
87
|
return services;
|
|
129
88
|
}
|
|
130
|
-
// =============================================================================
|
|
131
|
-
// Nested value helpers
|
|
132
|
-
// =============================================================================
|
|
133
|
-
// =============================================================================
|
|
134
|
-
// Interactive prompts (recursive)
|
|
135
|
-
// =============================================================================
|
|
136
|
-
/**
|
|
137
|
-
* Recursively prompt for all fields in the schema.
|
|
138
|
-
* Groups render as section headers; leaf fields get input prompts.
|
|
139
|
-
*/
|
|
140
89
|
async function promptFields(fields, existing, result, opts, depth = 0) {
|
|
141
90
|
for (const [fieldKey, entry] of Object.entries(fields)) {
|
|
142
91
|
if (entry.type === "group") {
|
|
143
|
-
// Section header
|
|
144
92
|
const indent = " ".repeat(depth);
|
|
145
93
|
console.error("");
|
|
146
94
|
console.error(`${indent}── ${entry.name} ──`);
|
|
147
|
-
// Ensure nested object exists
|
|
148
95
|
const existingGroup = (existing[fieldKey] ?? {});
|
|
149
96
|
const resultGroup = {};
|
|
150
97
|
await promptFields(entry.fields, existingGroup, resultGroup, opts, depth + 1);
|
|
151
98
|
result[fieldKey] = resultGroup;
|
|
152
99
|
}
|
|
153
100
|
else {
|
|
154
|
-
// Leaf field
|
|
155
101
|
if (entry.optional && !opts.all) {
|
|
156
102
|
const existingVal = existing[fieldKey];
|
|
157
103
|
if (existingVal !== undefined && existingVal !== "") {
|
|
@@ -168,7 +114,6 @@ async function promptFields(fields, existing, result, opts, depth = 0) {
|
|
|
168
114
|
let value;
|
|
169
115
|
if (entry.secret) {
|
|
170
116
|
value = await password({ message: label, mask: "*" });
|
|
171
|
-
// Keep existing if user just pressed Enter
|
|
172
117
|
if (!value && hasExisting) {
|
|
173
118
|
value = existingVal;
|
|
174
119
|
}
|
|
@@ -183,9 +128,6 @@ async function promptFields(fields, existing, result, opts, depth = 0) {
|
|
|
183
128
|
}
|
|
184
129
|
}
|
|
185
130
|
}
|
|
186
|
-
// =============================================================================
|
|
187
|
-
// Summary display (recursive)
|
|
188
|
-
// =============================================================================
|
|
189
131
|
function displaySummary(fields, values, depth = 0) {
|
|
190
132
|
const indent = " ".repeat(depth);
|
|
191
133
|
for (const [key, entry] of Object.entries(fields)) {
|
|
@@ -203,32 +145,23 @@ function displaySummary(fields, values, depth = 0) {
|
|
|
203
145
|
}
|
|
204
146
|
}
|
|
205
147
|
}
|
|
206
|
-
// =============================================================================
|
|
207
|
-
// Main command
|
|
208
|
-
// =============================================================================
|
|
209
148
|
export async function setCommand(servicePath, opts) {
|
|
210
149
|
const stackOpt = resolveStackOption(opts);
|
|
211
150
|
const context = detectContext(stackOpt);
|
|
212
151
|
const region = opts.region ?? process.env.AWS_REGION ?? "us-east-2";
|
|
213
|
-
// Ensure AWS credentials: if none in the environment, assume the stack's
|
|
214
|
-
// deployer role — which triggers `mesh login` automatically when there's no
|
|
215
|
-
// active session (instead of failing with a credentials error).
|
|
216
152
|
await ensureAwsCredentialsForStack(stackOpt ?? context.stage);
|
|
217
153
|
const ssmClient = new SSMClient({ region });
|
|
218
154
|
const smClient = new SecretsManagerClient({ region });
|
|
219
|
-
// Discover all external services
|
|
220
155
|
const services = await discoverExternalServices(ssmClient, context.tenant, context.platformEnv);
|
|
221
156
|
if (services.size === 0) {
|
|
222
157
|
logError("No external services found. Deploy an ExternalService first:\n" +
|
|
223
158
|
" new mesh.apps.ExternalService(\"symitar\", { env, credentials: { ... } })");
|
|
224
159
|
process.exit(1);
|
|
225
160
|
}
|
|
226
|
-
// Parse service name from path (e.g., "external/symitar" → "symitar")
|
|
227
161
|
let serviceName;
|
|
228
162
|
if (servicePath) {
|
|
229
163
|
serviceName = servicePath.replace(/^external\//, "");
|
|
230
164
|
}
|
|
231
|
-
// If no service specified or not found, list available
|
|
232
165
|
if (!serviceName || !services.has(serviceName)) {
|
|
233
166
|
if (serviceName) {
|
|
234
167
|
logError(`External service "${serviceName}" not found.`);
|
|
@@ -248,7 +181,6 @@ export async function setCommand(servicePath, opts) {
|
|
|
248
181
|
logError(`No credential schema found for "${serviceName}".`);
|
|
249
182
|
process.exit(1);
|
|
250
183
|
}
|
|
251
|
-
// Determine secret path
|
|
252
184
|
const secretPrefix = svc.meta.secretPrefix;
|
|
253
185
|
const secretId = opts.key ? `${secretPrefix}/${opts.key}` : secretPrefix;
|
|
254
186
|
if (schema.keyedBy && !opts.key) {
|
|
@@ -256,14 +188,11 @@ export async function setCommand(servicePath, opts) {
|
|
|
256
188
|
`Specify an instance:\n mesh secrets set external/${serviceName} --key=<${schema.keyedBy}>`);
|
|
257
189
|
process.exit(1);
|
|
258
190
|
}
|
|
259
|
-
// A reserved dot-name (`.index`, `.config`) or a path-bearing key would
|
|
260
|
-
// write credential JSON over the service's bookkeeping secrets.
|
|
261
191
|
if (opts.key && !isInstanceKey(opts.key)) {
|
|
262
192
|
logError(`Invalid instance key "${opts.key}": keys must not contain "/", start with ".", ` +
|
|
263
193
|
`or end with ".config" — those names are reserved for the index and config mirrors.`);
|
|
264
194
|
process.exit(1);
|
|
265
195
|
}
|
|
266
|
-
// Read existing values (if any)
|
|
267
196
|
let existing = {};
|
|
268
197
|
try {
|
|
269
198
|
const response = await smClient.send(new GetSecretValueCommand({ SecretId: secretId }));
|
|
@@ -275,9 +204,7 @@ export async function setCommand(servicePath, opts) {
|
|
|
275
204
|
if (!isResourceNotFound(err)) {
|
|
276
205
|
throw err;
|
|
277
206
|
}
|
|
278
|
-
// Secret doesn't exist yet (multi-instance key) — will create
|
|
279
207
|
}
|
|
280
|
-
// Non-interactive mode: JSON input (deep-merged)
|
|
281
208
|
if (opts.json) {
|
|
282
209
|
let values;
|
|
283
210
|
try {
|
|
@@ -296,7 +223,6 @@ export async function setCommand(servicePath, opts) {
|
|
|
296
223
|
logSuccess(`Credentials written to ${secretId}`);
|
|
297
224
|
return;
|
|
298
225
|
}
|
|
299
|
-
// Interactive mode
|
|
300
226
|
console.error("");
|
|
301
227
|
logInfo(`Setting credentials for: ${svc.meta.description || serviceName}`);
|
|
302
228
|
if (opts.key) {
|
|
@@ -306,7 +232,6 @@ export async function setCommand(servicePath, opts) {
|
|
|
306
232
|
const values = {};
|
|
307
233
|
await promptFields(schema.fields, existing, values, { all: !!opts.all });
|
|
308
234
|
console.error("");
|
|
309
|
-
// Merge and write
|
|
310
235
|
const merged = deepMerge(existing, values);
|
|
311
236
|
await writeSecret(smClient, secretId, merged, svc.meta);
|
|
312
237
|
await writeConfigMirror(smClient, secretId, schema, merged, svc.meta);
|
|
@@ -314,14 +239,10 @@ export async function setCommand(servicePath, opts) {
|
|
|
314
239
|
await addKeyToInstanceIndex(smClient, secretPrefix, opts.key, serviceName);
|
|
315
240
|
}
|
|
316
241
|
logSuccess(`Credentials written to ${secretId}`);
|
|
317
|
-
// Show summary
|
|
318
242
|
console.error("\nStored fields:");
|
|
319
243
|
displaySummary(schema.fields, merged);
|
|
320
244
|
console.error("");
|
|
321
245
|
}
|
|
322
|
-
// =============================================================================
|
|
323
|
-
// Helpers
|
|
324
|
-
// =============================================================================
|
|
325
246
|
export function isResourceNotFound(err) {
|
|
326
247
|
const e = err;
|
|
327
248
|
return (e?.name === "ResourceNotFoundException" ||
|
|
@@ -330,7 +251,6 @@ export function isResourceNotFound(err) {
|
|
|
330
251
|
e?.code === "ResourceNotFoundException" ||
|
|
331
252
|
(typeof e?.message === "string" && e.message.includes("ResourceNotFoundException")));
|
|
332
253
|
}
|
|
333
|
-
/** Deep merge two objects. Source values overwrite target at leaf level. */
|
|
334
254
|
function deepMerge(target, source) {
|
|
335
255
|
const result = { ...target };
|
|
336
256
|
for (const [key, value] of Object.entries(source)) {
|
|
@@ -358,7 +278,6 @@ async function writeSecret(client, secretId, values, meta) {
|
|
|
358
278
|
}
|
|
359
279
|
catch (err) {
|
|
360
280
|
if (isResourceNotFound(err)) {
|
|
361
|
-
// Multi-instance: create the per-key secret
|
|
362
281
|
await client.send(new CreateSecretCommand({
|
|
363
282
|
Name: secretId,
|
|
364
283
|
Description: `External service credentials for ${meta.name} (instance)`,
|
|
@@ -374,10 +293,6 @@ async function writeSecret(client, secretId, values, meta) {
|
|
|
374
293
|
}
|
|
375
294
|
}
|
|
376
295
|
}
|
|
377
|
-
/**
|
|
378
|
-
* Extract non-secret fields from merged values based on the credential schema.
|
|
379
|
-
* Walks groups recursively, preserving structure.
|
|
380
|
-
*/
|
|
381
296
|
function extractNonSecretFields(fields, values) {
|
|
382
297
|
const result = {};
|
|
383
298
|
for (const [key, entry] of Object.entries(fields)) {
|
|
@@ -394,22 +309,6 @@ function extractNonSecretFields(fields, values) {
|
|
|
394
309
|
}
|
|
395
310
|
return result;
|
|
396
311
|
}
|
|
397
|
-
/**
|
|
398
|
-
* Add an instance key to the service's instance index at
|
|
399
|
-
* `{secretPrefix}/.index` — the list `listInstances()` reads. Read-modify-
|
|
400
|
-
* write: a MISSING index is created from just this key (the deploy normally
|
|
401
|
-
* seeds an empty one), an already-listed key is a no-op. A MALFORMED index
|
|
402
|
-
* is deliberately left alone (warn only): rebuilding it from just this key
|
|
403
|
-
* would silently drop the rest of the fleet from the list, so the full
|
|
404
|
-
* repair belongs to `mesh secrets reindex`. The read-modify-write itself is
|
|
405
|
-
* unguarded — Secrets Manager has no conditional put — so two concurrent
|
|
406
|
-
* writers to the same service can drop a key; same repair.
|
|
407
|
-
*
|
|
408
|
-
* Non-fatal by design, like the `.config` mirror: the credential itself is
|
|
409
|
-
* already written, so failing the whole command here would report a write
|
|
410
|
-
* that succeeded as failed. The cost of skipping is an instance invisible to
|
|
411
|
-
* `listInstances()` until repaired — the warning names the repair.
|
|
412
|
-
*/
|
|
413
312
|
export async function addKeyToInstanceIndex(client, secretPrefix, key, serviceName) {
|
|
414
313
|
const indexId = instanceIndexSecretId(secretPrefix);
|
|
415
314
|
try {
|
|
@@ -421,7 +320,6 @@ export async function addKeyToInstanceIndex(client, secretPrefix, key, serviceNa
|
|
|
421
320
|
catch (err) {
|
|
422
321
|
if (!isResourceNotFound(err))
|
|
423
322
|
throw err;
|
|
424
|
-
// Pre-index deployment: the write below creates the index.
|
|
425
323
|
}
|
|
426
324
|
if (keys.includes(key))
|
|
427
325
|
return;
|
|
@@ -441,9 +339,6 @@ export async function addKeyToInstanceIndex(client, secretPrefix, key, serviceNa
|
|
|
441
339
|
{ Key: "mesh:service", Value: serviceName },
|
|
442
340
|
],
|
|
443
341
|
}));
|
|
444
|
-
// The declaring stack also declares this secret; created here first,
|
|
445
|
-
// it is not in the stack's state, and the stack's next deploy fails on
|
|
446
|
-
// the name collision until the secret is imported or deleted.
|
|
447
342
|
logInfo(`Created ${indexId} OUT OF BAND — the declaring stack does not manage it. ` +
|
|
448
343
|
`Deploy the declaring stack (it creates the index) before writing keys, or ` +
|
|
449
344
|
`import this secret into the stack before its next deploy.`);
|
|
@@ -481,8 +376,6 @@ async function writeConfigMirror(client, secretId, schema, merged, meta) {
|
|
|
481
376
|
}
|
|
482
377
|
}
|
|
483
378
|
catch (err) {
|
|
484
|
-
// Non-fatal: log warning but don't fail the main write
|
|
485
379
|
logInfo(`Warning: failed to write .config mirror to ${configId}: ${err}`);
|
|
486
380
|
}
|
|
487
381
|
}
|
|
488
|
-
//# sourceMappingURL=set.js.map
|