@mesh-tech/mesh-cli 0.20.2 → 0.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/mesh.d.ts +0 -12
- package/dist/bin/mesh.js +15 -13
- package/dist/bin/mesh.js.map +1 -2
- 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 +0 -98
- package/dist/src/commands/create-app.js +1 -163
- 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 +0 -128
- package/dist/src/commands/init/wizard.js +0 -109
- 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 +3 -1
- package/dist/src/commands/temporal.js.map +1 -2
- 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 +2 -2
- package/skills/core/SKILL.md +9 -10
- 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,78 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* First-run auth preflight helpers (MESH-2479).
|
|
3
|
-
*
|
|
4
|
-
* `mesh start`/`mesh dev` do long work (registry tarball fetches, docker
|
|
5
|
-
* builds, pnpm installs) that fails minutes in — with npm's generic advice —
|
|
6
|
-
* when the CodeArtifact token or AWS SSO session is stale. These helpers
|
|
7
|
-
* verify auth BEFORE the long work and name the exact fixing command.
|
|
8
|
-
*
|
|
9
|
-
* Pure parsers/classifiers are exported separately from the impure probes so
|
|
10
|
-
* the branch logic is unit-testable without network or a home directory.
|
|
11
|
-
*/
|
|
12
1
|
import * as fs from "fs";
|
|
13
2
|
import * as os from "os";
|
|
14
3
|
import * as path from "path";
|
|
15
|
-
/**
|
|
16
|
-
* The command that fixes a stale/missing CodeArtifact token — **broker-first**,
|
|
17
|
-
* so it works for someone with no AWS account at all.
|
|
18
|
-
*
|
|
19
|
-
* Bare on purpose. The `@mesh-tech` registry is one global identity
|
|
20
|
-
* (`utils/registry-identity.ts`): `mesh registry login` resolves it, signs in
|
|
21
|
-
* if it must, and writes `~/.npmrc` in a single run, so no remediation ever
|
|
22
|
-
* needs to name a platform context.
|
|
23
|
-
*/
|
|
24
4
|
export const REGISTRY_LOGIN_FIX = "mesh registry login";
|
|
25
|
-
/**
|
|
26
|
-
* The AWS-profile form. Only correct for people who **deploy**, or when the
|
|
27
|
-
* registry broker is unavailable.
|
|
28
|
-
*
|
|
29
|
-
* Kept as a separate named constant rather than the default: `--profile`
|
|
30
|
-
* deliberately skips the broker, so printing it as the generic fix sends a
|
|
31
|
-
* developer with no AWS account to a command that cannot work for them.
|
|
32
|
-
*/
|
|
33
5
|
export const REGISTRY_LOGIN_FIX_AWS = "mesh registry login --profile mesh-dev";
|
|
34
|
-
/**
|
|
35
|
-
* Render the registry fix. Always the bare command — the registry is global,
|
|
36
|
-
* so a remediation that has to name a context is a remediation the reader has
|
|
37
|
-
* to edit first, and one that names the wrong context does not work at all.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* registryLoginFix(); // → "mesh registry login"
|
|
41
|
-
*/
|
|
42
6
|
export function registryLoginFix() {
|
|
43
7
|
return REGISTRY_LOGIN_FIX;
|
|
44
8
|
}
|
|
45
|
-
/** The documented AWS SSO login form (root package.json `sso` script). */
|
|
46
9
|
export const SSO_LOGIN_FIX = "aws sso login --sso-session=mesh # or: pnpm sso";
|
|
47
|
-
/**
|
|
48
|
-
* The `aws configure sso-session` snippet `pnpm sso` depends on. Printed
|
|
49
|
-
* verbatim when ~/.aws/config has no [sso-session mesh] section — kept here
|
|
50
|
-
* so the CLI and scripts/sso-login.sh describe the same setup.
|
|
51
|
-
*/
|
|
52
10
|
export const SSO_SESSION_SNIPPET = `[sso-session mesh]
|
|
53
11
|
sso_start_url = https://trabian.awsapps.com/start
|
|
54
12
|
sso_region = us-east-1
|
|
55
13
|
sso_registration_scopes = sso:account:access`;
|
|
56
|
-
// ============================================================================
|
|
57
|
-
// ~/.npmrc parsing (pure)
|
|
58
|
-
// ============================================================================
|
|
59
|
-
/**
|
|
60
|
-
* The user-level npmrc `aws codeartifact login` writes into — the token line
|
|
61
|
-
* and, when the namespace flag is omitted, the unscoped `registry=` line.
|
|
62
|
-
*
|
|
63
|
-
* One definition for the whole CLI: the doctor, the probe, and the repair have
|
|
64
|
-
* to be looking at the same file or they disagree about the same machine.
|
|
65
|
-
* `os.homedir()` reads `$HOME` on POSIX, so a scratch-`HOME` test still works.
|
|
66
|
-
*/
|
|
67
14
|
export function homeNpmrcPath() {
|
|
68
15
|
return path.join(os.homedir(), ".npmrc");
|
|
69
16
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Extract the CodeArtifact registry endpoint + auth token from npmrc content.
|
|
72
|
-
* `aws codeartifact login` writes a line shaped like:
|
|
73
|
-
* //mesh-platform-…d.codeartifact.<region>.amazonaws.com/npm/<repo>/:_authToken=<tok>
|
|
74
|
-
* Returns null when no CodeArtifact token line is present.
|
|
75
|
-
*/
|
|
76
17
|
export function parseNpmrcRegistryAuth(content) {
|
|
77
18
|
for (const line of content.split("\n")) {
|
|
78
19
|
const match = line.trim().match(/^\/\/([^:]*\.codeartifact\.[^:]*):_authToken=(.+)$/);
|
|
@@ -83,32 +24,11 @@ export function parseNpmrcRegistryAuth(content) {
|
|
|
83
24
|
}
|
|
84
25
|
return null;
|
|
85
26
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Find an **unscoped** `registry=` line in npmrc content that points at
|
|
88
|
-
* CodeArtifact — the line `aws codeartifact login` writes when it is run
|
|
89
|
-
* WITHOUT `--namespace @mesh-tech`.
|
|
90
|
-
*
|
|
91
|
-
* That line makes CodeArtifact the *default* registry, so every public package
|
|
92
|
-
* (lodash, react, …) is fetched through it with the CodeArtifact token. When
|
|
93
|
-
* the token expires 12 hours later, `npm install` of anything at all fails
|
|
94
|
-
* with E401 — the private-scope breakage everyone expects, plus a total public
|
|
95
|
-
* npm outage nobody does.
|
|
96
|
-
*
|
|
97
|
-
* Deliberately narrow — it must only match a line that is BOTH unscoped AND a
|
|
98
|
-
* CodeArtifact host, so it never touches:
|
|
99
|
-
* - `@mesh-tech:registry=…` (scoped: the line we WANT)
|
|
100
|
-
* - `//…:_authToken=…` (auth, unaffected by the default registry)
|
|
101
|
-
* - `registry=https://npm.acme.internal/` (a team's legitimate private mirror)
|
|
102
|
-
*
|
|
103
|
-
* Returns the offending line verbatim (as it appears in the file), or null.
|
|
104
|
-
*/
|
|
105
27
|
export function findUnscopedCodeArtifactRegistry(content) {
|
|
106
28
|
for (const line of content.split("\n")) {
|
|
107
29
|
const trimmed = line.trim();
|
|
108
|
-
// npmrc comments start with ; or #
|
|
109
30
|
if (!trimmed || trimmed.startsWith(";") || trimmed.startsWith("#"))
|
|
110
31
|
continue;
|
|
111
|
-
// Anchored at `registry` — a scoped line starts with `@scope:`, so it can't match.
|
|
112
32
|
const match = trimmed.match(/^registry\s*=\s*(\S+)$/);
|
|
113
33
|
if (!match || !match[1])
|
|
114
34
|
continue;
|
|
@@ -117,23 +37,14 @@ export function findUnscopedCodeArtifactRegistry(content) {
|
|
|
117
37
|
}
|
|
118
38
|
return null;
|
|
119
39
|
}
|
|
120
|
-
/** True when a registry URL's *host* is a CodeArtifact endpoint. */
|
|
121
40
|
function isCodeArtifactRegistryUrl(value) {
|
|
122
41
|
try {
|
|
123
42
|
return new URL(value).hostname.includes(".codeartifact.");
|
|
124
43
|
}
|
|
125
44
|
catch {
|
|
126
|
-
// Not a parseable URL (env-var interpolation, protocol-relative, …) —
|
|
127
|
-
// fall back to a substring test so we don't miss an obvious hijack.
|
|
128
45
|
return value.includes(".codeartifact.");
|
|
129
46
|
}
|
|
130
47
|
}
|
|
131
|
-
/**
|
|
132
|
-
* Remove every unscoped CodeArtifact `registry=` line from npmrc content.
|
|
133
|
-
* Pure: returns the rewritten content plus the first line removed (null when
|
|
134
|
-
* the content was already clean, in which case `content` is returned
|
|
135
|
-
* unchanged and callers should skip the write entirely).
|
|
136
|
-
*/
|
|
137
48
|
export function stripUnscopedCodeArtifactRegistry(content) {
|
|
138
49
|
const offender = findUnscopedCodeArtifactRegistry(content);
|
|
139
50
|
if (offender === null)
|
|
@@ -141,31 +52,12 @@ export function stripUnscopedCodeArtifactRegistry(content) {
|
|
|
141
52
|
const kept = content
|
|
142
53
|
.split("\n")
|
|
143
54
|
.filter((line) => findUnscopedCodeArtifactRegistry(line) === null);
|
|
144
|
-
// split/join round-trips the file's trailing-newline state exactly.
|
|
145
55
|
return { content: kept.join("\n"), removed: offender };
|
|
146
56
|
}
|
|
147
|
-
/**
|
|
148
|
-
* The `//host/path/:_authToken=` key `aws codeartifact login` writes for a
|
|
149
|
-
* registry endpoint — the endpoint with its scheme stripped and a leading `//`.
|
|
150
|
-
*
|
|
151
|
-
* Pure and shared so the broker path writes byte-identical lines to the AWS CLI
|
|
152
|
-
* path. Two spellings of the same key would leave a stale token line behind
|
|
153
|
-
* that npm might prefer, and the symptom (E401 hours later) points nowhere
|
|
154
|
-
* near the cause.
|
|
155
|
-
*/
|
|
156
57
|
export function npmrcAuthKeyForEndpoint(endpoint) {
|
|
157
58
|
const withoutScheme = endpoint.replace(/^https?:\/\//, "");
|
|
158
59
|
return `//${withoutScheme.endsWith("/") ? withoutScheme : `${withoutScheme}/`}`;
|
|
159
60
|
}
|
|
160
|
-
/**
|
|
161
|
-
* Upsert `key=value` lines into npmrc content: replace the existing line for a
|
|
162
|
-
* key when present, append it otherwise, and leave every other line untouched.
|
|
163
|
-
*
|
|
164
|
-
* Pure. Always emits a trailing newline, and never reorders lines a
|
|
165
|
-
* user put there themselves — an npmrc is a config file people hand-edit, and
|
|
166
|
-
* a token refresh that rewrites the whole thing is how unrelated settings
|
|
167
|
-
* silently disappear.
|
|
168
|
-
*/
|
|
169
61
|
export function upsertNpmrcLines(content, entries) {
|
|
170
62
|
let lines = content.length ? content.split("\n") : [];
|
|
171
63
|
const trailingNewline = content.endsWith("\n");
|
|
@@ -187,16 +79,9 @@ export function upsertNpmrcLines(content, entries) {
|
|
|
187
79
|
}
|
|
188
80
|
return lines.join("\n") + "\n";
|
|
189
81
|
}
|
|
190
|
-
/** Map an HTTP status from an authenticated registry request to a token state. */
|
|
191
82
|
export function classifyRegistryStatus(status) {
|
|
192
|
-
// 401/403 mean the token itself was rejected. Anything else (200, 404, …)
|
|
193
|
-
// means auth was accepted — the token is usable.
|
|
194
83
|
return status === 401 || status === 403 ? "expired" : "fresh";
|
|
195
84
|
}
|
|
196
|
-
/**
|
|
197
|
-
* Verify the CodeArtifact token in ~/.npmrc actually works, with one small
|
|
198
|
-
* authenticated metadata request (bounded by `timeoutMs`). Never throws.
|
|
199
|
-
*/
|
|
200
85
|
export async function probeRegistryToken(opts) {
|
|
201
86
|
const npmrcPath = opts?.npmrcPath ?? homeNpmrcPath();
|
|
202
87
|
const timeoutMs = opts?.timeoutMs ?? 8_000;
|
|
@@ -206,7 +91,6 @@ export async function probeRegistryToken(opts) {
|
|
|
206
91
|
auth = parseNpmrcRegistryAuth(fs.readFileSync(npmrcPath, "utf-8"));
|
|
207
92
|
}
|
|
208
93
|
catch {
|
|
209
|
-
// unreadable/missing ~/.npmrc — same as no auth configured
|
|
210
94
|
}
|
|
211
95
|
if (!auth)
|
|
212
96
|
return { state: "missing" };
|
|
@@ -228,13 +112,6 @@ export async function probeRegistryToken(opts) {
|
|
|
228
112
|
};
|
|
229
113
|
}
|
|
230
114
|
}
|
|
231
|
-
/**
|
|
232
|
-
* Classify a probe + session into the preflight verdict. Pure; the network
|
|
233
|
-
* part lives in `registryPreflight`.
|
|
234
|
-
*
|
|
235
|
-
* @example
|
|
236
|
-
* classifyRegistryPreflight({ state: "fresh" }, { email: "dev@trabian.com" }).state; // → "valid"
|
|
237
|
-
*/
|
|
238
115
|
export function classifyRegistryPreflight(probe, session) {
|
|
239
116
|
const email = session?.email;
|
|
240
117
|
const fix = "mesh init";
|
|
@@ -242,14 +119,6 @@ export function classifyRegistryPreflight(probe, session) {
|
|
|
242
119
|
return { state: "valid", email, fix };
|
|
243
120
|
return { state: probe.state, email, fix, detail: probe.detail };
|
|
244
121
|
}
|
|
245
|
-
/**
|
|
246
|
-
* Registry preflight for commands that cannot proceed without package access
|
|
247
|
-
* (`mesh create-app` outside the platform monorepo). Never throws.
|
|
248
|
-
*
|
|
249
|
-
* @example
|
|
250
|
-
* const pf = await registryPreflight();
|
|
251
|
-
* if (pf.state !== "valid" && pf.state !== "unreachable") process.exit(1);
|
|
252
|
-
*/
|
|
253
122
|
export async function registryPreflight(opts) {
|
|
254
123
|
const probe = await probeRegistryToken(opts);
|
|
255
124
|
let session = null;
|
|
@@ -258,18 +127,12 @@ export async function registryPreflight(opts) {
|
|
|
258
127
|
session = readRegistrySession();
|
|
259
128
|
}
|
|
260
129
|
catch {
|
|
261
|
-
// no session store readable — the probe alone decides
|
|
262
130
|
}
|
|
263
131
|
return classifyRegistryPreflight(probe, session);
|
|
264
132
|
}
|
|
265
|
-
// ============================================================================
|
|
266
|
-
// npm / AWS error classification (pure)
|
|
267
|
-
// ============================================================================
|
|
268
|
-
/** True when npm output/an error message is an auth failure (E401/E403). */
|
|
269
133
|
export function isNpmAuthErrorText(text) {
|
|
270
134
|
return /\bE?40[13]\b|unauthenticated|unable to authenticate|authentication (required|failed)/i.test(text);
|
|
271
135
|
}
|
|
272
|
-
/** True when an npm exec error (with stderr/message) is an auth failure. */
|
|
273
136
|
export function isNpmAuthError(err) {
|
|
274
137
|
const e = err;
|
|
275
138
|
const text = [e?.stderr, e?.message]
|
|
@@ -277,14 +140,9 @@ export function isNpmAuthError(err) {
|
|
|
277
140
|
.join("\n");
|
|
278
141
|
return isNpmAuthErrorText(text);
|
|
279
142
|
}
|
|
280
|
-
/** True when an AWS SDK/CLI error message means the ambient session expired. */
|
|
281
143
|
export function isExpiredAwsTokenMessage(message) {
|
|
282
144
|
return /expired|invalid.*(security )?token|token.*(is )?invalid|no credential|could not load credentials|could not be found|sso session/i.test(message);
|
|
283
145
|
}
|
|
284
|
-
// ============================================================================
|
|
285
|
-
// ~/.aws/config parsing (pure) — `pnpm sso` / --profile prerequisites
|
|
286
|
-
// ============================================================================
|
|
287
|
-
/** Names of `[sso-session <name>]` sections in an AWS config file. */
|
|
288
146
|
export function parseSsoSessionNames(content) {
|
|
289
147
|
const names = [];
|
|
290
148
|
for (const line of content.split("\n")) {
|
|
@@ -294,12 +152,10 @@ export function parseSsoSessionNames(content) {
|
|
|
294
152
|
}
|
|
295
153
|
return names;
|
|
296
154
|
}
|
|
297
|
-
/** True when the AWS config file declares the named profile. */
|
|
298
155
|
export function awsConfigHasProfile(content, profile) {
|
|
299
156
|
const pattern = new RegExp(`^\\[(?:profile\\s+)?${profile.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\]$`);
|
|
300
157
|
return content.split("\n").some((line) => pattern.test(line.trim()));
|
|
301
158
|
}
|
|
302
|
-
/** Read ~/.aws/config (honoring AWS_CONFIG_FILE); "" when unreadable. */
|
|
303
159
|
export function readAwsConfig() {
|
|
304
160
|
const file = process.env.AWS_CONFIG_FILE ?? path.join(os.homedir(), ".aws", "config");
|
|
305
161
|
try {
|
|
@@ -309,10 +165,6 @@ export function readAwsConfig() {
|
|
|
309
165
|
return "";
|
|
310
166
|
}
|
|
311
167
|
}
|
|
312
|
-
// ============================================================================
|
|
313
|
-
// App dependency scan (for the dev doctor's registry check)
|
|
314
|
-
// ============================================================================
|
|
315
|
-
/** True when the app's package.json depends on any @mesh-tech/* package. */
|
|
316
168
|
export function appUsesMeshPackages(appRoot) {
|
|
317
169
|
try {
|
|
318
170
|
const pkg = JSON.parse(fs.readFileSync(path.join(appRoot, "package.json"), "utf-8"));
|
|
@@ -322,4 +174,3 @@ export function appUsesMeshPackages(appRoot) {
|
|
|
322
174
|
return false;
|
|
323
175
|
}
|
|
324
176
|
}
|
|
325
|
-
//# sourceMappingURL=auth-preflight.js.map
|
|
@@ -1,49 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared AWS credential resolution for mesh CLI commands.
|
|
3
|
-
*
|
|
4
|
-
* Three-tier resolution:
|
|
5
|
-
* 1. Existing AWS credentials in environment (CI/CD) → use directly
|
|
6
|
-
* 2. Zitadel JWT via `mesh login` → AssumeRoleWithWebIdentity
|
|
7
|
-
* 3. Fallback → AssumeRole via current AWS session (SSO)
|
|
8
|
-
*
|
|
9
|
-
* Uses @aws-sdk/client-sts directly — does NOT shell out to the `aws` CLI
|
|
10
|
-
* binary, so the binary is not a runtime requirement.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Derive the platform context key (e.g., "mesh.dev") from a Pulumi stack config.
|
|
14
|
-
*
|
|
15
|
-
* Reads `mesh:platform` from Pulumi.<stack>.yaml. Supports both formats:
|
|
16
|
-
* mesh:platform: '{"env":"dev","name":"mesh"}' → "mesh.dev"
|
|
17
|
-
* mesh:platform:
|
|
18
|
-
* name: mesh
|
|
19
|
-
* env: dev → "mesh.dev"
|
|
20
|
-
*/
|
|
21
1
|
export declare function derivePlatformContext(appRoot: string, stack: string): string | null;
|
|
22
|
-
/**
|
|
23
|
-
* Resolve a STABLE absolute path to the running `mesh` entrypoint for
|
|
24
|
-
* embedding in a `credential_process` line — or fall back to plain `mesh`
|
|
25
|
-
* (PATH lookup) when `argv1` is missing, doesn't exist on disk, or lives in
|
|
26
|
-
* a transient location (`npx` cache / OS temp dir): a profile pointing at a
|
|
27
|
-
* path that evaporates breaks every later AWS call with a cryptic
|
|
28
|
-
* credential_process error. The fallback is announced via `logWarn` so the
|
|
29
|
-
* user knows to install mesh-cli globally.
|
|
30
|
-
*/
|
|
31
2
|
export declare function resolveStableMeshBin(argv1: string | undefined, deps?: {
|
|
32
3
|
exists?: (p: string) => boolean;
|
|
33
4
|
warn?: (msg: string) => void;
|
|
34
5
|
}): string;
|
|
35
|
-
/**
|
|
36
|
-
* Render an AWS config-file `[profile …]` block whose `credential_process`
|
|
37
|
-
* re-invokes `mesh login … --credential-process`, so the AWS SDK's default
|
|
38
|
-
* provider chain auto-refreshes the underlying STS triple (the `mesh login`
|
|
39
|
-
* process re-issues the Zitadel token as needed).
|
|
40
|
-
*
|
|
41
|
-
* Shared by `mesh dev` (child services) and `mesh login --export` so both
|
|
42
|
-
* produce byte-identical profiles. Pure — no I/O. The `region` line is
|
|
43
|
-
* emitted only when `region` is a non-empty string. Includes a trailing
|
|
44
|
-
* newline. The binary path and role ARN are double-quoted when they contain
|
|
45
|
-
* whitespace (AWS config command-splitting rules).
|
|
46
|
-
*/
|
|
47
6
|
export declare function renderCredentialProcessProfile(args: {
|
|
48
7
|
profileName: string;
|
|
49
8
|
context: string;
|
|
@@ -51,160 +10,38 @@ export declare function renderCredentialProcessProfile(args: {
|
|
|
51
10
|
region?: string;
|
|
52
11
|
meshBin: string;
|
|
53
12
|
}): string;
|
|
54
|
-
/**
|
|
55
|
-
* Insert or replace the mesh-managed `[profile …]` section for `context` in
|
|
56
|
-
* the user's AWS config content, preserving ALL other content byte-for-byte
|
|
57
|
-
* (this is the user's real ~/.aws/config — clobbering it breaks their other
|
|
58
|
-
* profiles). Pure — no I/O; exported for unit testing.
|
|
59
|
-
*
|
|
60
|
-
* - Existing managed section for this context → replaced in place.
|
|
61
|
-
* - Orphaned START (matching END lost) → only the contiguous profile block
|
|
62
|
-
* that is provably ours is reclaimed; other contexts' sections and user
|
|
63
|
-
* content below are preserved (see `orphanedSectionTail`).
|
|
64
|
-
* - No section → appended, separated by a single blank line (and a trailing
|
|
65
|
-
* newline is added to the existing content if it lacks one).
|
|
66
|
-
*/
|
|
67
13
|
export declare function upsertManagedAwsConfigSection(existing: string, context: string, profileBlock: string): string;
|
|
68
|
-
/**
|
|
69
|
-
* Remove a BARE `[profile name]` block — one outside any managed section — from
|
|
70
|
-
* AWS config content. A file written before the managed-section format carries
|
|
71
|
-
* exactly one such block, and migrating it must not leave that block behind as a
|
|
72
|
-
* duplicate profile. Pure; exported for unit testing.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* stripBareProfile("[profile acme]\nregion = us-east-2\n", "acme"); // → ""
|
|
76
|
-
*/
|
|
77
14
|
export declare function stripBareProfile(existing: string, profileName: string): string;
|
|
78
|
-
/** Assume an IAM role via current AWS session and return credentials as env vars. */
|
|
79
15
|
export declare function assumeRole(roleArn: string, sessionName?: string, durationSeconds?: number): Promise<Record<string, string> | null>;
|
|
80
|
-
/** STS credentials for a Zitadel-JWT-assumed role, including expiry. */
|
|
81
16
|
export interface StsCreds {
|
|
82
17
|
AccessKeyId: string;
|
|
83
18
|
SecretAccessKey: string;
|
|
84
19
|
SessionToken: string;
|
|
85
|
-
/** ISO-8601 expiration timestamp. */
|
|
86
20
|
Expiration: string;
|
|
87
21
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Assume role using a Zitadel JWT via AssumeRoleWithWebIdentity, returning
|
|
90
|
-
* the full STS credential struct (including `Expiration`) rather than the
|
|
91
|
-
* env-var shape. Used by callers that need to track/refresh expiry (e.g.
|
|
92
|
-
* `credential_process`).
|
|
93
|
-
*/
|
|
94
22
|
export declare function assumeRoleCredentials(roleArn: string, idToken: string, sessionName: string, durationSeconds?: number): Promise<StsCreds | null>;
|
|
95
|
-
/** Assume role using a Zitadel JWT via AssumeRoleWithWebIdentity. */
|
|
96
23
|
export declare function assumeRoleWithWebIdentity(roleArn: string, idToken: string, sessionName: string, durationSeconds?: number): Promise<Record<string, string> | null>;
|
|
97
|
-
/**
|
|
98
|
-
* Extract the `iss` claim from a JWT without ever throwing — malformed or
|
|
99
|
-
* corrupt tokens (e.g. a damaged `~/.config/mesh/credentials.json`) yield
|
|
100
|
-
* `undefined`. The failure-diagnostic paths use this; a decode that throws
|
|
101
|
-
* there would crash before the diagnostic prints, which is exactly the
|
|
102
|
-
* failure class MESH-2515 removes.
|
|
103
|
-
*/
|
|
104
24
|
export declare function tokenIssuer(token: string): string | undefined;
|
|
105
|
-
/**
|
|
106
|
-
* Explain an AssumeRoleWithWebIdentity failure in platform terms: which login
|
|
107
|
-
* session (context + token issuer) tried to assume which role, in which AWS
|
|
108
|
-
* account. STS's "web identity token could not be validated" reads like an
|
|
109
|
-
* IAM/expiry problem, but the usual cause is a context whose issuer the role's
|
|
110
|
-
* account simply doesn't trust — e.g. a `mesh.dev` session against a role in a
|
|
111
|
-
* `trabian`-platform account (MESH-2515). stderr only — callers in
|
|
112
|
-
* `--credential-process` mode must keep stdout JSON-clean.
|
|
113
|
-
*
|
|
114
|
-
* `format: "inline"` renders the same facts as one line, for detail fields
|
|
115
|
-
* that get interpolated mid-sentence (the doctor/preflight cred probe). Both
|
|
116
|
-
* forms keep the `AssumeRoleWithWebIdentity failed` prefix the doctor plan
|
|
117
|
-
* documents as the detail capture.
|
|
118
|
-
*/
|
|
119
25
|
export declare function describeAssumeFailure(opts: {
|
|
120
26
|
roleArn: string;
|
|
121
27
|
context?: string;
|
|
122
28
|
issuer?: string;
|
|
123
29
|
}, format?: "block" | "inline"): string;
|
|
124
|
-
/** Format STS credentials as AWS `credential_process` JSON (Version 1). */
|
|
125
30
|
export declare function toCredentialProcessJson(creds: StsCreds): string;
|
|
126
31
|
export interface ResolvedAwsCreds {
|
|
127
|
-
/** AWS credential env vars (ACCESS_KEY_ID, SECRET_ACCESS_KEY, SESSION_TOKEN) */
|
|
128
32
|
env: Record<string, string>;
|
|
129
|
-
/** How the credentials were obtained */
|
|
130
33
|
method: "environment" | "zitadel" | "sso";
|
|
131
34
|
}
|
|
132
35
|
export interface AwsIdentity {
|
|
133
|
-
/** Full caller ARN, e.g. arn:aws:iam::159923586610:user/CI-CD_User */
|
|
134
36
|
arn: string;
|
|
135
37
|
accountId: string;
|
|
136
|
-
/** Where the SDK's default chain found the credentials, for the human reading it. */
|
|
137
38
|
source: "environment" | "profile";
|
|
138
39
|
}
|
|
139
|
-
/**
|
|
140
|
-
* Ask "is there a working AWS connection right now?" — nothing more.
|
|
141
|
-
*
|
|
142
|
-
* Deliberately NOT `resolveAwsCredentials`: that one answers "get me credentials
|
|
143
|
-
* for role X" and has an opinion about how they were obtained. This one runs
|
|
144
|
-
* GetCallerIdentity through the SDK's default provider chain and reports whatever
|
|
145
|
-
* it finds, so a static key/secret pair in `~/.aws/credentials` counts exactly as
|
|
146
|
-
* much as an SSO session or a Zitadel-minted role. Returns null when the chain
|
|
147
|
-
* yields nothing usable.
|
|
148
|
-
*/
|
|
149
40
|
export declare function probeAwsIdentity(): Promise<AwsIdentity | null>;
|
|
150
|
-
/**
|
|
151
|
-
* Pick the AWS role ARN to assume based on Zitadel claims.
|
|
152
|
-
*
|
|
153
|
-
* Zitadel emits project roles under
|
|
154
|
-
* `urn:zitadel:iam:org:project:<projectId>:roles` as a nested object
|
|
155
|
-
* keyed by role name. We treat the presence of `mesh.platform:admin`
|
|
156
|
-
* (or any role listed in `meshcli.adminRoles` in config) as the
|
|
157
|
-
* signal to assume the broader admin role when the caller has
|
|
158
|
-
* configured one.
|
|
159
|
-
*
|
|
160
|
-
* Returns `defaultRole` when no admin role is configured, no admin
|
|
161
|
-
* claim is present, or the JWT can't be parsed. This keeps existing
|
|
162
|
-
* deployments working without a config change.
|
|
163
|
-
*
|
|
164
|
-
* The admin AWS role's IAM trust policy is expected to gate
|
|
165
|
-
* assumption on the same Zitadel claim in production (so the CLI
|
|
166
|
-
* preference can't be spoofed). That setup is its own change — see
|
|
167
|
-
* TODO(mesh-zitadel-aws-role-mapping).
|
|
168
|
-
*/
|
|
169
41
|
export declare function selectRoleForCaller(idToken: string | null, options: {
|
|
170
42
|
defaultRole: string;
|
|
171
43
|
adminRole?: string;
|
|
172
|
-
/**
|
|
173
|
-
* Zitadel role names that should map to `adminRole`. Defaults to
|
|
174
|
-
* a single `mesh.platform:admin` role; callers can override via
|
|
175
|
-
* config to introduce role tiers later.
|
|
176
|
-
*/
|
|
177
44
|
adminClaimRoles?: string[];
|
|
178
45
|
}): string;
|
|
179
|
-
/**
|
|
180
|
-
* The Zitadel project-role names a decoded token carries.
|
|
181
|
-
*
|
|
182
|
-
* Zitadel emits project roles under a claim whose key is either
|
|
183
|
-
* `urn:zitadel:iam:org:project:roles` or the project-qualified
|
|
184
|
-
* `urn:zitadel:iam:org:project:<projectId>:roles`, and whose value is
|
|
185
|
-
* `{ "<roleKey>": { "<orgId>": "<domain>" } }` — the role name is the
|
|
186
|
-
* TOP-LEVEL key. Unwrapping one level deeper collects org ids, which match no
|
|
187
|
-
* role and deny every caller. A token may carry both claim shapes and roles
|
|
188
|
-
* from several projects, so every matching key is walked and the names merged.
|
|
189
|
-
*
|
|
190
|
-
* @param claims A decoded JWT payload.
|
|
191
|
-
* @returns Role names in claim order, deduplicated; empty when the token
|
|
192
|
-
* carries no roles claim.
|
|
193
|
-
* @example
|
|
194
|
-
* projectRoleKeys({ "urn:zitadel:iam:org:project:roles": { "registry:read": {} } });
|
|
195
|
-
* // → ["registry:read"]
|
|
196
|
-
*/
|
|
197
46
|
export declare function projectRoleKeys(claims: Record<string, unknown>): string[];
|
|
198
|
-
/**
|
|
199
|
-
* Resolve AWS credentials using the three-tier strategy.
|
|
200
|
-
*
|
|
201
|
-
* @param roleArn The IAM role to assume (from mesh:deployerRole)
|
|
202
|
-
* @param appRoot Pulumi app root directory
|
|
203
|
-
* @param stack Pulumi stack name
|
|
204
|
-
* @returns Resolved credentials, or null if all methods fail
|
|
205
|
-
*
|
|
206
|
-
* To inherit a broader role based on Zitadel claims, call
|
|
207
|
-
* `selectRoleForCaller` first and pass the result as `roleArn`.
|
|
208
|
-
*/
|
|
209
47
|
export declare function resolveAwsCredentials(roleArn: string, appRoot: string, stack: string): Promise<ResolvedAwsCreds | null>;
|
|
210
|
-
//# sourceMappingURL=aws-auth.d.ts.map
|