@empire-builder-kit/nx 1.0.0-beta.9 → 1.0.0-rc.2
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/NOTICE +6 -0
- package/README.md +113 -3
- package/executors.json +30 -0
- package/package.json +84 -6
- package/src/api-contract/baseline-update.d.ts +82 -0
- package/src/api-contract/baseline-update.js +225 -0
- package/src/api-contract/baseline-update.js.map +1 -0
- package/src/api-contract/compatibility.d.ts +30 -0
- package/src/api-contract/compatibility.js +643 -0
- package/src/api-contract/compatibility.js.map +1 -0
- package/src/api-contract/contract-graph.d.ts +35 -0
- package/src/api-contract/contract-graph.js +141 -0
- package/src/api-contract/contract-graph.js.map +1 -0
- package/src/api-contract/evidence.d.ts +23 -0
- package/src/api-contract/evidence.js +87 -0
- package/src/api-contract/evidence.js.map +1 -0
- package/src/api-contract/index.d.ts +6 -0
- package/src/api-contract/index.js +10 -0
- package/src/api-contract/index.js.map +1 -0
- package/src/api-contract/model.d.ts +144 -0
- package/src/api-contract/model.fixtures.d.ts +2 -0
- package/src/api-contract/model.fixtures.js +81 -0
- package/src/api-contract/model.fixtures.js.map +1 -0
- package/src/api-contract/model.js +993 -0
- package/src/api-contract/model.js.map +1 -0
- package/src/api-contract/rollout.d.ts +32 -0
- package/src/api-contract/rollout.js +88 -0
- package/src/api-contract/rollout.js.map +1 -0
- package/src/authorization/compatibility.d.ts +62 -0
- package/src/authorization/compatibility.js +175 -0
- package/src/authorization/compatibility.js.map +1 -0
- package/src/authorization/index.d.ts +1 -0
- package/src/authorization/index.js +5 -0
- package/src/authorization/index.js.map +1 -0
- package/src/blueprints/execution.d.ts +25 -1
- package/src/blueprints/execution.js +246 -83
- package/src/blueprints/execution.js.map +1 -1
- package/src/blueprints/external-sandbox.d.ts +53 -0
- package/src/blueprints/external-sandbox.js +1182 -0
- package/src/blueprints/external-sandbox.js.map +1 -0
- package/src/blueprints/manifest.d.ts +42 -2
- package/src/blueprints/manifest.js +82 -27
- package/src/blueprints/manifest.js.map +1 -1
- package/src/blueprints/resolver.d.ts +14 -5
- package/src/blueprints/resolver.js +228 -68
- package/src/blueprints/resolver.js.map +1 -1
- package/src/cli/agent-command.d.ts +30 -0
- package/src/cli/agent-command.js +204 -0
- package/src/cli/agent-command.js.map +1 -0
- package/src/cli/agent-runtime.d.ts +25 -0
- package/src/cli/agent-runtime.js +488 -0
- package/src/cli/agent-runtime.js.map +1 -0
- package/src/cli/blueprint-authority.d.ts +9 -0
- package/src/cli/blueprint-authority.js +43 -0
- package/src/cli/blueprint-authority.js.map +1 -0
- package/src/cli/blueprint-command.d.ts +24 -0
- package/src/cli/blueprint-command.js +63 -0
- package/src/cli/blueprint-command.js.map +1 -0
- package/src/cli/bootstrap.d.ts +31 -0
- package/src/cli/bootstrap.js +165 -0
- package/src/cli/bootstrap.js.map +1 -0
- package/src/cli/dev-command.d.ts +92 -0
- package/src/cli/dev-command.js +561 -0
- package/src/cli/dev-command.js.map +1 -0
- package/src/cli/main.d.ts +131 -0
- package/src/cli/main.js +1199 -0
- package/src/cli/main.js.map +1 -0
- package/src/cli/output.d.ts +19 -0
- package/src/cli/output.js +51 -0
- package/src/cli/output.js.map +1 -0
- package/src/cli/personal-secret-runtime.d.ts +81 -0
- package/src/cli/personal-secret-runtime.js +567 -0
- package/src/cli/personal-secret-runtime.js.map +1 -0
- package/src/cli/secret-terminal.d.ts +12 -0
- package/src/cli/secret-terminal.js +128 -0
- package/src/cli/secret-terminal.js.map +1 -0
- package/src/container-images.d.ts +1 -0
- package/src/container-images.js +5 -0
- package/src/container-images.js.map +1 -0
- package/src/data-lifecycle/index.d.ts +3 -0
- package/src/data-lifecycle/index.js +7 -0
- package/src/data-lifecycle/index.js.map +1 -0
- package/src/data-lifecycle/model.d.ts +172 -0
- package/src/data-lifecycle/model.fixtures.d.ts +2 -0
- package/src/data-lifecycle/model.fixtures.js +244 -0
- package/src/data-lifecycle/model.fixtures.js.map +1 -0
- package/src/data-lifecycle/model.js +95 -0
- package/src/data-lifecycle/model.js.map +1 -0
- package/src/data-lifecycle/sensitive-artifacts.d.ts +28 -0
- package/src/data-lifecycle/sensitive-artifacts.js +146 -0
- package/src/data-lifecycle/sensitive-artifacts.js.map +1 -0
- package/src/data-lifecycle/validation.d.ts +32 -0
- package/src/data-lifecycle/validation.js +837 -0
- package/src/data-lifecycle/validation.js.map +1 -0
- package/src/database-retirement/contract.d.ts +68 -0
- package/src/database-retirement/contract.js +166 -0
- package/src/database-retirement/contract.js.map +1 -0
- package/src/database-retirement/index.d.ts +1 -0
- package/src/database-retirement/index.js +5 -0
- package/src/database-retirement/index.js.map +1 -0
- package/src/deterministic-order.d.ts +2 -0
- package/src/deterministic-order.js +7 -0
- package/src/deterministic-order.js.map +1 -0
- package/src/developer-agent/context.d.ts +27 -0
- package/src/developer-agent/context.js +497 -0
- package/src/developer-agent/context.js.map +1 -0
- package/src/developer-agent/generator-planning.d.ts +34 -0
- package/src/developer-agent/generator-planning.js +645 -0
- package/src/developer-agent/generator-planning.js.map +1 -0
- package/src/developer-agent/generator-preview.d.ts +8 -0
- package/src/developer-agent/generator-preview.js +650 -0
- package/src/developer-agent/generator-preview.js.map +1 -0
- package/src/developer-agent/git-inspection.d.ts +108 -0
- package/src/developer-agent/git-inspection.js +815 -0
- package/src/developer-agent/git-inspection.js.map +1 -0
- package/src/developer-agent/handoff.d.ts +43 -0
- package/src/developer-agent/handoff.js +698 -0
- package/src/developer-agent/handoff.js.map +1 -0
- package/src/developer-agent/index.d.ts +10 -0
- package/src/developer-agent/index.js +14 -0
- package/src/developer-agent/index.js.map +1 -0
- package/src/developer-agent/model.d.ts +481 -0
- package/src/developer-agent/model.js +143 -0
- package/src/developer-agent/model.js.map +1 -0
- package/src/developer-agent/operation-registry.d.ts +45 -0
- package/src/developer-agent/operation-registry.js +1255 -0
- package/src/developer-agent/operation-registry.js.map +1 -0
- package/src/developer-agent/ordering.d.ts +9 -0
- package/src/developer-agent/ordering.js +15 -0
- package/src/developer-agent/ordering.js.map +1 -0
- package/src/developer-agent/planning.d.ts +18 -0
- package/src/developer-agent/planning.js +447 -0
- package/src/developer-agent/planning.js.map +1 -0
- package/src/developer-agent/preview-changes.d.ts +26 -0
- package/src/developer-agent/preview-changes.js +203 -0
- package/src/developer-agent/preview-changes.js.map +1 -0
- package/src/developer-agent/preview-source.d.ts +2 -0
- package/src/developer-agent/preview-source.js +16 -0
- package/src/developer-agent/preview-source.js.map +1 -0
- package/src/developer-agent/validation.d.ts +18 -0
- package/src/developer-agent/validation.js +2617 -0
- package/src/developer-agent/validation.js.map +1 -0
- package/src/developer-agent/workspace-inspection.d.ts +20 -0
- package/src/developer-agent/workspace-inspection.js +1134 -0
- package/src/developer-agent/workspace-inspection.js.map +1 -0
- package/src/developer-agent/workspace-path.d.ts +6 -0
- package/src/developer-agent/workspace-path.js +22 -0
- package/src/developer-agent/workspace-path.js.map +1 -0
- package/src/executors/blueprint-trust/blueprint-trust.d.ts +29 -0
- package/src/executors/blueprint-trust/blueprint-trust.js +115 -0
- package/src/executors/blueprint-trust/blueprint-trust.js.map +1 -0
- package/src/executors/blueprint-trust/schema.json +27 -0
- package/src/executors/blueprint-verification/blueprint-verification.d.ts +13 -0
- package/src/executors/blueprint-verification/blueprint-verification.js +110 -0
- package/src/executors/blueprint-verification/blueprint-verification.js.map +1 -0
- package/src/executors/blueprint-verification/schema.json +44 -0
- package/src/executors/deployment-plan/deployment-plan.js +1 -0
- package/src/executors/deployment-plan/deployment-plan.js.map +1 -1
- package/src/executors/dev-doctor/dev-doctor.d.ts +19 -5
- package/src/executors/dev-doctor/dev-doctor.js +186 -32
- package/src/executors/dev-doctor/dev-doctor.js.map +1 -1
- package/src/executors/dev-doctor/schema.json +1 -6
- package/src/executors/dev-setup/dev-setup.d.ts +7 -1
- package/src/executors/dev-setup/dev-setup.js +14 -3
- package/src/executors/dev-setup/dev-setup.js.map +1 -1
- package/src/executors/developer-context/developer-context.d.ts +38 -0
- package/src/executors/developer-context/developer-context.js +78 -0
- package/src/executors/developer-context/developer-context.js.map +1 -0
- package/src/executors/developer-context/schema.json +87 -0
- package/src/executors/fleet/fleet.d.ts +12 -43
- package/src/executors/fleet/fleet.js +120 -500
- package/src/executors/fleet/fleet.js.map +1 -1
- package/src/executors/fleet/schema.json +64 -14
- package/src/executors/github-bootstrap/github-bootstrap.d.ts +1 -0
- package/src/executors/github-bootstrap/github-bootstrap.js +1 -0
- package/src/executors/github-bootstrap/github-bootstrap.js.map +1 -1
- package/src/executors/github-bootstrap/schema.json +5 -0
- package/src/executors/infrastructure-plan/infrastructure-plan.d.ts +144 -0
- package/src/executors/infrastructure-plan/infrastructure-plan.js +3320 -0
- package/src/executors/infrastructure-plan/infrastructure-plan.js.map +1 -0
- package/src/executors/infrastructure-plan/schema.json +78 -0
- package/src/executors/secret-guardrails/schema.json +6 -0
- package/src/executors/secret-guardrails/secret-guardrails.d.ts +3 -0
- package/src/executors/secret-guardrails/secret-guardrails.js +44 -0
- package/src/executors/secret-guardrails/secret-guardrails.js.map +1 -0
- package/src/executors/secret-metadata/schema.json +31 -0
- package/src/executors/secret-metadata/secret-metadata.d.ts +32 -0
- package/src/executors/secret-metadata/secret-metadata.js +131 -0
- package/src/executors/secret-metadata/secret-metadata.js.map +1 -0
- package/src/executors/sst-lifecycle/logging-preflight.d.ts +17 -0
- package/src/executors/sst-lifecycle/logging-preflight.js +196 -0
- package/src/executors/sst-lifecycle/logging-preflight.js.map +1 -0
- package/src/executors/sst-lifecycle/run-sst-command.d.ts +23 -3
- package/src/executors/sst-lifecycle/run-sst-command.js +113 -10
- package/src/executors/sst-lifecycle/run-sst-command.js.map +1 -1
- package/src/executors/sst-lifecycle/schema.json +9 -5
- package/src/executors/sst-lifecycle/secret-preflight.d.ts +25 -0
- package/src/executors/sst-lifecycle/secret-preflight.js +119 -0
- package/src/executors/sst-lifecycle/secret-preflight.js.map +1 -0
- package/src/foundation/discovery.d.ts +17 -1
- package/src/foundation/discovery.js +16 -1
- package/src/foundation/discovery.js.map +1 -1
- package/src/foundation/index.d.ts +3 -0
- package/src/foundation/index.js +3 -0
- package/src/foundation/index.js.map +1 -1
- package/src/foundation/local-database-contract.d.ts +1 -0
- package/src/foundation/local-database-contract.js +3 -0
- package/src/foundation/local-database-contract.js.map +1 -1
- package/src/foundation/logging-preflight.d.ts +30 -0
- package/src/foundation/logging-preflight.js +138 -0
- package/src/foundation/logging-preflight.js.map +1 -0
- package/src/foundation/logging.d.ts +70 -0
- package/src/foundation/logging.js +133 -0
- package/src/foundation/logging.js.map +1 -0
- package/src/foundation/preflight.d.ts +9 -0
- package/src/foundation/preflight.js +58 -2
- package/src/foundation/preflight.js.map +1 -1
- package/src/foundation/provision-database-bindings.d.ts +9 -1
- package/src/foundation/provision-database-bindings.js +25 -5
- package/src/foundation/provision-database-bindings.js.map +1 -1
- package/src/foundation/provision-logical-database.d.ts +10 -2
- package/src/foundation/provision-logical-database.js +68 -113
- package/src/foundation/provision-logical-database.js.map +1 -1
- package/src/foundation/router-origin-proof.d.ts +2 -0
- package/src/foundation/router-origin-proof.js +25 -0
- package/src/foundation/router-origin-proof.js.map +1 -0
- package/src/foundation/stages.d.ts +1 -0
- package/src/foundation/stages.js +9 -1
- package/src/foundation/stages.js.map +1 -1
- package/src/frontend-security/index.d.ts +1 -0
- package/src/frontend-security/index.js +5 -0
- package/src/frontend-security/index.js.map +1 -0
- package/src/frontend-security/security-headers.d.ts +50 -0
- package/src/frontend-security/security-headers.js +418 -0
- package/src/frontend-security/security-headers.js.map +1 -0
- package/src/generators/feature-registry.d.ts +13 -0
- package/src/generators/feature-registry.js +73 -0
- package/src/generators/feature-registry.js.map +1 -0
- package/src/generators/function/function.d.ts +1 -1
- package/src/generators/function/function.js +51 -6
- package/src/generators/function/function.js.map +1 -1
- package/src/generators/function/schema.d.ts +1 -0
- package/src/generators/function/schema.json +6 -1
- package/src/generators/logging-registry.d.ts +13 -0
- package/src/generators/logging-registry.js +62 -0
- package/src/generators/logging-registry.js.map +1 -0
- package/src/generators/post-generation-install.d.ts +67 -0
- package/src/generators/post-generation-install.js +3308 -0
- package/src/generators/post-generation-install.js.map +1 -0
- package/src/generators/preset/generator.js +3 -0
- package/src/generators/preset/generator.js.map +1 -1
- package/src/generators/preset/tool-versions.d.ts +18 -0
- package/src/generators/preset/tool-versions.js +22 -0
- package/src/generators/preset/tool-versions.js.map +1 -0
- package/src/generators/preset/workspace-files-developer-agent.d.ts +14 -0
- package/src/generators/preset/workspace-files-developer-agent.js +511 -0
- package/src/generators/preset/workspace-files-developer-agent.js.map +1 -0
- package/src/generators/preset/workspace-files-foundation-workload-roles.d.ts +6 -0
- package/src/generators/preset/workspace-files-foundation-workload-roles.js +406 -0
- package/src/generators/preset/workspace-files-foundation-workload-roles.js.map +1 -0
- package/src/generators/preset/workspace-files-performance-cost.d.ts +66 -0
- package/src/generators/preset/workspace-files-performance-cost.js +866 -0
- package/src/generators/preset/workspace-files-performance-cost.js.map +1 -0
- package/src/generators/preset/workspace-files-performance-load.d.ts +73 -0
- package/src/generators/preset/workspace-files-performance-load.js +801 -0
- package/src/generators/preset/workspace-files-performance-load.js.map +1 -0
- package/src/generators/preset/workspace-files-workload-role-baseline.d.ts +9 -0
- package/src/generators/preset/workspace-files-workload-role-baseline.js +1102 -0
- package/src/generators/preset/workspace-files-workload-role-baseline.js.map +1 -0
- package/src/generators/preset/workspace-files.d.ts +14 -1
- package/src/generators/preset/workspace-files.js +8189 -245
- package/src/generators/preset/workspace-files.js.map +1 -1
- package/src/generators/repository-policy/repository-policy.js +3 -47
- package/src/generators/repository-policy/repository-policy.js.map +1 -1
- package/src/generators/slice/built-in-plan-api-contract-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-api-contract-files.js +2656 -0
- package/src/generators/slice/built-in-plan-api-contract-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-api-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-api-files.js +1186 -0
- package/src/generators/slice/built-in-plan-api-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-async-work-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-async-work-files.js +7903 -0
- package/src/generators/slice/built-in-plan-async-work-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-authorization-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-authorization-files.js +2314 -0
- package/src/generators/slice/built-in-plan-authorization-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +559 -0
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-deletion-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-deletion-files.js +1101 -0
- package/src/generators/slice/built-in-plan-data-deletion-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js +249 -0
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-files.js +1530 -0
- package/src/generators/slice/built-in-plan-data-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-files.js +750 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js +828 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-retention-job-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-retention-job-files.js +2604 -0
- package/src/generators/slice/built-in-plan-data-retention-job-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js +144 -0
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-data-rights-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-data-rights-files.js +4628 -0
- package/src/generators/slice/built-in-plan-data-rights-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-database-lifecycle-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-database-lifecycle-files.js +1901 -0
- package/src/generators/slice/built-in-plan-database-lifecycle-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js +485 -0
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-foundation-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-foundation-files.js +184 -0
- package/src/generators/slice/built-in-plan-foundation-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-frontend-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-frontend-files.js +2233 -0
- package/src/generators/slice/built-in-plan-frontend-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-infrastructure-files.js +3038 -0
- package/src/generators/slice/built-in-plan-infrastructure-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-infrastructure-safety-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-infrastructure-safety-files.js +312 -0
- package/src/generators/slice/built-in-plan-infrastructure-safety-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-metadata-files.d.ts +3 -0
- package/src/generators/slice/built-in-plan-metadata-files.js +219 -0
- package/src/generators/slice/built-in-plan-metadata-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-operations-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-operations-files.js +630 -0
- package/src/generators/slice/built-in-plan-operations-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-performance-files.d.ts +3 -0
- package/src/generators/slice/built-in-plan-performance-files.js +3293 -0
- package/src/generators/slice/built-in-plan-performance-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-project-files.d.ts +3 -0
- package/src/generators/slice/built-in-plan-project-files.js +979 -0
- package/src/generators/slice/built-in-plan-project-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-release-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-release-files.js +6387 -0
- package/src/generators/slice/built-in-plan-release-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-reliability-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-reliability-files.js +4499 -0
- package/src/generators/slice/built-in-plan-reliability-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-secret-runtime-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-secret-runtime-files.js +1004 -0
- package/src/generators/slice/built-in-plan-secret-runtime-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-shared.d.ts +53 -0
- package/src/generators/slice/built-in-plan-shared.js +113 -0
- package/src/generators/slice/built-in-plan-shared.js.map +1 -0
- package/src/generators/slice/built-in-plan-testing-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-testing-files.js +2356 -0
- package/src/generators/slice/built-in-plan-testing-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-verification-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-verification-files.js +358 -0
- package/src/generators/slice/built-in-plan-verification-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-web-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-web-files.js +430 -0
- package/src/generators/slice/built-in-plan-web-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-workload-role-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-workload-role-files.js +2356 -0
- package/src/generators/slice/built-in-plan-workload-role-files.js.map +1 -0
- package/src/generators/slice/built-in-plan.d.ts +8 -0
- package/src/generators/slice/built-in-plan.js +264 -0
- package/src/generators/slice/built-in-plan.js.map +1 -0
- package/src/generators/slice/schema.json +1 -1
- package/src/generators/slice/slice.d.ts +1 -22
- package/src/generators/slice/slice.js +185 -1510
- package/src/generators/slice/slice.js.map +1 -1
- package/src/generators/upgrade/schema.d.ts +2 -0
- package/src/generators/upgrade/schema.json +11 -1
- package/src/generators/upgrade/upgrade.d.ts +51 -1
- package/src/generators/upgrade/upgrade.js +820 -82
- package/src/generators/upgrade/upgrade.js.map +1 -1
- package/src/generators/workload/frozen-container.d.ts +8 -0
- package/src/generators/workload/frozen-container.js +36 -0
- package/src/generators/workload/frozen-container.js.map +1 -0
- package/src/generators/workload/performance-registration.d.ts +32 -0
- package/src/generators/workload/performance-registration.js +226 -0
- package/src/generators/workload/performance-registration.js.map +1 -0
- package/src/generators/workload/reliability-registration.d.ts +16 -0
- package/src/generators/workload/reliability-registration.js +150 -0
- package/src/generators/workload/reliability-registration.js.map +1 -0
- package/src/generators/workload/schema.d.ts +1 -0
- package/src/generators/workload/schema.json +6 -1
- package/src/generators/workload/service-performance-files.d.ts +4 -0
- package/src/generators/workload/service-performance-files.js +1846 -0
- package/src/generators/workload/service-performance-files.js.map +1 -0
- package/src/generators/workload/workload.d.ts +3 -2
- package/src/generators/workload/workload.js +1083 -18
- package/src/generators/workload/workload.js.map +1 -1
- package/src/git-policy/action-pins.d.ts +10 -0
- package/src/git-policy/action-pins.js +10 -0
- package/src/git-policy/action-pins.js.map +1 -1
- package/src/git-policy/github-bootstrap.d.ts +14 -1
- package/src/git-policy/github-bootstrap.js +274 -46
- package/src/git-policy/github-bootstrap.js.map +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/infrastructure-change/convergence.d.ts +13 -0
- package/src/infrastructure-change/convergence.js +85 -0
- package/src/infrastructure-change/convergence.js.map +1 -0
- package/src/infrastructure-change/drift.d.ts +13 -0
- package/src/infrastructure-change/drift.js +112 -0
- package/src/infrastructure-change/drift.js.map +1 -0
- package/src/infrastructure-change/index.d.ts +7 -0
- package/src/infrastructure-change/index.js +11 -0
- package/src/infrastructure-change/index.js.map +1 -0
- package/src/infrastructure-change/model.d.ts +253 -0
- package/src/infrastructure-change/model.js +28 -0
- package/src/infrastructure-change/model.js.map +1 -0
- package/src/infrastructure-change/normalize.d.ts +12 -0
- package/src/infrastructure-change/normalize.js +245 -0
- package/src/infrastructure-change/normalize.js.map +1 -0
- package/src/infrastructure-change/plan.d.ts +40 -0
- package/src/infrastructure-change/plan.js +361 -0
- package/src/infrastructure-change/plan.js.map +1 -0
- package/src/infrastructure-change/risk.d.ts +7 -0
- package/src/infrastructure-change/risk.js +269 -0
- package/src/infrastructure-change/risk.js.map +1 -0
- package/src/infrastructure-change/summary.d.ts +20 -0
- package/src/infrastructure-change/summary.js +130 -0
- package/src/infrastructure-change/summary.js.map +1 -0
- package/src/local-dev/context-discovery.d.ts +2 -0
- package/src/local-dev/context-discovery.js +59 -0
- package/src/local-dev/context-discovery.js.map +1 -0
- package/src/local-dev/contract-validation.d.ts +15 -0
- package/src/local-dev/contract-validation.js +84 -0
- package/src/local-dev/contract-validation.js.map +1 -0
- package/src/local-dev/contracts.d.ts +10 -1
- package/src/local-dev/contracts.js +57 -5
- package/src/local-dev/contracts.js.map +1 -1
- package/src/local-dev/control-contract.d.ts +67 -0
- package/src/local-dev/control-contract.js +180 -0
- package/src/local-dev/control-contract.js.map +1 -0
- package/src/local-dev/dev-command-core.d.ts +60 -0
- package/src/local-dev/dev-command-core.js +89 -0
- package/src/local-dev/dev-command-core.js.map +1 -0
- package/src/local-dev/effects.d.ts +16 -0
- package/src/local-dev/effects.js +63 -0
- package/src/local-dev/effects.js.map +1 -0
- package/src/local-dev/environment-inspector.d.ts +125 -0
- package/src/local-dev/environment-inspector.js +687 -0
- package/src/local-dev/environment-inspector.js.map +1 -0
- package/src/local-dev/environment-state.d.ts +113 -0
- package/src/local-dev/environment-state.js +463 -0
- package/src/local-dev/environment-state.js.map +1 -0
- package/src/local-dev/errors.d.ts +6 -0
- package/src/local-dev/errors.js +41 -0
- package/src/local-dev/errors.js.map +1 -0
- package/src/local-dev/fleet-client.d.ts +33 -0
- package/src/local-dev/fleet-client.js +156 -0
- package/src/local-dev/fleet-client.js.map +1 -0
- package/src/local-dev/fleet-configuration.d.ts +13 -0
- package/src/local-dev/fleet-configuration.js +71 -0
- package/src/local-dev/fleet-configuration.js.map +1 -0
- package/src/local-dev/fleet-inventory.d.ts +56 -0
- package/src/local-dev/fleet-inventory.js +469 -0
- package/src/local-dev/fleet-inventory.js.map +1 -0
- package/src/local-dev/fleet-ipc.d.ts +28 -0
- package/src/local-dev/fleet-ipc.js +267 -0
- package/src/local-dev/fleet-ipc.js.map +1 -0
- package/src/local-dev/fleet-launcher.d.ts +53 -0
- package/src/local-dev/fleet-launcher.js +379 -0
- package/src/local-dev/fleet-launcher.js.map +1 -0
- package/src/local-dev/fleet-lock.d.ts +41 -0
- package/src/local-dev/fleet-lock.js +135 -0
- package/src/local-dev/fleet-lock.js.map +1 -0
- package/src/local-dev/fleet-logs.d.ts +66 -0
- package/src/local-dev/fleet-logs.js +542 -0
- package/src/local-dev/fleet-logs.js.map +1 -0
- package/src/local-dev/fleet-process.d.ts +50 -0
- package/src/local-dev/fleet-process.js +289 -0
- package/src/local-dev/fleet-process.js.map +1 -0
- package/src/local-dev/fleet-runtime.d.ts +22 -0
- package/src/local-dev/fleet-runtime.js +368 -0
- package/src/local-dev/fleet-runtime.js.map +1 -0
- package/src/local-dev/fleet-session.d.ts +70 -0
- package/src/local-dev/fleet-session.js +301 -0
- package/src/local-dev/fleet-session.js.map +1 -0
- package/src/local-dev/fleet-slice-runner-daemon.d.ts +1 -0
- package/src/local-dev/fleet-slice-runner-daemon.js +21 -0
- package/src/local-dev/fleet-slice-runner-daemon.js.map +1 -0
- package/src/local-dev/fleet-startup.d.ts +22 -0
- package/src/local-dev/fleet-startup.js +114 -0
- package/src/local-dev/fleet-startup.js.map +1 -0
- package/src/local-dev/fleet-state.d.ts +62 -0
- package/src/local-dev/fleet-state.js +297 -0
- package/src/local-dev/fleet-state.js.map +1 -0
- package/src/local-dev/fleet-supervisor-daemon.d.ts +1 -0
- package/src/local-dev/fleet-supervisor-daemon.js +41 -0
- package/src/local-dev/fleet-supervisor-daemon.js.map +1 -0
- package/src/local-dev/fleet-supervisor.d.ts +52 -0
- package/src/local-dev/fleet-supervisor.js +384 -0
- package/src/local-dev/fleet-supervisor.js.map +1 -0
- package/src/local-dev/gateway.js +1 -1
- package/src/local-dev/gateway.js.map +1 -1
- package/src/local-dev/identity.js +4 -6
- package/src/local-dev/identity.js.map +1 -1
- package/src/local-dev/index.d.ts +1 -0
- package/src/local-dev/index.js +1 -0
- package/src/local-dev/index.js.map +1 -1
- package/src/local-dev/local-context.d.ts +62 -0
- package/src/local-dev/local-context.js +299 -0
- package/src/local-dev/local-context.js.map +1 -0
- package/src/local-dev/nx-workspace.d.ts +45 -0
- package/src/local-dev/nx-workspace.js +228 -0
- package/src/local-dev/nx-workspace.js.map +1 -0
- package/src/local-dev/personal-secret-ledger.d.ts +75 -0
- package/src/local-dev/personal-secret-ledger.js +391 -0
- package/src/local-dev/personal-secret-ledger.js.map +1 -0
- package/src/local-dev/personal-stage.d.ts +18 -0
- package/src/local-dev/personal-stage.js +129 -0
- package/src/local-dev/personal-stage.js.map +1 -0
- package/src/local-dev/private-state.d.ts +17 -0
- package/src/local-dev/private-state.js +254 -0
- package/src/local-dev/private-state.js.map +1 -0
- package/src/local-dev/process-identity.d.ts +9 -0
- package/src/local-dev/process-identity.js +79 -0
- package/src/local-dev/process-identity.js.map +1 -0
- package/src/local-dev/runtime-paths.d.ts +17 -0
- package/src/local-dev/runtime-paths.js +33 -0
- package/src/local-dev/runtime-paths.js.map +1 -0
- package/src/local-dev/secret-slice-claim.d.ts +17 -0
- package/src/local-dev/secret-slice-claim.js +75 -0
- package/src/local-dev/secret-slice-claim.js.map +1 -0
- package/src/local-dev/slice-claim.d.ts +36 -0
- package/src/local-dev/slice-claim.js +199 -0
- package/src/local-dev/slice-claim.js.map +1 -0
- package/src/local-dev/slice-runner.d.ts +121 -0
- package/src/local-dev/slice-runner.js +715 -0
- package/src/local-dev/slice-runner.js.map +1 -0
- package/src/local-dev/tls.js +51 -17
- package/src/local-dev/tls.js.map +1 -1
- package/src/ownership/composition.d.ts +5 -2
- package/src/ownership/composition.js +26 -3
- package/src/ownership/composition.js.map +1 -1
- package/src/ownership/hash.d.ts +1 -1
- package/src/ownership/hash.js +3 -1
- package/src/ownership/hash.js.map +1 -1
- package/src/ownership/record.d.ts +32 -1
- package/src/ownership/record.js +139 -2
- package/src/ownership/record.js.map +1 -1
- package/src/performance/cost-collection.d.ts +225 -0
- package/src/performance/cost-collection.js +825 -0
- package/src/performance/cost-collection.js.map +1 -0
- package/src/performance/cost-controls.d.ts +131 -0
- package/src/performance/cost-controls.js +336 -0
- package/src/performance/cost-controls.js.map +1 -0
- package/src/performance/evidence.d.ts +140 -0
- package/src/performance/evidence.js +599 -0
- package/src/performance/evidence.js.map +1 -0
- package/src/performance/index.d.ts +10 -0
- package/src/performance/index.js +14 -0
- package/src/performance/index.js.map +1 -0
- package/src/performance/load-safety.d.ts +84 -0
- package/src/performance/load-safety.js +346 -0
- package/src/performance/load-safety.js.map +1 -0
- package/src/performance/model.d.ts +129 -0
- package/src/performance/model.js +452 -0
- package/src/performance/model.js.map +1 -0
- package/src/performance/pr-artifact-budget.d.ts +42 -0
- package/src/performance/pr-artifact-budget.js +151 -0
- package/src/performance/pr-artifact-budget.js.map +1 -0
- package/src/performance/runner.d.ts +75 -0
- package/src/performance/runner.js +227 -0
- package/src/performance/runner.js.map +1 -0
- package/src/performance/scenario-endpoint.d.ts +1 -0
- package/src/performance/scenario-endpoint.js +5 -0
- package/src/performance/scenario-endpoint.js.map +1 -0
- package/src/performance/scenario.d.ts +193 -0
- package/src/performance/scenario.js +736 -0
- package/src/performance/scenario.js.map +1 -0
- package/src/performance/test-fixtures.d.ts +7 -0
- package/src/performance/test-fixtures.js +169 -0
- package/src/performance/test-fixtures.js.map +1 -0
- package/src/performance/unit-cost.d.ts +105 -0
- package/src/performance/unit-cost.js +364 -0
- package/src/performance/unit-cost.js.map +1 -0
- package/src/release/index.d.ts +4 -0
- package/src/release/index.js +8 -0
- package/src/release/index.js.map +1 -0
- package/src/release/lifecycle.d.ts +132 -0
- package/src/release/lifecycle.js +411 -0
- package/src/release/lifecycle.js.map +1 -0
- package/src/release/manifest.d.ts +148 -0
- package/src/release/manifest.js +503 -0
- package/src/release/manifest.js.map +1 -0
- package/src/release/rollout.d.ts +170 -0
- package/src/release/rollout.js +578 -0
- package/src/release/rollout.js.map +1 -0
- package/src/release/source-authority.d.ts +19 -0
- package/src/release/source-authority.js +195 -0
- package/src/release/source-authority.js.map +1 -0
- package/src/repository-policy/deployment-plan.d.ts +2 -1
- package/src/repository-policy/deployment-plan.js +2 -0
- package/src/repository-policy/deployment-plan.js.map +1 -1
- package/src/repository-policy/policy.d.ts +1 -1
- package/src/repository-policy/policy.js +29 -25
- package/src/repository-policy/policy.js.map +1 -1
- package/src/schemas/aggregate-count-evidence-v1.json +135 -0
- package/src/schemas/api-contract-baseline-v1.json +674 -0
- package/src/schemas/api-contract-compatibility-report-v1.json +126 -0
- package/src/schemas/aws-billing-actual-evidence-v1.json +407 -0
- package/src/schemas/blueprint-v1.json +18 -1
- package/src/schemas/data-lifecycle-policy-v1.json +517 -0
- package/src/schemas/generated-ownership-v2.json +22 -0
- package/src/schemas/performance-policy-v1.json +335 -0
- package/src/schemas/repository-policy-v1.json +1 -0
- package/src/schemas/testing-evidence-quarantine-v1.json +168 -0
- package/src/schemas/testing-evidence-result-v1.json +319 -0
- package/src/secrets/adapters.d.ts +49 -0
- package/src/secrets/adapters.js +184 -0
- package/src/secrets/adapters.js.map +1 -0
- package/src/secrets/aws-control-plane.d.ts +20 -0
- package/src/secrets/aws-control-plane.js +255 -0
- package/src/secrets/aws-control-plane.js.map +1 -0
- package/src/secrets/declaration-verification.d.ts +11 -0
- package/src/secrets/declaration-verification.js +68 -0
- package/src/secrets/declaration-verification.js.map +1 -0
- package/src/secrets/guardrails.d.ts +26 -0
- package/src/secrets/guardrails.js +328 -0
- package/src/secrets/guardrails.js.map +1 -0
- package/src/secrets/index.d.ts +12 -0
- package/src/secrets/index.js +16 -0
- package/src/secrets/index.js.map +1 -0
- package/src/secrets/metadata.d.ts +48 -0
- package/src/secrets/metadata.js +171 -0
- package/src/secrets/metadata.js.map +1 -0
- package/src/secrets/model.d.ts +49 -0
- package/src/secrets/model.js +125 -0
- package/src/secrets/model.js.map +1 -0
- package/src/secrets/operator.d.ts +101 -0
- package/src/secrets/operator.js +229 -0
- package/src/secrets/operator.js.map +1 -0
- package/src/secrets/permissions.d.ts +34 -0
- package/src/secrets/permissions.js +86 -0
- package/src/secrets/permissions.js.map +1 -0
- package/src/secrets/personal-command.d.ts +83 -0
- package/src/secrets/personal-command.js +197 -0
- package/src/secrets/personal-command.js.map +1 -0
- package/src/secrets/personal-ledger.d.ts +21 -0
- package/src/secrets/personal-ledger.js +135 -0
- package/src/secrets/personal-ledger.js.map +1 -0
- package/src/secrets/registry.d.ts +9 -0
- package/src/secrets/registry.js +86 -0
- package/src/secrets/registry.js.map +1 -0
- package/src/secrets/verification.d.ts +18 -0
- package/src/secrets/verification.js +139 -0
- package/src/secrets/verification.js.map +1 -0
- package/src/secrets/workload-access.d.ts +46 -0
- package/src/secrets/workload-access.js +163 -0
- package/src/secrets/workload-access.js.map +1 -0
- package/src/supply-chain/action-pins.d.ts +26 -0
- package/src/supply-chain/action-pins.js +208 -0
- package/src/supply-chain/action-pins.js.map +1 -0
- package/src/supply-chain/blueprint-trust-git.d.ts +130 -0
- package/src/supply-chain/blueprint-trust-git.js +1581 -0
- package/src/supply-chain/blueprint-trust-git.js.map +1 -0
- package/src/supply-chain/blueprint-trust-process.d.ts +4 -0
- package/src/supply-chain/blueprint-trust-process.js +88 -0
- package/src/supply-chain/blueprint-trust-process.js.map +1 -0
- package/src/supply-chain/blueprint-trust.d.ts +354 -0
- package/src/supply-chain/blueprint-trust.js +1558 -0
- package/src/supply-chain/blueprint-trust.js.map +1 -0
- package/src/supply-chain/blueprint-verification-authority.d.ts +62 -0
- package/src/supply-chain/blueprint-verification-authority.js +588 -0
- package/src/supply-chain/blueprint-verification-authority.js.map +1 -0
- package/src/supply-chain/blueprint-verification-execution.d.ts +68 -0
- package/src/supply-chain/blueprint-verification-execution.js +624 -0
- package/src/supply-chain/blueprint-verification-execution.js.map +1 -0
- package/src/supply-chain/build-output.d.ts +35 -0
- package/src/supply-chain/build-output.js +398 -0
- package/src/supply-chain/build-output.js.map +1 -0
- package/src/supply-chain/common.d.ts +21 -0
- package/src/supply-chain/common.js +107 -0
- package/src/supply-chain/common.js.map +1 -0
- package/src/supply-chain/container-artifact-contract.d.ts +23 -0
- package/src/supply-chain/container-artifact-contract.js +208 -0
- package/src/supply-chain/container-artifact-contract.js.map +1 -0
- package/src/supply-chain/container-release.d.ts +119 -0
- package/src/supply-chain/container-release.js +496 -0
- package/src/supply-chain/container-release.js.map +1 -0
- package/src/supply-chain/ecr-applicability.d.ts +19 -0
- package/src/supply-chain/ecr-applicability.js +103 -0
- package/src/supply-chain/ecr-applicability.js.map +1 -0
- package/src/supply-chain/ecr-scanning.d.ts +83 -0
- package/src/supply-chain/ecr-scanning.js +321 -0
- package/src/supply-chain/ecr-scanning.js.map +1 -0
- package/src/supply-chain/ecs-deployed-image.d.ts +85 -0
- package/src/supply-chain/ecs-deployed-image.js +300 -0
- package/src/supply-chain/ecs-deployed-image.js.map +1 -0
- package/src/supply-chain/errors.d.ts +6 -0
- package/src/supply-chain/errors.js +15 -0
- package/src/supply-chain/errors.js.map +1 -0
- package/src/supply-chain/generated-blueprint-trust-command.d.ts +4 -0
- package/src/supply-chain/generated-blueprint-trust-command.js +1362 -0
- package/src/supply-chain/generated-blueprint-trust-command.js.map +1 -0
- package/src/supply-chain/generated-command.d.ts +1 -0
- package/src/supply-chain/generated-command.js +687 -0
- package/src/supply-chain/generated-command.js.map +1 -0
- package/src/supply-chain/generated-container-release-command.d.ts +16 -0
- package/src/supply-chain/generated-container-release-command.js +2087 -0
- package/src/supply-chain/generated-container-release-command.js.map +1 -0
- package/src/supply-chain/generated-ecr-collector-command.d.ts +21 -0
- package/src/supply-chain/generated-ecr-collector-command.js +1338 -0
- package/src/supply-chain/generated-ecr-collector-command.js.map +1 -0
- package/src/supply-chain/generated-files.d.ts +13 -0
- package/src/supply-chain/generated-files.js +401 -0
- package/src/supply-chain/generated-files.js.map +1 -0
- package/src/supply-chain/generated-scanner-command.d.ts +1 -0
- package/src/supply-chain/generated-scanner-command.js +718 -0
- package/src/supply-chain/generated-scanner-command.js.map +1 -0
- package/src/supply-chain/index.d.ts +28 -0
- package/src/supply-chain/index.js +35 -0
- package/src/supply-chain/index.js.map +1 -0
- package/src/supply-chain/inventory.d.ts +79 -0
- package/src/supply-chain/inventory.js +717 -0
- package/src/supply-chain/inventory.js.map +1 -0
- package/src/supply-chain/license-expression.d.ts +7 -0
- package/src/supply-chain/license-expression.js +128 -0
- package/src/supply-chain/license-expression.js.map +1 -0
- package/src/supply-chain/pnpm-toolchain-authority.d.ts +31 -0
- package/src/supply-chain/pnpm-toolchain-authority.js +316 -0
- package/src/supply-chain/pnpm-toolchain-authority.js.map +1 -0
- package/src/supply-chain/policy.d.ts +105 -0
- package/src/supply-chain/policy.js +301 -0
- package/src/supply-chain/policy.js.map +1 -0
- package/src/supply-chain/publication.d.ts +48 -0
- package/src/supply-chain/publication.js +85 -0
- package/src/supply-chain/publication.js.map +1 -0
- package/src/supply-chain/sbom.d.ts +228 -0
- package/src/supply-chain/sbom.js +826 -0
- package/src/supply-chain/sbom.js.map +1 -0
- package/src/supply-chain/scanner.d.ts +77 -0
- package/src/supply-chain/scanner.js +502 -0
- package/src/supply-chain/scanner.js.map +1 -0
- package/src/supply-chain/vendored-source.d.ts +95 -0
- package/src/supply-chain/vendored-source.js +315 -0
- package/src/supply-chain/vendored-source.js.map +1 -0
- package/src/testing-evidence/fixture-scope.d.ts +52 -0
- package/src/testing-evidence/fixture-scope.js +140 -0
- package/src/testing-evidence/fixture-scope.js.map +1 -0
- package/src/testing-evidence/index.d.ts +5 -0
- package/src/testing-evidence/index.js +9 -0
- package/src/testing-evidence/index.js.map +1 -0
- package/src/testing-evidence/quarantine.d.ts +48 -0
- package/src/testing-evidence/quarantine.js +253 -0
- package/src/testing-evidence/quarantine.js.map +1 -0
- package/src/testing-evidence/result.d.ts +108 -0
- package/src/testing-evidence/result.js +571 -0
- package/src/testing-evidence/result.js.map +1 -0
- package/src/testing-evidence/runner-adapter.d.ts +51 -0
- package/src/testing-evidence/runner-adapter.js +288 -0
- package/src/testing-evidence/runner-adapter.js.map +1 -0
- package/src/testing-evidence/sensitive-artifacts.d.ts +13 -0
- package/src/testing-evidence/sensitive-artifacts.js +93 -0
- package/src/testing-evidence/sensitive-artifacts.js.map +1 -0
- package/src/work-markers/work-markers.js +4 -3
- package/src/work-markers/work-markers.js.map +1 -1
- package/src/workload-roles/account-baseline.d.ts +132 -0
- package/src/workload-roles/account-baseline.js +743 -0
- package/src/workload-roles/account-baseline.js.map +1 -0
- package/src/workload-roles/authority.d.ts +38 -0
- package/src/workload-roles/authority.js +156 -0
- package/src/workload-roles/authority.js.map +1 -0
- package/src/workload-roles/aws-adapter.d.ts +99 -0
- package/src/workload-roles/aws-adapter.js +416 -0
- package/src/workload-roles/aws-adapter.js.map +1 -0
- package/src/workload-roles/aws-internal-handler.d.ts +27 -0
- package/src/workload-roles/aws-internal-handler.js +58 -0
- package/src/workload-roles/aws-internal-handler.js.map +1 -0
- package/src/workload-roles/aws-s3-state.d.ts +52 -0
- package/src/workload-roles/aws-s3-state.js +164 -0
- package/src/workload-roles/aws-s3-state.js.map +1 -0
- package/src/workload-roles/aws-sdk-control-plane.d.ts +12 -0
- package/src/workload-roles/aws-sdk-control-plane.js +291 -0
- package/src/workload-roles/aws-sdk-control-plane.js.map +1 -0
- package/src/workload-roles/boundary.d.ts +33 -0
- package/src/workload-roles/boundary.js +130 -0
- package/src/workload-roles/boundary.js.map +1 -0
- package/src/workload-roles/convergence.d.ts +66 -0
- package/src/workload-roles/convergence.js +186 -0
- package/src/workload-roles/convergence.js.map +1 -0
- package/src/workload-roles/effective-policy.d.ts +51 -0
- package/src/workload-roles/effective-policy.js +183 -0
- package/src/workload-roles/effective-policy.js.map +1 -0
- package/src/workload-roles/handler.d.ts +43 -0
- package/src/workload-roles/handler.js +130 -0
- package/src/workload-roles/handler.js.map +1 -0
- package/src/workload-roles/history.d.ts +47 -0
- package/src/workload-roles/history.js +324 -0
- package/src/workload-roles/history.js.map +1 -0
- package/src/workload-roles/index.d.ts +17 -0
- package/src/workload-roles/index.js +21 -0
- package/src/workload-roles/index.js.map +1 -0
- package/src/workload-roles/injection.d.ts +119 -0
- package/src/workload-roles/injection.js +495 -0
- package/src/workload-roles/injection.js.map +1 -0
- package/src/workload-roles/manifest.d.ts +54 -0
- package/src/workload-roles/manifest.js +343 -0
- package/src/workload-roles/manifest.js.map +1 -0
- package/src/workload-roles/provisioner.d.ts +70 -0
- package/src/workload-roles/provisioner.js +231 -0
- package/src/workload-roles/provisioner.js.map +1 -0
- package/src/workload-roles/registration.d.ts +101 -0
- package/src/workload-roles/registration.js +457 -0
- package/src/workload-roles/registration.js.map +1 -0
- package/src/workload-roles/stage-boundary.d.ts +31 -0
- package/src/workload-roles/stage-boundary.js +208 -0
- package/src/workload-roles/stage-boundary.js.map +1 -0
- package/src/workload-roles/standard-slice.d.ts +54 -0
- package/src/workload-roles/standard-slice.js +252 -0
- package/src/workload-roles/standard-slice.js.map +1 -0
- package/migrations/standard-pre-v1-to-v1.md +0 -11
- package/src/foundation/aurora-logical-database.d.ts +0 -76
- package/src/foundation/aurora-logical-database.js +0 -419
- package/src/foundation/aurora-logical-database.js.map +0 -1
|
@@ -0,0 +1,1102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderWorkspaceWorkloadRoleBaselineFiles = renderWorkspaceWorkloadRoleBaselineFiles;
|
|
4
|
+
/**
|
|
5
|
+
* Isolated protected-account-baseline renderer. The workspace preset composes
|
|
6
|
+
* these files only after the workload-role contract is accepted; keeping this
|
|
7
|
+
* renderer separate gives its authority-bearing source focused proof.
|
|
8
|
+
*/
|
|
9
|
+
function renderWorkspaceWorkloadRoleBaselineFiles(options) {
|
|
10
|
+
return {
|
|
11
|
+
'docs/workload-role-account-baseline.md': `# Workload-role account baseline
|
|
12
|
+
|
|
13
|
+
The \`${options.name}\` workspace workload-role boundary, state bucket, fixed provisioner, candidate
|
|
14
|
+
registration, and ordinary deployment policy form one protected stage
|
|
15
|
+
publication. They are not ordinary SST resources.
|
|
16
|
+
|
|
17
|
+
The complete reviewed stage bundle must contain every Product Slice project
|
|
18
|
+
exactly once under one account, partition, stage, and candidate identity.
|
|
19
|
+
Publication rejects a missing or extra project, mixed identity, duplicate role,
|
|
20
|
+
changed manifest digest, unsupported IAM allow, or compact boundary larger than
|
|
21
|
+
the AWS 6,144-character managed-policy limit before it creates a mutation plan.
|
|
22
|
+
The singular stage boundary is a maximum-action cap, not a grant. Exact
|
|
23
|
+
resources and conditions remain in each digest-bound inline role policy.
|
|
24
|
+
|
|
25
|
+
## Authority
|
|
26
|
+
|
|
27
|
+
Initial bootstrap and later publication use an external protected
|
|
28
|
+
account-baseline authority. Do not configure a second GitHub OIDC/admin role and
|
|
29
|
+
do not run \`--apply\` in GitHub Actions. The publisher rejects the ordinary
|
|
30
|
+
deployment role and all GitHub Actions apply attempts. The external protected
|
|
31
|
+
CloudFormation update applies the aggregate boundary before any provisioner
|
|
32
|
+
invocation. The generated stack gives the fixed AWS-internal provisioner only:
|
|
33
|
+
|
|
34
|
+
- role/profile authority for exact registered v1 names;
|
|
35
|
+
- state access under exact registered project/digest keys; and
|
|
36
|
+
- log writes for the exact provisioner functions.
|
|
37
|
+
|
|
38
|
+
The ordinary deployment policy is not promoted until every project provisioner
|
|
39
|
+
returns a sanitized, exact registration. It contains only exact registration
|
|
40
|
+
reads, qualified provisioner observation/invocation, and exact
|
|
41
|
+
service-conditioned \`iam:PassRole\`. It contains no direct role, trust, inline
|
|
42
|
+
policy, tag, boundary, or delete mutation.
|
|
43
|
+
|
|
44
|
+
## Candidate bundle and first-stage bootstrap
|
|
45
|
+
|
|
46
|
+
The generated report target constructs registered documents directly from the
|
|
47
|
+
generated Foundation and Slice candidates plus read-only STS, SSM, and Secrets
|
|
48
|
+
Manager discovery. It never reads an existing workload-role registration and
|
|
49
|
+
has no AWS mutation client. Project selection is not an input: the target
|
|
50
|
+
derives the one Foundation and every generated Product Slice from
|
|
51
|
+
\`packages/*/project.json\`, rejects ambiguous ownership, and validates the
|
|
52
|
+
result as one stage boundary before writing JSON to stdout.
|
|
53
|
+
|
|
54
|
+
A stage that has never had a workload-role account baseline needs two exact
|
|
55
|
+
phases because Slice intent depends on outputs created by Foundation:
|
|
56
|
+
|
|
57
|
+
1. Run \`foundation-bootstrap\` report mode. This fixed phase emits Foundation
|
|
58
|
+
only; it is not a generic project filter.
|
|
59
|
+
2. Review and apply that Foundation-only publication, then deploy Foundation
|
|
60
|
+
with the same candidate identity. Bootstrap apply proves both the baseline
|
|
61
|
+
stack and Foundation workload-role pointer are absent before any mutation,
|
|
62
|
+
then uses create-only stack semantics so a concurrent bootstrap cannot win a
|
|
63
|
+
check/use race. It cannot shrink or replace an existing stage boundary.
|
|
64
|
+
3. Run \`full-stage\` report mode. It reads the now-provisioned Foundation
|
|
65
|
+
outputs and exact operator-secret metadata and emits Foundation plus every
|
|
66
|
+
generated Product Slice.
|
|
67
|
+
4. Review and apply the full-stage publication before deploying any Slice.
|
|
68
|
+
Every later publication uses \`full-stage\`; bootstrap reuse fails closed.
|
|
69
|
+
|
|
70
|
+
If initial bootstrap fails after its create-only stack succeeds but before the
|
|
71
|
+
Foundation pointer is promoted, do not bypass the one-time check. The external
|
|
72
|
+
account-baseline owner must inspect the failed stack and retained state, remove
|
|
73
|
+
that incomplete bootstrap explicitly, and restart from the same reviewed
|
|
74
|
+
candidate. A successful or ambiguous bootstrap is never reset for convenience.
|
|
75
|
+
|
|
76
|
+
\`\`\`bash
|
|
77
|
+
pnpm nx run ${options.name}:workload-role-candidate-report -- \\
|
|
78
|
+
--phase=foundation-bootstrap \\
|
|
79
|
+
--candidate=<reviewed-candidate> \\
|
|
80
|
+
--stage=staging \\
|
|
81
|
+
--region=us-east-1 \\
|
|
82
|
+
> /path/outside-the-checkout/staging-foundation-workload-roles.json
|
|
83
|
+
|
|
84
|
+
# After Foundation publication and deployment:
|
|
85
|
+
pnpm nx run ${options.name}:workload-role-candidate-report -- \\
|
|
86
|
+
--phase=full-stage \\
|
|
87
|
+
--candidate=<same-reviewed-candidate> \\
|
|
88
|
+
--stage=staging \\
|
|
89
|
+
--region=us-east-1 \\
|
|
90
|
+
> /path/outside-the-checkout/staging-workload-roles.json
|
|
91
|
+
\`\`\`
|
|
92
|
+
|
|
93
|
+
Independently record the derived project set and digest map in the review. Run
|
|
94
|
+
publisher report mode from a clean \`develop\` checkout for
|
|
95
|
+
development/staging or a clean \`main\` checkout for production. Supply the
|
|
96
|
+
matching phase, exact reviewed HEAD commit, and exact external publisher
|
|
97
|
+
principal returned by \`aws sts get-caller-identity\`:
|
|
98
|
+
|
|
99
|
+
\`\`\`bash
|
|
100
|
+
node tools/workload-role-baseline/publish.mjs \\
|
|
101
|
+
--documents=/path/outside-the-checkout/staging-workload-roles.json \\
|
|
102
|
+
--phase=full-stage \\
|
|
103
|
+
--candidate=<reviewed-candidate> \\
|
|
104
|
+
--stage=staging \\
|
|
105
|
+
--account=<12-digit-account> \\
|
|
106
|
+
--partition=aws \\
|
|
107
|
+
--region=us-east-1 \\
|
|
108
|
+
--digests=foundation:<sha256>,billing:<sha256>,orders:<sha256> \\
|
|
109
|
+
--deployment-role-arn=arn:aws:iam::<account>:role/<deployment-role> \\
|
|
110
|
+
--publisher-principal-arn=arn:aws:sts::<account>:assumed-role/<role>/<session> \\
|
|
111
|
+
--reviewed-commit=<full-git-object-id> \\
|
|
112
|
+
--code-bucket=<protected-versioned-artifact-bucket> \\
|
|
113
|
+
--code-key=workload-role-provisioner/v1/index.zip \\
|
|
114
|
+
--code-version=<reviewed-s3-version-id>
|
|
115
|
+
\`\`\`
|
|
116
|
+
|
|
117
|
+
When a reviewed candidate drops or renames an active role, also supply
|
|
118
|
+
\`--prior-histories=<reviewed-json-object-by-project>\` and
|
|
119
|
+
\`--prior=<project>:<prior-candidate>:<prior-manifest-digest>:<prior-history-digest>[,...]\`.
|
|
120
|
+
The history digest covers the complete canonical active set and every retained
|
|
121
|
+
tombstone; it is reviewed independently from the active manifest digest.
|
|
122
|
+
The publisher derives the exact phase-appropriate project set from the same
|
|
123
|
+
generated project inventory and rejects missing, extra, or substituted
|
|
124
|
+
documents and digest entries. When a full-stage candidate drops or renames an
|
|
125
|
+
active role, the report adds only the exact retired role and NAT profile ARNs
|
|
126
|
+
to temporary provisioner authority. It rejects stale, cross-stage,
|
|
127
|
+
cross-project, or unreviewed history and never uses a wildcard. Bootstrap
|
|
128
|
+
rejects all prior-history input.
|
|
129
|
+
|
|
130
|
+
Review both deterministic templates, the exact resource inventory, boundary
|
|
131
|
+
digest, and boundary character count. The transitional template contains only
|
|
132
|
+
reviewed retirement authority; the settled template contains none. Run
|
|
133
|
+
\`pnpm nx run ${options.name}:workload-role-provisioner-build\`; retain the
|
|
134
|
+
reported SHA-256 for
|
|
135
|
+
\`dist/workload-role-baseline/provisioner.zip\`. The deterministic archive
|
|
136
|
+
bundles \`tools/workload-role-baseline/provisioner.ts\` as \`index.handler\`
|
|
137
|
+
with \`@empire-builder-kit/nx\`, \`@aws-sdk/client-iam\`, and
|
|
138
|
+
\`@aws-sdk/client-s3\`. Upload that exact reviewed archive to the protected,
|
|
139
|
+
versioned code location named by the report.
|
|
140
|
+
|
|
141
|
+
## Apply and recovery
|
|
142
|
+
|
|
143
|
+
Apply only from the same reviewed source with externally obtained protected
|
|
144
|
+
account-baseline credentials:
|
|
145
|
+
|
|
146
|
+
\`\`\`bash
|
|
147
|
+
export EBK_ACCOUNT_BASELINE_AUTHORITY=external-protected
|
|
148
|
+
# Repeat the exact report command and append:
|
|
149
|
+
--apply
|
|
150
|
+
\`\`\`
|
|
151
|
+
|
|
152
|
+
Apply verifies the exact reviewed caller principal, exact deployment role,
|
|
153
|
+
actual Git branch, clean tree, and immutable reviewed commit. It updates the
|
|
154
|
+
aggregate boundary first, stores every
|
|
155
|
+
reviewed document with explicit AES-256 encryption, invokes each
|
|
156
|
+
candidate-qualified alias, validates all sanitized results, reapplies the
|
|
157
|
+
settled baseline to remove transition authority, replaces the one exact
|
|
158
|
+
deployment inline policy, and finally switches each protected SSM pointer. A
|
|
159
|
+
failure before the final three steps leaves ordinary deployment unpromoted.
|
|
160
|
+
Investigate and rerun the same immutable candidate; never widen the policy,
|
|
161
|
+
skip a Slice, substitute a digest, or invoke an unqualified function.
|
|
162
|
+
`,
|
|
163
|
+
'tools/workload-role-baseline/project-set.mjs': `import {
|
|
164
|
+
lstatSync,
|
|
165
|
+
readFileSync,
|
|
166
|
+
readdirSync,
|
|
167
|
+
} from 'node:fs';
|
|
168
|
+
import { join } from 'node:path';
|
|
169
|
+
|
|
170
|
+
const projectPattern = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
171
|
+
const phases = new Set(['foundation-bootstrap', 'full-stage']);
|
|
172
|
+
|
|
173
|
+
function readProject(path) {
|
|
174
|
+
let value;
|
|
175
|
+
try {
|
|
176
|
+
value = JSON.parse(readFileSync(path, 'utf8'));
|
|
177
|
+
} catch (error) {
|
|
178
|
+
if (error?.code === 'ENOENT') return undefined;
|
|
179
|
+
throw new Error('Generated workload-role project metadata is unreadable.');
|
|
180
|
+
}
|
|
181
|
+
if (
|
|
182
|
+
typeof value !== 'object' ||
|
|
183
|
+
value === null ||
|
|
184
|
+
Array.isArray(value) ||
|
|
185
|
+
typeof value.name !== 'string' ||
|
|
186
|
+
!Array.isArray(value.tags) ||
|
|
187
|
+
value.tags.some((tag) => typeof tag !== 'string')
|
|
188
|
+
) {
|
|
189
|
+
throw new Error('Generated workload-role project metadata is malformed.');
|
|
190
|
+
}
|
|
191
|
+
return value;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function discoverWorkloadRoleCandidateProjects(workspaceRoot) {
|
|
195
|
+
const packagesRoot = join(workspaceRoot, 'packages');
|
|
196
|
+
const projects = [];
|
|
197
|
+
for (const entry of readdirSync(packagesRoot, { withFileTypes: true })) {
|
|
198
|
+
if (!entry.isDirectory()) continue;
|
|
199
|
+
const metadata = readProject(
|
|
200
|
+
join(packagesRoot, entry.name, 'project.json'),
|
|
201
|
+
);
|
|
202
|
+
if (!metadata) continue;
|
|
203
|
+
const isFoundation =
|
|
204
|
+
entry.name === 'foundation' &&
|
|
205
|
+
metadata.name === 'foundation' &&
|
|
206
|
+
metadata.tags.includes('scope:foundation');
|
|
207
|
+
const isSlice = metadata.tags.includes('type:slice');
|
|
208
|
+
if (!isFoundation && !isSlice) continue;
|
|
209
|
+
if (
|
|
210
|
+
!projectPattern.test(metadata.name) ||
|
|
211
|
+
metadata.name !== entry.name ||
|
|
212
|
+
isFoundation === isSlice
|
|
213
|
+
) {
|
|
214
|
+
throw new Error(
|
|
215
|
+
'Generated workload-role project identity is ambiguous.',
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
const reportPath = join(
|
|
219
|
+
packagesRoot,
|
|
220
|
+
entry.name,
|
|
221
|
+
'infra',
|
|
222
|
+
'workload-roles',
|
|
223
|
+
'report.ts',
|
|
224
|
+
);
|
|
225
|
+
try {
|
|
226
|
+
if (!lstatSync(reportPath).isFile()) {
|
|
227
|
+
throw new Error();
|
|
228
|
+
}
|
|
229
|
+
} catch {
|
|
230
|
+
throw new Error(
|
|
231
|
+
'Generated workload-role candidate reporter is absent.',
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
projects.push({
|
|
235
|
+
kind: isFoundation ? 'foundation' : 'slice',
|
|
236
|
+
project: metadata.name,
|
|
237
|
+
reportPath,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
projects.sort((left, right) =>
|
|
241
|
+
left.project < right.project
|
|
242
|
+
? -1
|
|
243
|
+
: left.project > right.project
|
|
244
|
+
? 1
|
|
245
|
+
: 0,
|
|
246
|
+
);
|
|
247
|
+
if (
|
|
248
|
+
projects.filter(({ kind }) => kind === 'foundation').length !== 1 ||
|
|
249
|
+
new Set(projects.map(({ project }) => project)).size !== projects.length
|
|
250
|
+
) {
|
|
251
|
+
throw new Error(
|
|
252
|
+
'Workspace must contain one Foundation and unique Product Slices.',
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
return Object.freeze(projects);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export function selectWorkloadRoleCandidateProjects(projects, phase) {
|
|
259
|
+
if (!phases.has(phase)) {
|
|
260
|
+
throw new Error('Workload-role candidate report phase is invalid.');
|
|
261
|
+
}
|
|
262
|
+
if (phase === 'foundation-bootstrap') {
|
|
263
|
+
return Object.freeze(
|
|
264
|
+
projects.filter(({ kind }) => kind === 'foundation'),
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
return Object.freeze([...projects]);
|
|
268
|
+
}
|
|
269
|
+
`,
|
|
270
|
+
'tools/workload-role-baseline/report-candidate-bundle.mjs': `import {
|
|
271
|
+
mkdtempSync,
|
|
272
|
+
rmSync,
|
|
273
|
+
} from 'node:fs';
|
|
274
|
+
import { createRequire } from 'node:module';
|
|
275
|
+
import { tmpdir } from 'node:os';
|
|
276
|
+
import { join } from 'node:path';
|
|
277
|
+
import { build } from 'esbuild';
|
|
278
|
+
import {
|
|
279
|
+
createStageWorkloadRoleBoundaryContract,
|
|
280
|
+
requireRegisteredWorkloadRoleManifestDocument,
|
|
281
|
+
} from '@empire-builder-kit/nx/workload-roles';
|
|
282
|
+
import {
|
|
283
|
+
discoverWorkloadRoleCandidateProjects,
|
|
284
|
+
selectWorkloadRoleCandidateProjects,
|
|
285
|
+
} from './project-set.mjs';
|
|
286
|
+
|
|
287
|
+
const supported = new Set(['candidate', 'phase', 'region', 'stage']);
|
|
288
|
+
|
|
289
|
+
function parseArgs(values) {
|
|
290
|
+
const result = {};
|
|
291
|
+
for (const value of values) {
|
|
292
|
+
const separator = value.indexOf('=');
|
|
293
|
+
const name = value.slice(2, separator);
|
|
294
|
+
if (
|
|
295
|
+
!value.startsWith('--') ||
|
|
296
|
+
separator < 3 ||
|
|
297
|
+
!supported.has(name) ||
|
|
298
|
+
result[name] !== undefined
|
|
299
|
+
) {
|
|
300
|
+
throw new Error(
|
|
301
|
+
'Candidate report arguments must be unique --name=value entries.',
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
const parsed = value.slice(separator + 1);
|
|
305
|
+
if (!parsed) {
|
|
306
|
+
throw new Error('Candidate report argument is empty: ' + name);
|
|
307
|
+
}
|
|
308
|
+
result[name] = parsed;
|
|
309
|
+
}
|
|
310
|
+
return result;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function required(args, name, pattern) {
|
|
314
|
+
const value = args[name];
|
|
315
|
+
if (typeof value !== 'string' || !pattern.test(value)) {
|
|
316
|
+
throw new Error(
|
|
317
|
+
'Required candidate report argument is invalid: ' + name,
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
return value;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const args = parseArgs(process.argv.slice(2));
|
|
324
|
+
const candidateIdentity = required(
|
|
325
|
+
args,
|
|
326
|
+
'candidate',
|
|
327
|
+
/^[a-z0-9][a-z0-9._-]{0,127}$/,
|
|
328
|
+
);
|
|
329
|
+
const phase = required(
|
|
330
|
+
args,
|
|
331
|
+
'phase',
|
|
332
|
+
/^(foundation-bootstrap|full-stage)$/,
|
|
333
|
+
);
|
|
334
|
+
const region = required(
|
|
335
|
+
args,
|
|
336
|
+
'region',
|
|
337
|
+
/^[a-z]{2}(?:-gov)?-[a-z]+-\\d$/,
|
|
338
|
+
);
|
|
339
|
+
const stage = required(
|
|
340
|
+
args,
|
|
341
|
+
'stage',
|
|
342
|
+
/^(development|staging|production)$/,
|
|
343
|
+
);
|
|
344
|
+
const projects = selectWorkloadRoleCandidateProjects(
|
|
345
|
+
discoverWorkloadRoleCandidateProjects(process.cwd()),
|
|
346
|
+
phase,
|
|
347
|
+
);
|
|
348
|
+
const scratch = mkdtempSync(
|
|
349
|
+
join(tmpdir(), 'ebk-workload-role-report-'),
|
|
350
|
+
);
|
|
351
|
+
const require = createRequire(import.meta.url);
|
|
352
|
+
|
|
353
|
+
try {
|
|
354
|
+
const documents = [];
|
|
355
|
+
for (const project of projects) {
|
|
356
|
+
const outputPath = join(scratch, project.project + '.cjs');
|
|
357
|
+
await build({
|
|
358
|
+
bundle: true,
|
|
359
|
+
entryPoints: [project.reportPath],
|
|
360
|
+
format: 'cjs',
|
|
361
|
+
legalComments: 'none',
|
|
362
|
+
logLevel: 'silent',
|
|
363
|
+
outfile: outputPath,
|
|
364
|
+
platform: 'node',
|
|
365
|
+
sourcemap: false,
|
|
366
|
+
target: 'node22',
|
|
367
|
+
});
|
|
368
|
+
const reporter = require(outputPath).reportWorkloadRoleCandidate;
|
|
369
|
+
if (typeof reporter !== 'function') {
|
|
370
|
+
throw new Error(
|
|
371
|
+
'Generated workload-role candidate reporter was substituted.',
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
const document = requireRegisteredWorkloadRoleManifestDocument(
|
|
375
|
+
await reporter({ candidateIdentity, region, stage }),
|
|
376
|
+
);
|
|
377
|
+
if (document.project !== project.project) {
|
|
378
|
+
throw new Error(
|
|
379
|
+
'Generated workload-role candidate report named another project.',
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
documents.push(document);
|
|
383
|
+
}
|
|
384
|
+
const first = documents[0];
|
|
385
|
+
if (!first) {
|
|
386
|
+
throw new Error('Generated workload-role candidate set is empty.');
|
|
387
|
+
}
|
|
388
|
+
const boundary = createStageWorkloadRoleBoundaryContract({
|
|
389
|
+
documents,
|
|
390
|
+
expectedAccountId: first.accountId,
|
|
391
|
+
expectedCandidateIdentity: candidateIdentity,
|
|
392
|
+
expectedManifestDigests: Object.fromEntries(
|
|
393
|
+
documents.map(({ manifestDigest, project }) => [
|
|
394
|
+
project,
|
|
395
|
+
manifestDigest,
|
|
396
|
+
]),
|
|
397
|
+
),
|
|
398
|
+
expectedPartition: first.partition,
|
|
399
|
+
expectedProjects: projects.map(({ project }) => project),
|
|
400
|
+
expectedStage: stage,
|
|
401
|
+
});
|
|
402
|
+
process.stdout.write(
|
|
403
|
+
JSON.stringify(boundary.documents, null, 2) + '\\n',
|
|
404
|
+
);
|
|
405
|
+
} finally {
|
|
406
|
+
rmSync(scratch, { force: true, recursive: true });
|
|
407
|
+
}
|
|
408
|
+
`,
|
|
409
|
+
'tools/workload-role-baseline/provisioner.ts': `import * as iamSdk from '@aws-sdk/client-iam';
|
|
410
|
+
import * as s3Sdk from '@aws-sdk/client-s3';
|
|
411
|
+
import {
|
|
412
|
+
createAwsInternalWorkloadRoleProvisionerHandler,
|
|
413
|
+
createAwsSdkV3IamControlPlane,
|
|
414
|
+
createAwsSdkV3S3JsonControlPlane,
|
|
415
|
+
} from '@empire-builder-kit/nx/workload-roles';
|
|
416
|
+
|
|
417
|
+
const required = (
|
|
418
|
+
name:
|
|
419
|
+
| 'EBK_WORKLOAD_ROLE_BUCKET'
|
|
420
|
+
| 'EBK_WORKLOAD_ROLE_MANIFEST_DIGEST'
|
|
421
|
+
| 'EBK_WORKLOAD_ROLE_PROJECT'
|
|
422
|
+
| 'EBK_WORKLOAD_ROLE_PROVISIONER_ALIAS_ARN'
|
|
423
|
+
| 'EBK_WORKLOAD_ROLE_STAGE',
|
|
424
|
+
pattern: RegExp,
|
|
425
|
+
) => {
|
|
426
|
+
const value = process.env[name]?.trim();
|
|
427
|
+
if (!value || !pattern.test(value)) {
|
|
428
|
+
throw new Error('Fixed workload-role provisioner configuration is invalid.');
|
|
429
|
+
}
|
|
430
|
+
return value;
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
const bucketName = required(
|
|
434
|
+
'EBK_WORKLOAD_ROLE_BUCKET',
|
|
435
|
+
/^(?!\\d{1,3}(?:\\.\\d{1,3}){3}$)[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/,
|
|
436
|
+
);
|
|
437
|
+
const manifestDigest = required(
|
|
438
|
+
'EBK_WORKLOAD_ROLE_MANIFEST_DIGEST',
|
|
439
|
+
/^[a-f0-9]{64}$/,
|
|
440
|
+
);
|
|
441
|
+
const project = required(
|
|
442
|
+
'EBK_WORKLOAD_ROLE_PROJECT',
|
|
443
|
+
/^[a-z0-9][a-z0-9-]{0,62}$/,
|
|
444
|
+
);
|
|
445
|
+
const provisionerFunctionArn = required(
|
|
446
|
+
'EBK_WORKLOAD_ROLE_PROVISIONER_ALIAS_ARN',
|
|
447
|
+
/^arn:(aws|aws-cn|aws-us-gov):lambda:[a-z0-9-]+:\\d{12}:function:[A-Za-z0-9-_]+:candidate-[a-f0-9]{64}$/,
|
|
448
|
+
);
|
|
449
|
+
const stage = required(
|
|
450
|
+
'EBK_WORKLOAD_ROLE_STAGE',
|
|
451
|
+
/^[a-z0-9][a-z0-9-]{0,62}$/,
|
|
452
|
+
);
|
|
453
|
+
|
|
454
|
+
let fixedHandler: Promise<
|
|
455
|
+
(request: unknown) => Promise<unknown>
|
|
456
|
+
> | undefined;
|
|
457
|
+
|
|
458
|
+
async function configuredHandler() {
|
|
459
|
+
fixedHandler ??= Promise.all([
|
|
460
|
+
createAwsSdkV3IamControlPlane({
|
|
461
|
+
loadModule: async () => iamSdk,
|
|
462
|
+
}),
|
|
463
|
+
createAwsSdkV3S3JsonControlPlane({
|
|
464
|
+
loadModule: async () => s3Sdk,
|
|
465
|
+
}),
|
|
466
|
+
]).then(([iam, s3]) =>
|
|
467
|
+
createAwsInternalWorkloadRoleProvisionerHandler({
|
|
468
|
+
bucketName,
|
|
469
|
+
iam,
|
|
470
|
+
manifestDigest,
|
|
471
|
+
project,
|
|
472
|
+
provisionerFunctionArn,
|
|
473
|
+
s3,
|
|
474
|
+
stage,
|
|
475
|
+
}),
|
|
476
|
+
);
|
|
477
|
+
return fixedHandler;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export async function handler(request: unknown) {
|
|
481
|
+
return (await configuredHandler())(request);
|
|
482
|
+
}
|
|
483
|
+
`,
|
|
484
|
+
'tools/workload-role-baseline/build.mjs': `import { createHash } from 'node:crypto';
|
|
485
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
486
|
+
import { build } from 'esbuild';
|
|
487
|
+
|
|
488
|
+
const outputDirectory = 'dist/workload-role-baseline';
|
|
489
|
+
const archivePath = outputDirectory + '/provisioner.zip';
|
|
490
|
+
const entryName = Buffer.from('index.js', 'utf8');
|
|
491
|
+
|
|
492
|
+
const crcTable = Array.from({ length: 256 }, (_, index) => {
|
|
493
|
+
let value = index;
|
|
494
|
+
for (let bit = 0; bit < 8; bit += 1) {
|
|
495
|
+
value = (value & 1) === 1
|
|
496
|
+
? 0xedb88320 ^ (value >>> 1)
|
|
497
|
+
: value >>> 1;
|
|
498
|
+
}
|
|
499
|
+
return value >>> 0;
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
function crc32(value) {
|
|
503
|
+
let crc = 0xffffffff;
|
|
504
|
+
for (const byte of value) {
|
|
505
|
+
crc = crcTable[(crc ^ byte) & 0xff] ^ (crc >>> 8);
|
|
506
|
+
}
|
|
507
|
+
return (crc ^ 0xffffffff) >>> 0;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
function deterministicZip(name, contents) {
|
|
511
|
+
const checksum = crc32(contents);
|
|
512
|
+
const local = Buffer.alloc(30);
|
|
513
|
+
local.writeUInt32LE(0x04034b50, 0);
|
|
514
|
+
local.writeUInt16LE(20, 4);
|
|
515
|
+
local.writeUInt16LE(0, 6);
|
|
516
|
+
local.writeUInt16LE(0, 8);
|
|
517
|
+
local.writeUInt16LE(0, 10);
|
|
518
|
+
local.writeUInt16LE(0x21, 12);
|
|
519
|
+
local.writeUInt32LE(checksum, 14);
|
|
520
|
+
local.writeUInt32LE(contents.length, 18);
|
|
521
|
+
local.writeUInt32LE(contents.length, 22);
|
|
522
|
+
local.writeUInt16LE(name.length, 26);
|
|
523
|
+
local.writeUInt16LE(0, 28);
|
|
524
|
+
|
|
525
|
+
const central = Buffer.alloc(46);
|
|
526
|
+
central.writeUInt32LE(0x02014b50, 0);
|
|
527
|
+
central.writeUInt16LE(20, 4);
|
|
528
|
+
central.writeUInt16LE(20, 6);
|
|
529
|
+
central.writeUInt16LE(0, 8);
|
|
530
|
+
central.writeUInt16LE(0, 10);
|
|
531
|
+
central.writeUInt16LE(0, 12);
|
|
532
|
+
central.writeUInt16LE(0x21, 14);
|
|
533
|
+
central.writeUInt32LE(checksum, 16);
|
|
534
|
+
central.writeUInt32LE(contents.length, 20);
|
|
535
|
+
central.writeUInt32LE(contents.length, 24);
|
|
536
|
+
central.writeUInt16LE(name.length, 28);
|
|
537
|
+
central.writeUInt16LE(0, 30);
|
|
538
|
+
central.writeUInt16LE(0, 32);
|
|
539
|
+
central.writeUInt16LE(0, 34);
|
|
540
|
+
central.writeUInt16LE(0, 36);
|
|
541
|
+
central.writeUInt32LE(0, 38);
|
|
542
|
+
central.writeUInt32LE(0, 42);
|
|
543
|
+
|
|
544
|
+
const centralOffset = local.length + name.length + contents.length;
|
|
545
|
+
const end = Buffer.alloc(22);
|
|
546
|
+
end.writeUInt32LE(0x06054b50, 0);
|
|
547
|
+
end.writeUInt16LE(0, 4);
|
|
548
|
+
end.writeUInt16LE(0, 6);
|
|
549
|
+
end.writeUInt16LE(1, 8);
|
|
550
|
+
end.writeUInt16LE(1, 10);
|
|
551
|
+
end.writeUInt32LE(central.length + name.length, 12);
|
|
552
|
+
end.writeUInt32LE(centralOffset, 16);
|
|
553
|
+
end.writeUInt16LE(0, 20);
|
|
554
|
+
return Buffer.concat([
|
|
555
|
+
local,
|
|
556
|
+
name,
|
|
557
|
+
contents,
|
|
558
|
+
central,
|
|
559
|
+
name,
|
|
560
|
+
end,
|
|
561
|
+
]);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
const result = await build({
|
|
565
|
+
bundle: true,
|
|
566
|
+
entryPoints: ['tools/workload-role-baseline/provisioner.ts'],
|
|
567
|
+
format: 'cjs',
|
|
568
|
+
legalComments: 'none',
|
|
569
|
+
minify: false,
|
|
570
|
+
platform: 'node',
|
|
571
|
+
sourcemap: false,
|
|
572
|
+
target: 'node22',
|
|
573
|
+
write: false,
|
|
574
|
+
});
|
|
575
|
+
if (result.outputFiles.length !== 1) {
|
|
576
|
+
throw new Error('Provisioner build did not produce one exact bundled entry.');
|
|
577
|
+
}
|
|
578
|
+
const bundled = Buffer.from(result.outputFiles[0].contents);
|
|
579
|
+
const archive = deterministicZip(entryName, bundled);
|
|
580
|
+
const digest = createHash('sha256').update(archive).digest('hex');
|
|
581
|
+
mkdirSync(outputDirectory, { recursive: true });
|
|
582
|
+
writeFileSync(archivePath, archive, { mode: 0o600 });
|
|
583
|
+
writeFileSync(
|
|
584
|
+
outputDirectory + '/provisioner.sha256',
|
|
585
|
+
digest + ' provisioner.zip\\n',
|
|
586
|
+
{ encoding: 'utf8', mode: 0o600 },
|
|
587
|
+
);
|
|
588
|
+
process.stdout.write(
|
|
589
|
+
JSON.stringify({
|
|
590
|
+
archive: archivePath,
|
|
591
|
+
sha256: digest,
|
|
592
|
+
}) + '\\n',
|
|
593
|
+
);
|
|
594
|
+
`,
|
|
595
|
+
'tools/workload-role-baseline/publish.mjs': `import {
|
|
596
|
+
mkdtempSync,
|
|
597
|
+
readFileSync,
|
|
598
|
+
rmSync,
|
|
599
|
+
writeFileSync,
|
|
600
|
+
} from 'node:fs';
|
|
601
|
+
import { tmpdir } from 'node:os';
|
|
602
|
+
import { join } from 'node:path';
|
|
603
|
+
import { spawnSync } from 'node:child_process';
|
|
604
|
+
import {
|
|
605
|
+
createWorkloadRoleStageAccountBaselinePlan,
|
|
606
|
+
publishReviewedStageWorkloadRoleCandidate,
|
|
607
|
+
} from '@empire-builder-kit/nx/workload-roles';
|
|
608
|
+
import {
|
|
609
|
+
discoverWorkloadRoleCandidateProjects,
|
|
610
|
+
selectWorkloadRoleCandidateProjects,
|
|
611
|
+
} from './project-set.mjs';
|
|
612
|
+
|
|
613
|
+
const supported = new Set([
|
|
614
|
+
'account',
|
|
615
|
+
'apply',
|
|
616
|
+
'candidate',
|
|
617
|
+
'code-bucket',
|
|
618
|
+
'code-key',
|
|
619
|
+
'code-version',
|
|
620
|
+
'deployment-role-arn',
|
|
621
|
+
'digests',
|
|
622
|
+
'documents',
|
|
623
|
+
'partition',
|
|
624
|
+
'phase',
|
|
625
|
+
'prior',
|
|
626
|
+
'prior-histories',
|
|
627
|
+
'publisher-principal-arn',
|
|
628
|
+
'region',
|
|
629
|
+
'reviewed-commit',
|
|
630
|
+
'stage',
|
|
631
|
+
]);
|
|
632
|
+
|
|
633
|
+
function parseArgs(values) {
|
|
634
|
+
const result = {};
|
|
635
|
+
for (const value of values) {
|
|
636
|
+
if (!value.startsWith('--')) {
|
|
637
|
+
throw new Error('Publisher arguments must use --name=value.');
|
|
638
|
+
}
|
|
639
|
+
if (value === '--apply') {
|
|
640
|
+
if (result.apply !== undefined) throw new Error('Duplicate --apply.');
|
|
641
|
+
result.apply = true;
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
644
|
+
const separator = value.indexOf('=');
|
|
645
|
+
if (separator < 3) throw new Error('Publisher arguments must use --name=value.');
|
|
646
|
+
const name = value.slice(2, separator);
|
|
647
|
+
if (!supported.has(name) || result[name] !== undefined) {
|
|
648
|
+
throw new Error('Publisher argument is unsupported or duplicated: ' + name);
|
|
649
|
+
}
|
|
650
|
+
const parsed = value.slice(separator + 1);
|
|
651
|
+
if (!parsed) throw new Error('Publisher argument is empty: ' + name);
|
|
652
|
+
result[name] = parsed;
|
|
653
|
+
}
|
|
654
|
+
return result;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
function required(args, name, pattern) {
|
|
658
|
+
const value = args[name];
|
|
659
|
+
if (typeof value !== 'string' || !pattern.test(value)) {
|
|
660
|
+
throw new Error('Required publisher argument is invalid: ' + name);
|
|
661
|
+
}
|
|
662
|
+
return value;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
function exactDigests(value, projects) {
|
|
666
|
+
const result = {};
|
|
667
|
+
for (const entry of value.split(',')) {
|
|
668
|
+
const separator = entry.indexOf(':');
|
|
669
|
+
const project = entry.slice(0, separator);
|
|
670
|
+
const digest = entry.slice(separator + 1);
|
|
671
|
+
if (
|
|
672
|
+
separator < 1 ||
|
|
673
|
+
result[project] !== undefined ||
|
|
674
|
+
!/^[a-f0-9]{64}$/.test(digest)
|
|
675
|
+
) {
|
|
676
|
+
throw new Error('Reviewed digest map is invalid.');
|
|
677
|
+
}
|
|
678
|
+
result[project] = digest;
|
|
679
|
+
}
|
|
680
|
+
if (JSON.stringify(Object.keys(result).sort()) !== JSON.stringify(projects)) {
|
|
681
|
+
throw new Error('Reviewed digest map must name the exact project set.');
|
|
682
|
+
}
|
|
683
|
+
return result;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
function readDocuments(path) {
|
|
687
|
+
const value = JSON.parse(readFileSync(path, 'utf8'));
|
|
688
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
689
|
+
throw new Error('Reviewed document bundle must be a non-empty JSON array.');
|
|
690
|
+
}
|
|
691
|
+
return value;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
function git(args) {
|
|
695
|
+
const response = spawnSync('git', args, {
|
|
696
|
+
encoding: 'utf8',
|
|
697
|
+
maxBuffer: 4 * 1024 * 1024,
|
|
698
|
+
shell: false,
|
|
699
|
+
});
|
|
700
|
+
if (response.status !== 0) {
|
|
701
|
+
throw new Error('Unable to verify reviewed Git source.');
|
|
702
|
+
}
|
|
703
|
+
return response.stdout.trim();
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
function verifiedGitSource(stage, reviewedCommit) {
|
|
707
|
+
const expected = stage === 'production'
|
|
708
|
+
? 'refs/heads/main'
|
|
709
|
+
: 'refs/heads/develop';
|
|
710
|
+
const actualRef = git(['symbolic-ref', '--quiet', 'HEAD']);
|
|
711
|
+
const actualCommit = git(['rev-parse', 'HEAD']);
|
|
712
|
+
const status = git(['status', '--porcelain=v1', '--untracked-files=all']);
|
|
713
|
+
if (
|
|
714
|
+
actualRef !== expected ||
|
|
715
|
+
actualCommit !== reviewedCommit ||
|
|
716
|
+
status !== ''
|
|
717
|
+
) {
|
|
718
|
+
throw new Error(
|
|
719
|
+
'Publisher requires the exact clean reviewed commit on ' + expected + '.',
|
|
720
|
+
);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
function priorExpectations(value, projects) {
|
|
725
|
+
if (value === undefined) return undefined;
|
|
726
|
+
const result = {};
|
|
727
|
+
for (const entry of value.split(',')) {
|
|
728
|
+
const [
|
|
729
|
+
project,
|
|
730
|
+
candidateIdentity,
|
|
731
|
+
manifestDigest,
|
|
732
|
+
historyDigest,
|
|
733
|
+
extra,
|
|
734
|
+
] = entry.split(':');
|
|
735
|
+
if (
|
|
736
|
+
extra !== undefined ||
|
|
737
|
+
!projects.includes(project) ||
|
|
738
|
+
result[project] !== undefined ||
|
|
739
|
+
!/^[a-z0-9][a-z0-9._-]{0,127}$/.test(candidateIdentity ?? '') ||
|
|
740
|
+
!/^[a-f0-9]{64}$/.test(manifestDigest ?? '') ||
|
|
741
|
+
!/^[a-f0-9]{64}$/.test(historyDigest ?? '')
|
|
742
|
+
) {
|
|
743
|
+
throw new Error('Reviewed prior-history expectation is invalid.');
|
|
744
|
+
}
|
|
745
|
+
result[project] = { candidateIdentity, historyDigest, manifestDigest };
|
|
746
|
+
}
|
|
747
|
+
return result;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
function readPriorHistories(path) {
|
|
751
|
+
if (path === undefined) return undefined;
|
|
752
|
+
const value = JSON.parse(readFileSync(path, 'utf8'));
|
|
753
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
754
|
+
throw new Error('Reviewed prior histories must be a JSON object by project.');
|
|
755
|
+
}
|
|
756
|
+
return value;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
const args = parseArgs(process.argv.slice(2));
|
|
760
|
+
const expectedStage = required(
|
|
761
|
+
args,
|
|
762
|
+
'stage',
|
|
763
|
+
/^(development|staging|production)$/,
|
|
764
|
+
);
|
|
765
|
+
const publicationPhase = required(
|
|
766
|
+
args,
|
|
767
|
+
'phase',
|
|
768
|
+
/^(foundation-bootstrap|full-stage)$/,
|
|
769
|
+
);
|
|
770
|
+
verifiedGitSource(
|
|
771
|
+
expectedStage,
|
|
772
|
+
required(args, 'reviewed-commit', /^[a-f0-9]{40}(?:[a-f0-9]{24})?$/),
|
|
773
|
+
);
|
|
774
|
+
const expectedProjects = selectWorkloadRoleCandidateProjects(
|
|
775
|
+
discoverWorkloadRoleCandidateProjects(process.cwd()),
|
|
776
|
+
publicationPhase,
|
|
777
|
+
).map(({ project }) => project);
|
|
778
|
+
const expectedManifestDigests = exactDigests(
|
|
779
|
+
required(args, 'digests', /^.+$/),
|
|
780
|
+
expectedProjects,
|
|
781
|
+
);
|
|
782
|
+
const expectedPriorHistories = priorExpectations(args.prior, expectedProjects);
|
|
783
|
+
const reviewedPriorHistories = readPriorHistories(args['prior-histories']);
|
|
784
|
+
if (
|
|
785
|
+
(expectedPriorHistories === undefined) !==
|
|
786
|
+
(reviewedPriorHistories === undefined)
|
|
787
|
+
) {
|
|
788
|
+
throw new Error('--prior and --prior-histories must be supplied together.');
|
|
789
|
+
}
|
|
790
|
+
if (
|
|
791
|
+
publicationPhase === 'foundation-bootstrap' &&
|
|
792
|
+
expectedPriorHistories !== undefined
|
|
793
|
+
) {
|
|
794
|
+
throw new Error(
|
|
795
|
+
'Foundation bootstrap cannot carry prior workload-role history.',
|
|
796
|
+
);
|
|
797
|
+
}
|
|
798
|
+
const plan = createWorkloadRoleStageAccountBaselinePlan({
|
|
799
|
+
code: {
|
|
800
|
+
bucketName: required(
|
|
801
|
+
args,
|
|
802
|
+
'code-bucket',
|
|
803
|
+
/^(?!\\d{1,3}(?:\\.\\d{1,3}){3}$)[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/,
|
|
804
|
+
),
|
|
805
|
+
objectKey: required(args, 'code-key', /^(?!\\/).+$/),
|
|
806
|
+
objectVersion: required(args, 'code-version', /^.+$/),
|
|
807
|
+
},
|
|
808
|
+
expectedAccountId: required(args, 'account', /^\\d{12}$/),
|
|
809
|
+
expectedCandidateIdentity: required(
|
|
810
|
+
args,
|
|
811
|
+
'candidate',
|
|
812
|
+
/^[a-z0-9][a-z0-9._-]{0,127}$/,
|
|
813
|
+
),
|
|
814
|
+
expectedManifestDigests,
|
|
815
|
+
expectedPartition: required(
|
|
816
|
+
args,
|
|
817
|
+
'partition',
|
|
818
|
+
/^(aws|aws-cn|aws-us-gov)$/,
|
|
819
|
+
),
|
|
820
|
+
...(expectedPriorHistories ? { expectedPriorHistories } : {}),
|
|
821
|
+
expectedProjects,
|
|
822
|
+
expectedStage,
|
|
823
|
+
region: required(args, 'region', /^[a-z]{2}(?:-gov)?-[a-z]+-\\d$/),
|
|
824
|
+
registeredDocuments: readDocuments(
|
|
825
|
+
required(args, 'documents', /^.+$/),
|
|
826
|
+
),
|
|
827
|
+
reviewedDeploymentRoleArn: required(
|
|
828
|
+
args,
|
|
829
|
+
'deployment-role-arn',
|
|
830
|
+
/^arn:(aws|aws-cn|aws-us-gov):iam::\\d{12}:role\\/.+$/,
|
|
831
|
+
),
|
|
832
|
+
...(reviewedPriorHistories ? { reviewedPriorHistories } : {}),
|
|
833
|
+
reviewedPublisherPrincipalArn: required(
|
|
834
|
+
args,
|
|
835
|
+
'publisher-principal-arn',
|
|
836
|
+
/^arn:(aws|aws-cn|aws-us-gov):(iam|sts)::\\d{12}:(?:role|user|assumed-role)\\/.+$/,
|
|
837
|
+
),
|
|
838
|
+
});
|
|
839
|
+
|
|
840
|
+
const report = {
|
|
841
|
+
boundary: {
|
|
842
|
+
arn: plan.boundary.arn,
|
|
843
|
+
digest: plan.boundary.digest,
|
|
844
|
+
policyCharacters: plan.boundary.policyCharacters,
|
|
845
|
+
},
|
|
846
|
+
candidateIdentity: plan.candidateIdentity,
|
|
847
|
+
deploymentRoleArn: plan.deploymentRoleArn,
|
|
848
|
+
projects: plan.projectPlans.map((project) => ({
|
|
849
|
+
manifestDigest: project.manifestDigest,
|
|
850
|
+
project: project.project,
|
|
851
|
+
provisionerAliasArn: project.provisionerAliasArn,
|
|
852
|
+
registeredManifestObjectKey: project.registeredManifestObjectKey,
|
|
853
|
+
storageParameterName: project.storageParameterName,
|
|
854
|
+
})),
|
|
855
|
+
schemaVersion: plan.schemaVersion,
|
|
856
|
+
stackName: plan.stackName,
|
|
857
|
+
stage: plan.stage,
|
|
858
|
+
stateBucketName: plan.stateBucketName,
|
|
859
|
+
publicationPhase,
|
|
860
|
+
settledTemplate: plan.settledCloudFormationTemplate,
|
|
861
|
+
transitionalTemplate: plan.transitionalCloudFormationTemplate,
|
|
862
|
+
transitionalInstanceProfileArns: plan.transitionalInstanceProfileArns,
|
|
863
|
+
transitionalRoleArns: plan.transitionalRoleArns,
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
if (args.apply !== true) {
|
|
867
|
+
process.stdout.write(JSON.stringify(report, null, 2) + '\\n');
|
|
868
|
+
process.exit(0);
|
|
869
|
+
}
|
|
870
|
+
if (
|
|
871
|
+
process.env.EBK_ACCOUNT_BASELINE_AUTHORITY !== 'external-protected' ||
|
|
872
|
+
process.env.GITHUB_ACTIONS === 'true'
|
|
873
|
+
) {
|
|
874
|
+
throw new Error(
|
|
875
|
+
'Apply requires external protected account-baseline authority outside GitHub Actions.',
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
const scratch = mkdtempSync(join(tmpdir(), 'ebk-workload-role-baseline-'));
|
|
880
|
+
function aws(command, commandArgs) {
|
|
881
|
+
const response = spawnSync(
|
|
882
|
+
'aws',
|
|
883
|
+
[command, ...commandArgs, '--region', plan.region],
|
|
884
|
+
{
|
|
885
|
+
encoding: 'utf8',
|
|
886
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
887
|
+
shell: false,
|
|
888
|
+
},
|
|
889
|
+
);
|
|
890
|
+
if (response.status !== 0) {
|
|
891
|
+
throw new Error(
|
|
892
|
+
'Protected AWS operation failed: ' +
|
|
893
|
+
command +
|
|
894
|
+
' (' +
|
|
895
|
+
String(response.status) +
|
|
896
|
+
').',
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
return response.stdout;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
function requireAwsResourceAbsent(command, commandArgs, absentPattern, label) {
|
|
903
|
+
const response = spawnSync(
|
|
904
|
+
'aws',
|
|
905
|
+
[command, ...commandArgs, '--region', plan.region],
|
|
906
|
+
{
|
|
907
|
+
encoding: 'utf8',
|
|
908
|
+
maxBuffer: 4 * 1024 * 1024,
|
|
909
|
+
shell: false,
|
|
910
|
+
},
|
|
911
|
+
);
|
|
912
|
+
if (
|
|
913
|
+
response.status === 0 ||
|
|
914
|
+
response.status === null ||
|
|
915
|
+
!absentPattern.test(response.stderr ?? '')
|
|
916
|
+
) {
|
|
917
|
+
throw new Error(
|
|
918
|
+
'Foundation bootstrap requires proven absence of ' + label + '.',
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
try {
|
|
924
|
+
const caller = JSON.parse(
|
|
925
|
+
aws('sts', ['get-caller-identity', '--output', 'json']),
|
|
926
|
+
);
|
|
927
|
+
if (
|
|
928
|
+
caller.Account !== plan.boundary.accountId ||
|
|
929
|
+
caller.Arn !== plan.publisherPrincipalArn
|
|
930
|
+
) {
|
|
931
|
+
throw new Error(
|
|
932
|
+
'Current AWS identity is not external protected account-baseline authority.',
|
|
933
|
+
);
|
|
934
|
+
}
|
|
935
|
+
const deploymentRole = JSON.parse(
|
|
936
|
+
aws('iam', [
|
|
937
|
+
'get-role',
|
|
938
|
+
'--role-name',
|
|
939
|
+
plan.deploymentRoleName,
|
|
940
|
+
'--output',
|
|
941
|
+
'json',
|
|
942
|
+
]),
|
|
943
|
+
);
|
|
944
|
+
if (deploymentRole.Role?.Arn !== plan.deploymentRoleArn) {
|
|
945
|
+
throw new Error('Reviewed deployment role identity was substituted.');
|
|
946
|
+
}
|
|
947
|
+
if (publicationPhase === 'foundation-bootstrap') {
|
|
948
|
+
const foundation = plan.projectPlans[0];
|
|
949
|
+
if (
|
|
950
|
+
plan.projectPlans.length !== 1 ||
|
|
951
|
+
foundation?.project !== 'foundation'
|
|
952
|
+
) {
|
|
953
|
+
throw new Error(
|
|
954
|
+
'Foundation bootstrap project set was substituted.',
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
requireAwsResourceAbsent(
|
|
958
|
+
'cloudformation',
|
|
959
|
+
['describe-stacks', '--stack-name', plan.stackName],
|
|
960
|
+
/does not exist/i,
|
|
961
|
+
'the workload-role account-baseline stack',
|
|
962
|
+
);
|
|
963
|
+
requireAwsResourceAbsent(
|
|
964
|
+
'ssm',
|
|
965
|
+
['get-parameter', '--name', foundation.storageParameterName],
|
|
966
|
+
/ParameterNotFound/,
|
|
967
|
+
'the Foundation workload-role pointer',
|
|
968
|
+
);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
let baselineApplications = 0;
|
|
972
|
+
const controlPlane = {
|
|
973
|
+
async applyAccountBaseline(template, stackName) {
|
|
974
|
+
const templatePath = join(scratch, 'account-baseline.json');
|
|
975
|
+
writeFileSync(templatePath, JSON.stringify(template), {
|
|
976
|
+
encoding: 'utf8',
|
|
977
|
+
mode: 0o600,
|
|
978
|
+
});
|
|
979
|
+
if (
|
|
980
|
+
publicationPhase === 'foundation-bootstrap' &&
|
|
981
|
+
baselineApplications === 0
|
|
982
|
+
) {
|
|
983
|
+
aws('cloudformation', [
|
|
984
|
+
'create-stack',
|
|
985
|
+
'--template-body',
|
|
986
|
+
'file://' + templatePath,
|
|
987
|
+
'--stack-name',
|
|
988
|
+
stackName,
|
|
989
|
+
'--capabilities',
|
|
990
|
+
'CAPABILITY_NAMED_IAM',
|
|
991
|
+
]);
|
|
992
|
+
aws('cloudformation', [
|
|
993
|
+
'wait',
|
|
994
|
+
'stack-create-complete',
|
|
995
|
+
'--stack-name',
|
|
996
|
+
stackName,
|
|
997
|
+
]);
|
|
998
|
+
} else {
|
|
999
|
+
aws('cloudformation', [
|
|
1000
|
+
'deploy',
|
|
1001
|
+
'--template-file',
|
|
1002
|
+
templatePath,
|
|
1003
|
+
'--stack-name',
|
|
1004
|
+
stackName,
|
|
1005
|
+
'--capabilities',
|
|
1006
|
+
'CAPABILITY_NAMED_IAM',
|
|
1007
|
+
'--no-fail-on-empty-changeset',
|
|
1008
|
+
]);
|
|
1009
|
+
}
|
|
1010
|
+
baselineApplications += 1;
|
|
1011
|
+
},
|
|
1012
|
+
async putRegisteredDocument(input) {
|
|
1013
|
+
const path = join(scratch, input.value.project + '-registered.json');
|
|
1014
|
+
writeFileSync(path, JSON.stringify(input.value), {
|
|
1015
|
+
encoding: 'utf8',
|
|
1016
|
+
mode: 0o600,
|
|
1017
|
+
});
|
|
1018
|
+
aws('s3api', [
|
|
1019
|
+
'put-object',
|
|
1020
|
+
'--bucket',
|
|
1021
|
+
input.bucketName,
|
|
1022
|
+
'--key',
|
|
1023
|
+
input.key,
|
|
1024
|
+
'--body',
|
|
1025
|
+
path,
|
|
1026
|
+
'--server-side-encryption',
|
|
1027
|
+
'AES256',
|
|
1028
|
+
'--checksum-algorithm',
|
|
1029
|
+
'SHA256',
|
|
1030
|
+
]);
|
|
1031
|
+
},
|
|
1032
|
+
async invokeQualifiedProvisioner(functionArn, request) {
|
|
1033
|
+
const project = plan.projectPlans.find(
|
|
1034
|
+
(entry) => entry.provisionerAliasArn === functionArn,
|
|
1035
|
+
);
|
|
1036
|
+
if (!project) throw new Error('Qualified provisioner was substituted.');
|
|
1037
|
+
const outputPath = join(scratch, project.project + '-result.json');
|
|
1038
|
+
const metadata = JSON.parse(
|
|
1039
|
+
aws('lambda', [
|
|
1040
|
+
'invoke',
|
|
1041
|
+
'--function-name',
|
|
1042
|
+
functionArn,
|
|
1043
|
+
'--invocation-type',
|
|
1044
|
+
'RequestResponse',
|
|
1045
|
+
'--cli-binary-format',
|
|
1046
|
+
'raw-in-base64-out',
|
|
1047
|
+
'--payload',
|
|
1048
|
+
JSON.stringify(request),
|
|
1049
|
+
outputPath,
|
|
1050
|
+
'--output',
|
|
1051
|
+
'json',
|
|
1052
|
+
]),
|
|
1053
|
+
);
|
|
1054
|
+
if (metadata.FunctionError !== undefined) {
|
|
1055
|
+
throw new Error('Fixed provisioner returned a Lambda function error.');
|
|
1056
|
+
}
|
|
1057
|
+
return JSON.parse(readFileSync(outputPath, 'utf8'));
|
|
1058
|
+
},
|
|
1059
|
+
async putDeploymentRolePolicy(input) {
|
|
1060
|
+
const path = join(scratch, 'deployment-policy.json');
|
|
1061
|
+
writeFileSync(path, JSON.stringify(input.policy), {
|
|
1062
|
+
encoding: 'utf8',
|
|
1063
|
+
mode: 0o600,
|
|
1064
|
+
});
|
|
1065
|
+
aws('iam', [
|
|
1066
|
+
'put-role-policy',
|
|
1067
|
+
'--role-name',
|
|
1068
|
+
input.roleName,
|
|
1069
|
+
'--policy-name',
|
|
1070
|
+
input.policyName,
|
|
1071
|
+
'--policy-document',
|
|
1072
|
+
'file://' + path,
|
|
1073
|
+
]);
|
|
1074
|
+
},
|
|
1075
|
+
async putStoragePointer(input) {
|
|
1076
|
+
aws('ssm', [
|
|
1077
|
+
'put-parameter',
|
|
1078
|
+
'--name',
|
|
1079
|
+
input.name,
|
|
1080
|
+
'--type',
|
|
1081
|
+
'String',
|
|
1082
|
+
'--value',
|
|
1083
|
+
input.value,
|
|
1084
|
+
'--overwrite',
|
|
1085
|
+
]);
|
|
1086
|
+
},
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
const result = await publishReviewedStageWorkloadRoleCandidate({
|
|
1090
|
+
controlPlane,
|
|
1091
|
+
plan,
|
|
1092
|
+
});
|
|
1093
|
+
process.stdout.write(
|
|
1094
|
+
JSON.stringify({ ok: true, result, schemaVersion: 1 }) + '\\n',
|
|
1095
|
+
);
|
|
1096
|
+
} finally {
|
|
1097
|
+
rmSync(scratch, { force: true, recursive: true });
|
|
1098
|
+
}
|
|
1099
|
+
`,
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
//# sourceMappingURL=workspace-files-workload-role-baseline.js.map
|