@empire-builder-kit/nx 1.0.0-rc.46 → 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 +99 -6
- 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 +43 -2
- 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/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 +47 -4
- package/src/generators/preset/workspace-files-thin-docs.js +33 -5
- package/src/generators/preset/workspace-files.js +207 -13
- 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 +116 -11
- 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 +21 -4
- 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-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 -4
- package/src/generators/slice/built-in-plan-web-files.js +65 -0
- 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 +259 -593
- package/src/generators/workload/workload.js +60 -4
- package/src/git-policy/github-bootstrap.d.ts +6 -5
- package/src/git-policy/github-bootstrap.js +6 -4
- package/src/local-dev/fleet-process.d.ts +9 -2
- package/src/local-dev/fleet-process.js +27 -7
- 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 +21 -3
- package/src/supply-chain/generated-blueprint-trust-command.js +15 -0
- 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 }}
|
|
@@ -1545,6 +1584,7 @@ ${indentedScript(exactStageDeployerGuardScript('Container promotion', '$AWS_EXPE
|
|
|
1545
1584
|
EBK_POLICY_ACCOUNT_ID: \${{ needs.prepare.outputs.account_id }}
|
|
1546
1585
|
EBK_POLICY_REGION: \${{ needs.prepare.outputs.region }}
|
|
1547
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 }}
|
|
1548
1588
|
EBK_SLICE_PROJECTS: \${{ needs.prepare.outputs.slice_projects }}
|
|
1549
1589
|
EBK_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
|
|
1550
1590
|
EBK_STAGE: \${{ needs.prepare.outputs.stage }}
|
|
@@ -1701,13 +1741,14 @@ ${indentedScript(restoredCandidateValidationScript(), 10)}
|
|
|
1701
1741
|
ACTIONS_ID_TOKEN_REQUEST_URL: ''
|
|
1702
1742
|
run: pnpm nx run ${name}:supply-chain-check-protected
|
|
1703
1743
|
- name: Install pinned Playwright Chromium for deployed smoke proofs
|
|
1704
|
-
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 != '')
|
|
1705
1745
|
env:
|
|
1706
1746
|
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
|
|
1707
1747
|
ACTIONS_ID_TOKEN_REQUEST_URL: ''
|
|
1708
1748
|
run: |
|
|
1709
1749
|
${indentedScript(protectedBrowserInstallScript(), 10)}
|
|
1710
1750
|
${machineCredentialRequestStep()}
|
|
1751
|
+
${databaseCredentialRequestStep()}
|
|
1711
1752
|
- name: Revalidate exact protected branch tip before OIDC
|
|
1712
1753
|
env:
|
|
1713
1754
|
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ''
|
|
@@ -2305,6 +2346,7 @@ ${trunkPromotionGate}
|
|
|
2305
2346
|
EBK_POLICY_ACCOUNT_ID: \${{ needs.prepare.outputs.production_account_id }}
|
|
2306
2347
|
EBK_POLICY_REGION: \${{ needs.prepare.outputs.region }}
|
|
2307
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 }}
|
|
2308
2350
|
EBK_SLICE_PROJECTS: \${{ needs.prepare.outputs.slice_projects }}
|
|
2309
2351
|
EBK_SOURCE_COMMIT: \${{ inputs.source_commit || github.sha }}
|
|
2310
2352
|
EBK_STAGE: production
|
|
@@ -2395,6 +2437,7 @@ ${indentedScript(restoredCandidateValidationScript(), 10)}
|
|
|
2395
2437
|
run: |
|
|
2396
2438
|
${indentedScript(protectedBrowserInstallScript(), 10)}
|
|
2397
2439
|
${machineCredentialRequestStep()}
|
|
2440
|
+
${databaseCredentialRequestStep()}
|
|
2398
2441
|
${revalidateTip}
|
|
2399
2442
|
- name: Assume the one stage deployment role
|
|
2400
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
|
|
|
@@ -7716,6 +7716,10 @@ At a local milestone, \`pnpm verify\` checks current source through
|
|
|
7716
7716
|
protected Blueprint acceptance. The separate \`${name}:verify\` target and
|
|
7717
7717
|
protected GitHub workflows retain their committed-history and trust gates.
|
|
7718
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
|
+
|
|
7719
7723
|
Human-supplied secret values are entered only by a human. The Developer-Agent workflow
|
|
7720
7724
|
below describes the hand-off for \`ebk secret set\` and \`ebk secret remove\` and the
|
|
7721
7725
|
value-blind paths agents and CI use.
|
|
@@ -7791,6 +7795,11 @@ The Standard Foundation lives at \`packages/foundation\`. Product slices live be
|
|
|
7791
7795
|
\`packages/<slice-name>\` and consume versioned Foundation contracts instead of importing
|
|
7792
7796
|
Foundation implementation files.
|
|
7793
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
|
+
|
|
7794
7803
|
This workspace's \`${deploymentProfile}\` profile activates only:
|
|
7795
7804
|
${activeStages.join(', ')}. Each active canonical consumer stage uses the matching Foundation.
|
|
7796
7805
|
Inactive canonical stages are rejected. Framework-derived personal stages may use only the
|
|
@@ -7860,7 +7869,7 @@ custom work and remove the marker; do not merely delete it while leaving the req
|
|
|
7860
7869
|
unresolved. Open \`TODO\`, \`ASSUMPTION\`, and \`QUESTION\` markers are reported but do not block
|
|
7861
7870
|
deployment by themselves. Open \`SECURITY\` and \`BLOCKER\` markers fail staging and production
|
|
7862
7871
|
deploy or refresh before AWS access. Protected remove and unlock remain usable for recovery.
|
|
7863
|
-
There is no local or silent bypass in this
|
|
7872
|
+
There is no local or silent bypass in this contract; any future waiver mechanism
|
|
7864
7873
|
must be committed, reviewable, and auditable.
|
|
7865
7874
|
|
|
7866
7875
|
## Shared-operation claims
|
|
@@ -8244,11 +8253,38 @@ ${(0, cost_estimate_js_1.renderFoundationCostEstimate)({ deploymentProfile, head
|
|
|
8244
8253
|
tasks. The exact cluster resource ID is non-secret Foundation discovery.
|
|
8245
8254
|
- Relational Product Slices receive scoped logical-database credentials through the provisioning contract.
|
|
8246
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.
|
|
8247
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.
|
|
8248
8268
|
- Lambda and server-side web workloads use resource linking. Containers use the documented
|
|
8249
8269
|
stage-scoped SSM/secret path and least-privilege IAM.
|
|
8250
|
-
- Public domains are configured
|
|
8251
|
-
|
|
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.
|
|
8252
8288
|
- Every stage's CloudFront Router has its own global Web ACL. The baseline always includes AWS
|
|
8253
8289
|
Common Rule Set, Known Bad Inputs, Amazon IP Reputation, rate blocking, CloudWatch metrics,
|
|
8254
8290
|
and sampled requests. Nonproduction is allowlisted by default. Production is public by
|
|
@@ -8290,7 +8326,9 @@ import {
|
|
|
8290
8326
|
createRouterWafStagePlan,
|
|
8291
8327
|
${foundationPlan.resources.postgres ? ' foundationDatabaseEndpointHost,' : ''}
|
|
8292
8328
|
foundationSsmPath,
|
|
8329
|
+
identityDomainParentReady,
|
|
8293
8330
|
normalizeRouterWafPolicy,
|
|
8331
|
+
observeRootAliasRecords,
|
|
8294
8332
|
reconcileRouterWafBlockingRehearsal,
|
|
8295
8333
|
resolveObservabilityPolicy,
|
|
8296
8334
|
routerWafContractDigest,
|
|
@@ -8305,7 +8343,9 @@ import { createStageAuthorityIdentity } from '@empire-builder-kit/nx/aws-authori
|
|
|
8305
8343
|
import {
|
|
8306
8344
|
configuredDeploymentAccountForStage,
|
|
8307
8345
|
configuredDeploymentRegion,
|
|
8346
|
+
parseRepositoryOperatingPolicy,
|
|
8308
8347
|
productionRehearsalStage,
|
|
8348
|
+
resolveFoundationPublicDomain,
|
|
8309
8349
|
} from '@empire-builder-kit/nx/repository-policy';
|
|
8310
8350
|
import { createFoundationAccountCostControlPlan } from '@empire-builder-kit/nx/performance';
|
|
8311
8351
|
import accountCostPolicy from '../performance/account-cost-policy.json';
|
|
@@ -8355,7 +8395,26 @@ export function foundation() {
|
|
|
8355
8395
|
productionProfile: process.env.EBK_PRODUCTION_FOUNDATION_PROFILE,
|
|
8356
8396
|
});
|
|
8357
8397
|
${foundationPlan.resources.postgres ? " const isStaging = $app.stage === 'staging';" : ''}
|
|
8358
|
-
|
|
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
|
+
}
|
|
8359
8418
|
const productionConfiguration = isProduction
|
|
8360
8419
|
? productionFoundationProfileContract(
|
|
8361
8420
|
process.env.EBK_PRODUCTION_FOUNDATION_PROFILE,
|
|
@@ -8426,13 +8485,24 @@ ${foundationPlan.resources.network
|
|
|
8426
8485
|
});`
|
|
8427
8486
|
: ''}
|
|
8428
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;
|
|
8429
8499
|
const router = new sst.aws.Router('FoundationRouter', {
|
|
8430
|
-
...(
|
|
8500
|
+
...(routerDomain.kind === 'custom-domain'
|
|
8431
8501
|
? {
|
|
8432
8502
|
domain: {
|
|
8433
|
-
name: rootDomain,
|
|
8434
|
-
aliases: ['*.' + rootDomain],
|
|
8435
|
-
dns:
|
|
8503
|
+
name: routerDomain.rootDomain,
|
|
8504
|
+
aliases: ['*.' + routerDomain.rootDomain],
|
|
8505
|
+
dns: routerRootAlias!.dns,
|
|
8436
8506
|
},
|
|
8437
8507
|
}
|
|
8438
8508
|
: {}),
|
|
@@ -8564,6 +8634,63 @@ ${foundationPlan.resources.containerCompute ? " const cluster = new sst.aws.Clu
|
|
|
8564
8634
|
},
|
|
8565
8635
|
},
|
|
8566
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
|
+
}
|
|
8567
8694
|
${foundationPlan.resources.postgres
|
|
8568
8695
|
? ` const database = new sst.aws.Aurora('FoundationDatabase', {
|
|
8569
8696
|
// SQL bootstrap and migrations run inside the VPC. Keep the public HTTPS
|
|
@@ -8631,15 +8758,59 @@ ${foundationPlan.resources.postgres
|
|
|
8631
8758
|
const foundationAccountId = aws.getCallerIdentityOutput({}).accountId;
|
|
8632
8759
|
const foundationPartition = aws.getPartitionOutput({});
|
|
8633
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
|
+
});
|
|
8634
8771
|
const identityDomainName = foundationAccountId.apply(
|
|
8635
8772
|
(accountId: string) =>
|
|
8636
8773
|
identityDomainPrefix($app.stage, accountId),
|
|
8637
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
|
+
};
|
|
8638
8788
|
const userPool = new sst.aws.CognitoUserPool('FoundationIdentity', {
|
|
8639
|
-
domain:
|
|
8640
|
-
prefix: identityDomainName,
|
|
8641
|
-
},
|
|
8789
|
+
domain: identityDomain,
|
|
8642
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
|
+
: {}),
|
|
8643
8814
|
});
|
|
8644
8815
|
const identityDomainUrl = userPool.domainUrl;
|
|
8645
8816
|
if (!identityDomainUrl) {
|
|
@@ -8648,8 +8819,18 @@ ${foundationPlan.resources.postgres
|
|
|
8648
8819
|
);
|
|
8649
8820
|
}
|
|
8650
8821
|
const identityTokenEndpoint = identityDomainUrl.apply(
|
|
8651
|
-
(domainUrl: string) =>
|
|
8652
|
-
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
|
+
},
|
|
8653
8834
|
);
|
|
8654
8835
|
const eventBus = new sst.aws.Bus('FoundationEventBus');
|
|
8655
8836
|
const alertTopic = new sst.aws.SnsTopic('FoundationAlerts');
|
|
@@ -10459,6 +10640,19 @@ for (const name of readdirSync('packages')) {
|
|
|
10459
10640
|
const ownershipPath = join('packages', name, '.ebk/ownership.json');
|
|
10460
10641
|
if (!existsSync(ownershipPath)) continue;
|
|
10461
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
|
+
}
|
|
10462
10656
|
if (ownership.schemaVersion !== ${index_js_1.GENERATED_OWNERSHIP_SCHEMA_VERSION}) {
|
|
10463
10657
|
throw new Error('Product Slice ' + name + ' ownership metadata is incompatible.');
|
|
10464
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",
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderSiteDocumentationFiles = renderSiteDocumentationFiles;
|
|
4
|
+
const root_site_js_1 = require("../../foundation/root-site.js");
|
|
5
|
+
const built_in_site_shared_js_1 = require("./built-in-site-shared.js");
|
|
6
|
+
/** @internal */
|
|
7
|
+
function renderSiteDocumentationFiles() {
|
|
8
|
+
const logComponents = root_site_js_1.ROOT_SITE_LOG_COMPONENTS.map((component) => `\`${component}\``);
|
|
9
|
+
const logComponentList = `${logComponents.slice(0, -1).join(', ')} and ${logComponents[logComponents.length - 1]}`;
|
|
10
|
+
return {
|
|
11
|
+
'README.md': `# Root site
|
|
12
|
+
|
|
13
|
+
The workspace root site: a Next.js app that the Foundation Router serves at
|
|
14
|
+
\`/\` of each stage, beside the Product Slices at \`/<slice>\`. On a stage bound
|
|
15
|
+
to a custom domain it is the website at \`https://example.com/\`.
|
|
16
|
+
|
|
17
|
+
- Pages, components and content live under \`web/src/app/\` and
|
|
18
|
+
\`web/public/\`. They are yours to change.
|
|
19
|
+
- Managed files (see \`.ebk/ownership.json\`) are re-rendered by the root site
|
|
20
|
+
upgrade. Seeded files, such as this README, the starting pages and
|
|
21
|
+
\`frontend/security-headers.json\`, are yours after generation.
|
|
22
|
+
|
|
23
|
+
## Routing
|
|
24
|
+
|
|
25
|
+
Every Product Slice path takes precedence over the root site on every host:
|
|
26
|
+
\`/billing\` and \`/billing/...\` go to a \`billing\` Slice, and \`/\`,
|
|
27
|
+
\`/billing-faq\` and any other path go to the site. \`pnpm nx run
|
|
28
|
+
site:route-check\` refuses a site route that a Slice would take:
|
|
29
|
+
|
|
30
|
+
- a top-level page, folder or public file named like a Product Slice;
|
|
31
|
+
- a top-level \`web/public/\` directory whose name starts another path, because
|
|
32
|
+
the Router serves such a directory for every path with that prefix;
|
|
33
|
+
- an HTML file under \`web/public/\`, which the Router would serve without the
|
|
34
|
+
managed security headers;
|
|
35
|
+
- a top-level catch-all route, the \`/__ebk\` and \`/_next\` paths, and the Pages
|
|
36
|
+
Router.
|
|
37
|
+
|
|
38
|
+
A one-segment dynamic route such as \`[slug]\` cannot be checked. Slices take
|
|
39
|
+
its names, and its responses must stay dynamic or \`no-store\`.
|
|
40
|
+
|
|
41
|
+
The site answers \`${root_site_js_1.ROOT_SITE_HEALTH_PATH}\` for deployed readiness. Its managed proxy
|
|
42
|
+
marks every response it handles with \`${root_site_js_1.ROOT_SITE_ROUTE_HEADER}: ${root_site_js_1.ROOT_SITE_ROUTE_HEADER_VALUE}\`; Next.js's own
|
|
43
|
+
path-normalization redirects and the files the Router serves from storage
|
|
44
|
+
carry no marker. On a bound stage it answers only on the root domain and
|
|
45
|
+
redirects every other subdomain there with a 308.
|
|
46
|
+
|
|
47
|
+
## Security
|
|
48
|
+
|
|
49
|
+
The site shares its origin with every Product Slice, and every Slice session
|
|
50
|
+
cookie reaches it. It has no sign-in, API or mutating routes in this release;
|
|
51
|
+
link to a Slice's \`/<slice>/sign-in\` page instead. A script on the site can
|
|
52
|
+
call every Slice's same-origin routes, so keep \`frontend/security-headers.json\`
|
|
53
|
+
strict. Its \`worker-src 'none'\` keeps a service worker from taking scope \`/\`,
|
|
54
|
+
where it would intercept every Slice page; relaxing it is your decision.
|
|
55
|
+
|
|
56
|
+
## Commands
|
|
57
|
+
|
|
58
|
+
- \`pnpm nx run site:dev\`: local development at
|
|
59
|
+
\`http://127.0.0.1:${built_in_site_shared_js_1.ROOT_SITE_DEV_PORT}\`. The local Fleet does not route \`/\`, and the
|
|
60
|
+
site has no \`sst dev\` mode.
|
|
61
|
+
- \`pnpm nx run site:verify\`: typecheck, lint, route check, tests, the
|
|
62
|
+
deployed smoke listing and build.
|
|
63
|
+
- \`pnpm nx run site:smoke-deployed\`: deployed readiness on
|
|
64
|
+
\`${root_site_js_1.ROOT_SITE_HEALTH_PATH}\`, then \`e2e/site.spec.ts\` and the header proof on
|
|
65
|
+
the deployed URL. \`ebk deploy\` runs it after each site deploy.
|
|
66
|
+
- \`ebk deploy development\`: deploys the Foundation, then the site, then the
|
|
67
|
+
Slices. Remove the site after the Slices and before the Foundation.
|
|
68
|
+
|
|
69
|
+
Production deploys the site only when \`site.productionStatus\` is \`ready\` in
|
|
70
|
+
\`ebk.repository-policy.json\`.
|
|
71
|
+
|
|
72
|
+
## Site recovery
|
|
73
|
+
|
|
74
|
+
The \`site-server-errors\` alarm reports server errors from the site's
|
|
75
|
+
Next.js server. Read \`/ebk/<stage>/${root_site_js_1.ROOT_SITE_NAME}/next-server\` in CloudWatch Logs,
|
|
76
|
+
fix the cause, and redeploy.
|
|
77
|
+
|
|
78
|
+
A \`site-data-protection-findings\` alarm reports a protected-data finding in
|
|
79
|
+
one of the site's managed log groups, \`/ebk/<stage>/${root_site_js_1.ROOT_SITE_NAME}/<component>\` for
|
|
80
|
+
${logComponentList}.
|
|
81
|
+
Each group's data protection policy masks the matched value and audits the
|
|
82
|
+
finding, and the alarm's \`LogGroupName\` dimension names the group. Query
|
|
83
|
+
that group in CloudWatch Logs Insights over a bounded time range with
|
|
84
|
+
\`filter ispresent(@dataProtection)\`: the results show the events with a
|
|
85
|
+
finding, with the value masked. Unmasking it is a separate break-glass
|
|
86
|
+
authority, not implied by query access. Find the page, route or dependency
|
|
87
|
+
that logged the value, stop it logging the value, and redeploy. An empty
|
|
88
|
+
query result does not by itself resolve the incident.
|
|
89
|
+
`,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=built-in-site-documentation-files.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ROOT_SITE_PACKAGE_MANAGED_JSON_POINTERS } from './built-in-site-project-files.js';
|
|
2
|
+
export { ROOT_SITE_DEV_PORT, ROOT_SITE_NEXT_BUILD_ENVIRONMENT_KEYS, } from './built-in-site-shared.js';
|
|
3
|
+
/** Every file of a generated root site, keyed by its path in packages/site. */
|
|
4
|
+
export declare function renderBuiltInSiteFiles(input: {
|
|
5
|
+
/** The workspace runtime version, stamped as the framework version tag. */
|
|
6
|
+
runtimeVersion: string;
|
|
7
|
+
scope: string;
|
|
8
|
+
}): Record<string, string>;
|