@empire-builder-kit/nx 1.0.0-rc.45 → 1.0.0-rc.47
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/generators.json +11 -1
- package/package.json +3 -3
- package/src/aws-authority/stage-authority.d.ts +30 -2
- package/src/aws-authority/stage-authority.js +220 -25
- package/src/developer-agent/generator-planning.js +109 -9
- package/src/developer-agent/model.d.ts +7 -3
- package/src/developer-agent/model.js +1 -0
- package/src/developer-agent/operation-registry.d.ts +1 -0
- package/src/developer-agent/operation-registry.js +44 -3
- package/src/developer-agent/planning.js +5 -2
- package/src/developer-agent/preview-changes.js +10 -0
- package/src/developer-agent/validation.js +7 -3
- package/src/developer-agent/workspace-inspection.js +51 -4
- package/src/executors/deployment-plan/deployment-plan.js +3 -0
- package/src/executors/dev-doctor/dev-doctor.d.ts +25 -3
- package/src/executors/dev-doctor/dev-doctor.js +136 -49
- package/src/executors/dev-setup/dev-setup.d.ts +18 -1
- package/src/executors/dev-setup/dev-setup.js +320 -196
- package/src/executors/foundation-preflight/foundation-preflight.js +9 -1
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js +2 -2
- package/src/executors/github-bootstrap/github-bootstrap.d.ts +3 -0
- package/src/executors/github-bootstrap/github-bootstrap.js +28 -0
- package/src/executors/github-bootstrap/schema.json +14 -0
- package/src/executors/infrastructure-plan/infrastructure-plan.js +10 -3
- package/src/executors/local-deploy/local-deploy.d.ts +15 -0
- package/src/executors/local-deploy/local-deploy.js +96 -14
- package/src/executors/sst-lifecycle/logging-preflight.js +12 -1
- package/src/executors/sst-lifecycle/run-sst-command.js +51 -5
- package/src/foundation/cost-estimate.js +1 -1
- package/src/foundation/identity-domain-parent-ready.d.ts +91 -0
- package/src/foundation/identity-domain-parent-ready.js +333 -0
- package/src/foundation/identity-domain.d.ts +94 -0
- package/src/foundation/identity-domain.js +115 -0
- package/src/foundation/index.d.ts +2 -0
- package/src/foundation/index.js +7 -0
- package/src/foundation/preflight.js +17 -1
- package/src/foundation/root-site-readiness.d.ts +27 -0
- package/src/foundation/root-site-readiness.js +78 -0
- package/src/foundation/root-site.d.ts +81 -0
- package/src/foundation/root-site.js +268 -0
- package/src/generators/framework-prerequisites.d.ts +2 -0
- package/src/generators/framework-prerequisites.js +34 -0
- package/src/generators/function/function-registration.d.ts +24 -0
- package/src/generators/function/function-registration.js +66 -0
- package/src/generators/function/function.d.ts +16 -1
- package/src/generators/function/function.js +101 -18
- package/src/generators/function/schema.d.ts +1 -0
- package/src/generators/function/schema.json +6 -0
- package/src/generators/function-access/function-access.d.ts +14 -0
- package/src/generators/function-access/function-access.js +141 -0
- package/src/generators/function-access/schema.d.ts +6 -0
- package/src/generators/function-access/schema.json +25 -0
- package/src/generators/post-generation-install.d.ts +1 -1
- package/src/generators/post-generation-install.js +1 -1
- package/src/generators/preset/dependency-overrides.d.ts +1 -1
- package/src/generators/preset/dependency-overrides.js +1 -1
- package/src/generators/preset/workspace-files-adopter-skills.js +14 -0
- package/src/generators/preset/workspace-files-developer-agent.js +17 -11
- package/src/generators/preset/workspace-files-stage-authority.js +58 -1
- package/src/generators/preset/workspace-files-thin-deploy.d.ts +11 -0
- package/src/generators/preset/workspace-files-thin-deploy.js +52 -5
- package/src/generators/preset/workspace-files-thin-docs.js +33 -5
- package/src/generators/preset/workspace-files.js +238 -41
- package/src/generators/repository-policy/repository-policy.js +2 -1
- package/src/generators/repository-policy/schema.d.ts +2 -0
- package/src/generators/repository-policy/schema.json +7 -2
- package/src/generators/site/built-in-site-documentation-files.d.ts +2 -0
- package/src/generators/site/built-in-site-documentation-files.js +92 -0
- package/src/generators/site/built-in-site-files.d.ts +8 -0
- package/src/generators/site/built-in-site-files.js +40 -0
- package/src/generators/site/built-in-site-infrastructure-files.d.ts +2 -0
- package/src/generators/site/built-in-site-infrastructure-files.js +275 -0
- package/src/generators/site/built-in-site-plan.d.ts +19 -0
- package/src/generators/site/built-in-site-plan.js +65 -0
- package/src/generators/site/built-in-site-project-files.d.ts +3 -0
- package/src/generators/site/built-in-site-project-files.js +258 -0
- package/src/generators/site/built-in-site-script-files.d.ts +2 -0
- package/src/generators/site/built-in-site-script-files.js +306 -0
- package/src/generators/site/built-in-site-shared.d.ts +9 -0
- package/src/generators/site/built-in-site-shared.js +21 -0
- package/src/generators/site/built-in-site-smoke-files.d.ts +2 -0
- package/src/generators/site/built-in-site-smoke-files.js +37 -0
- package/src/generators/site/built-in-site-sst-config-files.d.ts +2 -0
- package/src/generators/site/built-in-site-sst-config-files.js +39 -0
- package/src/generators/site/built-in-site-web-files.d.ts +2 -0
- package/src/generators/site/built-in-site-web-files.js +284 -0
- package/src/generators/site/schema.d.ts +4 -0
- package/src/generators/site/schema.json +20 -0
- package/src/generators/site/site.d.ts +13 -0
- package/src/generators/site/site.js +221 -0
- package/src/generators/slice/built-in-plan-alarm-identity.d.ts +9 -0
- package/src/generators/slice/built-in-plan-alarm-identity.js +8 -1
- package/src/generators/slice/built-in-plan-api-contract-files.js +18 -0
- package/src/generators/slice/built-in-plan-async-work-files.js +18 -0
- package/src/generators/slice/built-in-plan-data-files.js +126 -14
- package/src/generators/slice/built-in-plan-foundation-files.d.ts +12 -0
- package/src/generators/slice/built-in-plan-foundation-files.js +114 -5
- package/src/generators/slice/built-in-plan-frontend-files.js +2 -271
- package/src/generators/slice/built-in-plan-frontend-header-proof.d.ts +6 -0
- package/src/generators/slice/built-in-plan-frontend-header-proof.js +282 -0
- package/src/generators/slice/built-in-plan-infrastructure-files.js +151 -237
- package/src/generators/slice/built-in-plan-key-value-cleanup.js +4 -3
- package/src/generators/slice/built-in-plan-log-group-helpers.d.ts +29 -0
- package/src/generators/slice/built-in-plan-log-group-helpers.js +130 -0
- package/src/generators/slice/built-in-plan-metadata-files.js +25 -5
- package/src/generators/slice/built-in-plan-next-build-authority.d.ts +5 -0
- package/src/generators/slice/built-in-plan-next-build-authority.js +124 -0
- package/src/generators/slice/built-in-plan-operations-files.d.ts +6 -0
- package/src/generators/slice/built-in-plan-operations-files.js +107 -219
- package/src/generators/slice/built-in-plan-performance-files.js +6 -1
- package/src/generators/slice/built-in-plan-release-files.js +0 -1
- package/src/generators/slice/built-in-plan-reliability-files.js +12 -8
- package/src/generators/slice/built-in-plan-shared.d.ts +1 -1
- package/src/generators/slice/built-in-plan-shared.js +1 -1
- package/src/generators/slice/built-in-plan-sst-config.d.ts +49 -0
- package/src/generators/slice/built-in-plan-sst-config.js +160 -0
- package/src/generators/slice/built-in-plan-testing-files.js +92 -49
- package/src/generators/slice/built-in-plan-verification-files.js +15 -5
- package/src/generators/slice/built-in-plan-web-files.js +69 -5
- package/src/generators/slice/built-in-plan.js +1 -2
- package/src/generators/slice/deployed-smoke-diagnostics.d.ts +35 -0
- package/src/generators/slice/deployed-smoke-diagnostics.js +189 -0
- package/src/generators/slice/deployed-smoke-readiness.d.ts +7 -0
- package/src/generators/slice/deployed-smoke-readiness.js +118 -23
- package/src/generators/slice/persistence-contract.js +2 -2
- package/src/generators/slice/pnpm-launch-script.d.ts +13 -0
- package/src/generators/slice/pnpm-launch-script.js +28 -0
- package/src/generators/slice/slice.js +27 -0
- package/src/generators/upgrade/custom-domain-notice.d.ts +19 -0
- package/src/generators/upgrade/custom-domain-notice.js +38 -0
- package/src/generators/upgrade/external-blueprint-compositions.d.ts +84 -0
- package/src/generators/upgrade/external-blueprint-compositions.js +478 -0
- package/src/generators/upgrade/framework-package-upgrade.d.ts +58 -0
- package/src/generators/upgrade/framework-package-upgrade.js +78 -0
- package/src/generators/upgrade/function-authentication-notice.d.ts +29 -0
- package/src/generators/upgrade/function-authentication-notice.js +74 -0
- package/src/generators/upgrade/schema.json +2 -2
- package/src/generators/upgrade/upgrade-plan.d.ts +52 -0
- package/src/generators/upgrade/upgrade-plan.js +406 -0
- package/src/generators/upgrade/upgrade.d.ts +1 -35
- package/src/generators/upgrade/upgrade.js +347 -595
- package/src/generators/workload/reliability-registration.d.ts +1 -1
- package/src/generators/workload/reliability-registration.js +9 -9
- package/src/generators/workload/workload.d.ts +1 -1
- package/src/generators/workload/workload.js +87 -13
- package/src/git-policy/github-bootstrap.d.ts +24 -5
- package/src/git-policy/github-bootstrap.js +105 -10
- package/src/local-dev/fleet-process.d.ts +9 -2
- package/src/local-dev/fleet-process.js +27 -7
- package/src/local-dev/fleet-session.js +41 -4
- package/src/local-dev/fleet-supervisor-daemon.js +1 -5
- package/src/local-dev/fleet-supervisor.d.ts +1 -0
- package/src/local-dev/fleet-supervisor.js +34 -11
- package/src/local-dev/gateway-daemon.d.ts +1 -1
- package/src/local-dev/gateway-daemon.js +6 -4
- package/src/local-dev/portless.d.ts +5 -0
- package/src/local-dev/portless.js +5 -0
- package/src/local-dev/process-group.d.ts +10 -0
- package/src/local-dev/process-group.js +33 -0
- package/src/local-dev/tls.js +31 -2
- package/src/local-dev/trust-store.d.ts +42 -0
- package/src/local-dev/trust-store.js +87 -0
- package/src/ownership/composition.d.ts +7 -0
- package/src/ownership/composition.js +64 -56
- package/src/ownership/index.d.ts +1 -0
- package/src/ownership/index.js +1 -0
- package/src/ownership/record.d.ts +19 -0
- package/src/ownership/record.js +26 -2
- package/src/ownership/site-record.d.ts +18 -0
- package/src/ownership/site-record.js +105 -0
- package/src/repository-policy/deployment-plan.d.ts +3 -0
- package/src/repository-policy/deployment-plan.js +33 -4
- package/src/repository-policy/index.d.ts +1 -0
- package/src/repository-policy/index.js +1 -0
- package/src/repository-policy/policy.d.ts +13 -1
- package/src/repository-policy/policy.js +55 -1
- package/src/repository-policy/public-dns.d.ts +65 -0
- package/src/repository-policy/public-dns.js +168 -0
- package/src/schemas/generated-ownership-v2.json +6 -0
- package/src/schemas/repository-policy-v1.json +67 -1
- package/src/supply-chain/blueprint-trust-git.js +24 -0
- package/src/supply-chain/blueprint-verification-authority.js +42 -3
- package/src/supply-chain/generated-blueprint-trust-command.js +15 -0
- package/src/supply-chain/sbom.js +74 -12
- package/src/work-markers/work-markers.js +4 -1
- package/src/workspace-deployment/ownership.d.ts +15 -0
- package/src/workspace-deployment/ownership.js +19 -3
|
@@ -4,6 +4,7 @@ exports.EBK_RECORD_MAIN_TOKEN_SECRET = exports.THIN_DEPLOY_WORKFLOW_PATH = void
|
|
|
4
4
|
exports.renderThinDeployVerifyCaller = renderThinDeployVerifyCaller;
|
|
5
5
|
exports.protectedBrowserInstallScript = protectedBrowserInstallScript;
|
|
6
6
|
exports.machineCredentialRequestScript = machineCredentialRequestScript;
|
|
7
|
+
exports.databaseCredentialRequestScript = databaseCredentialRequestScript;
|
|
7
8
|
exports.exactStageDeployerGuardScript = exactStageDeployerGuardScript;
|
|
8
9
|
exports.canonicalStageAuthorityDerivationScript = canonicalStageAuthorityDerivationScript;
|
|
9
10
|
exports.exactStagingPromotionPullGuardScript = exactStagingPromotionPullGuardScript;
|
|
@@ -120,9 +121,14 @@ function indentedScript(source, spaces) {
|
|
|
120
121
|
/** @internal Run exactly this generated script in the protected-runner fixture. */
|
|
121
122
|
function protectedBrowserInstallScript() {
|
|
122
123
|
return `set -euo pipefail
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
inventory="$EBK_SLICE_PROJECTS"
|
|
125
|
+
if [ -n "\${EBK_SITE_PROJECT:-}" ]; then
|
|
126
|
+
[ "$EBK_SITE_PROJECT" = site ] || { echo 'Invalid root site project'; exit 1; }
|
|
127
|
+
inventory="\${inventory:+$inventory,}$EBK_SITE_PROJECT"
|
|
128
|
+
fi
|
|
129
|
+
if [ -z "$inventory" ]; then exit 0; fi
|
|
130
|
+
case "$inventory" in ,*|*,|*,,*) echo 'Invalid smoke project inventory'; exit 1 ;; esac
|
|
131
|
+
IFS=',' read -r -a projects <<< "$inventory"
|
|
126
132
|
seen=,
|
|
127
133
|
for project in "\${projects[@]}"; do
|
|
128
134
|
case "$project" in ''|*[!A-Za-z0-9_-]*) echo 'Invalid smoke project'; exit 1 ;; esac
|
|
@@ -184,6 +190,38 @@ function machineCredentialRequestStep() {
|
|
|
184
190
|
run: |
|
|
185
191
|
${indentedScript(machineCredentialRequestScript(), 10)}`;
|
|
186
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* @internal Run exactly this generated script in the protected-runner fixture.
|
|
195
|
+
*
|
|
196
|
+
* Reads the deploying stage's optional database credential generation through
|
|
197
|
+
* a request name and exports the canonical variable only when it is set. An
|
|
198
|
+
* unset GitHub variable expands to '', which must not reach the Slice SST
|
|
199
|
+
* config, so the default bootstrap generation is kept when the request is
|
|
200
|
+
* empty. Every SQL Slice the deployment reaches rotates its generated
|
|
201
|
+
* database credential once when the requested generation is new.
|
|
202
|
+
*/
|
|
203
|
+
function databaseCredentialRequestScript() {
|
|
204
|
+
return `set -euo pipefail
|
|
205
|
+
generation="$EBK_REQUESTED_DATABASE_CREDENTIAL_GENERATION"
|
|
206
|
+
generation_pattern='^[a-z0-9][a-z0-9-]{0,62}$'
|
|
207
|
+
if [ -n "$generation" ] && ! [[ "$generation" =~ $generation_pattern ]]; then
|
|
208
|
+
echo 'EBK_DATABASE_CREDENTIAL_GENERATION must be 1 to 63 lowercase letters, digits, or hyphens that start with a letter or digit, or unset'
|
|
209
|
+
exit 1
|
|
210
|
+
fi
|
|
211
|
+
if [ -n "$generation" ]; then
|
|
212
|
+
echo "EBK_DATABASE_CREDENTIAL_GENERATION=$generation" >> "$GITHUB_ENV"
|
|
213
|
+
echo "Requested database credential generation: $generation"
|
|
214
|
+
fi`;
|
|
215
|
+
}
|
|
216
|
+
function databaseCredentialRequestStep() {
|
|
217
|
+
return ` - name: Validate requested database credential generation
|
|
218
|
+
env:
|
|
219
|
+
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
|
|
220
|
+
ACTIONS_ID_TOKEN_REQUEST_URL: ''
|
|
221
|
+
EBK_REQUESTED_DATABASE_CREDENTIAL_GENERATION: \${{ vars.EBK_DATABASE_CREDENTIAL_GENERATION }}
|
|
222
|
+
run: |
|
|
223
|
+
${indentedScript(databaseCredentialRequestScript(), 10)}`;
|
|
224
|
+
}
|
|
187
225
|
/** @internal Exported for executable source-contract tests. */
|
|
188
226
|
function exactStageDeployerGuardScript(operation, accountVariable) {
|
|
189
227
|
return `read -r caller_account caller_arn <<< "$(aws sts get-caller-identity --query '[Account,Arn]' --output text)"
|
|
@@ -604,6 +642,7 @@ jobs:
|
|
|
604
642
|
profile: \${{ steps.policy.outputs.deployment_profile }}
|
|
605
643
|
project: \${{ steps.route.outputs.project }}
|
|
606
644
|
region: \${{ steps.policy.outputs.deployment_region }}
|
|
645
|
+
site_project: \${{ steps.policy.outputs.site_project }}
|
|
607
646
|
slice_projects: \${{ steps.policy.outputs.slice_projects }}
|
|
608
647
|
slice_matrix: \${{ steps.policy.outputs.slice_matrix }}
|
|
609
648
|
staging_account_id: \${{ steps.policy.outputs.staging_account_id }}
|
|
@@ -759,7 +798,11 @@ ${indentedScript(`set -euo pipefail\n${canonicalStageAuthorityDerivationScript()
|
|
|
759
798
|
# production authority is derived here beside the staging authority.
|
|
760
799
|
- id: production-account
|
|
761
800
|
name: Derive canonical committed production authority for trunk promotion
|
|
762
|
-
if:
|
|
801
|
+
if: >-
|
|
802
|
+
steps.route.outputs.action == 'deploy' &&
|
|
803
|
+
steps.route.outputs.stage == 'staging' &&
|
|
804
|
+
steps.policy.outputs.deployment_profile != 'starter' &&
|
|
805
|
+
steps.policy.outputs.has_slices == 'true'
|
|
763
806
|
env:
|
|
764
807
|
EBK_DEVELOPMENT_ACCOUNT: \${{ steps.policy.outputs.development_account_id }}
|
|
765
808
|
EBK_PRODUCTION_ACCOUNT: \${{ steps.policy.outputs.production_account_id }}
|
|
@@ -1541,6 +1584,7 @@ ${indentedScript(exactStageDeployerGuardScript('Container promotion', '$AWS_EXPE
|
|
|
1541
1584
|
EBK_POLICY_ACCOUNT_ID: \${{ needs.prepare.outputs.account_id }}
|
|
1542
1585
|
EBK_POLICY_REGION: \${{ needs.prepare.outputs.region }}
|
|
1543
1586
|
EBK_RELEASE_SOURCE_COMMIT: \${{ needs.immutable-artifacts.outputs.source_commit || inputs.source_commit || github.sha }}
|
|
1587
|
+
EBK_SITE_PROJECT: \${{ needs.prepare.outputs.site_project }}
|
|
1544
1588
|
EBK_SLICE_PROJECTS: \${{ needs.prepare.outputs.slice_projects }}
|
|
1545
1589
|
EBK_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
|
|
1546
1590
|
EBK_STAGE: \${{ needs.prepare.outputs.stage }}
|
|
@@ -1697,13 +1741,14 @@ ${indentedScript(restoredCandidateValidationScript(), 10)}
|
|
|
1697
1741
|
ACTIONS_ID_TOKEN_REQUEST_URL: ''
|
|
1698
1742
|
run: pnpm nx run ${name}:supply-chain-check-protected
|
|
1699
1743
|
- name: Install pinned Playwright Chromium for deployed smoke proofs
|
|
1700
|
-
if: env.EBK_ACTION == 'deploy' && needs.prepare.outputs.has_slices == 'true'
|
|
1744
|
+
if: env.EBK_ACTION == 'deploy' && (needs.prepare.outputs.has_slices == 'true' || needs.prepare.outputs.site_project != '')
|
|
1701
1745
|
env:
|
|
1702
1746
|
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
|
|
1703
1747
|
ACTIONS_ID_TOKEN_REQUEST_URL: ''
|
|
1704
1748
|
run: |
|
|
1705
1749
|
${indentedScript(protectedBrowserInstallScript(), 10)}
|
|
1706
1750
|
${machineCredentialRequestStep()}
|
|
1751
|
+
${databaseCredentialRequestStep()}
|
|
1707
1752
|
- name: Revalidate exact protected branch tip before OIDC
|
|
1708
1753
|
env:
|
|
1709
1754
|
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
|
|
@@ -2301,6 +2346,7 @@ ${trunkPromotionGate}
|
|
|
2301
2346
|
EBK_POLICY_ACCOUNT_ID: \${{ needs.prepare.outputs.production_account_id }}
|
|
2302
2347
|
EBK_POLICY_REGION: \${{ needs.prepare.outputs.region }}
|
|
2303
2348
|
EBK_RELEASE_SOURCE_COMMIT: \${{ needs.immutable-artifacts.outputs.source_commit || inputs.source_commit || github.sha }}
|
|
2349
|
+
EBK_SITE_PROJECT: \${{ needs.prepare.outputs.site_project }}
|
|
2304
2350
|
EBK_SLICE_PROJECTS: \${{ needs.prepare.outputs.slice_projects }}
|
|
2305
2351
|
EBK_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
|
|
2306
2352
|
EBK_STAGE: production
|
|
@@ -2391,6 +2437,7 @@ ${indentedScript(restoredCandidateValidationScript(), 10)}
|
|
|
2391
2437
|
run: |
|
|
2392
2438
|
${indentedScript(protectedBrowserInstallScript(), 10)}
|
|
2393
2439
|
${machineCredentialRequestStep()}
|
|
2440
|
+
${databaseCredentialRequestStep()}
|
|
2394
2441
|
${revalidateTip}
|
|
2395
2442
|
- name: Assume the one stage deployment role
|
|
2396
2443
|
uses: ${actionPins.configureAwsCredentials}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.renderThinLifecycleDocumentation = renderThinLifecycleDocumentation;
|
|
4
4
|
const workspace_files_agent_development_js_1 = require("./workspace-files-agent-development.js");
|
|
5
5
|
const index_js_1 = require("../../repository-policy/index.js");
|
|
6
|
+
const policy_js_1 = require("../../supply-chain/policy.js");
|
|
6
7
|
function renderThinLifecycleDocumentation(options) {
|
|
7
8
|
const stages = (0, index_js_1.activeDeploymentStages)(options.deploymentProfile);
|
|
8
9
|
const stageList = stages.join(', ');
|
|
@@ -168,10 +169,12 @@ than the operator's Identity Center profile chain.
|
|
|
168
169
|
|
|
169
170
|
Governed AWS infrastructure planning and mutation are supported on macOS,
|
|
170
171
|
Linux, and WSL2. Native Windows can run local verification, but native-Windows
|
|
171
|
-
task Fleet (\`ebk dev\`) is not validated in this
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
task Fleet (\`ebk dev\`) is not validated in this release; Windows coverage of
|
|
173
|
+
the local browser and certificate-trust path is limited to the framework's
|
|
174
|
+
hosted Windows browser/trust fixture. Use WSL2 or a macOS/Linux host for Fleet
|
|
175
|
+
development and for \`deploy-local\`, \`infrastructure-plan\`, \`refresh\`,
|
|
176
|
+
\`remove\`, and \`unlock\`. Generated protected GitHub AWS jobs continue to
|
|
177
|
+
run on Ubuntu.
|
|
175
178
|
|
|
176
179
|
Development may deploy a dirty working tree without a prompt. Its receipt binds
|
|
177
180
|
the exact HEAD and working-tree digest. Local staging requires a clean commit
|
|
@@ -186,6 +189,21 @@ starter workflow is optional; isolated profiles require GitHub for the stages
|
|
|
186
189
|
declared by their profile. Direct user SST invocation is outside the supported
|
|
187
190
|
paved road.
|
|
188
191
|
|
|
192
|
+
Review the protected supply-chain findings before the first deployment through
|
|
193
|
+
the generated GitHub \`Deploy\` workflow. That workflow runs the protected
|
|
194
|
+
supply-chain check before every deployment it performs, including development
|
|
195
|
+
in the \`starter\` profile. Without a recorded exception, the check refuses any
|
|
196
|
+
license that the seeded \`supply-chain/license-policy.json\` does not allow,
|
|
197
|
+
including \`LicenseRef-Unknown\`, which it lists for review. A reviewed fresh
|
|
198
|
+
workspace lockfile on 2026-10-27 had two such findings through Pulumi:
|
|
199
|
+
\`spdx-exceptions@2.5.0\` with CC-BY-3.0, and \`@logdna/tail-file@2.2.0\` with
|
|
200
|
+
\`LicenseRef-Unknown\`. These are dated observations, not a promise about this
|
|
201
|
+
workspace's resolution. Inspect the current findings and record an exact,
|
|
202
|
+
approved, expiring exception for each in \`supply-chain/exceptions.json\`, or
|
|
203
|
+
make a deliberate license-policy decision as described in the seeded
|
|
204
|
+
\`supply-chain/README.md\`. An exception lasts at most
|
|
205
|
+
${policy_js_1.SUPPLY_CHAIN_EXCEPTION_MAX_DAYS} days and requires review before it expires.
|
|
206
|
+
|
|
189
207
|
## AWS authority
|
|
190
208
|
|
|
191
209
|
Each active stage has one stable deployment role and one runtime permission
|
|
@@ -193,6 +211,16 @@ boundary. SST/Pulumi creates workload roles inside the application stack; a
|
|
|
193
211
|
Pulumi transform applies the exact stage path and boundary. Authority is not
|
|
194
212
|
candidate-bound. See \`stage-deployment-authority.md\`.
|
|
195
213
|
|
|
214
|
+
Every SST Service or Task that passes no \`executionRole\`, including the
|
|
215
|
+
generated Services, Jobs, and SQL Tasks, uses the ECS task execution role that
|
|
216
|
+
SST creates by default. Its inline \`ReadSsmAndSecrets\` statement allows
|
|
217
|
+
Secrets Manager secret-value and SSM parameter reads on all resources, which
|
|
218
|
+
the stage runtime permission boundary limits to the stage account and Region.
|
|
219
|
+
Generated workloads do not use ECS secret injection; they read secrets through
|
|
220
|
+
their task roles. Only a principal that can register an ECS task definition and pass
|
|
221
|
+
that role, the deployment role's class of authority, can exercise these
|
|
222
|
+
permissions. Narrowing this policy is planned for 1.0.1.
|
|
223
|
+
|
|
196
224
|
The deployment role is a temporary bounded infrastructure administrator. IAM
|
|
197
225
|
cannot inspect the initial trust document on \`CreateRole\`; reviewed generated
|
|
198
226
|
source is therefore the create-time trust control, while later trust-policy
|
|
@@ -200,7 +228,7 @@ mutation remains denied. EBK does not claim a postdeployment trust attestor. In
|
|
|
200
228
|
commercial AWS, CloudFront, CloudFront-scope WAF, edge WAF log delivery, and
|
|
201
229
|
edge ACM use the us-east-1 control plane. CloudWatch Logs cannot scope the
|
|
202
230
|
generated WAF \`PutResourcePolicy\` payload through IAM; reviewed generated
|
|
203
|
-
source and the edge Region are its controls. This
|
|
231
|
+
source and the edge Region are its controls. This release does not claim Router edge support in noncommercial
|
|
204
232
|
partitions: CloudFront is unavailable in GovCloud, and the China-partition edge
|
|
205
233
|
control plane is not yet proven.
|
|
206
234
|
|
|
@@ -7659,6 +7659,7 @@ console.log('Installed the repository-local EBK pre-push hook at ' + hookPath +
|
|
|
7659
7659
|
.open-next
|
|
7660
7660
|
dist
|
|
7661
7661
|
*.tsbuildinfo
|
|
7662
|
+
**/next-env.d.ts
|
|
7662
7663
|
node_modules
|
|
7663
7664
|
.sst
|
|
7664
7665
|
**/playwright/.auth
|
|
@@ -7715,6 +7716,10 @@ At a local milestone, \`pnpm verify\` checks current source through
|
|
|
7715
7716
|
protected Blueprint acceptance. The separate \`${name}:verify\` target and
|
|
7716
7717
|
protected GitHub workflows retain their committed-history and trust gates.
|
|
7717
7718
|
|
|
7719
|
+
An optional root site at \`packages/site\` serves the Router's \`/\` beside the Product
|
|
7720
|
+
Slices; it is not a Slice, and every Slice path takes precedence over it. Verify a change to
|
|
7721
|
+
it with \`pnpm nx run site:verify\`.
|
|
7722
|
+
|
|
7718
7723
|
Human-supplied secret values are entered only by a human. The Developer-Agent workflow
|
|
7719
7724
|
below describes the hand-off for \`ebk secret set\` and \`ebk secret remove\` and the
|
|
7720
7725
|
value-blind paths agents and CI use.
|
|
@@ -7790,6 +7795,11 @@ The Standard Foundation lives at \`packages/foundation\`. Product slices live be
|
|
|
7790
7795
|
\`packages/<slice-name>\` and consume versioned Foundation contracts instead of importing
|
|
7791
7796
|
Foundation implementation files.
|
|
7792
7797
|
|
|
7798
|
+
An optional root site lives at \`packages/site\` (\`pnpm nx g @empire-builder-kit/nx:site\`).
|
|
7799
|
+
The Foundation Router serves it at \`/\`, beside each Slice at \`/<slice-name>\`, and every
|
|
7800
|
+
Slice path takes precedence over it. It deploys after the Foundation and before the Slices,
|
|
7801
|
+
and is removed after the Slices and before the Foundation. \`site\` is reserved for it.
|
|
7802
|
+
|
|
7793
7803
|
This workspace's \`${deploymentProfile}\` profile activates only:
|
|
7794
7804
|
${activeStages.join(', ')}. Each active canonical consumer stage uses the matching Foundation.
|
|
7795
7805
|
Inactive canonical stages are rejected. Framework-derived personal stages may use only the
|
|
@@ -7859,7 +7869,7 @@ custom work and remove the marker; do not merely delete it while leaving the req
|
|
|
7859
7869
|
unresolved. Open \`TODO\`, \`ASSUMPTION\`, and \`QUESTION\` markers are reported but do not block
|
|
7860
7870
|
deployment by themselves. Open \`SECURITY\` and \`BLOCKER\` markers fail staging and production
|
|
7861
7871
|
deploy or refresh before AWS access. Protected remove and unlock remain usable for recovery.
|
|
7862
|
-
There is no local or silent bypass in this
|
|
7872
|
+
There is no local or silent bypass in this contract; any future waiver mechanism
|
|
7863
7873
|
must be committed, reviewable, and auditable.
|
|
7864
7874
|
|
|
7865
7875
|
## Shared-operation claims
|
|
@@ -8243,11 +8253,38 @@ ${(0, cost_estimate_js_1.renderFoundationCostEstimate)({ deploymentProfile, head
|
|
|
8243
8253
|
tasks. The exact cluster resource ID is non-secret Foundation discovery.
|
|
8244
8254
|
- Relational Product Slices receive scoped logical-database credentials through the provisioning contract.
|
|
8245
8255
|
- DynamoDB tables and their access are Slice/task scoped; no shared Foundation application table exists.
|
|
8256
|
+
- Slice web clients have no OAuth grants: no OAuth flows, scopes or callback URLs. Web sign-in
|
|
8257
|
+
is server-side Cognito password auth, so the Cognito domain completes no hosted sign-in or
|
|
8258
|
+
authorization-code flow for a web client.
|
|
8259
|
+
- The Foundation user pool admits only administrator-created users: Cognito refuses
|
|
8260
|
+
\`SignUp\`, and a user exists only after \`AdminCreateUser\`. EBK generates no sign-up page.
|
|
8246
8261
|
- Cognito owns authentication; product slices own authorization policy and app clients.
|
|
8262
|
+
- A bound stage serves the Cognito identity domain, and with it the machine clients' token
|
|
8263
|
+
endpoint, on \`auth.<rootDomain>\`, with its own DNS-validated certificate; an unbound stage
|
|
8264
|
+
keeps the Cognito prefix domain. Cognito's own CloudFront distribution serves
|
|
8265
|
+
\`auth.<rootDomain>\`, outside the Router's Web ACL and its allowlist, as it serves the prefix
|
|
8266
|
+
domain: the token endpoint is public by AWS's design. The token issuer and its signing keys
|
|
8267
|
+
stay on \`cognito-idp.<region>.amazonaws.com\`, an AWS identifier no custom domain replaces.
|
|
8247
8268
|
- Lambda and server-side web workloads use resource linking. Containers use the documented
|
|
8248
8269
|
stage-scoped SSM/secret path and least-privilege IAM.
|
|
8249
|
-
- Public domains are configured
|
|
8250
|
-
|
|
8270
|
+
- Public domains are configured by the committed \`publicDns.<stage>\` binding in
|
|
8271
|
+
\`ebk.repository-policy.json\`: a bound stage's Router serves its \`rootDomain\` whether the
|
|
8272
|
+
stage is deployed locally or by the generated Deploy workflow, and Foundation passes SST the
|
|
8273
|
+
exact bound hosted-zone ID. Without a binding the Router keeps its CloudFront URL.
|
|
8274
|
+
\`EBK_ROOT_DOMAIN\` is optional; if set, it must equal the binding's \`rootDomain\`, and
|
|
8275
|
+
Foundation refuses before constructing resources otherwise. Generated source never contains
|
|
8276
|
+
credentials or customer domain assumptions.
|
|
8277
|
+
- A bound stage serves its Slice APIs on \`api.<rootDomain>\`, a Regional API Gateway domain
|
|
8278
|
+
that Foundation owns with its own DNS-validated certificate. Each Slice maps its API under
|
|
8279
|
+
\`/<slice>\` and disables its default \`execute-api\` endpoint. AWS WAF cannot protect HTTP
|
|
8280
|
+
APIs, so the Slice APIs are outside the Router's Web ACL and its allowlist, as they are on
|
|
8281
|
+
the \`execute-api\` host; their own authentication, authorization and API Gateway
|
|
8282
|
+
throttling protect them.
|
|
8283
|
+
- Generated Functions require a Cognito access token at API Gateway: a request without a valid
|
|
8284
|
+
token for the Slice's web or machine clients gets 401 before the Lambda runs, and browser
|
|
8285
|
+
pages call a Function through the Slice's Next.js server. A Function generated or switched
|
|
8286
|
+
as anonymous is a public route, with no authentication on the Router path or the Slice API
|
|
8287
|
+
path.
|
|
8251
8288
|
- Every stage's CloudFront Router has its own global Web ACL. The baseline always includes AWS
|
|
8252
8289
|
Common Rule Set, Known Bad Inputs, Amazon IP Reputation, rate blocking, CloudWatch metrics,
|
|
8253
8290
|
and sampled requests. Nonproduction is allowlisted by default. Production is public by
|
|
@@ -8289,7 +8326,9 @@ import {
|
|
|
8289
8326
|
createRouterWafStagePlan,
|
|
8290
8327
|
${foundationPlan.resources.postgres ? ' foundationDatabaseEndpointHost,' : ''}
|
|
8291
8328
|
foundationSsmPath,
|
|
8329
|
+
identityDomainParentReady,
|
|
8292
8330
|
normalizeRouterWafPolicy,
|
|
8331
|
+
observeRootAliasRecords,
|
|
8293
8332
|
reconcileRouterWafBlockingRehearsal,
|
|
8294
8333
|
resolveObservabilityPolicy,
|
|
8295
8334
|
routerWafContractDigest,
|
|
@@ -8304,7 +8343,9 @@ import { createStageAuthorityIdentity } from '@empire-builder-kit/nx/aws-authori
|
|
|
8304
8343
|
import {
|
|
8305
8344
|
configuredDeploymentAccountForStage,
|
|
8306
8345
|
configuredDeploymentRegion,
|
|
8346
|
+
parseRepositoryOperatingPolicy,
|
|
8307
8347
|
productionRehearsalStage,
|
|
8348
|
+
resolveFoundationPublicDomain,
|
|
8308
8349
|
} from '@empire-builder-kit/nx/repository-policy';
|
|
8309
8350
|
import { createFoundationAccountCostControlPlan } from '@empire-builder-kit/nx/performance';
|
|
8310
8351
|
import accountCostPolicy from '../performance/account-cost-policy.json';
|
|
@@ -8354,7 +8395,26 @@ export function foundation() {
|
|
|
8354
8395
|
productionProfile: process.env.EBK_PRODUCTION_FOUNDATION_PROFILE,
|
|
8355
8396
|
});
|
|
8356
8397
|
${foundationPlan.resources.postgres ? " const isStaging = $app.stage === 'staging';" : ''}
|
|
8357
|
-
|
|
8398
|
+
// The committed publicDns.<stage> binding is the only domain switch, so a
|
|
8399
|
+
// stage deployed by the generated Deploy workflow serves the same domain
|
|
8400
|
+
// as a local deploy. The stage authority grants record writes only in that
|
|
8401
|
+
// zone; EBK_ROOT_DOMAIN, if set, must equal the binding's rootDomain. This
|
|
8402
|
+
// refuses before any resource is constructed.
|
|
8403
|
+
const routerDomain = resolveFoundationPublicDomain({
|
|
8404
|
+
configuredRootDomain: process.env.EBK_ROOT_DOMAIN,
|
|
8405
|
+
policy: parseRepositoryOperatingPolicy(JSON.stringify(repositoryPolicy)),
|
|
8406
|
+
stage: $dev ? 'development' : $app.stage,
|
|
8407
|
+
});
|
|
8408
|
+
const rootDomain =
|
|
8409
|
+
routerDomain.kind === 'custom-domain' ? routerDomain.rootDomain : undefined;
|
|
8410
|
+
// Area 2: the binding also names the identity domain, auth.<root>.
|
|
8411
|
+
// Cognito limits a custom domain to 63 characters; refuse before any
|
|
8412
|
+
// resource is constructed.
|
|
8413
|
+
if (rootDomain && ('auth.' + rootDomain).length > 63) {
|
|
8414
|
+
throw new Error(
|
|
8415
|
+
'Foundation identity domain auth.<root> exceeds the 63-character Cognito domain limit; bind a shorter root domain.',
|
|
8416
|
+
);
|
|
8417
|
+
}
|
|
8358
8418
|
const productionConfiguration = isProduction
|
|
8359
8419
|
? productionFoundationProfileContract(
|
|
8360
8420
|
process.env.EBK_PRODUCTION_FOUNDATION_PROFILE,
|
|
@@ -8365,36 +8425,38 @@ ${foundationPlan.resources.network ? " const natMode = productionConfiguration?
|
|
|
8365
8425
|
if (repositoryPolicy.deploymentProfile !== normalizedRouterWafPolicy.deploymentProfile) {
|
|
8366
8426
|
throw new Error('Router WAF policy profile differs from committed repository policy.');
|
|
8367
8427
|
}
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
normalizedRouterWafPolicy.deploymentProfile
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8428
|
+
let rehearsal: ReturnType<typeof reconcileRouterWafBlockingRehearsal> = null;
|
|
8429
|
+
if (isProduction) {
|
|
8430
|
+
const rehearsalStage = productionRehearsalStage(normalizedRouterWafPolicy.deploymentProfile);
|
|
8431
|
+
const rehearsalAccount = configuredDeploymentAccountForStage(
|
|
8432
|
+
normalizedRouterWafPolicy.deploymentProfile,
|
|
8433
|
+
repositoryPolicy.deploymentAccounts,
|
|
8434
|
+
rehearsalStage,
|
|
8435
|
+
);
|
|
8436
|
+
const rehearsalRegion = configuredDeploymentRegion(repositoryPolicy.deploymentRegion);
|
|
8437
|
+
const rehearsalRoleArn = createStageAuthorityIdentity({
|
|
8438
|
+
accountId: rehearsalAccount,
|
|
8439
|
+
partition: rehearsalRegion.startsWith('us-gov-') ? 'aws-us-gov' : 'aws',
|
|
8440
|
+
region: rehearsalRegion,
|
|
8441
|
+
stage: rehearsalStage,
|
|
8442
|
+
}).deploymentRoleArn;
|
|
8443
|
+
rehearsal = reconcileRouterWafBlockingRehearsal({
|
|
8444
|
+
evidence: routerWafLiveEvidence,
|
|
8445
|
+
expected: {
|
|
8446
|
+
accountId: rehearsalAccount,
|
|
8447
|
+
deploymentRoleArn: rehearsalRoleArn,
|
|
8448
|
+
region: rehearsalRegion,
|
|
8449
|
+
stage: rehearsalStage,
|
|
8450
|
+
wafContractDigest: routerWafContractDigest(normalizedRouterWafPolicy),
|
|
8451
|
+
workspace: '${name}',
|
|
8452
|
+
},
|
|
8453
|
+
policy: normalizedRouterWafPolicy,
|
|
8454
|
+
receipt: routerWafBlockingRehearsal,
|
|
8455
|
+
});
|
|
8456
|
+
}
|
|
8381
8457
|
const wafPlan = createRouterWafStagePlan({
|
|
8382
8458
|
policy: normalizedRouterWafPolicy,
|
|
8383
|
-
rehearsal
|
|
8384
|
-
? reconcileRouterWafBlockingRehearsal({
|
|
8385
|
-
evidence: routerWafLiveEvidence,
|
|
8386
|
-
expected: {
|
|
8387
|
-
accountId: rehearsalAccount,
|
|
8388
|
-
deploymentRoleArn: rehearsalRoleArn,
|
|
8389
|
-
region: rehearsalRegion,
|
|
8390
|
-
stage: rehearsalStage,
|
|
8391
|
-
wafContractDigest: routerWafContractDigest(normalizedRouterWafPolicy),
|
|
8392
|
-
workspace: '${name}',
|
|
8393
|
-
},
|
|
8394
|
-
policy: normalizedRouterWafPolicy,
|
|
8395
|
-
receipt: routerWafBlockingRehearsal,
|
|
8396
|
-
})
|
|
8397
|
-
: null,
|
|
8459
|
+
rehearsal,
|
|
8398
8460
|
stage: $app.stage,
|
|
8399
8461
|
});
|
|
8400
8462
|
const deploymentAccount = process.env.AWS_EXPECTED_ACCOUNT_ID?.trim() ?? '';
|
|
@@ -8423,13 +8485,24 @@ ${foundationPlan.resources.network
|
|
|
8423
8485
|
});`
|
|
8424
8486
|
: ''}
|
|
8425
8487
|
${foundationPlan.resources.containerCompute ? " const cluster = new sst.aws.Cluster('FoundationCluster', { vpc });" : ''}
|
|
8488
|
+
// Area 2: Cognito refuses a custom domain whose parent has no A record,
|
|
8489
|
+
// and SST writes the Router's root and wildcard alias records only after its
|
|
8490
|
+
// distribution exists. The identity domain waits on exactly those records,
|
|
8491
|
+
// observed through the Router's own DNS adapter.
|
|
8492
|
+
const routerRootAlias =
|
|
8493
|
+
routerDomain.kind === 'custom-domain'
|
|
8494
|
+
? observeRootAliasRecords(
|
|
8495
|
+
sst.aws.dns({ zone: routerDomain.hostedZoneId }),
|
|
8496
|
+
routerDomain.rootDomain,
|
|
8497
|
+
)
|
|
8498
|
+
: undefined;
|
|
8426
8499
|
const router = new sst.aws.Router('FoundationRouter', {
|
|
8427
|
-
...(
|
|
8500
|
+
...(routerDomain.kind === 'custom-domain'
|
|
8428
8501
|
? {
|
|
8429
8502
|
domain: {
|
|
8430
|
-
name: rootDomain,
|
|
8431
|
-
aliases: ['*.' + rootDomain],
|
|
8432
|
-
dns:
|
|
8503
|
+
name: routerDomain.rootDomain,
|
|
8504
|
+
aliases: ['*.' + routerDomain.rootDomain],
|
|
8505
|
+
dns: routerRootAlias!.dns,
|
|
8433
8506
|
},
|
|
8434
8507
|
}
|
|
8435
8508
|
: {}),
|
|
@@ -8561,6 +8634,63 @@ ${foundationPlan.resources.containerCompute ? " const cluster = new sst.aws.Clu
|
|
|
8561
8634
|
},
|
|
8562
8635
|
},
|
|
8563
8636
|
});
|
|
8637
|
+
if (routerDomain.kind === 'custom-domain') {
|
|
8638
|
+
// A bound stage serves every Slice API on one Regional API
|
|
8639
|
+
// Gateway domain, api.<root>, with its own certificate in the stage Region.
|
|
8640
|
+
// Each Slice reads it by name and maps its API under /<slice>; the
|
|
8641
|
+
// Foundation owns the domain, its certificate and its records. These are
|
|
8642
|
+
// SST's own ApiGatewayV2 domain settings, and the certificate takes the
|
|
8643
|
+
// steps of SST's DnsValidatedCertificate: one DNS-validated ACM
|
|
8644
|
+
// certificate and its validation record in the bound zone.
|
|
8645
|
+
const dns = sst.aws.dns({ zone: routerDomain.hostedZoneId });
|
|
8646
|
+
const apiDomainName = 'api.' + routerDomain.rootDomain;
|
|
8647
|
+
const apiCertificate = new aws.acm.Certificate(
|
|
8648
|
+
'FoundationApiDomainSslCertificate',
|
|
8649
|
+
{ domainName: apiDomainName, validationMethod: 'DNS' },
|
|
8650
|
+
);
|
|
8651
|
+
const apiCertificateRecords = apiCertificate.domainValidationOptions.apply(
|
|
8652
|
+
(
|
|
8653
|
+
options: {
|
|
8654
|
+
resourceRecordName: string;
|
|
8655
|
+
resourceRecordType: string;
|
|
8656
|
+
resourceRecordValue: string;
|
|
8657
|
+
}[],
|
|
8658
|
+
) =>
|
|
8659
|
+
options.map((option) =>
|
|
8660
|
+
dns.createRecord(
|
|
8661
|
+
'FoundationApiDomainSsl',
|
|
8662
|
+
{
|
|
8663
|
+
name: option.resourceRecordName,
|
|
8664
|
+
type: option.resourceRecordType,
|
|
8665
|
+
value: option.resourceRecordValue,
|
|
8666
|
+
},
|
|
8667
|
+
{},
|
|
8668
|
+
),
|
|
8669
|
+
),
|
|
8670
|
+
);
|
|
8671
|
+
const apiCertificateValidation = new aws.acm.CertificateValidation(
|
|
8672
|
+
'FoundationApiDomainSslValidation',
|
|
8673
|
+
{ certificateArn: apiCertificate.arn },
|
|
8674
|
+
{ dependsOn: apiCertificateRecords },
|
|
8675
|
+
);
|
|
8676
|
+
const apiDomain = new aws.apigatewayv2.DomainName('FoundationApiDomain', {
|
|
8677
|
+
domainName: apiDomainName,
|
|
8678
|
+
domainNameConfiguration: {
|
|
8679
|
+
certificateArn: apiCertificateValidation.certificateArn,
|
|
8680
|
+
endpointType: 'REGIONAL',
|
|
8681
|
+
securityPolicy: 'TLS_1_2',
|
|
8682
|
+
},
|
|
8683
|
+
});
|
|
8684
|
+
dns.createAlias(
|
|
8685
|
+
'FoundationApiDomain',
|
|
8686
|
+
{
|
|
8687
|
+
aliasName: apiDomain.domainNameConfiguration.targetDomainName,
|
|
8688
|
+
aliasZone: apiDomain.domainNameConfiguration.hostedZoneId,
|
|
8689
|
+
name: apiDomainName,
|
|
8690
|
+
},
|
|
8691
|
+
{},
|
|
8692
|
+
);
|
|
8693
|
+
}
|
|
8564
8694
|
${foundationPlan.resources.postgres
|
|
8565
8695
|
? ` const database = new sst.aws.Aurora('FoundationDatabase', {
|
|
8566
8696
|
// SQL bootstrap and migrations run inside the VPC. Keep the public HTTPS
|
|
@@ -8628,15 +8758,59 @@ ${foundationPlan.resources.postgres
|
|
|
8628
8758
|
const foundationAccountId = aws.getCallerIdentityOutput({}).accountId;
|
|
8629
8759
|
const foundationPartition = aws.getPartitionOutput({});
|
|
8630
8760
|
const foundationRegion = aws.getRegionOutput({});
|
|
8761
|
+
// Users are created only by an administrator (AdminCreateUser): the pool
|
|
8762
|
+
// refuses Cognito SignUp. SST hands this transform the pool's provider
|
|
8763
|
+
// arguments with its own defaults already merged in; it replaces only
|
|
8764
|
+
// adminCreateUserConfig, whose one SST default member is
|
|
8765
|
+
// allowAdminCreateUserOnly: false. Every other pool argument is SST's.
|
|
8766
|
+
$transform(aws.cognito.UserPool, (args: any, _opts: any, logicalName: string) => {
|
|
8767
|
+
if (logicalName === 'FoundationIdentityUserPool') {
|
|
8768
|
+
args.adminCreateUserConfig = { allowAdminCreateUserOnly: true };
|
|
8769
|
+
}
|
|
8770
|
+
});
|
|
8631
8771
|
const identityDomainName = foundationAccountId.apply(
|
|
8632
8772
|
(accountId: string) =>
|
|
8633
8773
|
identityDomainPrefix($app.stage, accountId),
|
|
8634
8774
|
);
|
|
8775
|
+
// Area 2: a bound stage serves its identity domain, and with it the
|
|
8776
|
+
// machine clients' token endpoint, on auth.<root>, with its own certificate
|
|
8777
|
+
// and alias records in the bound zone. An unbound stage keeps the prefix
|
|
8778
|
+
// domain with the same arguments as before.
|
|
8779
|
+
const identityDomain =
|
|
8780
|
+
routerDomain.kind === 'custom-domain'
|
|
8781
|
+
? {
|
|
8782
|
+
name: 'auth.' + routerDomain.rootDomain,
|
|
8783
|
+
dns: sst.aws.dns({ zone: routerDomain.hostedZoneId }),
|
|
8784
|
+
}
|
|
8785
|
+
: {
|
|
8786
|
+
prefix: identityDomainName,
|
|
8787
|
+
};
|
|
8635
8788
|
const userPool = new sst.aws.CognitoUserPool('FoundationIdentity', {
|
|
8636
|
-
domain:
|
|
8637
|
-
prefix: identityDomainName,
|
|
8638
|
-
},
|
|
8789
|
+
domain: identityDomain,
|
|
8639
8790
|
usernames: ['email'],
|
|
8791
|
+
...(routerRootAlias
|
|
8792
|
+
? {
|
|
8793
|
+
transform: {
|
|
8794
|
+
domain: (_args: any, opts: any) => {
|
|
8795
|
+
opts.dependsOn = [
|
|
8796
|
+
...[opts.dependsOn ?? []].flat(),
|
|
8797
|
+
routerRootAlias.ready(router.distributionID),
|
|
8798
|
+
];
|
|
8799
|
+
// Cognito checks that <root> resolves to an address when it
|
|
8800
|
+
// creates auth.<root>. INSYNC is not enough: Route 53 answers the
|
|
8801
|
+
// Router's alias with no addresses while the distribution is
|
|
8802
|
+
// still deploying. rootDomain is set whenever routerRootAlias is.
|
|
8803
|
+
opts.hooks = {
|
|
8804
|
+
...opts.hooks,
|
|
8805
|
+
beforeCreate: [
|
|
8806
|
+
...(opts.hooks?.beforeCreate ?? []),
|
|
8807
|
+
identityDomainParentReady(rootDomain!),
|
|
8808
|
+
],
|
|
8809
|
+
};
|
|
8810
|
+
},
|
|
8811
|
+
},
|
|
8812
|
+
}
|
|
8813
|
+
: {}),
|
|
8640
8814
|
});
|
|
8641
8815
|
const identityDomainUrl = userPool.domainUrl;
|
|
8642
8816
|
if (!identityDomainUrl) {
|
|
@@ -8645,8 +8819,18 @@ ${foundationPlan.resources.postgres
|
|
|
8645
8819
|
);
|
|
8646
8820
|
}
|
|
8647
8821
|
const identityTokenEndpoint = identityDomainUrl.apply(
|
|
8648
|
-
(domainUrl: string) =>
|
|
8649
|
-
domainUrl.replace(/\\/+$/, '') + '/oauth2/token'
|
|
8822
|
+
(domainUrl: string) => {
|
|
8823
|
+
const endpoint = domainUrl.replace(/\\/+$/, '') + '/oauth2/token';
|
|
8824
|
+
if (
|
|
8825
|
+
routerDomain.kind === 'custom-domain' &&
|
|
8826
|
+
endpoint !== 'https://auth.' + routerDomain.rootDomain + '/oauth2/token'
|
|
8827
|
+
) {
|
|
8828
|
+
throw new Error(
|
|
8829
|
+
'Foundation identity domain must publish the bound token endpoint https://auth.<root>/oauth2/token. Reconcile the pinned SST version.',
|
|
8830
|
+
);
|
|
8831
|
+
}
|
|
8832
|
+
return endpoint;
|
|
8833
|
+
},
|
|
8650
8834
|
);
|
|
8651
8835
|
const eventBus = new sst.aws.Bus('FoundationEventBus');
|
|
8652
8836
|
const alertTopic = new sst.aws.SnsTopic('FoundationAlerts');
|
|
@@ -10456,6 +10640,19 @@ for (const name of readdirSync('packages')) {
|
|
|
10456
10640
|
const ownershipPath = join('packages', name, '.ebk/ownership.json');
|
|
10457
10641
|
if (!existsSync(ownershipPath)) continue;
|
|
10458
10642
|
const ownership = readJson(ownershipPath);
|
|
10643
|
+
// packages/site holds only the workspace root site, and its record belongs
|
|
10644
|
+
// only there.
|
|
10645
|
+
if (name === 'site' || ownership.kind === 'site') {
|
|
10646
|
+
if (
|
|
10647
|
+
name !== 'site' ||
|
|
10648
|
+
ownership.kind !== 'site' ||
|
|
10649
|
+
ownership.schemaVersion !== ${index_js_1.SITE_OWNERSHIP_SCHEMA_VERSION}
|
|
10650
|
+
) {
|
|
10651
|
+
throw new Error('Root site ownership metadata at ' + ownershipPath + ' is incompatible; packages/site is reserved for the workspace root site.');
|
|
10652
|
+
}
|
|
10653
|
+
validateOwnership(join('packages', name), ownership, 'Root site');
|
|
10654
|
+
continue;
|
|
10655
|
+
}
|
|
10459
10656
|
if (ownership.schemaVersion !== ${index_js_1.GENERATED_OWNERSHIP_SCHEMA_VERSION}) {
|
|
10460
10657
|
throw new Error('Product Slice ' + name + ' ownership metadata is incompatible.');
|
|
10461
10658
|
}
|
|
@@ -92,6 +92,7 @@ function createChange(options) {
|
|
|
92
92
|
...(options.profile
|
|
93
93
|
? { productionFoundationProfile: options.profile }
|
|
94
94
|
: {}),
|
|
95
|
+
...(options.site ? { site: options.site } : {}),
|
|
95
96
|
...(slices.length > 0
|
|
96
97
|
? {
|
|
97
98
|
slices: Object.fromEntries(slices.map((slice) => [slice, sliceStatusFor(options)])),
|
|
@@ -101,7 +102,7 @@ function createChange(options) {
|
|
|
101
102
|
if (Object.keys(change).length === 0 &&
|
|
102
103
|
options.workspaceDeploymentId === undefined &&
|
|
103
104
|
options.workspaceDeploymentMigrationEvidence === undefined) {
|
|
104
|
-
throw new Error('Repository policy command requires --deploymentProfile, --deploymentRegion, an exact stage account ID, --preset, --productionAccess, --productionApprovalMode, --profile, or --slices.');
|
|
105
|
+
throw new Error('Repository policy command requires --deploymentProfile, --deploymentRegion, an exact stage account ID, --preset, --productionAccess, --productionApprovalMode, --profile, --site, or --slices.');
|
|
105
106
|
}
|
|
106
107
|
return change;
|
|
107
108
|
}
|
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
ProductionApprovalMode,
|
|
6
6
|
ProductionFoundationProfile,
|
|
7
7
|
RepositoryModePreset,
|
|
8
|
+
RootSiteProductionStatus,
|
|
8
9
|
SliceProductionStatus,
|
|
9
10
|
} from '../../repository-policy/index.js';
|
|
10
11
|
|
|
@@ -19,6 +20,7 @@ export interface RepositoryPolicyGeneratorSchema {
|
|
|
19
20
|
productionApprovalMode?: ProductionApprovalMode;
|
|
20
21
|
profile?: ProductionFoundationProfile;
|
|
21
22
|
productionAccountId?: string | number;
|
|
23
|
+
site?: RootSiteProductionStatus;
|
|
22
24
|
skipFormat?: boolean;
|
|
23
25
|
slices?: string[];
|
|
24
26
|
status?: SliceProductionStatus;
|
|
@@ -99,10 +99,15 @@
|
|
|
99
99
|
"type": "array",
|
|
100
100
|
"items": {
|
|
101
101
|
"type": "string",
|
|
102
|
-
"pattern": "^[a-z0-9][a-z0-9-]*$"
|
|
102
|
+
"pattern": "^(?!site$)[a-z0-9][a-z0-9-]*$"
|
|
103
103
|
},
|
|
104
104
|
"uniqueItems": true,
|
|
105
|
-
"description": "Product Slices whose explicit production status should be added or changed."
|
|
105
|
+
"description": "Product Slices whose explicit production status should be added or changed. site is reserved for the workspace root site; use --site."
|
|
106
|
+
},
|
|
107
|
+
"site": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"enum": ["blocked", "ready"],
|
|
110
|
+
"description": "Production status of the workspace root site (site.productionStatus). Absent means blocked."
|
|
106
111
|
},
|
|
107
112
|
"status": {
|
|
108
113
|
"type": "string",
|