@empire-builder-kit/nx 1.0.0-rc.47 → 1.0.0-rc.48
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 +14 -169
- package/executors.json +24 -79
- package/generators.json +8 -18
- package/package.json +13 -71
- package/src/aws/identity.d.ts +1 -1
- package/src/aws-authority/boundary-transforms.d.ts +9 -0
- package/src/aws-authority/boundary-transforms.js +78 -0
- package/src/aws-authority/contracts.d.ts +116 -0
- package/src/aws-authority/contracts.js +40 -0
- package/src/aws-authority/deployment-guardrails.d.ts +4 -0
- package/src/aws-authority/deployment-guardrails.js +543 -0
- package/src/aws-authority/deployment-policy-groups.d.ts +3 -0
- package/src/aws-authority/deployment-policy-groups.js +299 -0
- package/src/aws-authority/deployment-resources.d.ts +64 -0
- package/src/aws-authority/deployment-resources.js +265 -0
- package/src/aws-authority/deployment-services.d.ts +3 -0
- package/src/aws-authority/deployment-services.js +717 -0
- package/src/aws-authority/development-authority.d.ts +11 -0
- package/src/aws-authority/development-authority.js +160 -0
- package/src/aws-authority/guardrail-actions.d.ts +87 -0
- package/src/aws-authority/guardrail-actions.js +463 -0
- package/src/aws-authority/policy-document.d.ts +15 -0
- package/src/aws-authority/policy-document.js +264 -0
- package/src/aws-authority/runtime-boundary.d.ts +7 -0
- package/src/aws-authority/runtime-boundary.js +211 -0
- package/src/aws-authority/service-actions.d.ts +96 -0
- package/src/aws-authority/service-actions.js +512 -0
- package/src/aws-authority/stage-authority.d.ts +6 -272
- package/src/aws-authority/stage-authority.js +109 -3609
- package/src/aws-authority/stage-identity.d.ts +6 -0
- package/src/aws-authority/stage-identity.js +134 -0
- package/src/cli/bootstrap.d.ts +0 -20
- package/src/cli/bootstrap.js +2 -153
- package/src/cli/dev-command.d.ts +2 -4
- package/src/cli/dev-command.js +1 -19
- package/src/cli/main.d.ts +0 -4
- package/src/cli/main.js +22 -80
- package/src/cli/output.d.ts +2 -4
- package/src/cli/output.js +2 -8
- package/src/executors/deployment-plan/deployment-plan.d.ts +0 -2
- package/src/executors/deployment-plan/deployment-plan.js +3 -68
- package/src/executors/dev-doctor/dev-doctor.js +2 -2
- package/src/executors/local-deploy/deployed-smoke.d.ts +12 -0
- package/src/executors/local-deploy/deployed-smoke.js +115 -0
- package/src/executors/local-deploy/deployment-authority.d.ts +24 -0
- package/src/executors/local-deploy/deployment-authority.js +81 -0
- package/src/executors/local-deploy/deployment-child.d.ts +18 -0
- package/src/executors/local-deploy/deployment-child.js +77 -0
- package/src/executors/local-deploy/deployment-contracts.d.ts +96 -0
- package/src/executors/local-deploy/deployment-contracts.js +3 -0
- package/src/executors/local-deploy/deployment-projects.d.ts +4 -0
- package/src/executors/local-deploy/deployment-projects.js +16 -0
- package/src/executors/local-deploy/deployment-receipt.d.ts +4 -0
- package/src/executors/local-deploy/deployment-receipt.js +55 -0
- package/src/executors/local-deploy/deployment-scope.d.ts +17 -0
- package/src/executors/local-deploy/deployment-scope.js +239 -0
- package/src/executors/local-deploy/deployment-source.d.ts +13 -0
- package/src/executors/local-deploy/deployment-source.js +86 -0
- package/src/executors/local-deploy/local-deploy.d.ts +5 -121
- package/src/executors/local-deploy/local-deploy.js +55 -936
- package/src/executors/sst-lifecycle/governed-child-process.d.ts +27 -0
- package/src/executors/sst-lifecycle/governed-child-process.js +277 -0
- package/src/executors/sst-lifecycle/governed-native-operation.js +4 -10
- package/src/executors/sst-lifecycle/run-sst-command.d.ts +4 -85
- package/src/executors/sst-lifecycle/run-sst-command.js +28 -834
- package/src/executors/sst-lifecycle/sst-contracts.d.ts +44 -0
- package/src/executors/sst-lifecycle/sst-contracts.js +3 -0
- package/src/executors/sst-lifecycle/sst-invocation.d.ts +17 -0
- package/src/executors/sst-lifecycle/sst-invocation.js +502 -0
- package/src/executors/sst-lifecycle/task-unlock.js +3 -3
- package/src/foundation/discovery.d.ts +1 -5
- package/src/foundation/discovery.js +0 -2
- package/src/foundation/index.d.ts +0 -2
- package/src/foundation/index.js +0 -9
- package/src/foundation/local-private-smoke-access.d.ts +6 -15
- package/src/foundation/local-private-smoke-access.js +8 -192
- package/src/foundation/observability.d.ts +16 -26
- package/src/foundation/observability.js +34 -135
- package/src/foundation/preflight.js +0 -14
- package/src/foundation/private-smoke-access.d.ts +7 -14
- package/src/foundation/private-smoke-access.js +4 -126
- package/src/foundation/root-site-workspace.d.ts +35 -0
- package/src/foundation/root-site-workspace.js +80 -0
- package/src/foundation/root-site.d.ts +8 -7
- package/src/foundation/root-site.js +17 -9
- package/src/generators/formatting.js +5 -4
- package/src/generators/function/function.d.ts +9 -5
- package/src/generators/function/function.js +106 -136
- package/src/generators/function/schema.json +2 -2
- package/src/generators/function-access/function-access.d.ts +0 -6
- package/src/generators/function-access/function-access.js +41 -109
- package/src/generators/observability-policy.js +1 -2
- package/src/{supply-chain → generators}/pnpm-toolchain-authority.d.ts +3 -3
- package/src/{supply-chain → generators}/pnpm-toolchain-authority.js +12 -12
- package/src/generators/post-generation-install.d.ts +1 -8
- package/src/generators/post-generation-install.js +11 -139
- package/src/generators/preset/dependency-overrides.d.ts +13 -19
- package/src/generators/preset/dependency-overrides.js +12 -56
- package/src/generators/preset/generator.js +0 -3
- package/src/generators/preset/workspace-files-foundation-infra.d.ts +6 -0
- package/src/generators/preset/workspace-files-foundation-infra.js +586 -0
- package/src/generators/preset/workspace-files-foundation-readme.d.ts +5 -0
- package/src/generators/preset/workspace-files-foundation-readme.js +90 -0
- package/src/generators/preset/workspace-files-foundation.d.ts +3 -0
- package/src/generators/preset/workspace-files-foundation.js +170 -0
- package/src/generators/preset/workspace-files-ownership.d.ts +9 -0
- package/src/generators/preset/workspace-files-ownership.js +124 -0
- package/src/generators/preset/workspace-files-root-config.d.ts +32 -0
- package/src/generators/preset/workspace-files-root-config.js +356 -0
- package/src/generators/preset/workspace-files-root-docs.d.ts +5 -0
- package/src/generators/preset/workspace-files-root-docs.js +109 -0
- package/src/generators/preset/workspace-files-shared.d.ts +18 -0
- package/src/generators/preset/workspace-files-shared.js +7 -0
- package/src/generators/preset/workspace-files-workflows.d.ts +39 -0
- package/src/generators/preset/workspace-files-workflows.js +306 -0
- package/src/generators/preset/workspace-files-workspace-health.d.ts +6 -0
- package/src/generators/preset/workspace-files-workspace-health.js +148 -0
- package/src/generators/preset/workspace-files.d.ts +10 -24
- package/src/generators/preset/workspace-files.js +48 -10705
- package/src/generators/site/built-in-site-documentation-files.d.ts +2 -1
- package/src/generators/site/built-in-site-documentation-files.js +15 -56
- package/src/generators/site/built-in-site-files.d.ts +4 -1
- package/src/generators/site/built-in-site-files.js +12 -11
- package/src/generators/site/built-in-site-infrastructure-files.d.ts +2 -1
- package/src/generators/site/built-in-site-infrastructure-files.js +46 -206
- package/src/generators/site/built-in-site-plan.d.ts +5 -1
- package/src/generators/site/built-in-site-plan.js +7 -5
- package/src/generators/site/built-in-site-project-files.d.ts +10 -2
- package/src/generators/site/built-in-site-project-files.js +131 -177
- package/src/generators/site/built-in-site-script-files.d.ts +2 -0
- package/src/generators/site/built-in-site-script-files.js +76 -280
- package/src/generators/site/built-in-site-shared.d.ts +64 -4
- package/src/generators/site/built-in-site-shared.js +307 -14
- package/src/generators/site/built-in-site-sst-config-files.d.ts +2 -1
- package/src/generators/site/built-in-site-sst-config-files.js +90 -22
- package/src/generators/site/built-in-site-web-files.d.ts +2 -1
- package/src/generators/site/built-in-site-web-files.js +19 -225
- package/src/generators/site/schema.d.ts +5 -0
- package/src/generators/site/schema.json +6 -0
- package/src/generators/site/site.d.ts +0 -8
- package/src/generators/site/site.js +17 -85
- package/src/generators/slice/built-in-plan-api-files.d.ts +1 -2
- package/src/generators/slice/built-in-plan-api-files.js +30 -890
- package/src/generators/slice/built-in-plan-database-lifecycle-files.js +57 -1851
- package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +5 -2
- package/src/generators/slice/built-in-plan-infrastructure-files.js +80 -3272
- package/src/generators/slice/built-in-plan-key-value-files.d.ts +3 -2
- package/src/generators/slice/built-in-plan-key-value-files.js +3 -21
- package/src/generators/slice/built-in-plan-project-files.d.ts +5 -3
- package/src/generators/slice/built-in-plan-project-files.js +79 -897
- package/src/generators/slice/built-in-plan-shared.d.ts +3 -18
- package/src/generators/slice/built-in-plan-shared.js +4 -57
- package/src/generators/slice/built-in-plan-web-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-web-files.js +14 -540
- package/src/generators/slice/built-in-plan.d.ts +2 -3
- package/src/generators/slice/built-in-plan.js +79 -277
- package/src/{developer-agent/preview-changes.d.ts → generators/slice/generation-tree.d.ts} +1 -5
- package/src/generators/slice/generation-tree.js +161 -0
- package/src/generators/slice/schema.json +12 -4
- package/src/generators/slice/slice-config.d.ts +7 -0
- package/src/generators/slice/slice-config.js +125 -0
- package/src/generators/slice/slice.js +29 -261
- package/src/generators/slice/sql-bootstrap.d.ts +1 -0
- package/src/generators/slice/sql-bootstrap.js +505 -0
- package/src/generators/slice/sql-client.d.ts +1 -0
- package/src/generators/slice/sql-client.js +107 -0
- package/src/generators/slice/sql-infrastructure.d.ts +1 -0
- package/src/generators/slice/sql-infrastructure.js +225 -0
- package/src/generators/slice/sql-logging.d.ts +1 -0
- package/src/generators/slice/sql-logging.js +266 -0
- package/src/generators/slice/sql-migration.d.ts +2 -0
- package/src/generators/slice/sql-migration.js +202 -0
- package/src/generators/slice/standard-slice-contract.d.ts +25 -0
- package/src/generators/slice/standard-slice-contract.js +64 -0
- package/src/generators/sql/schema.json +1 -1
- package/src/generators/sql/sql.d.ts +1 -1
- package/src/generators/sql/sql.js +13 -7
- package/src/generators/upgrade/framework-package-upgrade.d.ts +4 -27
- package/src/generators/upgrade/framework-package-upgrade.js +16 -39
- package/src/generators/upgrade/framework-packages.d.ts +25 -0
- package/src/generators/upgrade/framework-packages.js +138 -0
- package/src/generators/upgrade/function-authentication-notice.d.ts +10 -18
- package/src/generators/upgrade/function-authentication-notice.js +24 -44
- package/src/generators/upgrade/schema.d.ts +0 -3
- package/src/generators/upgrade/schema.json +6 -16
- package/src/generators/upgrade/slice-compositions.d.ts +20 -0
- package/src/generators/upgrade/slice-compositions.js +100 -0
- package/src/generators/upgrade/slice-upgrade-guidance.d.ts +19 -0
- package/src/generators/upgrade/slice-upgrade-guidance.js +50 -0
- package/src/generators/upgrade/slice-upgrade.d.ts +4 -0
- package/src/generators/upgrade/slice-upgrade.js +231 -0
- package/src/generators/upgrade/upgrade-plan.d.ts +10 -13
- package/src/generators/upgrade/upgrade-plan.js +33 -197
- package/src/generators/upgrade/upgrade-preflight.d.ts +20 -0
- package/src/generators/upgrade/upgrade-preflight.js +64 -0
- package/src/generators/upgrade/upgrade.d.ts +8 -53
- package/src/generators/upgrade/upgrade.js +23 -1571
- package/src/generators/workload/schema.json +2 -2
- package/src/generators/workload/workload.d.ts +11 -11
- package/src/generators/workload/workload.js +166 -1255
- package/src/index.d.ts +0 -5
- package/src/index.js +0 -5
- package/src/local-dev/browser-verification.d.ts +0 -7
- package/src/local-dev/browser-verification.js +0 -136
- package/src/local-dev/contracts.d.ts +6 -0
- package/src/local-dev/contracts.js +17 -9
- package/src/local-dev/environment-checks.d.ts +126 -0
- package/src/local-dev/environment-checks.js +81 -0
- package/src/local-dev/environment-inspector.d.ts +3 -124
- package/src/local-dev/environment-inspector.js +9 -148
- package/src/local-dev/private-state.d.ts +1 -0
- package/src/local-dev/private-state.js +19 -23
- package/src/local-dev/process-identity.js +4 -2
- package/src/local-dev/slice-runner-child.d.ts +37 -0
- package/src/local-dev/slice-runner-child.js +127 -0
- package/src/local-dev/slice-runner-recovery.d.ts +32 -0
- package/src/local-dev/slice-runner-recovery.js +216 -0
- package/src/local-dev/slice-runner-state.d.ts +82 -0
- package/src/local-dev/slice-runner-state.js +265 -0
- package/src/local-dev/slice-runner.d.ts +4 -117
- package/src/local-dev/slice-runner.js +59 -594
- package/src/local-dev/tls.js +8 -97
- package/src/ownership/index.d.ts +1 -0
- package/src/ownership/index.js +6 -0
- package/src/ownership/pnpm-workspace.d.ts +77 -0
- package/src/ownership/pnpm-workspace.js +225 -0
- package/src/ownership/site-record.d.ts +8 -0
- package/src/ownership/site-record.js +17 -2
- package/src/repository-policy/capacity-migration.d.ts +1 -1
- package/src/repository-policy/capacity-migration.js +1 -1
- package/src/repository-policy/foundation-router.d.ts +17 -0
- package/src/repository-policy/foundation-router.js +44 -0
- package/src/repository-policy/index.d.ts +2 -0
- package/src/repository-policy/index.js +2 -0
- package/src/repository-policy/policy-accounts.d.ts +22 -0
- package/src/repository-policy/policy-accounts.js +134 -0
- package/src/repository-policy/policy-files.d.ts +8 -0
- package/src/repository-policy/policy-files.js +201 -0
- package/src/repository-policy/policy-internal.d.ts +2 -0
- package/src/repository-policy/policy-internal.js +11 -0
- package/src/repository-policy/policy-model.d.ts +95 -0
- package/src/repository-policy/policy-model.js +42 -0
- package/src/repository-policy/policy-validation.d.ts +4 -0
- package/src/repository-policy/policy-validation.js +308 -0
- package/src/repository-policy/policy.d.ts +5 -120
- package/src/repository-policy/policy.js +34 -662
- package/src/repository-policy/public-dns.d.ts +4 -0
- package/src/repository-policy/public-dns.js +102 -5
- package/src/{generators/repository-policy → repository-policy}/tree-policy.d.ts +1 -1
- package/src/{generators/repository-policy → repository-policy}/tree-policy.js +5 -5
- package/src/schemas/repository-policy-v1.json +40 -3
- package/src/secrets/index.d.ts +0 -5
- package/src/secrets/index.js +0 -5
- package/src/slice-infra/index.d.ts +57 -0
- package/src/slice-infra/index.js +117 -0
- package/src/slice-scripts/build.d.ts +27 -0
- package/src/slice-scripts/build.js +120 -0
- package/src/slice-scripts/database.d.ts +87 -0
- package/src/slice-scripts/database.js +328 -0
- package/src/slice-scripts/index.d.ts +11 -0
- package/src/slice-scripts/index.js +23 -0
- package/src/slice-scripts/root-site-routes.d.ts +11 -0
- package/src/slice-scripts/root-site-routes.js +83 -0
- package/src/slice-scripts/sql-migration-engine.mjs +180 -0
- package/src/workload-roles/effective-policy.d.ts +0 -37
- package/src/workload-roles/effective-policy.js +1 -174
- package/src/workload-roles/standard-slice.d.ts +2 -19
- package/src/workload-roles/standard-slice.js +3 -129
- package/src/api-contract/baseline-update.d.ts +0 -82
- package/src/api-contract/baseline-update.js +0 -225
- package/src/api-contract/compatibility.d.ts +0 -30
- package/src/api-contract/compatibility.js +0 -643
- package/src/api-contract/contract-graph.d.ts +0 -35
- package/src/api-contract/contract-graph.js +0 -141
- package/src/api-contract/evidence.d.ts +0 -23
- package/src/api-contract/evidence.js +0 -87
- package/src/api-contract/index.d.ts +0 -6
- package/src/api-contract/index.js +0 -10
- package/src/api-contract/model.d.ts +0 -144
- package/src/api-contract/model.js +0 -993
- package/src/api-contract/rollout.d.ts +0 -32
- package/src/api-contract/rollout.js +0 -88
- package/src/authorization/compatibility.d.ts +0 -62
- package/src/authorization/compatibility.js +0 -175
- package/src/authorization/index.d.ts +0 -1
- package/src/authorization/index.js +0 -5
- package/src/blueprints/execution.d.ts +0 -55
- package/src/blueprints/execution.js +0 -329
- package/src/blueprints/external-sandbox.d.ts +0 -53
- package/src/blueprints/external-sandbox.js +0 -1194
- package/src/blueprints/index.d.ts +0 -5
- package/src/blueprints/index.js +0 -9
- package/src/blueprints/inputs.d.ts +0 -43
- package/src/blueprints/inputs.js +0 -103
- package/src/blueprints/manifest.d.ts +0 -281
- package/src/blueprints/manifest.js +0 -424
- package/src/blueprints/resolver.d.ts +0 -37
- package/src/blueprints/resolver.js +0 -387
- package/src/blueprints/transitions.d.ts +0 -20
- package/src/blueprints/transitions.js +0 -61
- package/src/cli/agent-command.d.ts +0 -30
- package/src/cli/agent-command.js +0 -204
- package/src/cli/agent-runtime.d.ts +0 -25
- package/src/cli/agent-runtime.js +0 -498
- package/src/cli/blueprint-authority.d.ts +0 -9
- package/src/cli/blueprint-authority.js +0 -43
- package/src/cli/blueprint-command.d.ts +0 -24
- package/src/cli/blueprint-command.js +0 -63
- package/src/data-lifecycle/index.d.ts +0 -3
- package/src/data-lifecycle/index.js +0 -7
- package/src/data-lifecycle/model.d.ts +0 -172
- package/src/data-lifecycle/model.js +0 -95
- package/src/data-lifecycle/sensitive-artifacts.d.ts +0 -28
- package/src/data-lifecycle/sensitive-artifacts.js +0 -146
- package/src/data-lifecycle/validation.d.ts +0 -32
- package/src/data-lifecycle/validation.js +0 -837
- package/src/database-retirement/contract.d.ts +0 -68
- package/src/database-retirement/contract.js +0 -166
- package/src/database-retirement/index.d.ts +0 -1
- package/src/database-retirement/index.js +0 -5
- package/src/developer-agent/context.d.ts +0 -57
- package/src/developer-agent/context.js +0 -662
- package/src/developer-agent/generator-planning.d.ts +0 -34
- package/src/developer-agent/generator-planning.js +0 -759
- package/src/developer-agent/generator-preview.d.ts +0 -8
- package/src/developer-agent/generator-preview.js +0 -650
- package/src/developer-agent/git-inspection.d.ts +0 -112
- package/src/developer-agent/git-inspection.js +0 -887
- package/src/developer-agent/handoff.d.ts +0 -43
- package/src/developer-agent/handoff.js +0 -713
- package/src/developer-agent/index.d.ts +0 -10
- package/src/developer-agent/index.js +0 -14
- package/src/developer-agent/model.d.ts +0 -497
- package/src/developer-agent/model.js +0 -144
- package/src/developer-agent/operation-registry.d.ts +0 -61
- package/src/developer-agent/operation-registry.js +0 -1591
- package/src/developer-agent/ordering.d.ts +0 -9
- package/src/developer-agent/ordering.js +0 -15
- package/src/developer-agent/planning.d.ts +0 -25
- package/src/developer-agent/planning.js +0 -481
- package/src/developer-agent/preview-changes.js +0 -225
- package/src/developer-agent/preview-source.d.ts +0 -2
- package/src/developer-agent/preview-source.js +0 -19
- package/src/developer-agent/validation.d.ts +0 -30
- package/src/developer-agent/validation.js +0 -2729
- package/src/developer-agent/workspace-inspection.d.ts +0 -20
- package/src/developer-agent/workspace-inspection.js +0 -1236
- package/src/developer-agent/workspace-path.d.ts +0 -6
- package/src/developer-agent/workspace-path.js +0 -22
- package/src/executors/blueprint-trust/blueprint-trust.d.ts +0 -29
- package/src/executors/blueprint-trust/blueprint-trust.js +0 -121
- package/src/executors/blueprint-trust/schema.json +0 -27
- package/src/executors/blueprint-verification/blueprint-verification.d.ts +0 -13
- package/src/executors/blueprint-verification/blueprint-verification.js +0 -110
- package/src/executors/blueprint-verification/schema.json +0 -44
- package/src/executors/developer-context/developer-context.d.ts +0 -38
- package/src/executors/developer-context/developer-context.js +0 -78
- package/src/executors/developer-context/schema.json +0 -87
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.d.ts +0 -19
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js +0 -105
- package/src/executors/foundation-profile-preflight/schema.json +0 -32
- package/src/executors/github-bootstrap/github-bootstrap.d.ts +0 -13
- package/src/executors/github-bootstrap/github-bootstrap.js +0 -62
- package/src/executors/github-bootstrap/schema.json +0 -50
- package/src/executors/infrastructure-plan/infrastructure-plan.d.ts +0 -37
- package/src/executors/infrastructure-plan/infrastructure-plan.js +0 -275
- package/src/executors/infrastructure-plan/schema.json +0 -38
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.d.ts +0 -42
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js +0 -1229
- package/src/executors/router-waf-rehearsal/schema.json +0 -29
- package/src/executors/secret-guardrails/schema.json +0 -6
- package/src/executors/secret-guardrails/secret-guardrails.d.ts +0 -3
- package/src/executors/secret-guardrails/secret-guardrails.js +0 -44
- package/src/executors/secret-initialize/schema.json +0 -42
- package/src/executors/secret-initialize/secret-initialize.d.ts +0 -34
- package/src/executors/secret-initialize/secret-initialize.js +0 -297
- package/src/executors/secret-metadata/schema.json +0 -36
- package/src/executors/secret-metadata/secret-metadata.d.ts +0 -46
- package/src/executors/secret-metadata/secret-metadata.js +0 -230
- package/src/executors/sst-lifecycle/generated-secret-retirement.d.ts +0 -53
- package/src/executors/sst-lifecycle/generated-secret-retirement.js +0 -192
- package/src/executors/sst-lifecycle/logging-preflight.d.ts +0 -22
- package/src/executors/sst-lifecycle/logging-preflight.js +0 -217
- package/src/executors/sst-lifecycle/secret-preflight.d.ts +0 -27
- package/src/executors/sst-lifecycle/secret-preflight.js +0 -125
- package/src/executors/work-markers/schema.json +0 -14
- package/src/executors/work-markers/work-markers.d.ts +0 -6
- package/src/executors/work-markers/work-markers.js +0 -20
- package/src/foundation/cost-estimate.d.ts +0 -175
- package/src/foundation/cost-estimate.js +0 -706
- package/src/foundation/private-smoke-admission.d.ts +0 -45
- package/src/foundation/private-smoke-admission.js +0 -180
- package/src/foundation/private-smoke-control-plane.d.ts +0 -18
- package/src/foundation/private-smoke-control-plane.js +0 -184
- package/src/foundation/root-site-readiness.d.ts +0 -27
- package/src/foundation/root-site-readiness.js +0 -78
- package/src/foundation/router-waf-rate-rehearsal.d.ts +0 -97
- package/src/foundation/router-waf-rate-rehearsal.js +0 -210
- package/src/foundation/router-waf.d.ts +0 -149
- package/src/foundation/router-waf.js +0 -809
- package/src/frontend-security/index.d.ts +0 -1
- package/src/frontend-security/index.js +0 -5
- package/src/frontend-security/security-headers.d.ts +0 -50
- package/src/frontend-security/security-headers.js +0 -418
- package/src/generators/blueprint/blueprint.d.ts +0 -5
- package/src/generators/blueprint/blueprint.js +0 -102
- package/src/generators/blueprint/files.d.ts +0 -6
- package/src/generators/blueprint/files.js +0 -217
- package/src/generators/blueprint/schema.d.ts +0 -4
- package/src/generators/blueprint/schema.json +0 -18
- package/src/generators/feature-registry.d.ts +0 -13
- package/src/generators/feature-registry.js +0 -73
- package/src/generators/function/function-registration.d.ts +0 -24
- package/src/generators/function/function-registration.js +0 -66
- package/src/generators/observability-infrastructure.d.ts +0 -2
- package/src/generators/observability-infrastructure.js +0 -31
- package/src/generators/preset/workspace-files-adopter-skills.d.ts +0 -7
- package/src/generators/preset/workspace-files-adopter-skills.js +0 -359
- package/src/generators/preset/workspace-files-agent-development.d.ts +0 -9
- package/src/generators/preset/workspace-files-agent-development.js +0 -42
- package/src/generators/preset/workspace-files-ci-acceptance.d.ts +0 -1
- package/src/generators/preset/workspace-files-ci-acceptance.js +0 -791
- package/src/generators/preset/workspace-files-ci-install.d.ts +0 -2
- package/src/generators/preset/workspace-files-ci-install.js +0 -196
- package/src/generators/preset/workspace-files-developer-agent.d.ts +0 -16
- package/src/generators/preset/workspace-files-developer-agent.js +0 -644
- package/src/generators/preset/workspace-files-ecr-inspector.d.ts +0 -18
- package/src/generators/preset/workspace-files-ecr-inspector.js +0 -298
- package/src/generators/preset/workspace-files-foundation-workload-roles.d.ts +0 -6
- package/src/generators/preset/workspace-files-foundation-workload-roles.js +0 -409
- package/src/generators/preset/workspace-files-performance-cost.d.ts +0 -66
- package/src/generators/preset/workspace-files-performance-cost.js +0 -866
- package/src/generators/preset/workspace-files-performance-load.d.ts +0 -73
- package/src/generators/preset/workspace-files-performance-load.js +0 -815
- package/src/generators/preset/workspace-files-shared-operation-claims.d.ts +0 -10
- package/src/generators/preset/workspace-files-shared-operation-claims.js +0 -59
- package/src/generators/preset/workspace-files-stage-authority.d.ts +0 -6
- package/src/generators/preset/workspace-files-stage-authority.js +0 -586
- package/src/generators/preset/workspace-files-thin-deploy.d.ts +0 -76
- package/src/generators/preset/workspace-files-thin-deploy.js +0 -2563
- package/src/generators/preset/workspace-files-thin-docs.d.ts +0 -7
- package/src/generators/preset/workspace-files-thin-docs.js +0 -386
- package/src/generators/preset/workspace-files-thin-release.d.ts +0 -14
- package/src/generators/preset/workspace-files-thin-release.js +0 -26
- package/src/generators/preset/workspace-files-workload-role-baseline.d.ts +0 -9
- package/src/generators/preset/workspace-files-workload-role-baseline.js +0 -1314
- package/src/generators/repository-policy/repository-policy.d.ts +0 -4
- package/src/generators/repository-policy/repository-policy.js +0 -294
- package/src/generators/repository-policy/schema.d.ts +0 -30
- package/src/generators/repository-policy/schema.json +0 -127
- package/src/generators/site/built-in-site-smoke-files.d.ts +0 -2
- package/src/generators/site/built-in-site-smoke-files.js +0 -37
- package/src/generators/slice/built-in-plan-alarm-identity.d.ts +0 -182
- package/src/generators/slice/built-in-plan-alarm-identity.js +0 -209
- package/src/generators/slice/built-in-plan-api-contract-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-api-contract-files.js +0 -2848
- package/src/generators/slice/built-in-plan-async-work-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-async-work-files.js +0 -6118
- package/src/generators/slice/built-in-plan-authorization-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-authorization-files.js +0 -2082
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +0 -1301
- package/src/generators/slice/built-in-plan-authorization-storage.d.ts +0 -3
- package/src/generators/slice/built-in-plan-authorization-storage.js +0 -119
- package/src/generators/slice/built-in-plan-background-work-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-background-work-files.js +0 -99
- package/src/generators/slice/built-in-plan-data-deletion-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-deletion-files.js +0 -273
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js +0 -223
- package/src/generators/slice/built-in-plan-data-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-files.js +0 -618
- package/src/generators/slice/built-in-plan-data-lifecycle-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-lifecycle-files.js +0 -775
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js +0 -863
- package/src/generators/slice/built-in-plan-data-retention-job-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-retention-job-files.js +0 -169
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js +0 -186
- package/src/generators/slice/built-in-plan-data-rights-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-data-rights-files.js +0 -152
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js +0 -508
- package/src/generators/slice/built-in-plan-event-contract-literal.d.ts +0 -6
- package/src/generators/slice/built-in-plan-event-contract-literal.js +0 -52
- package/src/generators/slice/built-in-plan-foundation-files.d.ts +0 -15
- package/src/generators/slice/built-in-plan-foundation-files.js +0 -314
- package/src/generators/slice/built-in-plan-frontend-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-frontend-files.js +0 -1975
- package/src/generators/slice/built-in-plan-frontend-header-proof.d.ts +0 -6
- package/src/generators/slice/built-in-plan-frontend-header-proof.js +0 -282
- package/src/generators/slice/built-in-plan-infrastructure-safety-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-infrastructure-safety-files.js +0 -373
- package/src/generators/slice/built-in-plan-key-value-cleanup.d.ts +0 -4
- package/src/generators/slice/built-in-plan-key-value-cleanup.js +0 -101
- package/src/generators/slice/built-in-plan-key-value-consumer.d.ts +0 -4
- package/src/generators/slice/built-in-plan-key-value-consumer.js +0 -151
- package/src/generators/slice/built-in-plan-key-value-deletion.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-deletion.js +0 -377
- package/src/generators/slice/built-in-plan-key-value-delivery.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-delivery.js +0 -137
- package/src/generators/slice/built-in-plan-key-value-export.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-export.js +0 -595
- package/src/generators/slice/built-in-plan-key-value-holds.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-holds.js +0 -189
- package/src/generators/slice/built-in-plan-key-value-infrastructure.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-infrastructure.js +0 -102
- package/src/generators/slice/built-in-plan-key-value-performance.d.ts +0 -5
- package/src/generators/slice/built-in-plan-key-value-performance.js +0 -530
- package/src/generators/slice/built-in-plan-key-value-provider.d.ts +0 -4
- package/src/generators/slice/built-in-plan-key-value-provider.js +0 -366
- package/src/generators/slice/built-in-plan-key-value-records.d.ts +0 -3
- package/src/generators/slice/built-in-plan-key-value-records.js +0 -232
- package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.js +0 -103
- package/src/generators/slice/built-in-plan-key-value-retention-job-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-retention-job-files.js +0 -160
- package/src/generators/slice/built-in-plan-key-value-retention-maintenance.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-retention-maintenance.js +0 -329
- package/src/generators/slice/built-in-plan-key-value-retention-worker.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-retention-worker.js +0 -477
- package/src/generators/slice/built-in-plan-key-value-retention.d.ts +0 -2
- package/src/generators/slice/built-in-plan-key-value-retention.js +0 -184
- package/src/generators/slice/built-in-plan-log-group-helpers.d.ts +0 -29
- package/src/generators/slice/built-in-plan-log-group-helpers.js +0 -130
- package/src/generators/slice/built-in-plan-metadata-files.d.ts +0 -3
- package/src/generators/slice/built-in-plan-metadata-files.js +0 -401
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.js +0 -324
- package/src/generators/slice/built-in-plan-next-build-authority.d.ts +0 -5
- package/src/generators/slice/built-in-plan-next-build-authority.js +0 -124
- package/src/generators/slice/built-in-plan-operations-files.d.ts +0 -8
- package/src/generators/slice/built-in-plan-operations-files.js +0 -1106
- package/src/generators/slice/built-in-plan-performance-files.d.ts +0 -4
- package/src/generators/slice/built-in-plan-performance-files.js +0 -2444
- package/src/generators/slice/built-in-plan-release-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-release-files.js +0 -6585
- package/src/generators/slice/built-in-plan-reliability-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-reliability-files.js +0 -4728
- package/src/generators/slice/built-in-plan-secret-runtime-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-secret-runtime-files.js +0 -1015
- package/src/generators/slice/built-in-plan-sql-events.d.ts +0 -2
- package/src/generators/slice/built-in-plan-sql-events.js +0 -276
- package/src/generators/slice/built-in-plan-testing-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-testing-files.js +0 -2618
- package/src/generators/slice/built-in-plan-testing-persistence-event-files.d.ts +0 -7
- package/src/generators/slice/built-in-plan-testing-persistence-event-files.js +0 -487
- package/src/generators/slice/built-in-plan-testing-persistence-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-testing-persistence-files.js +0 -180
- package/src/generators/slice/built-in-plan-thin-release-files.d.ts +0 -11
- package/src/generators/slice/built-in-plan-thin-release-files.js +0 -162
- package/src/generators/slice/built-in-plan-verification-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-verification-files.js +0 -442
- package/src/generators/slice/built-in-plan-workload-role-files.d.ts +0 -2
- package/src/generators/slice/built-in-plan-workload-role-files.js +0 -2220
- package/src/generators/slice/data-policy-review-seed.d.ts +0 -2
- package/src/generators/slice/data-policy-review-seed.js +0 -22
- package/src/generators/slice/deployed-smoke-diagnostics.d.ts +0 -35
- package/src/generators/slice/deployed-smoke-diagnostics.js +0 -189
- package/src/generators/slice/deployed-smoke-readiness.d.ts +0 -9
- package/src/generators/slice/deployed-smoke-readiness.js +0 -309
- package/src/generators/slice/local-source-identity.d.ts +0 -2
- package/src/generators/slice/local-source-identity.js +0 -31
- package/src/generators/slice/pnpm-launch-script.d.ts +0 -13
- package/src/generators/slice/pnpm-launch-script.js +0 -28
- package/src/generators/upgrade/custom-domain-notice.d.ts +0 -19
- package/src/generators/upgrade/custom-domain-notice.js +0 -38
- package/src/generators/upgrade/external-blueprint-compositions.d.ts +0 -84
- package/src/generators/upgrade/external-blueprint-compositions.js +0 -478
- package/src/generators/upgrade/sql-seeded-reconciliation.d.ts +0 -2
- package/src/generators/upgrade/sql-seeded-reconciliation.js +0 -170
- package/src/generators/workload/performance-registration.d.ts +0 -33
- package/src/generators/workload/performance-registration.js +0 -224
- package/src/generators/workload/reliability-registration.d.ts +0 -16
- package/src/generators/workload/reliability-registration.js +0 -150
- package/src/generators/workload/service-performance-files.d.ts +0 -5
- package/src/generators/workload/service-performance-files.js +0 -1883
- package/src/git-policy/action-pins.d.ts +0 -43
- package/src/git-policy/action-pins.js +0 -50
- package/src/git-policy/github-bootstrap.d.ts +0 -95
- package/src/git-policy/github-bootstrap.js +0 -1250
- package/src/git-policy/index.d.ts +0 -3
- package/src/git-policy/index.js +0 -7
- package/src/git-policy/routing.d.ts +0 -21
- package/src/git-policy/routing.js +0 -138
- package/src/infrastructure-change/convergence.d.ts +0 -13
- package/src/infrastructure-change/convergence.js +0 -85
- package/src/infrastructure-change/drift.d.ts +0 -13
- package/src/infrastructure-change/drift.js +0 -112
- package/src/infrastructure-change/index.d.ts +0 -7
- package/src/infrastructure-change/index.js +0 -11
- package/src/infrastructure-change/local-capability.d.ts +0 -73
- package/src/infrastructure-change/local-capability.js +0 -114
- package/src/infrastructure-change/model.d.ts +0 -274
- package/src/infrastructure-change/model.js +0 -29
- package/src/infrastructure-change/normalize.d.ts +0 -16
- package/src/infrastructure-change/normalize.js +0 -285
- package/src/infrastructure-change/plan.d.ts +0 -67
- package/src/infrastructure-change/plan.js +0 -671
- package/src/infrastructure-change/risk.d.ts +0 -9
- package/src/infrastructure-change/risk.js +0 -349
- package/src/infrastructure-change/summary.d.ts +0 -20
- package/src/infrastructure-change/summary.js +0 -130
- package/src/performance/cost-collection.d.ts +0 -225
- package/src/performance/cost-collection.js +0 -827
- package/src/performance/cost-controls.d.ts +0 -135
- package/src/performance/cost-controls.js +0 -347
- package/src/performance/evidence.d.ts +0 -140
- package/src/performance/evidence.js +0 -601
- package/src/performance/index.d.ts +0 -10
- package/src/performance/index.js +0 -14
- package/src/performance/load-safety.d.ts +0 -84
- package/src/performance/load-safety.js +0 -348
- package/src/performance/model.d.ts +0 -129
- package/src/performance/model.js +0 -451
- package/src/performance/pr-artifact-budget.d.ts +0 -42
- package/src/performance/pr-artifact-budget.js +0 -151
- package/src/performance/runner.d.ts +0 -75
- package/src/performance/runner.js +0 -227
- package/src/performance/scenario-endpoint.d.ts +0 -1
- package/src/performance/scenario-endpoint.js +0 -5
- package/src/performance/scenario.d.ts +0 -215
- package/src/performance/scenario.js +0 -744
- package/src/performance/unit-cost.d.ts +0 -105
- package/src/performance/unit-cost.js +0 -364
- package/src/release/index.d.ts +0 -2
- package/src/release/index.js +0 -6
- package/src/release/lifecycle.d.ts +0 -132
- package/src/release/lifecycle.js +0 -411
- package/src/release/manifest.d.ts +0 -148
- package/src/release/manifest.js +0 -503
- package/src/release/rollout.d.ts +0 -170
- package/src/release/rollout.js +0 -578
- package/src/release/source-authority.d.ts +0 -19
- package/src/release/source-authority.js +0 -212
- package/src/schemas/aggregate-count-evidence-v1.json +0 -135
- package/src/schemas/api-contract-baseline-v1.json +0 -674
- package/src/schemas/api-contract-compatibility-report-v1.json +0 -126
- package/src/schemas/aws-billing-actual-evidence-v1.json +0 -407
- package/src/schemas/blueprint-input-schema-v1.json +0 -23
- package/src/schemas/blueprint-v1.json +0 -188
- package/src/schemas/data-lifecycle-policy-v1.json +0 -517
- package/src/schemas/performance-policy-v1.json +0 -335
- package/src/schemas/testing-evidence-quarantine-v1.json +0 -168
- package/src/schemas/testing-evidence-result-v1.json +0 -319
- package/src/secrets/aws-control-plane.d.ts +0 -29
- package/src/secrets/aws-control-plane.js +0 -322
- package/src/secrets/generated-aws-control-plane.d.ts +0 -33
- package/src/secrets/generated-aws-control-plane.js +0 -322
- package/src/secrets/guardrails.d.ts +0 -26
- package/src/secrets/guardrails.js +0 -328
- package/src/secrets/metadata.d.ts +0 -48
- package/src/secrets/metadata.js +0 -199
- package/src/secrets/operator.d.ts +0 -190
- package/src/secrets/operator.js +0 -701
- package/src/secrets/verification.d.ts +0 -18
- package/src/secrets/verification.js +0 -152
- package/src/supply-chain/action-pins.d.ts +0 -26
- package/src/supply-chain/action-pins.js +0 -262
- package/src/supply-chain/blueprint-trust-git.d.ts +0 -130
- package/src/supply-chain/blueprint-trust-git.js +0 -1666
- package/src/supply-chain/blueprint-trust-process.d.ts +0 -4
- package/src/supply-chain/blueprint-trust-process.js +0 -88
- package/src/supply-chain/blueprint-trust.d.ts +0 -354
- package/src/supply-chain/blueprint-trust.js +0 -1558
- package/src/supply-chain/blueprint-verification-authority.d.ts +0 -62
- package/src/supply-chain/blueprint-verification-authority.js +0 -679
- package/src/supply-chain/blueprint-verification-execution.d.ts +0 -68
- package/src/supply-chain/blueprint-verification-execution.js +0 -639
- package/src/supply-chain/build-output-bounds.d.ts +0 -2
- package/src/supply-chain/build-output-bounds.js +0 -12
- package/src/supply-chain/build-output.d.ts +0 -41
- package/src/supply-chain/build-output.js +0 -551
- package/src/supply-chain/common.d.ts +0 -21
- package/src/supply-chain/common.js +0 -107
- package/src/supply-chain/container-artifact-contract.d.ts +0 -23
- package/src/supply-chain/container-artifact-contract.js +0 -208
- package/src/supply-chain/container-release.d.ts +0 -119
- package/src/supply-chain/container-release.js +0 -496
- package/src/supply-chain/ecr-applicability.d.ts +0 -19
- package/src/supply-chain/ecr-applicability.js +0 -103
- package/src/supply-chain/ecr-scanning.d.ts +0 -85
- package/src/supply-chain/ecr-scanning.js +0 -325
- package/src/supply-chain/ecs-deployed-image.d.ts +0 -87
- package/src/supply-chain/ecs-deployed-image.js +0 -302
- package/src/supply-chain/errors.d.ts +0 -6
- package/src/supply-chain/errors.js +0 -15
- package/src/supply-chain/generated-blueprint-trust-command.d.ts +0 -4
- package/src/supply-chain/generated-blueprint-trust-command.js +0 -1394
- package/src/supply-chain/generated-command.d.ts +0 -1
- package/src/supply-chain/generated-command.js +0 -775
- package/src/supply-chain/generated-container-release-command.d.ts +0 -16
- package/src/supply-chain/generated-container-release-command.js +0 -3248
- package/src/supply-chain/generated-ecr-collector-command.d.ts +0 -20
- package/src/supply-chain/generated-ecr-collector-command.js +0 -1445
- package/src/supply-chain/generated-files.d.ts +0 -13
- package/src/supply-chain/generated-files.js +0 -421
- package/src/supply-chain/generated-scanner-command.d.ts +0 -1
- package/src/supply-chain/generated-scanner-command.js +0 -778
- package/src/supply-chain/index.d.ts +0 -28
- package/src/supply-chain/index.js +0 -36
- package/src/supply-chain/inventory.d.ts +0 -96
- package/src/supply-chain/inventory.js +0 -828
- package/src/supply-chain/license-expression.d.ts +0 -7
- package/src/supply-chain/license-expression.js +0 -128
- package/src/supply-chain/policy.d.ts +0 -105
- package/src/supply-chain/policy.js +0 -304
- package/src/supply-chain/publication.d.ts +0 -48
- package/src/supply-chain/publication.js +0 -85
- package/src/supply-chain/sbom.d.ts +0 -228
- package/src/supply-chain/sbom.js +0 -913
- package/src/supply-chain/scanner.d.ts +0 -77
- package/src/supply-chain/scanner.js +0 -514
- package/src/supply-chain/vendored-source.d.ts +0 -95
- package/src/supply-chain/vendored-source.js +0 -315
- package/src/testing-evidence/fixture-scope.d.ts +0 -53
- package/src/testing-evidence/fixture-scope.js +0 -142
- package/src/testing-evidence/index.d.ts +0 -5
- package/src/testing-evidence/index.js +0 -9
- package/src/testing-evidence/quarantine.d.ts +0 -48
- package/src/testing-evidence/quarantine.js +0 -253
- package/src/testing-evidence/result.d.ts +0 -109
- package/src/testing-evidence/result.js +0 -585
- package/src/testing-evidence/runner-adapter.d.ts +0 -51
- package/src/testing-evidence/runner-adapter.js +0 -288
- package/src/testing-evidence/sensitive-artifacts.d.ts +0 -13
- package/src/testing-evidence/sensitive-artifacts.js +0 -93
- package/src/work-markers/index.d.ts +0 -1
- package/src/work-markers/index.js +0 -5
- package/src/work-markers/work-markers.d.ts +0 -39
- package/src/work-markers/work-markers.js +0 -363
- package/src/workload-roles/account-baseline.d.ts +0 -143
- package/src/workload-roles/account-baseline.js +0 -980
- package/src/workload-roles/authority.d.ts +0 -40
- package/src/workload-roles/authority.js +0 -202
- package/src/workload-roles/aws-adapter.d.ts +0 -99
- package/src/workload-roles/aws-adapter.js +0 -416
- package/src/workload-roles/aws-internal-handler.d.ts +0 -27
- package/src/workload-roles/aws-internal-handler.js +0 -58
- package/src/workload-roles/aws-s3-state.d.ts +0 -52
- package/src/workload-roles/aws-s3-state.js +0 -191
- package/src/workload-roles/aws-sdk-control-plane.d.ts +0 -12
- package/src/workload-roles/aws-sdk-control-plane.js +0 -291
- package/src/workload-roles/boundary.d.ts +0 -34
- package/src/workload-roles/boundary.js +0 -137
- package/src/workload-roles/convergence.d.ts +0 -66
- package/src/workload-roles/convergence.js +0 -186
- package/src/workload-roles/handler.d.ts +0 -43
- package/src/workload-roles/handler.js +0 -158
- package/src/workload-roles/history.d.ts +0 -47
- package/src/workload-roles/history.js +0 -324
- package/src/workload-roles/injection.d.ts +0 -119
- package/src/workload-roles/injection.js +0 -495
- package/src/workload-roles/manifest.d.ts +0 -54
- package/src/workload-roles/manifest.js +0 -343
- package/src/workload-roles/provisioner.d.ts +0 -70
- package/src/workload-roles/provisioner.js +0 -239
- package/src/workload-roles/registration.d.ts +0 -102
- package/src/workload-roles/registration.js +0 -462
- package/src/workload-roles/stage-boundary.d.ts +0 -31
- package/src/workload-roles/stage-boundary.js +0 -208
- /package/src/executors/{foundation-profile-preflight → local-deploy}/production-database-safeguard.d.ts +0 -0
- /package/src/executors/{foundation-profile-preflight → local-deploy}/production-database-safeguard.js +0 -0
|
@@ -1,980 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WorkloadRoleAccountBaselineError = exports.WORKLOAD_ROLE_PROVISIONER_MAX_ATTEMPTS = exports.WORKLOAD_ROLE_ACCOUNT_BASELINE_SCHEMA_VERSION = exports.WORKLOAD_ROLE_DEPLOYMENT_POLICY_NAME = void 0;
|
|
4
|
-
exports.workloadRoleProvisionerAliasArn = workloadRoleProvisionerAliasArn;
|
|
5
|
-
exports.createWorkloadRoleStageAccountBaselinePlan = createWorkloadRoleStageAccountBaselinePlan;
|
|
6
|
-
exports.createWorkloadRoleStageDeploymentPromotion = createWorkloadRoleStageDeploymentPromotion;
|
|
7
|
-
exports.publishReviewedStageWorkloadRoleCandidate = publishReviewedStageWorkloadRoleCandidate;
|
|
8
|
-
const node_crypto_1 = require("node:crypto");
|
|
9
|
-
const handler_js_1 = require("./handler.js");
|
|
10
|
-
const provisioner_js_1 = require("./provisioner.js");
|
|
11
|
-
const history_js_1 = require("./history.js");
|
|
12
|
-
const registration_js_1 = require("./registration.js");
|
|
13
|
-
const stage_boundary_js_1 = require("./stage-boundary.js");
|
|
14
|
-
exports.WORKLOAD_ROLE_DEPLOYMENT_POLICY_NAME = 'ebk-workload-role-deployment-v1';
|
|
15
|
-
exports.WORKLOAD_ROLE_ACCOUNT_BASELINE_SCHEMA_VERSION = 1;
|
|
16
|
-
exports.WORKLOAD_ROLE_PROVISIONER_MAX_ATTEMPTS = 5;
|
|
17
|
-
const IAM_MANAGED_POLICY_MAX_CHARACTERS = 6_144;
|
|
18
|
-
const IAM_ROLE_MAX_ATTACHED_MANAGED_POLICIES = 10;
|
|
19
|
-
const IAM_DEPLOYMENT_ROLE_MAX_FRAMEWORK_MANAGED_POLICIES = 9;
|
|
20
|
-
const workloadRoleProvisionerRetryDelaysMs = [
|
|
21
|
-
1_000, 2_000, 4_000, 8_000,
|
|
22
|
-
];
|
|
23
|
-
const boundedInternalProvisionerFailures = new Set([
|
|
24
|
-
'fixed-provisioner-convergence-error',
|
|
25
|
-
'fixed-provisioner-history-load-error',
|
|
26
|
-
'fixed-provisioner-history-save-error',
|
|
27
|
-
'fixed-provisioner-internal-error',
|
|
28
|
-
'fixed-provisioner-registration-save-error',
|
|
29
|
-
'fixed-provisioner-source-load-error',
|
|
30
|
-
]);
|
|
31
|
-
const retryableProvisionerFailures = new Set([
|
|
32
|
-
'fixed-provisioner-convergence-error',
|
|
33
|
-
'fixed-provisioner-history-load-error',
|
|
34
|
-
'fixed-provisioner-internal-error',
|
|
35
|
-
'fixed-provisioner-source-load-error',
|
|
36
|
-
]);
|
|
37
|
-
class WorkloadRoleAccountBaselineError extends Error {
|
|
38
|
-
classification;
|
|
39
|
-
constructor(classification, message) {
|
|
40
|
-
super(message);
|
|
41
|
-
this.classification = classification;
|
|
42
|
-
this.name = 'WorkloadRoleAccountBaselineError';
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.WorkloadRoleAccountBaselineError = WorkloadRoleAccountBaselineError;
|
|
46
|
-
const accountPattern = /^\d{12}$/;
|
|
47
|
-
const bucketPattern = /^(?!\d{1,3}(?:\.\d{1,3}){3}$)[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/;
|
|
48
|
-
const candidatePattern = /^[a-z0-9][a-z0-9._-]{0,127}$/;
|
|
49
|
-
const digestPattern = /^[a-f0-9]{64}$/;
|
|
50
|
-
const projectPattern = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
51
|
-
const regionPattern = /^[a-z]{2}(?:-gov)?-[a-z]+-\d$/;
|
|
52
|
-
const stagePattern = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
53
|
-
const deploymentRoleArnPattern = /^arn:(aws|aws-cn|aws-us-gov):iam::(\d{12}):role\/(?:[A-Za-z0-9+=,.@_-]+\/)*([A-Za-z0-9+=,.@_-]{1,64})$/;
|
|
54
|
-
const publisherPrincipalArnPattern = /^arn:(aws|aws-cn|aws-us-gov):(iam|sts)::(\d{12}):(?:role|user|assumed-role)\/[A-Za-z0-9+=,.@_/-]+$/;
|
|
55
|
-
function compareStrings(left, right) {
|
|
56
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
57
|
-
}
|
|
58
|
-
function requireMatch(value, pattern, label) {
|
|
59
|
-
if (!pattern.test(value)) {
|
|
60
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-input-invalid', `${label} is invalid.`);
|
|
61
|
-
}
|
|
62
|
-
return value;
|
|
63
|
-
}
|
|
64
|
-
function stableName(components, maximumLength) {
|
|
65
|
-
const value = components.join('-').toLowerCase();
|
|
66
|
-
if (value.length <= maximumLength)
|
|
67
|
-
return value;
|
|
68
|
-
const digest = (0, node_crypto_1.createHash)('sha256')
|
|
69
|
-
.update(value, 'utf8')
|
|
70
|
-
.digest('hex')
|
|
71
|
-
.slice(0, 12);
|
|
72
|
-
return `${value.slice(0, maximumLength - 13)}-${digest}`;
|
|
73
|
-
}
|
|
74
|
-
function logicalId(project, suffix) {
|
|
75
|
-
const digest = (0, node_crypto_1.createHash)('sha256')
|
|
76
|
-
.update(project, 'utf8')
|
|
77
|
-
.digest('hex')
|
|
78
|
-
.slice(0, 12);
|
|
79
|
-
return `Project${digest}${suffix}`;
|
|
80
|
-
}
|
|
81
|
-
function provisionerFunctionName(stage, project) {
|
|
82
|
-
return stableName(['ebk', stage, project, 'role-provisioner'], 64);
|
|
83
|
-
}
|
|
84
|
-
function provisionerRoleName(stage) {
|
|
85
|
-
return stableName(['ebk', stage, 'workload-role-provisioner'], 64);
|
|
86
|
-
}
|
|
87
|
-
function stateBucketName(accountId, region, stage) {
|
|
88
|
-
return stableName(['ebk', 'wr', accountId, region, stage], 63);
|
|
89
|
-
}
|
|
90
|
-
function stackName(stage) {
|
|
91
|
-
return stableName(['ebk', stage, 'workload-role-account-baseline'], 128);
|
|
92
|
-
}
|
|
93
|
-
function deploymentPolicyStackName(stage) {
|
|
94
|
-
return stableName(['ebk', stage, 'workload-role-deployment-policy'], 128);
|
|
95
|
-
}
|
|
96
|
-
function workloadRoleProvisionerAliasArn(options) {
|
|
97
|
-
requireMatch(options.accountId, accountPattern, 'Account ID');
|
|
98
|
-
requireMatch(options.manifestDigest, digestPattern, 'Manifest digest');
|
|
99
|
-
requireMatch(options.project, projectPattern, 'Project');
|
|
100
|
-
requireMatch(options.region, regionPattern, 'Region');
|
|
101
|
-
requireMatch(options.stage, stagePattern, 'Stage');
|
|
102
|
-
if (!['aws', 'aws-cn', 'aws-us-gov'].includes(options.partition)) {
|
|
103
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-input-invalid', 'Partition is invalid.');
|
|
104
|
-
}
|
|
105
|
-
return `arn:${options.partition}:lambda:${options.region}:${options.accountId}:function:${provisionerFunctionName(options.stage, options.project)}:candidate-${options.manifestDigest}`;
|
|
106
|
-
}
|
|
107
|
-
function requireCodeLocation(value) {
|
|
108
|
-
if (!bucketPattern.test(value.bucketName) ||
|
|
109
|
-
value.objectKey.trim() === '' ||
|
|
110
|
-
value.objectKey.startsWith('/') ||
|
|
111
|
-
value.objectVersion.trim() === '') {
|
|
112
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-input-invalid', 'Provisioner code must use an exact protected S3 bucket, key, and object version.');
|
|
113
|
-
}
|
|
114
|
-
return { ...value };
|
|
115
|
-
}
|
|
116
|
-
function exactRoleArns(boundary) {
|
|
117
|
-
return boundary.documents
|
|
118
|
-
.flatMap(({ accountId, manifest, partition }) => manifest.roles.map(({ roleName }) => `arn:${partition}:iam::${accountId}:role/${roleName}`))
|
|
119
|
-
.sort(compareStrings);
|
|
120
|
-
}
|
|
121
|
-
function priorTransitionAuthority(options) {
|
|
122
|
-
if ((options.expectedPriorHistories === undefined) !==
|
|
123
|
-
(options.reviewedPriorHistories === undefined)) {
|
|
124
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-input-invalid', 'Reviewed prior histories and their independent expectations must be supplied together.');
|
|
125
|
-
}
|
|
126
|
-
if (!options.expectedPriorHistories || !options.reviewedPriorHistories) {
|
|
127
|
-
return { histories: {}, instanceProfileArns: [], roleArns: [] };
|
|
128
|
-
}
|
|
129
|
-
const expectedProjects = Object.keys(options.expectedPriorHistories).sort(compareStrings);
|
|
130
|
-
const reviewedProjects = Object.keys(options.reviewedPriorHistories).sort(compareStrings);
|
|
131
|
-
if (JSON.stringify(expectedProjects) !== JSON.stringify(reviewedProjects) ||
|
|
132
|
-
expectedProjects.some((project) => !options.boundary.projects.includes(project))) {
|
|
133
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-project-set-invalid', 'Prior histories must name one exact reviewed subset of current projects.');
|
|
134
|
-
}
|
|
135
|
-
const currentByProject = new Map(options.boundary.documents.map((document) => [
|
|
136
|
-
document.project,
|
|
137
|
-
new Map(document.manifest.roles.map((role) => [role.id, role])),
|
|
138
|
-
]));
|
|
139
|
-
const currentNames = new Set(options.boundary.documents.flatMap((document) => document.manifest.roles.map(({ roleName }) => roleName.toLowerCase())));
|
|
140
|
-
const transitionNames = new Set();
|
|
141
|
-
const roleArns = [];
|
|
142
|
-
const instanceProfileArns = [];
|
|
143
|
-
const histories = {};
|
|
144
|
-
for (const project of expectedProjects) {
|
|
145
|
-
const expectation = options.expectedPriorHistories[project];
|
|
146
|
-
if (!expectation ||
|
|
147
|
-
!candidatePattern.test(expectation.candidateIdentity) ||
|
|
148
|
-
!digestPattern.test(expectation.historyDigest) ||
|
|
149
|
-
!digestPattern.test(expectation.manifestDigest)) {
|
|
150
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-input-invalid', `Prior history expectation for ${project} is invalid.`);
|
|
151
|
-
}
|
|
152
|
-
let history;
|
|
153
|
-
try {
|
|
154
|
-
history = (0, history_js_1.requireWorkloadRoleHistory)(options.reviewedPriorHistories[project]);
|
|
155
|
-
}
|
|
156
|
-
catch {
|
|
157
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-substitution', `Prior history for ${project} is malformed or differs from its reviewed manifest.`);
|
|
158
|
-
}
|
|
159
|
-
if (history.stage !== options.boundary.stage ||
|
|
160
|
-
history.currentCandidateIdentity !== expectation.candidateIdentity ||
|
|
161
|
-
history.historyDigest !== expectation.historyDigest ||
|
|
162
|
-
history.currentManifestDigest !== expectation.manifestDigest ||
|
|
163
|
-
[...history.active, ...history.tombstones].some(({ boundaryArn, ownership }) => ownership.project !== project || boundaryArn !== options.boundary.arn)) {
|
|
164
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-substitution', `Prior history for ${project} differs from its reviewed candidate, digest, stage, project, or boundary.`);
|
|
165
|
-
}
|
|
166
|
-
const currentById = currentByProject.get(project);
|
|
167
|
-
if (!currentById) {
|
|
168
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-project-set-invalid', `Current project ${project} is absent.`);
|
|
169
|
-
}
|
|
170
|
-
for (const prior of history.active) {
|
|
171
|
-
if (currentById.get(prior.id)?.roleName === prior.roleName)
|
|
172
|
-
continue;
|
|
173
|
-
const normalizedName = prior.roleName.toLowerCase();
|
|
174
|
-
if (currentNames.has(normalizedName) ||
|
|
175
|
-
transitionNames.has(normalizedName)) {
|
|
176
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-substitution', `Prior transition role ${prior.roleName} collides with a current or reviewed transition role.`);
|
|
177
|
-
}
|
|
178
|
-
transitionNames.add(normalizedName);
|
|
179
|
-
const roleArn = `arn:${options.boundary.partition}:iam::${options.boundary.accountId}:role/${prior.roleName}`;
|
|
180
|
-
roleArns.push(roleArn);
|
|
181
|
-
if (prior.surface === 'foundation-nat-instance') {
|
|
182
|
-
instanceProfileArns.push(`arn:${options.boundary.partition}:iam::${options.boundary.accountId}:instance-profile/${prior.roleName}-profile`);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
histories[project] = history;
|
|
186
|
-
}
|
|
187
|
-
return {
|
|
188
|
-
histories,
|
|
189
|
-
instanceProfileArns: instanceProfileArns.sort(compareStrings),
|
|
190
|
-
roleArns: roleArns.sort(compareStrings),
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
function exactInstanceProfileArns(boundary) {
|
|
194
|
-
return boundary.documents
|
|
195
|
-
.flatMap(({ accountId, manifest, partition }) => manifest.roles
|
|
196
|
-
.filter(({ surface }) => surface === 'foundation-nat-instance')
|
|
197
|
-
.map(({ roleName }) => `arn:${partition}:iam::${accountId}:instance-profile/${roleName}-profile`))
|
|
198
|
-
.sort(compareStrings);
|
|
199
|
-
}
|
|
200
|
-
function exactInstanceProfileRoleArns(boundary) {
|
|
201
|
-
return boundary.documents
|
|
202
|
-
.flatMap(({ accountId, manifest, partition }) => manifest.roles
|
|
203
|
-
.filter(({ surface }) => surface === 'foundation-nat-instance')
|
|
204
|
-
.map(({ roleName }) => `arn:${partition}:iam::${accountId}:role/${roleName}`))
|
|
205
|
-
.sort(compareStrings);
|
|
206
|
-
}
|
|
207
|
-
function provisionerPolicy(options) {
|
|
208
|
-
const currentRoleArns = exactRoleArns(options.boundary);
|
|
209
|
-
const roleArns = [...currentRoleArns, ...options.transitionalRoleArns].sort(compareStrings);
|
|
210
|
-
const profileArns = [
|
|
211
|
-
...exactInstanceProfileArns(options.boundary),
|
|
212
|
-
...options.transitionalInstanceProfileArns,
|
|
213
|
-
].sort(compareStrings);
|
|
214
|
-
const profileRoleArns = exactInstanceProfileRoleArns(options.boundary);
|
|
215
|
-
return {
|
|
216
|
-
Statement: [
|
|
217
|
-
{
|
|
218
|
-
Action: ['logs:CreateLogStream', 'logs:PutLogEvents'],
|
|
219
|
-
Effect: 'Allow',
|
|
220
|
-
Resource: options.logGroupArns
|
|
221
|
-
.map((arn) => `${arn}:*`)
|
|
222
|
-
.sort(compareStrings),
|
|
223
|
-
Sid: 'WriteProvisionerLogs',
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
Action: ['s3:ListBucket'],
|
|
227
|
-
Condition: {
|
|
228
|
-
NumericLessThanEquals: { 's3:max-keys': '1' },
|
|
229
|
-
StringEquals: {
|
|
230
|
-
's3:prefix': [...options.readableObjectKeys].sort(compareStrings),
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
Effect: 'Allow',
|
|
234
|
-
Resource: [options.stateBucketArn],
|
|
235
|
-
Sid: 'ListExactRegisteredState',
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
Action: ['s3:GetObject'],
|
|
239
|
-
Effect: 'Allow',
|
|
240
|
-
Resource: [
|
|
241
|
-
...options.registeredObjectArns,
|
|
242
|
-
...options.stateObjectArns,
|
|
243
|
-
].sort(compareStrings),
|
|
244
|
-
Sid: 'ReadExactRegisteredState',
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
Action: ['s3:DeleteObject', 's3:PutObject'],
|
|
248
|
-
Effect: 'Allow',
|
|
249
|
-
Resource: [...options.stateObjectArns].sort(compareStrings),
|
|
250
|
-
Sid: 'WriteExactProvisionedState',
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
Action: ['iam:CreateRole', 'iam:PutRolePermissionsBoundary'],
|
|
254
|
-
Condition: {
|
|
255
|
-
StringEquals: {
|
|
256
|
-
'iam:PermissionsBoundary': options.boundary.arn,
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
Effect: 'Allow',
|
|
260
|
-
Resource: currentRoleArns,
|
|
261
|
-
Sid: 'CreateExactBoundedRoles',
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
Action: [
|
|
265
|
-
'iam:DeleteRole',
|
|
266
|
-
'iam:DeleteRolePolicy',
|
|
267
|
-
'iam:DetachRolePolicy',
|
|
268
|
-
'iam:GetRole',
|
|
269
|
-
'iam:GetRolePolicy',
|
|
270
|
-
'iam:ListAttachedRolePolicies',
|
|
271
|
-
'iam:ListRolePolicies',
|
|
272
|
-
'iam:PutRolePolicy',
|
|
273
|
-
'iam:TagRole',
|
|
274
|
-
'iam:UntagRole',
|
|
275
|
-
'iam:UpdateAssumeRolePolicy',
|
|
276
|
-
],
|
|
277
|
-
Effect: 'Allow',
|
|
278
|
-
Resource: roleArns,
|
|
279
|
-
Sid: 'ConvergeExactRegisteredRoles',
|
|
280
|
-
},
|
|
281
|
-
...(profileRoleArns.length === 0
|
|
282
|
-
? []
|
|
283
|
-
: [
|
|
284
|
-
{
|
|
285
|
-
Action: ['iam:PassRole'],
|
|
286
|
-
Condition: {
|
|
287
|
-
StringEquals: {
|
|
288
|
-
'iam:PassedToService': 'ec2.amazonaws.com',
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
Effect: 'Allow',
|
|
292
|
-
Resource: profileRoleArns,
|
|
293
|
-
Sid: 'PassExactNatInstanceProfileRoles',
|
|
294
|
-
},
|
|
295
|
-
]),
|
|
296
|
-
...(profileArns.length === 0
|
|
297
|
-
? []
|
|
298
|
-
: [
|
|
299
|
-
{
|
|
300
|
-
Action: [
|
|
301
|
-
'iam:AddRoleToInstanceProfile',
|
|
302
|
-
'iam:CreateInstanceProfile',
|
|
303
|
-
'iam:DeleteInstanceProfile',
|
|
304
|
-
'iam:GetInstanceProfile',
|
|
305
|
-
'iam:RemoveRoleFromInstanceProfile',
|
|
306
|
-
],
|
|
307
|
-
Effect: 'Allow',
|
|
308
|
-
Resource: [...roleArns, ...profileArns].sort(compareStrings),
|
|
309
|
-
Sid: 'ConvergeExactNatInstanceProfiles',
|
|
310
|
-
},
|
|
311
|
-
]),
|
|
312
|
-
],
|
|
313
|
-
Version: '2012-10-17',
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
function policyCharacters(statements) {
|
|
317
|
-
return JSON.stringify({ Statement: statements, Version: '2012-10-17' })
|
|
318
|
-
.length;
|
|
319
|
-
}
|
|
320
|
-
function boundedManagedPolicyStatements(statement, label) {
|
|
321
|
-
if (policyCharacters([statement]) <= IAM_MANAGED_POLICY_MAX_CHARACTERS) {
|
|
322
|
-
return [statement];
|
|
323
|
-
}
|
|
324
|
-
const parts = [];
|
|
325
|
-
let resources = [];
|
|
326
|
-
for (const resource of statement.Resource) {
|
|
327
|
-
const candidate = {
|
|
328
|
-
...statement,
|
|
329
|
-
Resource: [...resources, resource],
|
|
330
|
-
Sid: `${statement.Sid}Part0001`,
|
|
331
|
-
};
|
|
332
|
-
if (policyCharacters([candidate]) <= IAM_MANAGED_POLICY_MAX_CHARACTERS) {
|
|
333
|
-
resources.push(resource);
|
|
334
|
-
continue;
|
|
335
|
-
}
|
|
336
|
-
if (resources.length === 0) {
|
|
337
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-input-invalid', `${label} statement ${statement.Sid} cannot fit an IAM managed policy.`);
|
|
338
|
-
}
|
|
339
|
-
parts.push({ ...statement, Resource: resources });
|
|
340
|
-
resources = [resource];
|
|
341
|
-
}
|
|
342
|
-
if (resources.length > 0) {
|
|
343
|
-
parts.push({ ...statement, Resource: resources });
|
|
344
|
-
}
|
|
345
|
-
return parts.map((part, index) => {
|
|
346
|
-
const suffix = `Part${String(index + 1).padStart(4, '0')}`;
|
|
347
|
-
const result = { ...part, Sid: `${statement.Sid}${suffix}` };
|
|
348
|
-
if (policyCharacters([result]) > IAM_MANAGED_POLICY_MAX_CHARACTERS) {
|
|
349
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-input-invalid', `${label} statement ${statement.Sid} cannot fit an IAM managed policy.`);
|
|
350
|
-
}
|
|
351
|
-
return result;
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
function boundedManagedPolicyDocuments(policy, label, maximumDocuments = IAM_ROLE_MAX_ATTACHED_MANAGED_POLICIES) {
|
|
355
|
-
const statements = policy.Statement.flatMap((statement) => boundedManagedPolicyStatements(statement, label));
|
|
356
|
-
const documents = [];
|
|
357
|
-
let current = [];
|
|
358
|
-
for (const statement of statements) {
|
|
359
|
-
const candidate = [...current, statement];
|
|
360
|
-
if (policyCharacters(candidate) <= IAM_MANAGED_POLICY_MAX_CHARACTERS) {
|
|
361
|
-
current = candidate;
|
|
362
|
-
continue;
|
|
363
|
-
}
|
|
364
|
-
if (current.length === 0) {
|
|
365
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-input-invalid', `${label} statement cannot fit an IAM managed policy.`);
|
|
366
|
-
}
|
|
367
|
-
documents.push({ Statement: current, Version: '2012-10-17' });
|
|
368
|
-
current = [statement];
|
|
369
|
-
}
|
|
370
|
-
if (current.length > 0) {
|
|
371
|
-
documents.push({ Statement: current, Version: '2012-10-17' });
|
|
372
|
-
}
|
|
373
|
-
if (documents.length === 0 || documents.length > maximumDocuments) {
|
|
374
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-input-invalid', `${label} exceeds the bounded IAM managed-policy attachment count.`);
|
|
375
|
-
}
|
|
376
|
-
return documents;
|
|
377
|
-
}
|
|
378
|
-
function bucketPolicy(partition, bucketName) {
|
|
379
|
-
const bucketArn = `arn:${partition}:s3:::${bucketName}`;
|
|
380
|
-
const objectArn = `${bucketArn}/*`;
|
|
381
|
-
return {
|
|
382
|
-
Statement: [
|
|
383
|
-
{
|
|
384
|
-
Action: 's3:*',
|
|
385
|
-
Condition: { Bool: { 'aws:SecureTransport': 'false' } },
|
|
386
|
-
Effect: 'Deny',
|
|
387
|
-
Principal: '*',
|
|
388
|
-
Resource: [bucketArn, objectArn],
|
|
389
|
-
Sid: 'DenyInsecureTransport',
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
Action: 's3:PutObject',
|
|
393
|
-
Condition: {
|
|
394
|
-
Null: { 's3:x-amz-server-side-encryption': 'true' },
|
|
395
|
-
},
|
|
396
|
-
Effect: 'Deny',
|
|
397
|
-
Principal: '*',
|
|
398
|
-
Resource: objectArn,
|
|
399
|
-
Sid: 'DenyMissingEncryptionHeader',
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
Action: 's3:PutObject',
|
|
403
|
-
Condition: {
|
|
404
|
-
StringNotEquals: {
|
|
405
|
-
's3:x-amz-server-side-encryption': 'AES256',
|
|
406
|
-
},
|
|
407
|
-
},
|
|
408
|
-
Effect: 'Deny',
|
|
409
|
-
Principal: '*',
|
|
410
|
-
Resource: objectArn,
|
|
411
|
-
Sid: 'DenyUnexpectedEncryption',
|
|
412
|
-
},
|
|
413
|
-
],
|
|
414
|
-
Version: '2012-10-17',
|
|
415
|
-
};
|
|
416
|
-
}
|
|
417
|
-
function projectLambdaResources(options) {
|
|
418
|
-
const functionId = logicalId(options.plan.project, 'ProvisionerFunction');
|
|
419
|
-
const logId = logicalId(options.plan.project, 'ProvisionerLogGroup');
|
|
420
|
-
const versionId = logicalId(options.plan.project, 'ProvisionerVersion');
|
|
421
|
-
const aliasId = logicalId(options.plan.project, 'ProvisionerAlias');
|
|
422
|
-
return {
|
|
423
|
-
[logId]: {
|
|
424
|
-
DeletionPolicy: 'RetainExceptOnCreate',
|
|
425
|
-
Properties: {
|
|
426
|
-
LogGroupName: `/aws/lambda/${options.plan.functionName}`,
|
|
427
|
-
RetentionInDays: 30,
|
|
428
|
-
},
|
|
429
|
-
Type: 'AWS::Logs::LogGroup',
|
|
430
|
-
UpdateReplacePolicy: 'Retain',
|
|
431
|
-
},
|
|
432
|
-
[functionId]: {
|
|
433
|
-
DependsOn: [logId, 'WorkloadRoleStateBucketPolicy'],
|
|
434
|
-
Properties: {
|
|
435
|
-
Code: {
|
|
436
|
-
S3Bucket: options.code.bucketName,
|
|
437
|
-
S3Key: options.code.objectKey,
|
|
438
|
-
S3ObjectVersion: options.code.objectVersion,
|
|
439
|
-
},
|
|
440
|
-
Environment: {
|
|
441
|
-
Variables: {
|
|
442
|
-
EBK_WORKLOAD_ROLE_BUCKET: options.plan.storage.bucketName,
|
|
443
|
-
EBK_WORKLOAD_ROLE_MANIFEST_DIGEST: options.plan.manifestDigest,
|
|
444
|
-
EBK_WORKLOAD_ROLE_PROJECT: options.plan.project,
|
|
445
|
-
EBK_WORKLOAD_ROLE_PROVISIONER_ALIAS_ARN: options.plan.provisionerAliasArn,
|
|
446
|
-
EBK_WORKLOAD_ROLE_STAGE: options.plan.registeredDocument.manifest.candidate.stage,
|
|
447
|
-
},
|
|
448
|
-
},
|
|
449
|
-
FunctionName: options.plan.functionName,
|
|
450
|
-
Handler: 'index.handler',
|
|
451
|
-
MemorySize: 512,
|
|
452
|
-
// Accounts at Lambda's minimum concurrency quota cannot reserve even
|
|
453
|
-
// one execution because AWS requires ten executions to remain
|
|
454
|
-
// unreserved. The publisher invokes one exact candidate alias at a
|
|
455
|
-
// time and the provisioner converges one digest-bound registration,
|
|
456
|
-
// so quota-dependent reservation is neither required nor portable.
|
|
457
|
-
Role: {
|
|
458
|
-
'Fn::GetAtt': [options.provisionerRoleLogicalId, 'Arn'],
|
|
459
|
-
},
|
|
460
|
-
Runtime: 'nodejs22.x',
|
|
461
|
-
Timeout: 900,
|
|
462
|
-
},
|
|
463
|
-
Type: 'AWS::Lambda::Function',
|
|
464
|
-
},
|
|
465
|
-
[versionId]: {
|
|
466
|
-
Properties: {
|
|
467
|
-
Description: `Candidate ${options.plan.manifestDigest}`,
|
|
468
|
-
FunctionName: { Ref: functionId },
|
|
469
|
-
},
|
|
470
|
-
Type: 'AWS::Lambda::Version',
|
|
471
|
-
},
|
|
472
|
-
[aliasId]: {
|
|
473
|
-
Properties: {
|
|
474
|
-
FunctionName: { Ref: functionId },
|
|
475
|
-
FunctionVersion: { 'Fn::GetAtt': [versionId, 'Version'] },
|
|
476
|
-
Name: options.plan.provisionerAliasName,
|
|
477
|
-
},
|
|
478
|
-
Type: 'AWS::Lambda::Alias',
|
|
479
|
-
},
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
function cloudFormationTemplate(options) {
|
|
483
|
-
const stateBucketArn = `arn:${options.boundary.partition}:s3:::${options.stateBucketName}`;
|
|
484
|
-
const registeredObjectKeys = options.projectPlans.map(({ registeredManifestObjectKey }) => registeredManifestObjectKey);
|
|
485
|
-
const historyObjectKeys = options.projectPlans.map(({ project }) => (0, registration_js_1.workloadRoleHistoryObjectKey)(options.boundary.stage, project));
|
|
486
|
-
const registeredObjectArns = registeredObjectKeys.map((key) => `${stateBucketArn}/${key}`);
|
|
487
|
-
const stateObjectArns = options.projectPlans.flatMap(({ project }) => [
|
|
488
|
-
`arn:${options.boundary.partition}:s3:::${options.stateBucketName}/${(0, registration_js_1.provisionedWorkloadRoleRegistrationObjectKey)({
|
|
489
|
-
manifestDigest: options.boundary.manifestDigestsByProject[project],
|
|
490
|
-
project,
|
|
491
|
-
provisionerFunctionArn: options.projectPlans.find((plan) => plan.project === project)?.provisionerAliasArn,
|
|
492
|
-
stage: options.boundary.stage,
|
|
493
|
-
})}`,
|
|
494
|
-
`arn:${options.boundary.partition}:s3:::${options.stateBucketName}/${(0, registration_js_1.workloadRoleHistoryObjectKey)(options.boundary.stage, project)}`,
|
|
495
|
-
]);
|
|
496
|
-
const logGroupArns = options.projectPlans.map(({ functionName }) => `arn:${options.boundary.partition}:logs:${options.region}:${options.boundary.accountId}:log-group:/aws/lambda/${functionName}`);
|
|
497
|
-
const policy = provisionerPolicy({
|
|
498
|
-
boundary: options.boundary,
|
|
499
|
-
logGroupArns,
|
|
500
|
-
readableObjectKeys: [...registeredObjectKeys, ...historyObjectKeys].sort(compareStrings),
|
|
501
|
-
registeredObjectArns,
|
|
502
|
-
stateBucketArn,
|
|
503
|
-
stateObjectArns,
|
|
504
|
-
transitionalInstanceProfileArns: options.transitionalInstanceProfileArns,
|
|
505
|
-
transitionalRoleArns: options.transitionalRoleArns,
|
|
506
|
-
});
|
|
507
|
-
const policyDocuments = boundedManagedPolicyDocuments(policy, 'Provisioner policy');
|
|
508
|
-
const policyLogicalIds = policyDocuments.map((_, index) => `WorkloadRoleProvisionerPolicy${index + 1}`);
|
|
509
|
-
const resources = {
|
|
510
|
-
WorkloadRoleBoundary: {
|
|
511
|
-
Properties: {
|
|
512
|
-
Description: 'Exact reviewed aggregate maximum-permission boundary for this stage.',
|
|
513
|
-
ManagedPolicyName: options.boundary.policyName,
|
|
514
|
-
Path: options.boundary.path,
|
|
515
|
-
PolicyDocument: options.boundary.policy,
|
|
516
|
-
},
|
|
517
|
-
Type: 'AWS::IAM::ManagedPolicy',
|
|
518
|
-
},
|
|
519
|
-
...Object.fromEntries(policyDocuments.map((document, index) => [
|
|
520
|
-
policyLogicalIds[index],
|
|
521
|
-
{
|
|
522
|
-
Properties: {
|
|
523
|
-
Description: `Exact reviewed authority shard ${index + 1} for the fixed ${options.boundary.stage} workload-role provisioner.`,
|
|
524
|
-
ManagedPolicyName: stableName([
|
|
525
|
-
'ebk',
|
|
526
|
-
options.boundary.stage,
|
|
527
|
-
'workload-role-provisioner',
|
|
528
|
-
'v2',
|
|
529
|
-
`policy-${index + 1}`,
|
|
530
|
-
], 128),
|
|
531
|
-
Path: options.boundary.path,
|
|
532
|
-
PolicyDocument: document,
|
|
533
|
-
},
|
|
534
|
-
Type: 'AWS::IAM::ManagedPolicy',
|
|
535
|
-
},
|
|
536
|
-
])),
|
|
537
|
-
WorkloadRoleProvisionerRole: {
|
|
538
|
-
Properties: {
|
|
539
|
-
AssumeRolePolicyDocument: {
|
|
540
|
-
Statement: [
|
|
541
|
-
{
|
|
542
|
-
Action: 'sts:AssumeRole',
|
|
543
|
-
Effect: 'Allow',
|
|
544
|
-
Principal: { Service: 'lambda.amazonaws.com' },
|
|
545
|
-
},
|
|
546
|
-
],
|
|
547
|
-
Version: '2012-10-17',
|
|
548
|
-
},
|
|
549
|
-
ManagedPolicyArns: policyLogicalIds.map((logicalId) => ({
|
|
550
|
-
Ref: logicalId,
|
|
551
|
-
})),
|
|
552
|
-
RoleName: options.provisionerRoleName,
|
|
553
|
-
Tags: [
|
|
554
|
-
{ Key: 'ebk:managed-by', Value: 'account-baseline' },
|
|
555
|
-
{ Key: 'ebk:stage', Value: options.boundary.stage },
|
|
556
|
-
],
|
|
557
|
-
},
|
|
558
|
-
Type: 'AWS::IAM::Role',
|
|
559
|
-
},
|
|
560
|
-
WorkloadRoleStateBucket: {
|
|
561
|
-
DeletionPolicy: 'Retain',
|
|
562
|
-
Properties: {
|
|
563
|
-
BucketEncryption: {
|
|
564
|
-
ServerSideEncryptionConfiguration: [
|
|
565
|
-
{
|
|
566
|
-
ServerSideEncryptionByDefault: {
|
|
567
|
-
SSEAlgorithm: 'AES256',
|
|
568
|
-
},
|
|
569
|
-
},
|
|
570
|
-
],
|
|
571
|
-
},
|
|
572
|
-
BucketName: options.stateBucketName,
|
|
573
|
-
OwnershipControls: {
|
|
574
|
-
Rules: [{ ObjectOwnership: 'BucketOwnerEnforced' }],
|
|
575
|
-
},
|
|
576
|
-
PublicAccessBlockConfiguration: {
|
|
577
|
-
BlockPublicAcls: true,
|
|
578
|
-
BlockPublicPolicy: true,
|
|
579
|
-
IgnorePublicAcls: true,
|
|
580
|
-
RestrictPublicBuckets: true,
|
|
581
|
-
},
|
|
582
|
-
VersioningConfiguration: { Status: 'Enabled' },
|
|
583
|
-
},
|
|
584
|
-
Type: 'AWS::S3::Bucket',
|
|
585
|
-
UpdateReplacePolicy: 'Retain',
|
|
586
|
-
},
|
|
587
|
-
WorkloadRoleStateBucketPolicy: {
|
|
588
|
-
Properties: {
|
|
589
|
-
Bucket: { Ref: 'WorkloadRoleStateBucket' },
|
|
590
|
-
PolicyDocument: bucketPolicy(options.boundary.partition, options.stateBucketName),
|
|
591
|
-
},
|
|
592
|
-
Type: 'AWS::S3::BucketPolicy',
|
|
593
|
-
},
|
|
594
|
-
};
|
|
595
|
-
for (const plan of options.projectPlans) {
|
|
596
|
-
Object.assign(resources, projectLambdaResources({
|
|
597
|
-
code: options.code,
|
|
598
|
-
plan,
|
|
599
|
-
provisionerRoleLogicalId: 'WorkloadRoleProvisionerRole',
|
|
600
|
-
}));
|
|
601
|
-
}
|
|
602
|
-
return {
|
|
603
|
-
AWSTemplateFormatVersion: '2010-09-09',
|
|
604
|
-
Description: 'Protected Empire Builder Kit v1 stage workload-role account baseline. Apply only with external account-baseline authority.',
|
|
605
|
-
Resources: resources,
|
|
606
|
-
};
|
|
607
|
-
}
|
|
608
|
-
function createWorkloadRoleStageAccountBaselinePlan(options) {
|
|
609
|
-
requireMatch(options.expectedAccountId, accountPattern, 'Expected account ID');
|
|
610
|
-
requireMatch(options.expectedCandidateIdentity, candidatePattern, 'Expected candidate identity');
|
|
611
|
-
requireMatch(options.expectedStage, stagePattern, 'Expected stage');
|
|
612
|
-
requireMatch(options.region, regionPattern, 'Region');
|
|
613
|
-
const code = requireCodeLocation(options.code);
|
|
614
|
-
const deploymentRole = deploymentRoleArnPattern.exec(options.reviewedDeploymentRoleArn);
|
|
615
|
-
if (!deploymentRole ||
|
|
616
|
-
deploymentRole[1] !== options.expectedPartition ||
|
|
617
|
-
deploymentRole[2] !== options.expectedAccountId) {
|
|
618
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-substitution', 'Deployment role must be one exact role in the reviewed account and partition.');
|
|
619
|
-
}
|
|
620
|
-
const publisherPrincipal = publisherPrincipalArnPattern.exec(options.reviewedPublisherPrincipalArn);
|
|
621
|
-
if (!publisherPrincipal ||
|
|
622
|
-
publisherPrincipal[1] !== options.expectedPartition ||
|
|
623
|
-
publisherPrincipal[3] !== options.expectedAccountId ||
|
|
624
|
-
options.reviewedPublisherPrincipalArn === options.reviewedDeploymentRoleArn) {
|
|
625
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-substitution', 'Publisher principal must be one distinct exact externally reviewed principal in the expected account and partition.');
|
|
626
|
-
}
|
|
627
|
-
const boundary = (0, stage_boundary_js_1.createStageWorkloadRoleBoundaryContract)({
|
|
628
|
-
documents: options.registeredDocuments,
|
|
629
|
-
expectedAccountId: options.expectedAccountId,
|
|
630
|
-
expectedCandidateIdentity: options.expectedCandidateIdentity,
|
|
631
|
-
expectedManifestDigests: options.expectedManifestDigests,
|
|
632
|
-
expectedPartition: options.expectedPartition,
|
|
633
|
-
expectedProjects: options.expectedProjects,
|
|
634
|
-
expectedStage: options.expectedStage,
|
|
635
|
-
});
|
|
636
|
-
const transitionAuthority = priorTransitionAuthority({
|
|
637
|
-
boundary,
|
|
638
|
-
...(options.expectedPriorHistories
|
|
639
|
-
? { expectedPriorHistories: options.expectedPriorHistories }
|
|
640
|
-
: {}),
|
|
641
|
-
...(options.reviewedPriorHistories
|
|
642
|
-
? { reviewedPriorHistories: options.reviewedPriorHistories }
|
|
643
|
-
: {}),
|
|
644
|
-
});
|
|
645
|
-
const bucketName = stateBucketName(options.expectedAccountId, options.region, options.expectedStage);
|
|
646
|
-
const projectPlans = boundary.documents.map((document) => {
|
|
647
|
-
const expectedProvisionerArn = workloadRoleProvisionerAliasArn({
|
|
648
|
-
accountId: document.accountId,
|
|
649
|
-
manifestDigest: document.manifestDigest,
|
|
650
|
-
partition: document.partition,
|
|
651
|
-
project: document.project,
|
|
652
|
-
region: options.region,
|
|
653
|
-
stage: document.manifest.candidate.stage,
|
|
654
|
-
});
|
|
655
|
-
if (document.provisionerFunctionArn !== expectedProvisionerArn) {
|
|
656
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-substitution', `Registered project ${document.project} does not name its exact candidate-qualified provisioner.`);
|
|
657
|
-
}
|
|
658
|
-
const storage = (0, registration_js_1.createWorkloadRoleStorageRegistration)({
|
|
659
|
-
bucketName,
|
|
660
|
-
candidateIdentity: document.manifest.candidate.identity,
|
|
661
|
-
manifestDigest: document.manifestDigest,
|
|
662
|
-
project: document.project,
|
|
663
|
-
provisionerFunctionArn: expectedProvisionerArn,
|
|
664
|
-
stage: document.manifest.candidate.stage,
|
|
665
|
-
});
|
|
666
|
-
return {
|
|
667
|
-
candidateIdentity: document.manifest.candidate.identity,
|
|
668
|
-
functionName: provisionerFunctionName(document.manifest.candidate.stage, document.project),
|
|
669
|
-
manifestDigest: document.manifestDigest,
|
|
670
|
-
project: document.project,
|
|
671
|
-
provisionerAliasArn: expectedProvisionerArn,
|
|
672
|
-
provisionerAliasName: `candidate-${document.manifestDigest}`,
|
|
673
|
-
provisionerRequest: {
|
|
674
|
-
candidateIdentity: document.manifest.candidate.identity,
|
|
675
|
-
manifestDigest: document.manifestDigest,
|
|
676
|
-
operation: 'converge',
|
|
677
|
-
stage: document.manifest.candidate.stage,
|
|
678
|
-
},
|
|
679
|
-
registeredDocument: document,
|
|
680
|
-
registeredManifestObjectKey: (0, registration_js_1.registeredWorkloadRoleManifestObjectKey)({
|
|
681
|
-
manifestDigest: document.manifestDigest,
|
|
682
|
-
project: document.project,
|
|
683
|
-
provisionerFunctionArn: expectedProvisionerArn,
|
|
684
|
-
stage: document.manifest.candidate.stage,
|
|
685
|
-
}),
|
|
686
|
-
storage,
|
|
687
|
-
storageParameterName: (0, registration_js_1.workloadRoleStorageRegistrationPath)(document.manifest.candidate.stage, document.project),
|
|
688
|
-
};
|
|
689
|
-
});
|
|
690
|
-
const roleName = provisionerRoleName(options.expectedStage);
|
|
691
|
-
return {
|
|
692
|
-
boundary,
|
|
693
|
-
candidateIdentity: options.expectedCandidateIdentity,
|
|
694
|
-
deploymentRoleArn: options.reviewedDeploymentRoleArn,
|
|
695
|
-
deploymentRoleName: deploymentRole[3],
|
|
696
|
-
projectPlans,
|
|
697
|
-
provisionerRoleName: roleName,
|
|
698
|
-
publisherPrincipalArn: options.reviewedPublisherPrincipalArn,
|
|
699
|
-
region: options.region,
|
|
700
|
-
schemaVersion: exports.WORKLOAD_ROLE_ACCOUNT_BASELINE_SCHEMA_VERSION,
|
|
701
|
-
stackName: stackName(options.expectedStage),
|
|
702
|
-
stage: options.expectedStage,
|
|
703
|
-
stateBucketName: bucketName,
|
|
704
|
-
settledCloudFormationTemplate: cloudFormationTemplate({
|
|
705
|
-
boundary,
|
|
706
|
-
code,
|
|
707
|
-
projectPlans,
|
|
708
|
-
provisionerRoleName: roleName,
|
|
709
|
-
region: options.region,
|
|
710
|
-
stateBucketName: bucketName,
|
|
711
|
-
transitionalInstanceProfileArns: [],
|
|
712
|
-
transitionalRoleArns: [],
|
|
713
|
-
}),
|
|
714
|
-
transitionalCloudFormationTemplate: cloudFormationTemplate({
|
|
715
|
-
boundary,
|
|
716
|
-
code,
|
|
717
|
-
projectPlans,
|
|
718
|
-
provisionerRoleName: roleName,
|
|
719
|
-
region: options.region,
|
|
720
|
-
stateBucketName: bucketName,
|
|
721
|
-
transitionalInstanceProfileArns: transitionAuthority.instanceProfileArns,
|
|
722
|
-
transitionalRoleArns: transitionAuthority.roleArns,
|
|
723
|
-
}),
|
|
724
|
-
transitionalInstanceProfileArns: transitionAuthority.instanceProfileArns,
|
|
725
|
-
transitionalRoleArns: transitionAuthority.roleArns,
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
function requireSuccessResult(plan, value) {
|
|
729
|
-
if (typeof value !== 'object' ||
|
|
730
|
-
value === null ||
|
|
731
|
-
Array.isArray(value) ||
|
|
732
|
-
!('ok' in value) ||
|
|
733
|
-
value.ok !== true) {
|
|
734
|
-
const internalClassification = boundedInternalFailureClassification(value);
|
|
735
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-result-invalid', internalClassification
|
|
736
|
-
? `Fixed provisioner for ${plan.project} returned ${internalClassification} without sanitized success.`
|
|
737
|
-
: `Fixed provisioner for ${plan.project} did not return sanitized success.`);
|
|
738
|
-
}
|
|
739
|
-
const result = value;
|
|
740
|
-
const allowed = [
|
|
741
|
-
'candidateIdentity',
|
|
742
|
-
'historyDigest',
|
|
743
|
-
'manifestDigest',
|
|
744
|
-
'ok',
|
|
745
|
-
'operation',
|
|
746
|
-
'operationCounts',
|
|
747
|
-
'protocolVersion',
|
|
748
|
-
'provisionedRegistration',
|
|
749
|
-
'resultSchemaVersion',
|
|
750
|
-
'stage',
|
|
751
|
-
];
|
|
752
|
-
if (Object.keys(result).some((property) => !allowed.includes(property)) ||
|
|
753
|
-
result.candidateIdentity !== plan.candidateIdentity ||
|
|
754
|
-
typeof result.historyDigest !== 'string' ||
|
|
755
|
-
!digestPattern.test(result.historyDigest) ||
|
|
756
|
-
result.manifestDigest !== plan.manifestDigest ||
|
|
757
|
-
result.operation !== 'converge' ||
|
|
758
|
-
result.protocolVersion !==
|
|
759
|
-
provisioner_js_1.FIXED_WORKLOAD_ROLE_PROVISIONER_PROTOCOL_VERSION ||
|
|
760
|
-
result.resultSchemaVersion !==
|
|
761
|
-
handler_js_1.FIXED_WORKLOAD_ROLE_PROVISIONER_RESULT_SCHEMA_VERSION ||
|
|
762
|
-
result.stage !== plan.registeredDocument.manifest.candidate.stage ||
|
|
763
|
-
typeof result.operationCounts !== 'object' ||
|
|
764
|
-
result.operationCounts === null ||
|
|
765
|
-
Array.isArray(result.operationCounts)) {
|
|
766
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-result-invalid', `Fixed provisioner success envelope for ${plan.project} was substituted.`);
|
|
767
|
-
}
|
|
768
|
-
const counts = result.operationCounts;
|
|
769
|
-
if (Object.keys(counts).sort().join(',') !== 'create,remove,update' ||
|
|
770
|
-
Object.values(counts).some((count) => !Number.isSafeInteger(count) || count < 0)) {
|
|
771
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-result-invalid', `Fixed provisioner operation counts for ${plan.project} are invalid.`);
|
|
772
|
-
}
|
|
773
|
-
const provisionedRegistration = (0, registration_js_1.requireProvisionedWorkloadRoleRegistrationDocument)(result.provisionedRegistration);
|
|
774
|
-
if (provisionedRegistration.registration.provisionerFunctionArn !==
|
|
775
|
-
plan.provisionerAliasArn) {
|
|
776
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-result-invalid', `Fixed provisioner result for ${plan.project} names another alias.`);
|
|
777
|
-
}
|
|
778
|
-
return {
|
|
779
|
-
...value,
|
|
780
|
-
provisionedRegistration,
|
|
781
|
-
};
|
|
782
|
-
}
|
|
783
|
-
function boundedInternalFailureClassification(value) {
|
|
784
|
-
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
785
|
-
return undefined;
|
|
786
|
-
}
|
|
787
|
-
const result = value;
|
|
788
|
-
if (Object.keys(result).sort().join(',') ===
|
|
789
|
-
'classification,ok,protocolVersion,resultSchemaVersion' &&
|
|
790
|
-
typeof result.classification === 'string' &&
|
|
791
|
-
boundedInternalProvisionerFailures.has(result.classification) &&
|
|
792
|
-
result.ok === false &&
|
|
793
|
-
result.protocolVersion ===
|
|
794
|
-
provisioner_js_1.FIXED_WORKLOAD_ROLE_PROVISIONER_PROTOCOL_VERSION &&
|
|
795
|
-
result.resultSchemaVersion ===
|
|
796
|
-
handler_js_1.FIXED_WORKLOAD_ROLE_PROVISIONER_RESULT_SCHEMA_VERSION) {
|
|
797
|
-
return result.classification;
|
|
798
|
-
}
|
|
799
|
-
return undefined;
|
|
800
|
-
}
|
|
801
|
-
function isRetryableProvisionerFailure(value) {
|
|
802
|
-
const classification = boundedInternalFailureClassification(value);
|
|
803
|
-
return (classification !== undefined &&
|
|
804
|
-
retryableProvisionerFailures.has(classification));
|
|
805
|
-
}
|
|
806
|
-
async function invokeQualifiedProvisionerWithRetry(options) {
|
|
807
|
-
for (let attempt = 1; attempt <= exports.WORKLOAD_ROLE_PROVISIONER_MAX_ATTEMPTS; attempt += 1) {
|
|
808
|
-
const result = await options.controlPlane.invokeQualifiedProvisioner(options.plan.provisionerAliasArn, options.plan.provisionerRequest);
|
|
809
|
-
if (!isRetryableProvisionerFailure(result) ||
|
|
810
|
-
attempt === exports.WORKLOAD_ROLE_PROVISIONER_MAX_ATTEMPTS) {
|
|
811
|
-
return result;
|
|
812
|
-
}
|
|
813
|
-
const delayMs = workloadRoleProvisionerRetryDelaysMs[attempt - 1];
|
|
814
|
-
const wait = options.waitBeforeProvisionerRetry ??
|
|
815
|
-
(({ delayMs: boundedDelayMs }) => new Promise((resolve) => {
|
|
816
|
-
setTimeout(resolve, boundedDelayMs);
|
|
817
|
-
}));
|
|
818
|
-
await wait({
|
|
819
|
-
attempt,
|
|
820
|
-
delayMs,
|
|
821
|
-
maxAttempts: exports.WORKLOAD_ROLE_PROVISIONER_MAX_ATTEMPTS,
|
|
822
|
-
project: options.plan.project,
|
|
823
|
-
});
|
|
824
|
-
}
|
|
825
|
-
throw new Error('Unreachable bounded provisioner retry state.');
|
|
826
|
-
}
|
|
827
|
-
function deploymentStatementSid(project, sid) {
|
|
828
|
-
const projectDigest = (0, node_crypto_1.createHash)('sha256')
|
|
829
|
-
.update(project, 'utf8')
|
|
830
|
-
.digest('hex')
|
|
831
|
-
.slice(0, 12);
|
|
832
|
-
return `Project${projectDigest}${sid}`;
|
|
833
|
-
}
|
|
834
|
-
function deploymentPolicyCloudFormationTemplate(options) {
|
|
835
|
-
const documents = boundedManagedPolicyDocuments(options.deploymentPolicy, 'Deployment policy', IAM_DEPLOYMENT_ROLE_MAX_FRAMEWORK_MANAGED_POLICIES);
|
|
836
|
-
return {
|
|
837
|
-
AWSTemplateFormatVersion: '2010-09-09',
|
|
838
|
-
Description: 'Protected Empire Builder Kit v1 exact stage workload-role deployment authority. Apply only after complete provisioner convergence.',
|
|
839
|
-
Resources: Object.fromEntries(documents.map((document, index) => [
|
|
840
|
-
`WorkloadRoleDeploymentPolicy${index + 1}`,
|
|
841
|
-
{
|
|
842
|
-
Properties: {
|
|
843
|
-
Description: `Exact reviewed authority shard ${index + 1} for the ${options.boundary.stage} deployment role.`,
|
|
844
|
-
ManagedPolicyName: stableName([
|
|
845
|
-
'ebk',
|
|
846
|
-
options.boundary.stage,
|
|
847
|
-
'workload-role-deployment',
|
|
848
|
-
'v2',
|
|
849
|
-
`policy-${index + 1}`,
|
|
850
|
-
], 128),
|
|
851
|
-
Path: options.boundary.path,
|
|
852
|
-
PolicyDocument: document,
|
|
853
|
-
Roles: [options.deploymentRoleName],
|
|
854
|
-
},
|
|
855
|
-
Type: 'AWS::IAM::ManagedPolicy',
|
|
856
|
-
},
|
|
857
|
-
])),
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
|
-
function createWorkloadRoleStageDeploymentPromotion(options) {
|
|
861
|
-
const resultProjects = Object.keys(options.provisionerResults).sort(compareStrings);
|
|
862
|
-
const expectedProjects = options.plan.projectPlans
|
|
863
|
-
.map(({ project }) => project)
|
|
864
|
-
.sort(compareStrings);
|
|
865
|
-
if (JSON.stringify(resultProjects) !== JSON.stringify(expectedProjects)) {
|
|
866
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-project-set-invalid', 'Provisioner results must contain the complete reviewed project set.');
|
|
867
|
-
}
|
|
868
|
-
const deploymentStatements = [];
|
|
869
|
-
const projectPromotions = {};
|
|
870
|
-
const sanitizedProjects = [];
|
|
871
|
-
for (const plan of options.plan.projectPlans) {
|
|
872
|
-
const result = requireSuccessResult(plan, options.provisionerResults[plan.project]);
|
|
873
|
-
const preflight = (0, registration_js_1.validateWorkloadRolePreflight)({
|
|
874
|
-
expectedCandidateIdentity: options.plan.candidateIdentity,
|
|
875
|
-
expectedProject: plan.project,
|
|
876
|
-
expectedStage: options.plan.stage,
|
|
877
|
-
provisionedRegistration: result.provisionedRegistration,
|
|
878
|
-
registeredManifest: plan.registeredDocument,
|
|
879
|
-
storageRegistration: plan.storage,
|
|
880
|
-
});
|
|
881
|
-
deploymentStatements.push(...preflight.authorityPlan.statements.map((statement) => ({
|
|
882
|
-
Action: [...statement.actions],
|
|
883
|
-
...(statement.conditions ? { Condition: statement.conditions } : {}),
|
|
884
|
-
Effect: statement.effect,
|
|
885
|
-
Resource: [...statement.resources],
|
|
886
|
-
Sid: deploymentStatementSid(plan.project, statement.sid),
|
|
887
|
-
})));
|
|
888
|
-
projectPromotions[plan.project] = {
|
|
889
|
-
provisionedRegistration: result.provisionedRegistration,
|
|
890
|
-
storageParameterName: plan.storageParameterName,
|
|
891
|
-
storageParameterValue: JSON.stringify(plan.storage),
|
|
892
|
-
};
|
|
893
|
-
sanitizedProjects.push({
|
|
894
|
-
historyDigest: result.historyDigest,
|
|
895
|
-
manifestDigest: plan.manifestDigest,
|
|
896
|
-
operationCounts: {
|
|
897
|
-
create: result.operationCounts.create,
|
|
898
|
-
remove: result.operationCounts.remove,
|
|
899
|
-
update: result.operationCounts.update,
|
|
900
|
-
},
|
|
901
|
-
project: plan.project,
|
|
902
|
-
});
|
|
903
|
-
}
|
|
904
|
-
deploymentStatements.sort((left, right) => compareStrings(left.Sid, right.Sid));
|
|
905
|
-
const deploymentPolicy = {
|
|
906
|
-
Statement: deploymentStatements,
|
|
907
|
-
Version: '2012-10-17',
|
|
908
|
-
};
|
|
909
|
-
return {
|
|
910
|
-
deploymentPolicy,
|
|
911
|
-
deploymentPolicyName: exports.WORKLOAD_ROLE_DEPLOYMENT_POLICY_NAME,
|
|
912
|
-
deploymentPolicyStackName: deploymentPolicyStackName(options.plan.stage),
|
|
913
|
-
deploymentPolicyTemplate: deploymentPolicyCloudFormationTemplate({
|
|
914
|
-
boundary: options.plan.boundary,
|
|
915
|
-
deploymentPolicy,
|
|
916
|
-
deploymentRoleName: options.plan.deploymentRoleName,
|
|
917
|
-
}),
|
|
918
|
-
projectPromotions,
|
|
919
|
-
sanitizedResult: {
|
|
920
|
-
candidateIdentity: options.plan.candidateIdentity,
|
|
921
|
-
projects: sanitizedProjects,
|
|
922
|
-
stage: options.plan.stage,
|
|
923
|
-
},
|
|
924
|
-
};
|
|
925
|
-
}
|
|
926
|
-
/**
|
|
927
|
-
* Protected stage promotion ordering. The aggregate boundary and narrowly
|
|
928
|
-
* reviewed transition authority are updated first, then every exact registered
|
|
929
|
-
* project converges. The settled baseline removes transition authority before
|
|
930
|
-
* the ordinary deployment policy or any project pointer is promoted. Those
|
|
931
|
-
* promotion surfaces remain unchanged unless every project returns an exact
|
|
932
|
-
* sanitized success and the settled baseline applies.
|
|
933
|
-
*/
|
|
934
|
-
async function publishReviewedStageWorkloadRoleCandidate(options) {
|
|
935
|
-
await options.controlPlane.applyAccountBaseline(options.plan.transitionalCloudFormationTemplate, options.plan.stackName);
|
|
936
|
-
for (const project of options.plan.projectPlans) {
|
|
937
|
-
await options.controlPlane.putRegisteredDocument({
|
|
938
|
-
bucketName: project.storage.bucketName,
|
|
939
|
-
key: project.registeredManifestObjectKey,
|
|
940
|
-
value: project.registeredDocument,
|
|
941
|
-
});
|
|
942
|
-
}
|
|
943
|
-
const provisionerResults = {};
|
|
944
|
-
for (const project of options.plan.projectPlans) {
|
|
945
|
-
provisionerResults[project.project] =
|
|
946
|
-
await invokeQualifiedProvisionerWithRetry({
|
|
947
|
-
controlPlane: options.controlPlane,
|
|
948
|
-
plan: project,
|
|
949
|
-
...(options.waitBeforeProvisionerRetry
|
|
950
|
-
? {
|
|
951
|
-
waitBeforeProvisionerRetry: options.waitBeforeProvisionerRetry,
|
|
952
|
-
}
|
|
953
|
-
: {}),
|
|
954
|
-
});
|
|
955
|
-
}
|
|
956
|
-
const promotion = createWorkloadRoleStageDeploymentPromotion({
|
|
957
|
-
plan: options.plan,
|
|
958
|
-
provisionerResults,
|
|
959
|
-
});
|
|
960
|
-
await options.controlPlane.applyAccountBaseline(options.plan.settledCloudFormationTemplate, options.plan.stackName);
|
|
961
|
-
await options.controlPlane.putDeploymentRolePolicy({
|
|
962
|
-
policy: promotion.deploymentPolicy,
|
|
963
|
-
policyName: promotion.deploymentPolicyName,
|
|
964
|
-
roleName: options.plan.deploymentRoleName,
|
|
965
|
-
stackName: promotion.deploymentPolicyStackName,
|
|
966
|
-
template: promotion.deploymentPolicyTemplate,
|
|
967
|
-
});
|
|
968
|
-
for (const project of options.plan.projectPlans) {
|
|
969
|
-
const promoted = promotion.projectPromotions[project.project];
|
|
970
|
-
if (!promoted) {
|
|
971
|
-
throw new WorkloadRoleAccountBaselineError('account-baseline-result-invalid', `Promotion result for ${project.project} is absent.`);
|
|
972
|
-
}
|
|
973
|
-
await options.controlPlane.putStoragePointer({
|
|
974
|
-
name: promoted.storageParameterName,
|
|
975
|
-
value: promoted.storageParameterValue,
|
|
976
|
-
});
|
|
977
|
-
}
|
|
978
|
-
return promotion.sanitizedResult;
|
|
979
|
-
}
|
|
980
|
-
//# sourceMappingURL=account-baseline.js.map
|