@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
|
@@ -45,7 +45,15 @@ const executor = async (options, context) => {
|
|
|
45
45
|
}
|
|
46
46
|
(0, index_js_1.assertRepositoryPolicyRequest)(context.root, {
|
|
47
47
|
action: 'deploy',
|
|
48
|
-
projects: [
|
|
48
|
+
projects: [
|
|
49
|
+
{
|
|
50
|
+
// The root site has its own production gate.
|
|
51
|
+
kind: context.projectsConfigurations?.projects[context.projectName]?.tags?.includes('type:site')
|
|
52
|
+
? 'site'
|
|
53
|
+
: 'slice',
|
|
54
|
+
name: context.projectName,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
49
57
|
stage: stages.consumerStage,
|
|
50
58
|
});
|
|
51
59
|
}
|
|
@@ -13,12 +13,12 @@ const index_js_1 = require("../../repository-policy/index.js");
|
|
|
13
13
|
function evaluateFoundationRemoval(foundationStage, registrationNames) {
|
|
14
14
|
if (registrationNames.length === 0) {
|
|
15
15
|
return {
|
|
16
|
-
message: `[foundation-remove-preflight] foundationStage=${foundationStage}: no
|
|
16
|
+
message: `[foundation-remove-preflight] foundationStage=${foundationStage}: no consumer registrations remain.`,
|
|
17
17
|
success: true,
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
return {
|
|
21
|
-
message: `[foundation-remove-preflight] foundationStage=${foundationStage}: Foundation removal is blocked by
|
|
21
|
+
message: `[foundation-remove-preflight] foundationStage=${foundationStage}: Foundation removal is blocked by consumer registration records: ${registrationNames.join(', ')}. Remove the known consumer-stage stacks first (Product Slices, then the root site); investigate every unrecognized record before retrying.`,
|
|
22
22
|
success: false,
|
|
23
23
|
};
|
|
24
24
|
}
|
|
@@ -3,6 +3,9 @@ interface GitHubBootstrapExecutorOptions {
|
|
|
3
3
|
apply?: boolean;
|
|
4
4
|
immutableOidcTrustAcknowledgement?: string;
|
|
5
5
|
npmPrereleaseReviewerIds?: string;
|
|
6
|
+
npmStable?: boolean;
|
|
7
|
+
npmStableReviewerIds?: string;
|
|
8
|
+
npmStablePreventSelfReview?: boolean;
|
|
6
9
|
productionReviewerIds?: string;
|
|
7
10
|
repository?: string;
|
|
8
11
|
}
|
|
@@ -10,6 +10,34 @@ function parseReviewerIds(value) {
|
|
|
10
10
|
}
|
|
11
11
|
const executor = async (options, context) => {
|
|
12
12
|
try {
|
|
13
|
+
if (options.npmStable === true) {
|
|
14
|
+
if (options.npmStableReviewerIds === undefined ||
|
|
15
|
+
!/^[1-9][0-9]*(,[1-9][0-9]*)*$/.test(options.npmStableReviewerIds) ||
|
|
16
|
+
typeof options.npmStablePreventSelfReview !== 'boolean') {
|
|
17
|
+
throw new Error('npm-stable requires explicit reviewer IDs and prevent-self-review choice.');
|
|
18
|
+
}
|
|
19
|
+
if (options.npmPrereleaseReviewerIds !== undefined ||
|
|
20
|
+
options.productionReviewerIds !== undefined ||
|
|
21
|
+
options.immutableOidcTrustAcknowledgement !== undefined) {
|
|
22
|
+
throw new Error('npm-stable does not accept adopter bootstrap options.');
|
|
23
|
+
}
|
|
24
|
+
const report = await (0, index_js_1.runGitHubBootstrap)({
|
|
25
|
+
npmStable: true,
|
|
26
|
+
apply: options.apply === true,
|
|
27
|
+
repository: options.repository?.trim() ?? '',
|
|
28
|
+
npmStableReviewerIds: parseReviewerIds(options.npmStableReviewerIds),
|
|
29
|
+
npmStablePreventSelfReview: options.npmStablePreventSelfReview,
|
|
30
|
+
token: process.env.GH_TOKEN?.trim() ||
|
|
31
|
+
process.env.GITHUB_TOKEN?.trim() ||
|
|
32
|
+
'',
|
|
33
|
+
});
|
|
34
|
+
devkit_1.logger.info(JSON.stringify(report, null, 2));
|
|
35
|
+
return { success: options.apply ? report.ready : true };
|
|
36
|
+
}
|
|
37
|
+
if (options.npmStableReviewerIds !== undefined ||
|
|
38
|
+
options.npmStablePreventSelfReview !== undefined) {
|
|
39
|
+
throw new Error('npm-stable settings require the explicit npmStable selector.');
|
|
40
|
+
}
|
|
13
41
|
const policy = (0, index_js_2.readRepositoryOperatingPolicy)(context.root);
|
|
14
42
|
const report = await (0, index_js_1.runGitHubBootstrap)({
|
|
15
43
|
apply: options.apply === true,
|
|
@@ -31,6 +31,20 @@
|
|
|
31
31
|
"type": "string",
|
|
32
32
|
"pattern": "^[1-9][0-9]*(,[1-9][0-9]*)*$",
|
|
33
33
|
"description": "Optional comma-separated GitHub user IDs when committed Repository Operating Policy selects environment-reviewer mode. Existing reviewers are preserved when omitted."
|
|
34
|
+
},
|
|
35
|
+
"npmStable": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"default": false,
|
|
38
|
+
"description": "Configure only the framework npm-stable environment; exact framework repository required."
|
|
39
|
+
},
|
|
40
|
+
"npmStableReviewerIds": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"pattern": "^[1-9][0-9]*(,[1-9][0-9]*)*$",
|
|
43
|
+
"description": "Explicit GitHub user IDs for the framework npm-stable required reviewers."
|
|
44
|
+
},
|
|
45
|
+
"npmStablePreventSelfReview": {
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"description": "Explicit prevent-self-review choice for the framework npm-stable environment."
|
|
34
48
|
}
|
|
35
49
|
}
|
|
36
50
|
}
|
|
@@ -6,6 +6,7 @@ const client_sts_1 = require("@aws-sdk/client-sts");
|
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
8
|
const index_js_1 = require("../../aws-authority/index.js");
|
|
9
|
+
const root_site_js_1 = require("../../foundation/root-site.js");
|
|
9
10
|
const identity_js_1 = require("../../aws/identity.js");
|
|
10
11
|
const index_js_2 = require("../../repository-policy/index.js");
|
|
11
12
|
const federated_credential_transport_js_1 = require("../local-deploy/federated-credential-transport.js");
|
|
@@ -32,10 +33,16 @@ function projectKind(context) {
|
|
|
32
33
|
}
|
|
33
34
|
const foundation = project.tags?.includes('scope:foundation') ?? false;
|
|
34
35
|
const slice = project.tags?.includes('type:slice') ?? false;
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
const site = project.tags?.includes('type:site') ?? false;
|
|
37
|
+
if ([foundation, site, slice].filter(Boolean).length !== 1) {
|
|
38
|
+
throw new Error(`Nx project ${context.projectName} must declare exactly one lifecycle kind tag: scope:foundation, type:site or type:slice.`);
|
|
37
39
|
}
|
|
38
|
-
|
|
40
|
+
// One root site per workspace, at its fixed package.
|
|
41
|
+
if (site &&
|
|
42
|
+
(context.projectName !== root_site_js_1.ROOT_SITE_NAME || project.root !== root_site_js_1.ROOT_SITE_ROOT)) {
|
|
43
|
+
throw new Error(`Nx project ${context.projectName} is tagged type:site; the workspace root site is the ${root_site_js_1.ROOT_SITE_NAME} project at ${root_site_js_1.ROOT_SITE_ROOT}.`);
|
|
44
|
+
}
|
|
45
|
+
return foundation ? 'foundation' : site ? 'site' : 'slice';
|
|
39
46
|
}
|
|
40
47
|
function projectWorkingDirectory(options, context) {
|
|
41
48
|
const configured = context.projectName
|
|
@@ -44,6 +44,16 @@ interface ProjectDescriptor {
|
|
|
44
44
|
tags: readonly string[];
|
|
45
45
|
targets: Readonly<Record<string, unknown>>;
|
|
46
46
|
}
|
|
47
|
+
interface DeployedSmokeTarget {
|
|
48
|
+
apiUrl: string;
|
|
49
|
+
clientId: string;
|
|
50
|
+
userPoolId: string;
|
|
51
|
+
webUrl: string;
|
|
52
|
+
}
|
|
53
|
+
/** The root site publishes only its web URL: no API and no sign-in. */
|
|
54
|
+
interface DeployedSiteSmokeTarget {
|
|
55
|
+
webUrl: string;
|
|
56
|
+
}
|
|
47
57
|
interface ChildReceipt {
|
|
48
58
|
completedAt: string;
|
|
49
59
|
outcome: 'failed' | 'skipped-unchanged' | 'succeeded';
|
|
@@ -101,6 +111,11 @@ declare function attestLocalContainerBinding(input: {
|
|
|
101
111
|
sourceCommit: string;
|
|
102
112
|
stage: CanonicalDeploymentStage;
|
|
103
113
|
}): void;
|
|
114
|
+
/** The root site's bounded public outputs: its kind, name, stage and a web
|
|
115
|
+
* URL at the Router origin's `/`, with the same literal-host refusal as a
|
|
116
|
+
* Slice. */
|
|
117
|
+
export declare function readDeployedSiteSmokeTarget(workspaceRoot: string, project: ProjectDescriptor, stage: CanonicalDeploymentStage): DeployedSiteSmokeTarget;
|
|
118
|
+
export declare function deployedSmokeEnvironment(target: DeployedSiteSmokeTarget | DeployedSmokeTarget): Record<string, string>;
|
|
104
119
|
export declare function deployedSourceCommit(sourceCommit: string, environment?: NodeJS.ProcessEnv): string;
|
|
105
120
|
/** Determine the one native deployment order. Foundation is always first and
|
|
106
121
|
* production Slice admission remains a committed policy decision. */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.localWorkingTreeDigest = localWorkingTreeDigest;
|
|
4
|
+
exports.readDeployedSiteSmokeTarget = readDeployedSiteSmokeTarget;
|
|
5
|
+
exports.deployedSmokeEnvironment = deployedSmokeEnvironment;
|
|
4
6
|
exports.deployedSourceCommit = deployedSourceCommit;
|
|
5
7
|
exports.localDeploymentProjectOrder = localDeploymentProjectOrder;
|
|
6
8
|
exports.runLocalDeploy = runLocalDeploy;
|
|
@@ -26,6 +28,7 @@ const index_js_3 = require("../../workspace-deployment/index.js");
|
|
|
26
28
|
const private_smoke_access_js_1 = require("../../foundation/private-smoke-access.js");
|
|
27
29
|
const local_private_smoke_access_js_1 = require("../../foundation/local-private-smoke-access.js");
|
|
28
30
|
const capability_plan_js_1 = require("../../foundation/capability-plan.js");
|
|
31
|
+
const root_site_js_1 = require("../../foundation/root-site.js");
|
|
29
32
|
const sst_environment_source_js_1 = require("../sst-lifecycle/sst-environment-source.js");
|
|
30
33
|
const SHA = /^[a-f0-9]{40,64}$/u;
|
|
31
34
|
const ROLE = /^arn:(aws|aws-us-gov|aws-cn):iam::\d{12}:role\/[A-Za-z0-9+=,.@_/-]{1,512}$/u;
|
|
@@ -333,6 +336,14 @@ function readDeployedSmokeTarget(workspaceRoot, project, stage) {
|
|
|
333
336
|
catch {
|
|
334
337
|
throw new Error(`Native SST outputs for ${project.name} contain invalid smoke URLs.`);
|
|
335
338
|
}
|
|
339
|
+
// WHATWG URL keeps '*' in a host. A Slice whose managed infrastructure still
|
|
340
|
+
// publishes SST's referenced-Router URL names the wildcard alias host under a
|
|
341
|
+
// custom domain. Refuse a '*' and any character outside letters, digits, '.'
|
|
342
|
+
// and '-' before smoke; this is not a hostname validator.
|
|
343
|
+
const literalHost = /^[a-z0-9.-]+$/u;
|
|
344
|
+
if (!literalHost.test(api.hostname) || !literalHost.test(web.hostname)) {
|
|
345
|
+
throw new Error(`Native SST outputs for ${project.name} name a host with '*' or a character other than letters, digits, '.' and '-'. Slice URLs must use the Foundation routerUrl host; apply the managed Slice upgrade and redeploy before smoke.`);
|
|
346
|
+
}
|
|
336
347
|
const credentialFreeHttps = (url) => url.protocol === 'https:' &&
|
|
337
348
|
!url.username &&
|
|
338
349
|
!url.password &&
|
|
@@ -342,7 +353,9 @@ function readDeployedSmokeTarget(workspaceRoot, project, stage) {
|
|
|
342
353
|
value.stage !== stage ||
|
|
343
354
|
!credentialFreeHttps(api) ||
|
|
344
355
|
!credentialFreeHttps(web) ||
|
|
345
|
-
|
|
356
|
+
// A bound Slice API is mapped under /<project> on the Foundation's
|
|
357
|
+
// api.<root> domain; an execute-api origin has no path.
|
|
358
|
+
!['/', `/${project.name}`].includes(api.pathname.replace(/\/$/u, '') || '/') ||
|
|
346
359
|
web.pathname.replace(/\/$/u, '') !== `/${project.name}` ||
|
|
347
360
|
!/^[a-z0-9]{1,128}$/u.test(String(value.authClientId ?? '')) ||
|
|
348
361
|
!/^[A-Za-z0-9_-]{1,128}_[A-Za-z0-9]{1,128}$/u.test(String(value.authUserPoolId ?? ''))) {
|
|
@@ -355,6 +368,55 @@ function readDeployedSmokeTarget(workspaceRoot, project, stage) {
|
|
|
355
368
|
webUrl: web.href,
|
|
356
369
|
};
|
|
357
370
|
}
|
|
371
|
+
/** The root site's bounded public outputs: its kind, name, stage and a web
|
|
372
|
+
* URL at the Router origin's `/`, with the same literal-host refusal as a
|
|
373
|
+
* Slice. */
|
|
374
|
+
function readDeployedSiteSmokeTarget(workspaceRoot, project, stage) {
|
|
375
|
+
const projectRoot = confinedWorkspacePath(workspaceRoot, project.root);
|
|
376
|
+
const outputPath = (0, node_path_1.join)(projectRoot, '.sst', 'outputs.json');
|
|
377
|
+
const identity = (0, node_fs_1.lstatSync)(outputPath);
|
|
378
|
+
if (!identity.isFile() ||
|
|
379
|
+
identity.isSymbolicLink() ||
|
|
380
|
+
identity.size < 2 ||
|
|
381
|
+
identity.size > 64 * 1024) {
|
|
382
|
+
throw new Error(`Native SST outputs for ${project.name} are absent or unsafe.`);
|
|
383
|
+
}
|
|
384
|
+
const value = JSON.parse((0, node_fs_1.readFileSync)(outputPath, 'utf8'));
|
|
385
|
+
let web;
|
|
386
|
+
try {
|
|
387
|
+
web = new URL(String(value.webUrl ?? ''));
|
|
388
|
+
}
|
|
389
|
+
catch {
|
|
390
|
+
throw new Error(`Native SST outputs for ${project.name} contain an invalid smoke URL.`);
|
|
391
|
+
}
|
|
392
|
+
if (!/^[a-z0-9.-]+$/u.test(web.hostname)) {
|
|
393
|
+
throw new Error(`Native SST outputs for ${project.name} name a host with '*' or a character other than letters, digits, '.' and '-'. The root site URL must use the Foundation routerUrl host; apply the managed root site upgrade and redeploy before smoke.`);
|
|
394
|
+
}
|
|
395
|
+
if (value.kind !== 'site' ||
|
|
396
|
+
value.name !== root_site_js_1.ROOT_SITE_NAME ||
|
|
397
|
+
value.stage !== stage ||
|
|
398
|
+
['apiUrl', 'authClientId', 'authUserPoolId'].some((key) => key in value) ||
|
|
399
|
+
web.protocol !== 'https:' ||
|
|
400
|
+
web.username ||
|
|
401
|
+
web.password ||
|
|
402
|
+
web.search ||
|
|
403
|
+
web.hash ||
|
|
404
|
+
web.pathname !== '/') {
|
|
405
|
+
throw new Error(`Native SST outputs for ${project.name} do not match the deployed stage and root site smoke target.`);
|
|
406
|
+
}
|
|
407
|
+
return { webUrl: web.href };
|
|
408
|
+
}
|
|
409
|
+
function deployedSmokeEnvironment(target) {
|
|
410
|
+
if (!('apiUrl' in target))
|
|
411
|
+
return { EBK_SMOKE_URL: target.webUrl };
|
|
412
|
+
return {
|
|
413
|
+
EBK_SMOKE_API_URL: target.apiUrl,
|
|
414
|
+
EBK_SMOKE_AUTHORITY_VERSION: 'cognito-admin-cloudwatch-observe-v1',
|
|
415
|
+
EBK_SMOKE_CLIENT_ID: target.clientId,
|
|
416
|
+
EBK_SMOKE_URL: target.webUrl,
|
|
417
|
+
EBK_SMOKE_USER_POOL_ID: target.userPoolId,
|
|
418
|
+
};
|
|
419
|
+
}
|
|
358
420
|
const GIT_SHA = /^[a-f0-9]{40,64}$/u;
|
|
359
421
|
// A trunk promotion deploys the immutable artifacts built from the release
|
|
360
422
|
// source (EBK_RELEASE_SOURCE_COMMIT, the staging-built head) while it runs
|
|
@@ -515,6 +577,16 @@ function localDeploymentProjectOrder(policy, context, stage, requestedSlices) {
|
|
|
515
577
|
.filter((project) => project.tags.includes('type:slice') &&
|
|
516
578
|
supportsTarget(project, 'deploy'))
|
|
517
579
|
.sort((left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0);
|
|
580
|
+
// The root site deploys after the Foundation and before every Slice, so it
|
|
581
|
+
// is removed after them.
|
|
582
|
+
const sites = projects.filter((project) => project.tags.includes('type:site') && supportsTarget(project, 'deploy'));
|
|
583
|
+
if (slices.some(({ name }) => name === root_site_js_1.ROOT_SITE_NAME)) {
|
|
584
|
+
throw new Error(`Product Slice ${root_site_js_1.ROOT_SITE_NAME} cannot deploy: ${root_site_js_1.ROOT_SITE_NAME} is reserved for the workspace root site. ${root_site_js_1.ROOT_SITE_RENAME_GUIDANCE}`);
|
|
585
|
+
}
|
|
586
|
+
if (sites.length > 1 ||
|
|
587
|
+
sites.some(({ name, root }) => name !== root_site_js_1.ROOT_SITE_NAME || root !== root_site_js_1.ROOT_SITE_ROOT)) {
|
|
588
|
+
throw new Error(`Local deployment accepts one root site, the ${root_site_js_1.ROOT_SITE_NAME} project at ${root_site_js_1.ROOT_SITE_ROOT}.`);
|
|
589
|
+
}
|
|
518
590
|
if (stage === 'production') {
|
|
519
591
|
const missing = slices
|
|
520
592
|
.filter(({ name }) => policy.slices[name] === undefined)
|
|
@@ -522,13 +594,22 @@ function localDeploymentProjectOrder(policy, context, stage, requestedSlices) {
|
|
|
522
594
|
if (missing.length > 0) {
|
|
523
595
|
throw new Error(`Registered Product Slices lack an explicit production policy: ${missing.join(', ')}.`);
|
|
524
596
|
}
|
|
597
|
+
if (sites.length > 0 && policy.site === undefined) {
|
|
598
|
+
throw new Error('The registered root site lacks an explicit production policy: set site.productionStatus to blocked or ready.');
|
|
599
|
+
}
|
|
525
600
|
}
|
|
526
|
-
const
|
|
527
|
-
?
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
601
|
+
const eligibleSites = stage === 'production' && policy.site?.productionStatus !== 'ready'
|
|
602
|
+
? []
|
|
603
|
+
: sites;
|
|
604
|
+
const eligibleSlices = [
|
|
605
|
+
...eligibleSites,
|
|
606
|
+
...(stage === 'production'
|
|
607
|
+
? slices.filter(({ name }) => {
|
|
608
|
+
const status = policy.slices[name]?.productionStatus;
|
|
609
|
+
return status === 'pilot' || status === 'ready';
|
|
610
|
+
})
|
|
611
|
+
: slices),
|
|
612
|
+
];
|
|
532
613
|
if (requestedSlices !== undefined &&
|
|
533
614
|
(!Array.isArray(requestedSlices) ||
|
|
534
615
|
requestedSlices.length === 0 ||
|
|
@@ -547,7 +628,10 @@ function localDeploymentProjectOrder(policy, context, stage, requestedSlices) {
|
|
|
547
628
|
: eligibleSlices.filter(({ name }) => requestedSlices.includes(name));
|
|
548
629
|
const selected = [
|
|
549
630
|
{ kind: 'foundation', name: foundations[0]?.name ?? '' },
|
|
550
|
-
...selectedSlices.map(({ name }) => ({
|
|
631
|
+
...selectedSlices.map(({ name, tags }) => ({
|
|
632
|
+
kind: tags.includes('type:site') ? 'site' : 'slice',
|
|
633
|
+
name,
|
|
634
|
+
})),
|
|
551
635
|
];
|
|
552
636
|
const decision = (0, index_js_2.evaluateRepositoryPolicyRequest)(policy, {
|
|
553
637
|
action: 'deploy',
|
|
@@ -1201,7 +1285,9 @@ async function runLocalDeploy(options, context, dependencies = {}) {
|
|
|
1201
1285
|
if (supportsTarget(descriptor, 'smoke-deployed')) {
|
|
1202
1286
|
if (transport)
|
|
1203
1287
|
await transport.refresh();
|
|
1204
|
-
const smokeTarget =
|
|
1288
|
+
const smokeTarget = descriptor.tags.includes('type:site')
|
|
1289
|
+
? readDeployedSiteSmokeTarget(context.root, descriptor, options.stage)
|
|
1290
|
+
: readDeployedSmokeTarget(context.root, descriptor, options.stage);
|
|
1205
1291
|
assertDeploymentSourceUnchanged(context.root, source, run);
|
|
1206
1292
|
const smokeStartedAt = now().toISOString();
|
|
1207
1293
|
try {
|
|
@@ -1218,11 +1304,7 @@ async function runLocalDeploy(options, context, dependencies = {}) {
|
|
|
1218
1304
|
EBK_NX_STAGE_LIFECYCLE: githubAuthority ? 'github' : 'local',
|
|
1219
1305
|
EBK_SOURCE_COMMIT: source.commit,
|
|
1220
1306
|
EBK_DEPLOYED_SOURCE_COMMIT: deployedSourceCommit(source.commit),
|
|
1221
|
-
|
|
1222
|
-
EBK_SMOKE_AUTHORITY_VERSION: 'cognito-admin-cloudwatch-observe-v1',
|
|
1223
|
-
EBK_SMOKE_CLIENT_ID: smokeTarget.clientId,
|
|
1224
|
-
EBK_SMOKE_URL: smokeTarget.webUrl,
|
|
1225
|
-
EBK_SMOKE_USER_POOL_ID: smokeTarget.userPoolId,
|
|
1307
|
+
...deployedSmokeEnvironment(smokeTarget),
|
|
1226
1308
|
EBK_STAGE: options.stage,
|
|
1227
1309
|
},
|
|
1228
1310
|
expectedRoleArn,
|
|
@@ -11,6 +11,7 @@ const node_child_process_1 = require("node:child_process");
|
|
|
11
11
|
const promises_1 = require("node:fs/promises");
|
|
12
12
|
const node_path_1 = require("node:path");
|
|
13
13
|
const index_js_1 = require("../../foundation/index.js");
|
|
14
|
+
const root_site_js_1 = require("../../foundation/root-site.js");
|
|
14
15
|
const logging_registry_js_1 = require("../../generators/logging-registry.js");
|
|
15
16
|
const MAX_STATE_EXPORT_BYTES = 32 * 1024 * 1024;
|
|
16
17
|
function normalizedSlug(value, label) {
|
|
@@ -137,6 +138,16 @@ async function loadManagedLogGroupContracts(input) {
|
|
|
137
138
|
const slice = normalizedSlug(input.context.projectName, 'Product Slice');
|
|
138
139
|
const packageJson = (await read((0, node_path_1.join)(input.context.root, 'package.json')));
|
|
139
140
|
const workspace = normalizedSlug(packageJson.name, 'Workspace');
|
|
141
|
+
// The root site's managed log groups are a fixed set: it declares no
|
|
142
|
+
// logging registry and no databases.
|
|
143
|
+
if (input.context.projectsConfigurations?.projects[input.context.projectName]?.tags?.includes('type:site')) {
|
|
144
|
+
return root_site_js_1.ROOT_SITE_LOG_COMPONENTS.map((component) => (0, index_js_1.createManagedLogGroupContract)({
|
|
145
|
+
component,
|
|
146
|
+
slice: root_site_js_1.ROOT_SITE_NAME,
|
|
147
|
+
stage: input.invocation.environment.EBK_CONSUMER_STAGE,
|
|
148
|
+
workspace,
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
140
151
|
const registry = (0, logging_registry_js_1.parseSliceLoggingRegistry)(await read((0, node_path_1.join)(input.invocation.cwd, logging_registry_js_1.SLICE_LOGGING_REGISTRY_PATH)));
|
|
141
152
|
const stage = input.invocation.environment.EBK_CONSUMER_STAGE;
|
|
142
153
|
const localDev = input.context.projectsConfigurations?.projects[input.context.projectName]?.metadata?.['ebk']?.['localDev'];
|
|
@@ -171,7 +182,7 @@ async function loadManagedLogGroupContracts(input) {
|
|
|
171
182
|
async function preflightManagedLogGroups(command, options, context, invocation, dependencies = {}) {
|
|
172
183
|
const tags = context.projectsConfigurations?.projects[context.projectName ?? '']?.tags ??
|
|
173
184
|
[];
|
|
174
|
-
if (!tags.includes('type:slice'))
|
|
185
|
+
if (!tags.includes('type:slice') && !tags.includes('type:site'))
|
|
175
186
|
return;
|
|
176
187
|
const contracts = await loadManagedLogGroupContracts({
|
|
177
188
|
context,
|
|
@@ -25,6 +25,8 @@ const index_js_2 = require("../../repository-policy/index.js");
|
|
|
25
25
|
const index_js_3 = require("../../workspace-deployment/index.js");
|
|
26
26
|
const index_js_4 = require("../../work-markers/index.js");
|
|
27
27
|
const secret_preflight_js_1 = require("./secret-preflight.js");
|
|
28
|
+
const root_site_js_1 = require("../../foundation/root-site.js");
|
|
29
|
+
const root_site_readiness_js_1 = require("../../foundation/root-site-readiness.js");
|
|
28
30
|
const task_native_writer_js_1 = require("../../local-dev/task-native-writer.js");
|
|
29
31
|
const local_deploy_js_1 = require("../local-deploy/local-deploy.js");
|
|
30
32
|
const task_stack_absence_js_1 = require("../dev-task-cleanup/task-stack-absence.js");
|
|
@@ -51,7 +53,7 @@ const SST_PROCESS_GROUP_POLL_MS = 25;
|
|
|
51
53
|
const GOVERNED_PROCESS_GROUP_ENV = 'EBK_GOVERNED_PROCESS_GROUP';
|
|
52
54
|
function assertGovernedAwsLifecyclePlatform(platform = process.platform) {
|
|
53
55
|
if (platform === 'win32') {
|
|
54
|
-
throw new Error('Governed AWS infrastructure lifecycle is unavailable on native Windows; use macOS, Linux, or WSL2. Native-Windows task Fleet is not validated in this
|
|
56
|
+
throw new Error('Governed AWS infrastructure lifecycle is unavailable on native Windows; use macOS, Linux, or WSL2. Native-Windows task Fleet is not validated in this release either.');
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
function isMissingProcessError(error) {
|
|
@@ -393,13 +395,51 @@ function projectKind(context) {
|
|
|
393
395
|
if (!context.projectName) {
|
|
394
396
|
throw new Error('SST lifecycle requires an Nx project name for tag-derived Repository Operating Policy evaluation.');
|
|
395
397
|
}
|
|
396
|
-
const
|
|
398
|
+
const project = context.projectsConfigurations?.projects[context.projectName];
|
|
399
|
+
const tags = project?.tags ?? [];
|
|
397
400
|
const foundation = tags.includes('scope:foundation');
|
|
398
401
|
const slice = tags.includes('type:slice');
|
|
399
|
-
|
|
400
|
-
|
|
402
|
+
const site = tags.includes('type:site');
|
|
403
|
+
if ([foundation, site, slice].filter(Boolean).length !== 1) {
|
|
404
|
+
throw new Error(`Nx project ${context.projectName} must declare exactly one lifecycle kind tag: scope:foundation, type:site or type:slice.`);
|
|
405
|
+
}
|
|
406
|
+
// One root site per workspace, at its fixed package.
|
|
407
|
+
if (site &&
|
|
408
|
+
(context.projectName !== root_site_js_1.ROOT_SITE_NAME || project?.root !== root_site_js_1.ROOT_SITE_ROOT)) {
|
|
409
|
+
throw new Error(`Nx project ${context.projectName} is tagged type:site; the workspace root site is the ${root_site_js_1.ROOT_SITE_NAME} project at ${root_site_js_1.ROOT_SITE_ROOT}.`);
|
|
410
|
+
}
|
|
411
|
+
return foundation ? 'foundation' : site ? 'site' : 'slice';
|
|
412
|
+
}
|
|
413
|
+
function readWorkspaceFile(root, path) {
|
|
414
|
+
try {
|
|
415
|
+
return (0, node_fs_1.readFileSync)((0, node_path_1.join)(root, path), 'utf8');
|
|
416
|
+
}
|
|
417
|
+
catch (error) {
|
|
418
|
+
if (error.code === 'ENOENT')
|
|
419
|
+
return undefined;
|
|
420
|
+
throw error;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* A Product Slice may not deploy under the reserved root site name, and a
|
|
425
|
+
* Slice deploy beside a root site needs readiness that recognises root-site
|
|
426
|
+
* fallthrough. Both refuse before any mutation.
|
|
427
|
+
*/
|
|
428
|
+
function assertSliceDeployBesideRootSite(context) {
|
|
429
|
+
const name = context.projectName ?? '';
|
|
430
|
+
const projects = context.projectsConfigurations?.projects ?? {};
|
|
431
|
+
const root = projects[name]?.root ?? '';
|
|
432
|
+
if (name === root_site_js_1.ROOT_SITE_NAME || root === root_site_js_1.ROOT_SITE_ROOT) {
|
|
433
|
+
throw new Error(`Product Slice ${name} cannot deploy: ${root_site_js_1.ROOT_SITE_NAME} and ${root_site_js_1.ROOT_SITE_ROOT} are reserved for the workspace root site. ${root_site_js_1.ROOT_SITE_RENAME_GUIDANCE}`);
|
|
434
|
+
}
|
|
435
|
+
const read = (path) => readWorkspaceFile(context.root, path);
|
|
436
|
+
if (!(0, root_site_readiness_js_1.workspaceHasRootSite)(read, Object.values(projects).map((project) => project.tags))) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
const stale = (0, root_site_readiness_js_1.slicesNeedingRootSiteReadinessUpgrade)(read, [{ name, root }]);
|
|
440
|
+
if (stale.length > 0) {
|
|
441
|
+
throw new Error((0, root_site_readiness_js_1.formatRootSiteReadinessUpgrade)(stale));
|
|
401
442
|
}
|
|
402
|
-
return foundation ? 'foundation' : 'slice';
|
|
403
443
|
}
|
|
404
444
|
function createSstChildEnvironment(ambient, invocation) {
|
|
405
445
|
const stageSanitized = (0, personal_stage_js_1.isFrameworkPersonalStage)(invocation.EBK_CONSUMER_STAGE)
|
|
@@ -528,6 +568,12 @@ function buildSstCommandInvocation(command, options, context, environment = proc
|
|
|
528
568
|
if (options.stageMode !== expectedStageMode) {
|
|
529
569
|
throw new Error(`Nx project ${context.projectName} is tagged as ${kind} and requires stageMode ${expectedStageMode}; executor options cannot change project kind.`);
|
|
530
570
|
}
|
|
571
|
+
if (command === 'dev' && kind === 'site') {
|
|
572
|
+
throw new Error('The root site has no sst dev mode in 1.0; run pnpm nx run site:dev.');
|
|
573
|
+
}
|
|
574
|
+
if (command === 'deploy' && kind === 'slice') {
|
|
575
|
+
assertSliceDeployBesideRootSite(context);
|
|
576
|
+
}
|
|
531
577
|
const configuredRoot = context.projectName
|
|
532
578
|
? context.projectsConfigurations?.projects[context.projectName]?.root
|
|
533
579
|
: undefined;
|
|
@@ -687,7 +687,7 @@ function renderFoundationCostEstimate(options) {
|
|
|
687
687
|
'left',
|
|
688
688
|
]),
|
|
689
689
|
'',
|
|
690
|
-
'Not priced: EC2 NAT instance root volumes (AMI default size), EC2 data transfer out (NAT instances have no per-GB processing charge), an adopter-owned public hosted zone
|
|
690
|
+
'Not priced: EC2 NAT instance root volumes (AMI default size), EC2 data transfer out (NAT instances have no per-GB processing charge), an adopter-owned public hosted zone named by a committed `publicDns.<stage>` binding, AWS Budgets, Cost Anomaly Detection, SSM standard parameters and SST bootstrap storage.',
|
|
691
691
|
'',
|
|
692
692
|
heading(level + 1, 'Price sources'),
|
|
693
693
|
'',
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { promises as dnsPromises } from 'node:dns';
|
|
2
|
+
/**
|
|
3
|
+
* How long the identity domain's hook waits for `<root>` to answer an A
|
|
4
|
+
* query. It covers CloudFront's deployment of a new Router distribution with
|
|
5
|
+
* room to spare, and the longest negative answer (900 s under Route 53's
|
|
6
|
+
* default SOA) a cache between this machine and the zone could hold. At the
|
|
7
|
+
* bound the hook warns and lets the create go on: Cognito's own check then
|
|
8
|
+
* decides, as it did before the hook existed. Every lookup, poll and pause
|
|
9
|
+
* ends by the bound.
|
|
10
|
+
*/
|
|
11
|
+
export declare const IDENTITY_DOMAIN_PARENT_RESOLUTION_BOUND_MS: number;
|
|
12
|
+
/** The pause between two polls, and before the poll that confirms a release. */
|
|
13
|
+
export declare const IDENTITY_DOMAIN_PARENT_POLL_INTERVAL_MS = 10000;
|
|
14
|
+
/**
|
|
15
|
+
* How long every one of the zone's name servers may fail to answer at all,
|
|
16
|
+
* with no definite answer from any of them, before the hook continues
|
|
17
|
+
* through the system resolver.
|
|
18
|
+
*/
|
|
19
|
+
export declare const IDENTITY_DOMAIN_PARENT_TRANSPORT_GRACE_MS = 60000;
|
|
20
|
+
/** The least time between two progress lines. */
|
|
21
|
+
export declare const IDENTITY_DOMAIN_PARENT_PROGRESS_INTERVAL_MS = 30000;
|
|
22
|
+
/** The c-ares options of a resolver the hook builds. */
|
|
23
|
+
export interface ParentResolverOptions {
|
|
24
|
+
readonly timeout: number;
|
|
25
|
+
readonly tries: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The c-ares options of every resolver the hook builds. With c-ares's
|
|
29
|
+
* back-off, one query to a server that never answers takes about 8 to 10 s
|
|
30
|
+
* (measured), not `timeout` times `tries`.
|
|
31
|
+
*/
|
|
32
|
+
export declare const IDENTITY_DOMAIN_PARENT_RESOLVER_OPTIONS: ParentResolverOptions;
|
|
33
|
+
/**
|
|
34
|
+
* The two lookups the hook makes. Node's `resolve*` never read `/etc/hosts`.
|
|
35
|
+
* `cancel` ends the lookups still in flight, which then reject.
|
|
36
|
+
*/
|
|
37
|
+
export interface ParentResolver {
|
|
38
|
+
resolveNs(name: string): Promise<string[]>;
|
|
39
|
+
resolve4(name: string): Promise<string[]>;
|
|
40
|
+
cancel?(): void;
|
|
41
|
+
}
|
|
42
|
+
/** Node's `dns.promises.Resolver`, or a stand-in with the same constructor. */
|
|
43
|
+
export type ParentResolverConstructor = typeof dnsPromises.Resolver;
|
|
44
|
+
/**
|
|
45
|
+
* A resolver on this machine's configured DNS servers: it looks up the
|
|
46
|
+
* zone's name servers, and carries the poll on when those servers cannot be
|
|
47
|
+
* reached. Exported so a spec can assert the options it passes.
|
|
48
|
+
*/
|
|
49
|
+
export declare function systemParentResolver(options?: ParentResolverOptions, Resolver?: ParentResolverConstructor): ParentResolver;
|
|
50
|
+
/**
|
|
51
|
+
* A resolver that asks one of the zone's own name servers, by address, and
|
|
52
|
+
* no other server: Node falls through to another server only on a timeout or
|
|
53
|
+
* an error, never on a negative answer, so the poll asks each server itself.
|
|
54
|
+
* Exported so a spec can assert the options and the server it passes.
|
|
55
|
+
*/
|
|
56
|
+
export declare function authoritativeParentResolver(address: string, options?: ParentResolverOptions, Resolver?: ParentResolverConstructor): ParentResolver;
|
|
57
|
+
/**
|
|
58
|
+
* What this module's specs inject into the hook. An adopter sets none of
|
|
59
|
+
* them, so the public `identityDomainParentReady` takes no options.
|
|
60
|
+
*/
|
|
61
|
+
export interface ParentReadyHookOptions {
|
|
62
|
+
boundMs?: number;
|
|
63
|
+
intervalMs?: number;
|
|
64
|
+
transportGraceMs?: number;
|
|
65
|
+
progressIntervalMs?: number;
|
|
66
|
+
/** The system-configured resolver: name-server discovery, and the continuation. */
|
|
67
|
+
systemResolver?: () => ParentResolver;
|
|
68
|
+
/** One resolver per name-server address, for the authoritative poll. */
|
|
69
|
+
authoritativeResolver?: (address: string) => ParentResolver;
|
|
70
|
+
/** A fresh label for each continuation poll, never reused. */
|
|
71
|
+
nonce?: () => string;
|
|
72
|
+
log?: (line: string) => void;
|
|
73
|
+
/** A monotonic clock in milliseconds. */
|
|
74
|
+
now?: () => number;
|
|
75
|
+
/** The pause between two polls; the hook never asks for one past the bound. */
|
|
76
|
+
sleep?: (ms: number) => Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Calls `expire` once `ms` have passed, unless the function it returns is
|
|
79
|
+
* called first: how the hook ends a poll still in flight at the bound.
|
|
80
|
+
*/
|
|
81
|
+
timer?: (ms: number, expire: () => void) => () => void;
|
|
82
|
+
}
|
|
83
|
+
/** The arguments Pulumi passes a resource hook, as far as this hook reads them. */
|
|
84
|
+
export interface IdentityDomainParentReadyHookArgs {
|
|
85
|
+
newInputs?: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The hook `identityDomainParentReady` returns, with what this module's
|
|
89
|
+
* specs inject.
|
|
90
|
+
*/
|
|
91
|
+
export declare function createParentReadyHook(rootDomain: string, options?: ParentReadyHookOptions): (args: IdentityDomainParentReadyHookArgs) => Promise<void>;
|