@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,66 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zitadel seeding for the `mesh start` local platform — the `mesh login local`
|
|
3
|
-
* path (P1 critical path, design §2.1 seeding).
|
|
4
|
-
*
|
|
5
|
-
* Mirrors what ZitadelPlatformIdentity provisions in the cloud, via the
|
|
6
|
-
* management REST API using the first-instance machine user's PAT (written to
|
|
7
|
-
* the zitadel_machinekey volume by the compose bootstrap). Org structure
|
|
8
|
-
* follows the approved Zitadel tenant-auth pattern: everything here lives in
|
|
9
|
-
* the PLATFORM org (`mesh` — platform-layer creds home, named by the
|
|
10
|
-
* compose first-instance config); app tenants get their own orgs, created by
|
|
11
|
-
* `mesh dev --local` (see auth-provision.ts):
|
|
12
|
-
* - project "mesh-cli" (pattern naming: project per app — the CLI is a
|
|
13
|
-
* platform-level client feature)
|
|
14
|
-
* - native OIDC application "cli" inside it (PKCE + device code, no
|
|
15
|
-
* secret — the same shape as ZitadelPlatformIdentity's cliApp, plus
|
|
16
|
-
* devMode for http)
|
|
17
|
-
* - two human test users (dev@local.mesh, ops@local.mesh)
|
|
18
|
-
* - registry parity: /mesh-platform/local/dev/platform/zitadel in the local
|
|
19
|
-
* AWS fabric ({endpoint, cliClientId} — what `mesh login` SSM discovery
|
|
20
|
-
* reads) and temporal/test-users entries (what `mesh dev test-user` reads)
|
|
21
|
-
* - the `local` CLI login context in ~/.config/mesh/config.json, so
|
|
22
|
-
* `mesh login local` works with zero discovery.
|
|
23
|
-
*
|
|
24
|
-
* Idempotent: search-before-create for project/app, "already exists" is
|
|
25
|
-
* success for users, SSM params overwrite.
|
|
26
|
-
*/
|
|
27
1
|
export declare const ZITADEL_ISSUER = "http://localhost:8080";
|
|
28
2
|
export declare const LOGIN_CONTEXT = "local";
|
|
29
|
-
/** The platform org — home of platform-layer creds, same name as the cloud
|
|
30
|
-
* platform tenant. Set by ZITADEL_FIRSTINSTANCE_ORG_NAME in the compose;
|
|
31
|
-
* app tenants (incl. the default `local`) get their own orgs on demand. */
|
|
32
3
|
export declare const PLATFORM_ORG = "mesh";
|
|
33
|
-
/**
|
|
34
|
-
* Approved-pattern naming inside the platform org: project per app
|
|
35
|
-
* (lowercase), application per service/client inside it. The CLI is a
|
|
36
|
-
* platform-level client feature → project `mesh-cli`, application `cli`.
|
|
37
|
-
* (The cloud's legacy catch-all "Platform" project is being retired by the
|
|
38
|
-
* pattern doc's spec items; local starts pattern-true.)
|
|
39
|
-
*/
|
|
40
4
|
export declare const CLI_PROJECT_NAME = "mesh-cli";
|
|
41
5
|
export declare const CLI_APP_NAME = "cli";
|
|
42
6
|
export declare const CLI_REDIRECT_URI = "http://localhost:9876/callback";
|
|
43
|
-
/**
|
|
44
|
-
* The Hub's own auth config (pattern-true: the Hub is a platform app →
|
|
45
|
-
* project `hub` in the platform org, application per service). The `ui`
|
|
46
|
-
* application backs the oauth2-proxy that fronts the Hub UI — the same
|
|
47
|
-
* sidecar topology `mesh.apps.Service` deploys with `auth.provider: "mesh"`.
|
|
48
|
-
* Roles ARE the Hub's vocabulary — imported from the module the deployed Hub's
|
|
49
|
-
* infra declares them from, so a role that exists in the cloud is grantable
|
|
50
|
-
* locally too (MESH-2504), including the tenant-keyed restricted keys
|
|
51
|
-
* (`vendor:<tenant>`, `auditor:<tenant>`) that carry the only scope the policy
|
|
52
|
-
* actually reads. The bare keys alone are not a usable local vocabulary: a bare
|
|
53
|
-
* restricted grant names no tenant, so `checkPolicy` matches it against nothing
|
|
54
|
-
* and it authorizes no tenant-scoped read.
|
|
55
|
-
*/
|
|
56
7
|
export declare const HUB_PROJECT_NAME = "hub";
|
|
57
8
|
export declare const HUB_APP_NAME = "ui";
|
|
58
|
-
/** Registered on the seeded Hub app; the default-port URI is always included
|
|
59
|
-
* so a later port switch never strands the app config. Zitadel's devMode only
|
|
60
|
-
* relaxes the https requirement — every redirect URI must still be registered
|
|
61
|
-
* exactly, so an existing app is RECONCILED (union-merged) on each seed run.
|
|
62
|
-
* Functions, not constants: hubPort() must be read at call time so tests and
|
|
63
|
-
* programmatic callers that set MESH_HUB_PORT after import see the override. */
|
|
64
9
|
export declare const hubRedirectUri: () => string;
|
|
65
10
|
export declare const HUB_DEFAULT_REDIRECT_URI = "http://localhost:9000/oauth2/callback";
|
|
66
11
|
export declare const HUB_ROLES: string[];
|
|
@@ -73,13 +18,7 @@ export interface LocalTestUser {
|
|
|
73
18
|
lastName: string;
|
|
74
19
|
password: string;
|
|
75
20
|
}
|
|
76
|
-
/** Seeded human test users — plainly-labeled dev-grade credentials. */
|
|
77
21
|
export declare const TEST_USERS: LocalTestUser[];
|
|
78
|
-
/**
|
|
79
|
-
* The CLI OIDC app payload — the same shape ZitadelPlatformIdentity creates in
|
|
80
|
-
* the cloud (native, PKCE, device code, JWT access tokens, role assertions),
|
|
81
|
-
* plus devMode so Zitadel accepts the http:// redirect locally.
|
|
82
|
-
*/
|
|
83
22
|
export declare function buildCliAppPayload(): {
|
|
84
23
|
name: string;
|
|
85
24
|
redirectUris: string[];
|
|
@@ -93,35 +32,23 @@ export declare function buildCliAppPayload(): {
|
|
|
93
32
|
idTokenUserinfoAssertion: boolean;
|
|
94
33
|
devMode: boolean;
|
|
95
34
|
};
|
|
96
|
-
/** Read the seeder PAT the compose bootstrap wrote to the machinekey volume. */
|
|
97
35
|
export declare function readSeederPat(): string;
|
|
98
|
-
/** Call the local Zitadel REST API; `orgId` sets the org context header. */
|
|
99
36
|
export declare function api(pat: string, method: string, apiPath: string, body?: unknown, orgId?: string): Promise<any>;
|
|
100
37
|
export declare const isAlreadyExists: (err: any) => boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Shared search-before-create for Zitadel projects: return the existing
|
|
103
|
-
* project's id, else create it. Every ensure*Project in the local seeding
|
|
104
|
-
* and auth-provisioning goes through this.
|
|
105
|
-
*/
|
|
106
38
|
export declare function ensureZitadelProject(pat: string, name: string, opts?: {
|
|
107
39
|
orgId?: string;
|
|
108
40
|
describe?: string;
|
|
109
41
|
logExisting?: boolean;
|
|
110
42
|
}): Promise<string>;
|
|
111
|
-
/** Shared name-equals application search; returns the raw app or undefined. */
|
|
112
43
|
export declare function searchZitadelApp(pat: string, projectId: string, name: string, orgId?: string): Promise<any | undefined>;
|
|
113
44
|
export interface HubAuthConfig {
|
|
114
45
|
clientId: string;
|
|
115
46
|
clientSecret: string;
|
|
116
47
|
cookieSecret: string;
|
|
117
|
-
/** The Hub's own Zitadel project — what its authz pointer names (§7.1). */
|
|
118
48
|
projectId: string;
|
|
119
49
|
}
|
|
120
|
-
/** Where the Hub's oauth2-proxy credentials persist between runs (the local
|
|
121
|
-
* analog of the K8s Secret the Service component creates for the sidecar). */
|
|
122
50
|
export declare function hubAuthPath(): string;
|
|
123
51
|
export declare function readHubAuth(): HubAuthConfig | null;
|
|
124
|
-
/** The slice of Zitadel's OIDC app shape the reconcile below reads. */
|
|
125
52
|
interface HubOidcApp {
|
|
126
53
|
id: string;
|
|
127
54
|
oidcConfig?: {
|
|
@@ -137,16 +64,8 @@ interface HubOidcApp {
|
|
|
137
64
|
devMode?: boolean;
|
|
138
65
|
};
|
|
139
66
|
}
|
|
140
|
-
/** Union-merge the current-port redirect URIs into an existing Hub app's OIDC
|
|
141
|
-
* config. Needed whenever the app was seeded under a different MESH_HUB_PORT:
|
|
142
|
-
* devMode does NOT exempt an unregistered redirect_uri (Zitadel rejects the
|
|
143
|
-
* authorize call with "redirect_uri is missing in the client configuration"),
|
|
144
|
-
* it only permits http://. No-op when everything is already registered.
|
|
145
|
-
* Exported for tests. */
|
|
146
67
|
export declare function reconcileHubRedirectUris(pat: string, projectId: string, app: HubOidcApp): Promise<void>;
|
|
147
|
-
/** Seed the Hub's auth config; persists oauth2-proxy credentials locally. */
|
|
148
68
|
export declare function seedHubAuth(pat: string): Promise<HubAuthConfig>;
|
|
149
|
-
/** Secrets Manager id the Hub reads its Zitadel admin key from (opsHubSecretName). */
|
|
150
69
|
export declare const OPS_HUB_SECRET_ID = "mesh/local/dev/zitadel/ops-hub";
|
|
151
70
|
export interface ZitadelSeedResult {
|
|
152
71
|
projectId: string;
|
|
@@ -155,4 +74,3 @@ export interface ZitadelSeedResult {
|
|
|
155
74
|
}
|
|
156
75
|
export declare function seedZitadel(awsConfig: object): Promise<ZitadelSeedResult>;
|
|
157
76
|
export {};
|
|
158
|
-
//# sourceMappingURL=seed-zitadel.d.ts.map
|
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zitadel seeding for the `mesh start` local platform — the `mesh login local`
|
|
3
|
-
* path (P1 critical path, design §2.1 seeding).
|
|
4
|
-
*
|
|
5
|
-
* Mirrors what ZitadelPlatformIdentity provisions in the cloud, via the
|
|
6
|
-
* management REST API using the first-instance machine user's PAT (written to
|
|
7
|
-
* the zitadel_machinekey volume by the compose bootstrap). Org structure
|
|
8
|
-
* follows the approved Zitadel tenant-auth pattern: everything here lives in
|
|
9
|
-
* the PLATFORM org (`mesh` — platform-layer creds home, named by the
|
|
10
|
-
* compose first-instance config); app tenants get their own orgs, created by
|
|
11
|
-
* `mesh dev --local` (see auth-provision.ts):
|
|
12
|
-
* - project "mesh-cli" (pattern naming: project per app — the CLI is a
|
|
13
|
-
* platform-level client feature)
|
|
14
|
-
* - native OIDC application "cli" inside it (PKCE + device code, no
|
|
15
|
-
* secret — the same shape as ZitadelPlatformIdentity's cliApp, plus
|
|
16
|
-
* devMode for http)
|
|
17
|
-
* - two human test users (dev@local.mesh, ops@local.mesh)
|
|
18
|
-
* - registry parity: /mesh-platform/local/dev/platform/zitadel in the local
|
|
19
|
-
* AWS fabric ({endpoint, cliClientId} — what `mesh login` SSM discovery
|
|
20
|
-
* reads) and temporal/test-users entries (what `mesh dev test-user` reads)
|
|
21
|
-
* - the `local` CLI login context in ~/.config/mesh/config.json, so
|
|
22
|
-
* `mesh login local` works with zero discovery.
|
|
23
|
-
*
|
|
24
|
-
* Idempotent: search-before-create for project/app, "already exists" is
|
|
25
|
-
* success for users, SSM params overwrite.
|
|
26
|
-
*/
|
|
27
1
|
import * as fs from "fs";
|
|
28
2
|
import * as os from "os";
|
|
29
3
|
import * as path from "path";
|
|
@@ -36,47 +10,17 @@ import { LOCAL_TENANT, LOCAL_ENV } from "./seed.js";
|
|
|
36
10
|
import { meshCacheDir } from "../../utils/cache-home.js";
|
|
37
11
|
export const ZITADEL_ISSUER = "http://localhost:8080";
|
|
38
12
|
export const LOGIN_CONTEXT = "local";
|
|
39
|
-
/** The platform org — home of platform-layer creds, same name as the cloud
|
|
40
|
-
* platform tenant. Set by ZITADEL_FIRSTINSTANCE_ORG_NAME in the compose;
|
|
41
|
-
* app tenants (incl. the default `local`) get their own orgs on demand. */
|
|
42
13
|
export const PLATFORM_ORG = "mesh";
|
|
43
|
-
/**
|
|
44
|
-
* Approved-pattern naming inside the platform org: project per app
|
|
45
|
-
* (lowercase), application per service/client inside it. The CLI is a
|
|
46
|
-
* platform-level client feature → project `mesh-cli`, application `cli`.
|
|
47
|
-
* (The cloud's legacy catch-all "Platform" project is being retired by the
|
|
48
|
-
* pattern doc's spec items; local starts pattern-true.)
|
|
49
|
-
*/
|
|
50
14
|
export const CLI_PROJECT_NAME = "mesh-cli";
|
|
51
15
|
export const CLI_APP_NAME = "cli";
|
|
52
16
|
export const CLI_REDIRECT_URI = "http://localhost:9876/callback";
|
|
53
|
-
/**
|
|
54
|
-
* The Hub's own auth config (pattern-true: the Hub is a platform app →
|
|
55
|
-
* project `hub` in the platform org, application per service). The `ui`
|
|
56
|
-
* application backs the oauth2-proxy that fronts the Hub UI — the same
|
|
57
|
-
* sidecar topology `mesh.apps.Service` deploys with `auth.provider: "mesh"`.
|
|
58
|
-
* Roles ARE the Hub's vocabulary — imported from the module the deployed Hub's
|
|
59
|
-
* infra declares them from, so a role that exists in the cloud is grantable
|
|
60
|
-
* locally too (MESH-2504), including the tenant-keyed restricted keys
|
|
61
|
-
* (`vendor:<tenant>`, `auditor:<tenant>`) that carry the only scope the policy
|
|
62
|
-
* actually reads. The bare keys alone are not a usable local vocabulary: a bare
|
|
63
|
-
* restricted grant names no tenant, so `checkPolicy` matches it against nothing
|
|
64
|
-
* and it authorizes no tenant-scoped read.
|
|
65
|
-
*/
|
|
66
17
|
export const HUB_PROJECT_NAME = "hub";
|
|
67
18
|
export const HUB_APP_NAME = "ui";
|
|
68
|
-
/** Registered on the seeded Hub app; the default-port URI is always included
|
|
69
|
-
* so a later port switch never strands the app config. Zitadel's devMode only
|
|
70
|
-
* relaxes the https requirement — every redirect URI must still be registered
|
|
71
|
-
* exactly, so an existing app is RECONCILED (union-merged) on each seed run.
|
|
72
|
-
* Functions, not constants: hubPort() must be read at call time so tests and
|
|
73
|
-
* programmatic callers that set MESH_HUB_PORT after import see the override. */
|
|
74
19
|
export const hubRedirectUri = () => `http://localhost:${hubPort()}/oauth2/callback`;
|
|
75
20
|
export const HUB_DEFAULT_REDIRECT_URI = `http://localhost:${DEFAULT_HUB_PORT}/oauth2/callback`;
|
|
76
21
|
export const HUB_ROLES = hubOperatorRoleKeys([LOCAL_TENANT]);
|
|
77
22
|
export const ZITADEL_SSM_PARAM = `/mesh-platform/${LOCAL_TENANT}/${LOCAL_ENV}/platform/zitadel`;
|
|
78
23
|
export const TEST_USERS_SSM_PREFIX = `/mesh-platform/${LOCAL_TENANT}/${LOCAL_ENV}/temporal/test-users`;
|
|
79
|
-
/** Seeded human test users — plainly-labeled dev-grade credentials. */
|
|
80
24
|
export const TEST_USERS = [
|
|
81
25
|
{
|
|
82
26
|
name: "dev",
|
|
@@ -93,11 +37,6 @@ export const TEST_USERS = [
|
|
|
93
37
|
password: "LocalDev1!",
|
|
94
38
|
},
|
|
95
39
|
];
|
|
96
|
-
/**
|
|
97
|
-
* The CLI OIDC app payload — the same shape ZitadelPlatformIdentity creates in
|
|
98
|
-
* the cloud (native, PKCE, device code, JWT access tokens, role assertions),
|
|
99
|
-
* plus devMode so Zitadel accepts the http:// redirect locally.
|
|
100
|
-
*/
|
|
101
40
|
export function buildCliAppPayload() {
|
|
102
41
|
return {
|
|
103
42
|
name: CLI_APP_NAME,
|
|
@@ -113,7 +52,6 @@ export function buildCliAppPayload() {
|
|
|
113
52
|
devMode: true,
|
|
114
53
|
};
|
|
115
54
|
}
|
|
116
|
-
/** Read the seeder PAT the compose bootstrap wrote to the machinekey volume. */
|
|
117
55
|
export function readSeederPat() {
|
|
118
56
|
const tmp = path.join(fs.mkdtempSync(path.join(os.tmpdir(), "mesh-zitadel-")), "pat.txt");
|
|
119
57
|
try {
|
|
@@ -130,7 +68,6 @@ export function readSeederPat() {
|
|
|
130
68
|
fs.rmSync(path.dirname(tmp), { recursive: true, force: true });
|
|
131
69
|
}
|
|
132
70
|
}
|
|
133
|
-
/** Call the local Zitadel REST API; `orgId` sets the org context header. */
|
|
134
71
|
export async function api(pat, method, apiPath, body, orgId) {
|
|
135
72
|
const res = await fetch(`${ZITADEL_ISSUER}${apiPath}`, {
|
|
136
73
|
method,
|
|
@@ -153,11 +90,6 @@ export async function api(pat, method, apiPath, body, orgId) {
|
|
|
153
90
|
return data;
|
|
154
91
|
}
|
|
155
92
|
export const isAlreadyExists = (err) => err?.status === 409 || err?.zitadelCode === 6 || /already exists/i.test(err?.message ?? "");
|
|
156
|
-
/**
|
|
157
|
-
* Shared search-before-create for Zitadel projects: return the existing
|
|
158
|
-
* project's id, else create it. Every ensure*Project in the local seeding
|
|
159
|
-
* and auth-provisioning goes through this.
|
|
160
|
-
*/
|
|
161
93
|
export async function ensureZitadelProject(pat, name, opts = {}) {
|
|
162
94
|
const search = await api(pat, "POST", "/management/v1/projects/_search", { queries: [{ nameQuery: { name, method: "TEXT_QUERY_METHOD_EQUALS" } }] }, opts.orgId);
|
|
163
95
|
const existing = search?.result?.[0]?.id;
|
|
@@ -170,7 +102,6 @@ export async function ensureZitadelProject(pat, name, opts = {}) {
|
|
|
170
102
|
logSuccess(`Created Zitadel project '${name}'${opts.describe ? ` (${opts.describe})` : ""}`);
|
|
171
103
|
return created.id;
|
|
172
104
|
}
|
|
173
|
-
/** Shared name-equals application search; returns the raw app or undefined. */
|
|
174
105
|
export async function searchZitadelApp(pat, projectId, name, orgId) {
|
|
175
106
|
const search = await api(pat, "POST", `/management/v1/projects/${projectId}/apps/_search`, { queries: [{ nameQuery: { name, method: "TEXT_QUERY_METHOD_EQUALS" } }] }, orgId);
|
|
176
107
|
return search?.result?.[0];
|
|
@@ -215,8 +146,6 @@ async function ensureTestUsers(pat) {
|
|
|
215
146
|
}
|
|
216
147
|
}
|
|
217
148
|
}
|
|
218
|
-
/** Where the Hub's oauth2-proxy credentials persist between runs (the local
|
|
219
|
-
* analog of the K8s Secret the Service component creates for the sidecar). */
|
|
220
149
|
export function hubAuthPath() {
|
|
221
150
|
return path.join(meshCacheDir("mesh-local"), "hub-auth.json");
|
|
222
151
|
}
|
|
@@ -232,13 +161,6 @@ export function readHubAuth() {
|
|
|
232
161
|
}
|
|
233
162
|
}
|
|
234
163
|
const ensureHubProject = (pat) => ensureZitadelProject(pat, HUB_PROJECT_NAME, { describe: "Hub platform app" });
|
|
235
|
-
/**
|
|
236
|
-
* What a role key is called in Zitadel's own UI and in the Hub's role picker.
|
|
237
|
-
*
|
|
238
|
-
* A tenant-keyed key reads as the base role plus the tenant it is scoped to, so
|
|
239
|
-
* that `vendor:local` is not offered to an administrator as an opaque string
|
|
240
|
-
* sitting next to a bare `vendor` that grants something entirely different.
|
|
241
|
-
*/
|
|
242
164
|
function hubRoleDisplayName(roleKey) {
|
|
243
165
|
const tenant = hubRoleKeyTenant(roleKey);
|
|
244
166
|
return tenant === null ? roleKey : `${restrictedRoleBase(roleKey) ?? roleKey} (${tenant})`;
|
|
@@ -258,21 +180,11 @@ async function ensureHubRoles(pat, projectId) {
|
|
|
258
180
|
}
|
|
259
181
|
}
|
|
260
182
|
}
|
|
261
|
-
/** Union-merge the current-port redirect URIs into an existing Hub app's OIDC
|
|
262
|
-
* config. Needed whenever the app was seeded under a different MESH_HUB_PORT:
|
|
263
|
-
* devMode does NOT exempt an unregistered redirect_uri (Zitadel rejects the
|
|
264
|
-
* authorize call with "redirect_uri is missing in the client configuration"),
|
|
265
|
-
* it only permits http://. No-op when everything is already registered.
|
|
266
|
-
* Exported for tests. */
|
|
267
183
|
export async function reconcileHubRedirectUris(pat, projectId, app) {
|
|
268
184
|
const cfg = app?.oidcConfig ?? {};
|
|
269
185
|
const redirectUris = [
|
|
270
186
|
...new Set([...(cfg.redirectUris ?? []), hubRedirectUri(), HUB_DEFAULT_REDIRECT_URI]),
|
|
271
187
|
];
|
|
272
|
-
// Both slash forms: the Hub's /logout sends `${origin}/` (trailing slash —
|
|
273
|
-
// matching the deployed platform, which registers `${baseUrl}/`), and
|
|
274
|
-
// Zitadel exact-matches post_logout_redirect_uri. Seeding only the bare
|
|
275
|
-
// form made local sign-out fail with "post_logout_redirect_uri invalid".
|
|
276
188
|
const postLogoutRedirectUris = [
|
|
277
189
|
...new Set([
|
|
278
190
|
...(cfg.postLogoutRedirectUris ?? []),
|
|
@@ -286,12 +198,6 @@ export async function reconcileHubRedirectUris(pat, projectId, app) {
|
|
|
286
198
|
postLogoutRedirectUris.length === (cfg.postLogoutRedirectUris ?? []).length) {
|
|
287
199
|
return;
|
|
288
200
|
}
|
|
289
|
-
// UpdateOIDCAppConfig replaces the whole config — carry the fields we seed
|
|
290
|
-
// (falling back to the create-time shape; appType/authMethodType are
|
|
291
|
-
// re-asserted to the seeded values). Fields we never seed — e.g.
|
|
292
|
-
// additionalOrigins, clockSkew, backChannelLogoutUri — are NOT carried, so
|
|
293
|
-
// anything set out-of-band in the Zitadel console is dropped here. Fine for
|
|
294
|
-
// the local dev app; revisit before reusing against a shared instance.
|
|
295
201
|
await api(pat, "PUT", `/management/v1/projects/${projectId}/apps/${app.id}/oidc_config`, {
|
|
296
202
|
redirectUris,
|
|
297
203
|
postLogoutRedirectUris,
|
|
@@ -310,9 +216,6 @@ export async function reconcileHubRedirectUris(pat, projectId, app) {
|
|
|
310
216
|
});
|
|
311
217
|
logSuccess(`Registered Hub redirect URI http://localhost:${hubPort()}/oauth2/callback (MESH_HUB_PORT)`);
|
|
312
218
|
}
|
|
313
|
-
/** Ensure the Hub `ui` web application; heals a lost client secret (Zitadel
|
|
314
|
-
* returns it once — regenerate when the persisted copy is gone) and keeps the
|
|
315
|
-
* redirect URIs in sync with the configured Hub port. */
|
|
316
219
|
async function ensureHubApp(pat, projectId) {
|
|
317
220
|
const existing = await searchZitadelApp(pat, projectId, HUB_APP_NAME);
|
|
318
221
|
if (existing) {
|
|
@@ -329,8 +232,6 @@ async function ensureHubApp(pat, projectId) {
|
|
|
329
232
|
name: HUB_APP_NAME,
|
|
330
233
|
redirectUris: [...new Set([hubRedirectUri(), HUB_DEFAULT_REDIRECT_URI])],
|
|
331
234
|
postLogoutRedirectUris: [
|
|
332
|
-
// Both slash forms — see reconcileHubRedirectUris; Zitadel exact-matches
|
|
333
|
-
// and the Hub's /logout sends the trailing-slash form.
|
|
334
235
|
...new Set([
|
|
335
236
|
`http://localhost:${hubPort()}`,
|
|
336
237
|
`http://localhost:${hubPort()}/`,
|
|
@@ -351,8 +252,6 @@ async function ensureHubApp(pat, projectId) {
|
|
|
351
252
|
logSuccess(`Created Zitadel application '${HUB_APP_NAME}' (Hub UI web client, code flow)`);
|
|
352
253
|
return { clientId: created.clientId, clientSecret: created.clientSecret };
|
|
353
254
|
}
|
|
354
|
-
/** Grant Hub roles: admin@local.mesh + dev get `ops` (full dashboard),
|
|
355
|
-
* ops@local.mesh gets `developer` — proves per-user role claims. */
|
|
356
255
|
async function ensureHubGrants(pat, projectId) {
|
|
357
256
|
const grants = [
|
|
358
257
|
{ email: "admin@local.mesh", roles: ["ops"] },
|
|
@@ -379,15 +278,12 @@ async function ensureHubGrants(pat, projectId) {
|
|
|
379
278
|
}
|
|
380
279
|
}
|
|
381
280
|
}
|
|
382
|
-
/** Seed the Hub's auth config; persists oauth2-proxy credentials locally. */
|
|
383
281
|
export async function seedHubAuth(pat) {
|
|
384
282
|
const projectId = await ensureHubProject(pat);
|
|
385
283
|
await ensureHubRoles(pat, projectId);
|
|
386
284
|
const app = await ensureHubApp(pat, projectId);
|
|
387
285
|
await ensureHubGrants(pat, projectId);
|
|
388
286
|
const persisted = readHubAuth();
|
|
389
|
-
// oauth2-proxy wants a RAW 16/24/32-byte cookie secret — the hosted
|
|
390
|
-
// sidecar uses a 32-char RandomPassword; mirror that.
|
|
391
287
|
const persistedCookie = persisted?.cookieSecret && [16, 24, 32].includes(persisted.cookieSecret.length)
|
|
392
288
|
? persisted.cookieSecret
|
|
393
289
|
: undefined;
|
|
@@ -400,20 +296,6 @@ export async function seedHubAuth(pat) {
|
|
|
400
296
|
fs.writeFileSync(hubAuthPath(), JSON.stringify(config, null, 2), { mode: 0o600 });
|
|
401
297
|
return config;
|
|
402
298
|
}
|
|
403
|
-
/**
|
|
404
|
-
* Publish the Hub's OWN authz pointer — the local stand-in for what the platform
|
|
405
|
-
* Pulumi program publishes (Hub RBAC design §7.1).
|
|
406
|
-
*
|
|
407
|
-
* The Hub administers every app's identity through
|
|
408
|
-
* `identity/apps/{app}/users`, which resolves the app's Zitadel project and org
|
|
409
|
-
* from its published pointer. Without a pointer of its own the Hub is the one
|
|
410
|
-
* app it cannot administer: its Users page has no project to create people in
|
|
411
|
-
* and no role vocabulary to grant, which is why that page could only ever be a
|
|
412
|
-
* mock. Locally there is no Pulumi run to publish it, so seeding does.
|
|
413
|
-
*
|
|
414
|
-
* Read-modify-write: the compiled-schema keys (`opsHubMetadataRef`, `mode`) are
|
|
415
|
-
* published by the Hub itself and must survive this.
|
|
416
|
-
*/
|
|
417
299
|
async function publishHubAuthzPointer(projectId, orgId, awsConfig) {
|
|
418
300
|
const { SSMClient, GetParameterCommand, PutParameterCommand } = await import("@aws-sdk/client-ssm");
|
|
419
301
|
const ssm = new SSMClient(awsConfig);
|
|
@@ -424,7 +306,6 @@ async function publishHubAuthzPointer(projectId, orgId, awsConfig) {
|
|
|
424
306
|
current = JSON.parse(existing.Parameter?.Value ?? "{}");
|
|
425
307
|
}
|
|
426
308
|
catch {
|
|
427
|
-
// First run — nothing published yet.
|
|
428
309
|
}
|
|
429
310
|
const value = {
|
|
430
311
|
spicedb: { instanceRefs: [] },
|
|
@@ -440,7 +321,6 @@ async function publishHubAuthzPointer(projectId, orgId, awsConfig) {
|
|
|
440
321
|
}));
|
|
441
322
|
logSuccess(`Hub authz pointer published → project ${projectId} in org ${orgId}`);
|
|
442
323
|
}
|
|
443
|
-
/** Registry parity: what SSM discovery and `mesh dev test-user` read in the cloud. */
|
|
444
324
|
async function writeRegistryParams(cliClientId, awsConfig) {
|
|
445
325
|
const { SSMClient, PutParameterCommand } = await import("@aws-sdk/client-ssm");
|
|
446
326
|
const ssm = new SSMClient(awsConfig);
|
|
@@ -461,21 +341,7 @@ async function writeRegistryParams(cliClientId, awsConfig) {
|
|
|
461
341
|
}));
|
|
462
342
|
}
|
|
463
343
|
}
|
|
464
|
-
/** Secrets Manager id the Hub reads its Zitadel admin key from (opsHubSecretName). */
|
|
465
344
|
export const OPS_HUB_SECRET_ID = "mesh/local/dev/zitadel/ops-hub";
|
|
466
|
-
/**
|
|
467
|
-
* Give the local Hub an ADMIN plane.
|
|
468
|
-
*
|
|
469
|
-
* The Hub verifies tokens with `ZITADEL_ISSUER`, but every WRITE — creating a
|
|
470
|
-
* user, minting an API key — goes through a machine key it loads from Secrets
|
|
471
|
-
* Manager. Without that key the local Hub silently offers no create affordance
|
|
472
|
-
* and nothing reaches the IdP, which reads as "the feature is broken" rather
|
|
473
|
-
* than "the credential was never provisioned".
|
|
474
|
-
*
|
|
475
|
-
* The key is a Zitadel machine key (private_key_jwt): `{ keyId, key, userId }`.
|
|
476
|
-
* Idempotent — an existing user is reused, and a fresh key is minted only when
|
|
477
|
-
* the secret is absent, because Zitadel returns the private half exactly once.
|
|
478
|
-
*/
|
|
479
345
|
async function ensureOpsHubAdmin(pat, awsConfig) {
|
|
480
346
|
const { SecretsManagerClient, GetSecretValueCommand, CreateSecretCommand, PutSecretValueCommand, } = await import("@aws-sdk/client-secrets-manager");
|
|
481
347
|
const sm = new SecretsManagerClient(awsConfig);
|
|
@@ -501,8 +367,6 @@ async function ensureOpsHubAdmin(pat, awsConfig) {
|
|
|
501
367
|
}
|
|
502
368
|
if (!userId)
|
|
503
369
|
throw new MeshCliError("could not create the Hub's Zitadel admin user");
|
|
504
|
-
// IAM_OWNER because the Hub administers every org on the instance — each app
|
|
505
|
-
// tenant gets its own org, and a key is minted in the app's org, not the Hub's.
|
|
506
370
|
await api(pat, "POST", "/admin/v1/members", { userId, roles: ["IAM_OWNER"] }).catch(() => undefined);
|
|
507
371
|
const key = await api(pat, "POST", `/management/v1/users/${userId}/keys`, {
|
|
508
372
|
type: "KEY_TYPE_JSON",
|
|
@@ -518,25 +382,11 @@ async function ensureOpsHubAdmin(pat, awsConfig) {
|
|
|
518
382
|
});
|
|
519
383
|
logSuccess(`Hub admin key provisioned → ${OPS_HUB_SECRET_ID} (Zitadel writes enabled)`);
|
|
520
384
|
}
|
|
521
|
-
/** Where the local stack's mail goes — the `mailpit` service in docker-compose. */
|
|
522
385
|
const LOCAL_SMTP = {
|
|
523
386
|
host: "mailpit:1025",
|
|
524
387
|
from: "no-reply@local.mesh",
|
|
525
388
|
fromName: "Mesh (local)",
|
|
526
389
|
};
|
|
527
|
-
/**
|
|
528
|
-
* Point the instance's mail at the local mailbox, on every start.
|
|
529
|
-
*
|
|
530
|
-
* The compose file sets the same thing via `ZITADEL_DEFAULTINSTANCE_SMTP…`,
|
|
531
|
-
* but those apply at FIRST INIT only — so every stack that existed before the
|
|
532
|
-
* mailbox was added would keep no SMTP config at all, and activation and
|
|
533
|
-
* password-reset mail would go on silently going nowhere. Reconciling here
|
|
534
|
-
* covers those without asking anyone to `mesh stop --destroy`.
|
|
535
|
-
*
|
|
536
|
-
* Idempotent: reads the configured providers first and only writes when the
|
|
537
|
-
* host differs. Best-effort — a stack whose mail is misconfigured is worth a
|
|
538
|
-
* warning, not a failed `mesh start`.
|
|
539
|
-
*/
|
|
540
390
|
async function ensureLocalSmtp(pat) {
|
|
541
391
|
try {
|
|
542
392
|
const existing = await api(pat, "POST", "/admin/v1/smtp/_search", {}).catch(() => null);
|
|
@@ -551,7 +401,6 @@ async function ensureLocalSmtp(pat) {
|
|
|
551
401
|
user: "",
|
|
552
402
|
password: "",
|
|
553
403
|
});
|
|
554
|
-
// A provider that exists but is not active still sends nothing.
|
|
555
404
|
if (created?.id)
|
|
556
405
|
await api(pat, "POST", `/admin/v1/smtp/${created.id}/_activate`, {});
|
|
557
406
|
logSuccess(`Local mailbox wired to Zitadel → ${LOCAL_SMTP.host} (view at http://localhost:8025)`);
|
|
@@ -575,21 +424,15 @@ export async function seedZitadel(awsConfig) {
|
|
|
575
424
|
throw new MeshCliError(`Platform org '${PLATFORM_ORG}' not found — the zitadel volume predates the org naming.`, { remediation: { command: "mesh stop --destroy && mesh start" } });
|
|
576
425
|
}
|
|
577
426
|
logSuccess(`Platform org '${PLATFORM_ORG}' ready (platform tenant root — holds platform-service auth config)`);
|
|
578
|
-
// Zitadel v4 defaults new instances to the login-v2 UI — a separate
|
|
579
|
-
// container this stack doesn't run. Pin the built-in v1 login so the
|
|
580
|
-
// authorize flow has a page to land on (idempotent; compose sets the
|
|
581
|
-
// same default at first-instance time).
|
|
582
427
|
try {
|
|
583
428
|
await api(pat, "PUT", "/v2/features/instance", { loginV2: { required: false } });
|
|
584
429
|
}
|
|
585
430
|
catch {
|
|
586
|
-
// pre-v4 instance or endpoint drift — v1 login is already the default
|
|
587
431
|
}
|
|
588
432
|
await ensureLocalSmtp(pat);
|
|
589
433
|
const projectId = await ensureCliProject(pat);
|
|
590
434
|
const cliClientId = await ensureCliApp(pat, projectId);
|
|
591
435
|
await ensureTestUsers(pat);
|
|
592
|
-
// Hub auth AFTER test users exist (role grants target them).
|
|
593
436
|
const hubAuth = await seedHubAuth(pat);
|
|
594
437
|
await publishHubAuthzPointer(hubAuth.projectId, org.result[0].id, awsConfig);
|
|
595
438
|
await writeRegistryParams(cliClientId, awsConfig);
|
|
@@ -598,4 +441,3 @@ export async function seedZitadel(awsConfig) {
|
|
|
598
441
|
logSuccess(`Login context '${LOGIN_CONTEXT}' configured → try: mesh login ${LOGIN_CONTEXT}`);
|
|
599
442
|
return { projectId, cliClientId, hubAuth };
|
|
600
443
|
}
|
|
601
|
-
//# sourceMappingURL=seed-zitadel.js.map
|
|
@@ -1,28 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* First-boot seeding for the `mesh start` local platform.
|
|
3
|
-
*
|
|
4
|
-
* Registers tenant `local` / env `dev` in the local AWS fabric's (ministack)
|
|
5
|
-
* SSM registry with the same shape TenantEnvironments writes in the cloud
|
|
6
|
-
* (/mesh-platform/{tenant}/{env}/app-tenants → TenantEnvironmentsExports), and
|
|
7
|
-
* creates the tenant artifacts bucket. Idempotent — parameters are overwritten,
|
|
8
|
-
* the bucket create tolerates "already owned by you".
|
|
9
|
-
*
|
|
10
|
-
* Zitadel org/project/CLI-app + test-user seeding (the `mesh login local`
|
|
11
|
-
* path) is tracked as a follow-up on the mesh start epic.
|
|
12
|
-
*/
|
|
13
1
|
export declare const LOCAL_TENANT = "local";
|
|
14
2
|
export declare const LOCAL_ENV = "dev";
|
|
15
3
|
export declare const LOCAL_AWS_ENDPOINT = "http://localhost:4566";
|
|
16
4
|
export declare const LOCAL_AWS_REGION = "us-east-2";
|
|
17
5
|
export declare const ARTIFACTS_BUCKET = "mesh-local-artifacts";
|
|
18
|
-
/**
|
|
19
|
-
* General-purpose local data bucket for pipeline development. A `mesh dev
|
|
20
|
-
* --local` session inherits `AWS_ENDPOINT_URL`, so a pipeline's S3 resource
|
|
21
|
-
* (a Dagster pipes-message reader, a sample-input loader) pointed at this
|
|
22
|
-
* bucket round-trips against ministack with no AWS account. Seeded with a
|
|
23
|
-
* sample pipes fragment under `samples/` so a fresh stack has something to
|
|
24
|
-
* materialize from.
|
|
25
|
-
*/
|
|
26
6
|
export declare const DATA_BUCKET = "mesh-local-data";
|
|
27
7
|
export declare const APP_TENANTS_PARAM = "/mesh-platform/local/dev/app-tenants";
|
|
28
8
|
export declare const LOCAL_AWS_CONFIG: {
|
|
@@ -33,21 +13,7 @@ export declare const LOCAL_AWS_CONFIG: {
|
|
|
33
13
|
secretAccessKey: string;
|
|
34
14
|
};
|
|
35
15
|
};
|
|
36
|
-
/**
|
|
37
|
-
* Env vars that point any AWS SDK process on the host at the local fabric —
|
|
38
|
-
* the SDK-native endpoint override (AWS_ENDPOINT_URL, supported since SDK JS
|
|
39
|
-
* v3 ~3.428), so no client-code changes are needed. `mesh dev` local mode
|
|
40
|
-
* injects these into app processes; humans can `eval` them from the
|
|
41
|
-
* `mesh start` output. In-network services get the same wiring with
|
|
42
|
-
* http://ministack:4566 (see the compose file's x-local-aws-env anchor).
|
|
43
|
-
*/
|
|
44
16
|
export declare function localAwsEnv(): Record<string, string>;
|
|
45
|
-
/**
|
|
46
|
-
* The local tenant registration, shaped like TenantEnvironmentsExports
|
|
47
|
-
* (libs/infra-components …/platform/TenantEnvironments.ts) so consumers of the
|
|
48
|
-
* registry (Hub API, init checks) read local and cloud identically. AWS-only
|
|
49
|
-
* fields carry inert local placeholders.
|
|
50
|
-
*/
|
|
51
17
|
export declare function buildAppTenantsSeed(): {
|
|
52
18
|
hubTenant: string;
|
|
53
19
|
primaryTenant: {
|
|
@@ -73,43 +39,13 @@ export interface SeedResult {
|
|
|
73
39
|
bucket: string;
|
|
74
40
|
}
|
|
75
41
|
export declare const FABRIC_CHECK_PATH = "/mesh-platform/local/dev/.fabric-check";
|
|
76
|
-
/** The tenant's Temporal namespace, matching the cloud convention
|
|
77
|
-
* TemporalNamespaceProvisioner uses ({tenant}-{env}, e.g. "acme-dev"). */
|
|
78
42
|
export declare const TEMPORAL_NAMESPACE = "local-dev";
|
|
79
43
|
export declare const TEMPORAL_ADDRESS = "localhost:7233";
|
|
80
|
-
/**
|
|
81
|
-
* Register the local tenant's Temporal namespace ({tenant}-{env} — the same
|
|
82
|
-
* name TemporalNamespaceProvisioner would create in the cloud). Idempotent:
|
|
83
|
-
* "already exists" is success. Dynamic import — @temporalio/client is an
|
|
84
|
-
* optionalDependency (same pattern as commands/temporal.ts).
|
|
85
|
-
*/
|
|
86
44
|
export declare function seedTemporalNamespace(): Promise<void>;
|
|
87
|
-
/**
|
|
88
|
-
* Idempotently register a Temporal namespace. `mesh dev --local` uses this
|
|
89
|
-
* for the per-app namespaces ({tenant}-{env}-{app}) the cloud provisioner
|
|
90
|
-
* creates — the Hub's per-app workflow views resolve exactly that name.
|
|
91
|
-
*/
|
|
92
45
|
export declare function ensureTemporalNamespace(namespace: string, description?: string): Promise<void>;
|
|
93
|
-
/**
|
|
94
|
-
* A deterministic >4 KB payload for the Advanced-tier round-trip. Standard
|
|
95
|
-
* SSM params cap at 4 KB; mesh.exports.Export writes tier "Advanced" values
|
|
96
|
-
* up to 8 KB (Export.ts), and the emulator's fidelity there is the one open
|
|
97
|
-
* question the design (§2.5) requires this check to answer on every boot.
|
|
98
|
-
*/
|
|
99
46
|
export declare function buildFabricCheckPayload(targetBytes?: number): string;
|
|
100
|
-
/**
|
|
101
|
-
* Verify the local AWS fabric behaves like real SSM where the platform
|
|
102
|
-
* depends on it: an 8 KB Advanced-tier parameter round-trips intact, and
|
|
103
|
-
* child parameters under a path come back via GetParametersByPath (the
|
|
104
|
-
* shape mesh.exports.Export's splitKeys mode reads). Check params are
|
|
105
|
-
* removed afterwards.
|
|
106
|
-
*/
|
|
107
47
|
export declare function verifyFabric(): Promise<void>;
|
|
108
|
-
/** Write the Hub-readable tenant + environment registrations (the shapes
|
|
109
|
-
* hub-api's SSM assembler requires: RawTenant at /{tenant}, RawEnvironment
|
|
110
|
-
* at /{tenant}/{env}). Exported for reuse by app-tenant provisioning. */
|
|
111
48
|
export declare function registerTenantEnv(tenant: string, opts?: {
|
|
112
49
|
tier?: "hub" | "dedicated" | "shared";
|
|
113
50
|
}): Promise<void>;
|
|
114
51
|
export declare function seedLocalPlatform(): Promise<SeedResult>;
|
|
115
|
-
//# sourceMappingURL=seed.d.ts.map
|