@empire-builder-kit/nx 1.0.0-rc.30 → 1.0.0-rc.31
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/executors.json +8 -3
- package/package.json +10 -7
- package/src/aws/child-environment.d.ts +10 -0
- package/src/aws/child-environment.js +77 -0
- package/src/aws/child-environment.js.map +1 -0
- package/src/aws/identity.d.ts +13 -0
- package/src/aws/identity.js +41 -0
- package/src/aws/identity.js.map +1 -0
- package/src/aws-authority/index.d.ts +1 -0
- package/src/aws-authority/index.js +5 -0
- package/src/aws-authority/index.js.map +1 -0
- package/src/aws-authority/stage-authority.d.ts +238 -0
- package/src/aws-authority/stage-authority.js +2836 -0
- package/src/aws-authority/stage-authority.js.map +1 -0
- package/src/developer-agent/generator-planning.js +4 -4
- package/src/developer-agent/generator-planning.js.map +1 -1
- package/src/developer-agent/operation-registry.js +14 -6
- package/src/developer-agent/operation-registry.js.map +1 -1
- package/src/executors/deployment-plan/deployment-plan.js +1 -1
- package/src/executors/deployment-plan/deployment-plan.js.map +1 -1
- package/src/executors/foundation-preflight/foundation-preflight.d.ts +0 -1
- package/src/executors/foundation-preflight/foundation-preflight.js.map +1 -1
- package/src/executors/foundation-preflight/schema.json +0 -5
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.d.ts +12 -3
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js +95 -32
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js.map +1 -1
- package/src/executors/foundation-profile-preflight/production-database-safeguard.d.ts +64 -0
- package/src/executors/foundation-profile-preflight/production-database-safeguard.js +221 -0
- package/src/executors/foundation-profile-preflight/production-database-safeguard.js.map +1 -0
- package/src/executors/foundation-profile-preflight/schema.json +1 -6
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.d.ts +11 -1
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js +44 -21
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js.map +1 -1
- package/src/executors/foundation-remove-preflight/schema.json +6 -1
- package/src/executors/infrastructure-plan/infrastructure-plan.d.ts +25 -369
- package/src/executors/infrastructure-plan/infrastructure-plan.js +222 -5472
- package/src/executors/infrastructure-plan/infrastructure-plan.js.map +1 -1
- package/src/executors/infrastructure-plan/schema.json +8 -64
- package/src/executors/local-deploy/federated-credential-transport.d.ts +48 -0
- package/src/executors/local-deploy/federated-credential-transport.js +252 -0
- package/src/executors/local-deploy/federated-credential-transport.js.map +1 -0
- package/src/executors/local-deploy/local-approval.d.ts +4 -9
- package/src/executors/local-deploy/local-approval.js +3 -7
- package/src/executors/local-deploy/local-approval.js.map +1 -1
- package/src/executors/local-deploy/local-deploy.d.ts +58 -43
- package/src/executors/local-deploy/local-deploy.js +938 -804
- package/src/executors/local-deploy/local-deploy.js.map +1 -1
- package/src/executors/local-deploy/schema.json +3 -20
- package/src/executors/refresh/refresh.js +2 -2
- package/src/executors/refresh/refresh.js.map +1 -1
- package/src/executors/remove/remove.js +2 -2
- package/src/executors/remove/remove.js.map +1 -1
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.d.ts +25 -1
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js +905 -22
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js.map +1 -1
- package/src/executors/router-waf-rehearsal/schema.json +17 -2
- package/src/executors/secret-initialize/schema.json +42 -0
- package/src/executors/secret-initialize/secret-initialize.d.ts +30 -0
- package/src/executors/secret-initialize/secret-initialize.js +229 -0
- package/src/executors/secret-initialize/secret-initialize.js.map +1 -0
- package/src/executors/secret-metadata/secret-metadata.d.ts +2 -1
- package/src/executors/secret-metadata/secret-metadata.js +62 -29
- package/src/executors/secret-metadata/secret-metadata.js.map +1 -1
- package/src/executors/sst-lifecycle/generated-secret-retirement.d.ts +53 -0
- package/src/executors/sst-lifecycle/generated-secret-retirement.js +192 -0
- package/src/executors/sst-lifecycle/generated-secret-retirement.js.map +1 -0
- package/src/executors/sst-lifecycle/governed-native-operation.d.ts +46 -0
- package/src/executors/sst-lifecycle/governed-native-operation.js +153 -0
- package/src/executors/sst-lifecycle/governed-native-operation.js.map +1 -0
- package/src/executors/sst-lifecycle/run-sst-command.d.ts +25 -7
- package/src/executors/sst-lifecycle/run-sst-command.js +459 -89
- package/src/executors/sst-lifecycle/run-sst-command.js.map +1 -1
- package/src/executors/sst-lifecycle/schema.json +0 -5
- package/src/executors/sst-lifecycle/secret-preflight.d.ts +2 -0
- package/src/executors/sst-lifecycle/secret-preflight.js +13 -7
- package/src/executors/sst-lifecycle/secret-preflight.js.map +1 -1
- package/src/executors/unlock/unlock.js +2 -2
- package/src/executors/unlock/unlock.js.map +1 -1
- package/src/foundation/router-waf-rate-rehearsal.d.ts +97 -0
- package/src/foundation/router-waf-rate-rehearsal.js +210 -0
- package/src/foundation/router-waf-rate-rehearsal.js.map +1 -0
- package/src/foundation/router-waf.d.ts +59 -9
- package/src/foundation/router-waf.js +427 -32
- package/src/foundation/router-waf.js.map +1 -1
- package/src/foundation/stages.d.ts +1 -0
- package/src/foundation/stages.js +11 -0
- package/src/foundation/stages.js.map +1 -1
- package/src/generators/formatting.d.ts +8 -0
- package/src/generators/formatting.js +118 -0
- package/src/generators/formatting.js.map +1 -0
- package/src/generators/function/function.js +37 -17
- package/src/generators/function/function.js.map +1 -1
- package/src/generators/post-generation-install.js +2 -2
- package/src/generators/post-generation-install.js.map +1 -1
- package/src/generators/preset/generator.js +22 -7
- package/src/generators/preset/generator.js.map +1 -1
- package/src/generators/preset/workspace-files-developer-agent.js +15 -7
- package/src/generators/preset/workspace-files-developer-agent.js.map +1 -1
- package/src/generators/preset/workspace-files-ecr-inspector.d.ts +18 -0
- package/src/generators/preset/workspace-files-ecr-inspector.js +298 -0
- package/src/generators/preset/workspace-files-ecr-inspector.js.map +1 -0
- package/src/generators/preset/workspace-files-performance-cost.d.ts +2 -2
- package/src/generators/preset/workspace-files-performance-cost.js +8 -8
- package/src/generators/preset/workspace-files-performance-cost.js.map +1 -1
- package/src/generators/preset/workspace-files-performance-load.d.ts +1 -1
- package/src/generators/preset/workspace-files-performance-load.js +8 -12
- package/src/generators/preset/workspace-files-performance-load.js.map +1 -1
- package/src/generators/preset/workspace-files-stage-authority.d.ts +4 -0
- package/src/generators/preset/workspace-files-stage-authority.js +275 -0
- package/src/generators/preset/workspace-files-stage-authority.js.map +1 -0
- package/src/generators/preset/workspace-files-thin-deploy.d.ts +35 -0
- package/src/generators/preset/workspace-files-thin-deploy.js +1434 -0
- package/src/generators/preset/workspace-files-thin-deploy.js.map +1 -0
- package/src/generators/preset/workspace-files-thin-docs.d.ts +5 -0
- package/src/generators/preset/workspace-files-thin-docs.js +224 -0
- package/src/generators/preset/workspace-files-thin-docs.js.map +1 -0
- package/src/generators/preset/workspace-files-thin-release.d.ts +14 -0
- package/src/generators/preset/workspace-files-thin-release.js +26 -0
- package/src/generators/preset/workspace-files-thin-release.js.map +1 -0
- package/src/generators/preset/workspace-files.d.ts +1 -1
- package/src/generators/preset/workspace-files.js +373 -223
- package/src/generators/preset/workspace-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-api-files.js +1 -0
- package/src/generators/slice/built-in-plan-api-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +4 -0
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js +5 -31
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-data-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-data-files.js +89 -30
- package/src/generators/slice/built-in-plan-data-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-foundation-files.js +3 -5
- package/src/generators/slice/built-in-plan-foundation-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-frontend-files.js +5 -1
- package/src/generators/slice/built-in-plan-frontend-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-infrastructure-files.js +199 -188
- package/src/generators/slice/built-in-plan-infrastructure-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-metadata-files.js +13 -0
- package/src/generators/slice/built-in-plan-metadata-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.js +307 -0
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-operations-files.js +43 -49
- package/src/generators/slice/built-in-plan-operations-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-performance-files.js +37 -19
- package/src/generators/slice/built-in-plan-performance-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-project-files.js +9 -68
- package/src/generators/slice/built-in-plan-project-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-secret-runtime-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-secret-runtime-files.js +74 -76
- package/src/generators/slice/built-in-plan-secret-runtime-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-testing-files.js +74 -47
- package/src/generators/slice/built-in-plan-testing-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-thin-release-files.d.ts +11 -0
- package/src/generators/slice/built-in-plan-thin-release-files.js +129 -0
- package/src/generators/slice/built-in-plan-thin-release-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-verification-files.js +6 -2
- package/src/generators/slice/built-in-plan-verification-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-web-files.js +4 -2
- package/src/generators/slice/built-in-plan-web-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-workload-role-files.js +26 -4
- package/src/generators/slice/built-in-plan-workload-role-files.js.map +1 -1
- package/src/generators/slice/built-in-plan.d.ts +1 -0
- package/src/generators/slice/built-in-plan.js +28 -11
- package/src/generators/slice/built-in-plan.js.map +1 -1
- package/src/generators/slice/slice.js +27 -29
- package/src/generators/slice/slice.js.map +1 -1
- package/src/generators/upgrade/upgrade.d.ts +1 -1
- package/src/generators/upgrade/upgrade.js +224 -69
- package/src/generators/upgrade/upgrade.js.map +1 -1
- package/src/generators/workload/performance-registration.d.ts +1 -0
- package/src/generators/workload/performance-registration.js +6 -4
- package/src/generators/workload/performance-registration.js.map +1 -1
- package/src/generators/workload/service-performance-files.d.ts +1 -0
- package/src/generators/workload/service-performance-files.js +27 -7
- package/src/generators/workload/service-performance-files.js.map +1 -1
- package/src/generators/workload/workload.d.ts +1 -1
- package/src/generators/workload/workload.js +55 -28
- package/src/generators/workload/workload.js.map +1 -1
- package/src/git-policy/github-bootstrap.d.ts +19 -6
- package/src/git-policy/github-bootstrap.js +103 -157
- package/src/git-policy/github-bootstrap.js.map +1 -1
- package/src/local-dev/private-state.d.ts +3 -0
- package/src/local-dev/private-state.js +17 -5
- package/src/local-dev/private-state.js.map +1 -1
- package/src/performance/cost-collection.d.ts +1 -1
- package/src/performance/cost-collection.js +4 -2
- package/src/performance/cost-collection.js.map +1 -1
- package/src/performance/cost-controls.d.ts +3 -1
- package/src/performance/cost-controls.js +9 -4
- package/src/performance/cost-controls.js.map +1 -1
- package/src/performance/evidence.d.ts +1 -1
- package/src/performance/evidence.js +5 -3
- package/src/performance/evidence.js.map +1 -1
- package/src/performance/load-safety.js +5 -3
- package/src/performance/load-safety.js.map +1 -1
- package/src/performance/model.d.ts +2 -2
- package/src/performance/model.js +4 -3
- package/src/performance/model.js.map +1 -1
- package/src/release/index.d.ts +0 -2
- package/src/release/index.js +0 -2
- package/src/release/index.js.map +1 -1
- package/src/release/source-authority.d.ts +4 -5
- package/src/release/source-authority.js +13 -123
- package/src/release/source-authority.js.map +1 -1
- package/src/repository-policy/aurora-preflight.d.ts +1 -1
- package/src/repository-policy/aurora-preflight.js +4 -1
- package/src/repository-policy/aurora-preflight.js.map +1 -1
- package/src/repository-policy/policy.d.ts +5 -1
- package/src/repository-policy/policy.js +64 -13
- package/src/repository-policy/policy.js.map +1 -1
- package/src/schemas/performance-policy-v1.json +3 -1
- package/src/secrets/adapters.d.ts +5 -1
- package/src/secrets/adapters.js +22 -1
- package/src/secrets/adapters.js.map +1 -1
- package/src/secrets/aws-control-plane.d.ts +10 -1
- package/src/secrets/aws-control-plane.js +67 -0
- package/src/secrets/aws-control-plane.js.map +1 -1
- package/src/secrets/generated-aws-control-plane.d.ts +23 -0
- package/src/secrets/generated-aws-control-plane.js +259 -0
- package/src/secrets/generated-aws-control-plane.js.map +1 -0
- package/src/secrets/metadata.js +38 -10
- package/src/secrets/metadata.js.map +1 -1
- package/src/secrets/model.d.ts +8 -1
- package/src/secrets/model.js +24 -3
- package/src/secrets/model.js.map +1 -1
- package/src/secrets/operator.d.ts +89 -3
- package/src/secrets/operator.js +422 -9
- package/src/secrets/operator.js.map +1 -1
- package/src/secrets/registry.d.ts +2 -1
- package/src/secrets/registry.js +18 -1
- package/src/secrets/registry.js.map +1 -1
- package/src/secrets/workload-access.js +10 -2
- package/src/secrets/workload-access.js.map +1 -1
- package/src/supply-chain/action-pins.js +61 -7
- package/src/supply-chain/action-pins.js.map +1 -1
- package/src/supply-chain/build-output-bounds.d.ts +2 -0
- package/src/supply-chain/build-output-bounds.js +12 -0
- package/src/supply-chain/build-output-bounds.js.map +1 -0
- package/src/supply-chain/build-output.js +2 -4
- package/src/supply-chain/build-output.js.map +1 -1
- package/src/supply-chain/ecr-scanning.d.ts +5 -3
- package/src/supply-chain/ecr-scanning.js +11 -7
- package/src/supply-chain/ecr-scanning.js.map +1 -1
- package/src/supply-chain/ecs-deployed-image.d.ts +5 -3
- package/src/supply-chain/ecs-deployed-image.js +6 -4
- package/src/supply-chain/ecs-deployed-image.js.map +1 -1
- package/src/supply-chain/generated-container-release-command.js +816 -34
- package/src/supply-chain/generated-container-release-command.js.map +1 -1
- package/src/supply-chain/generated-ecr-collector-command.d.ts +0 -1
- package/src/supply-chain/generated-ecr-collector-command.js +188 -91
- package/src/supply-chain/generated-ecr-collector-command.js.map +1 -1
- package/src/supply-chain/generated-files.js +4 -3
- package/src/supply-chain/generated-files.js.map +1 -1
- package/src/supply-chain/index.d.ts +1 -1
- package/src/supply-chain/index.js +2 -1
- package/src/supply-chain/index.js.map +1 -1
- package/src/workload-roles/index.d.ts +10 -17
- package/src/workload-roles/index.js +5 -18
- package/src/workload-roles/index.js.map +1 -1
package/src/secrets/metadata.js
CHANGED
|
@@ -23,8 +23,9 @@ function expectedDeclarations(declarations, scope) {
|
|
|
23
23
|
const names = new Set();
|
|
24
24
|
for (const declaration of declarations) {
|
|
25
25
|
(0, model_js_1.validateSecretMetadataDeclaration)(declaration);
|
|
26
|
-
if (declaration.source !== 'operator'
|
|
27
|
-
|
|
26
|
+
if (declaration.source !== 'operator' &&
|
|
27
|
+
declaration.source !== 'generated') {
|
|
28
|
+
throw new model_js_1.SecretMetadataModelError(`declarations.${declaration.logicalName}.source`, 'must be operator or generated for the deployed-secret metadata path');
|
|
28
29
|
}
|
|
29
30
|
if (names.has(declaration.logicalName)) {
|
|
30
31
|
throw new model_js_1.SecretMetadataModelError('declarations', 'must not contain duplicate logical names');
|
|
@@ -54,6 +55,17 @@ function identityDisposition(observed, expectedTags) {
|
|
|
54
55
|
}
|
|
55
56
|
return present.length === identityTagKeys.length ? 'owned' : 'ambiguous';
|
|
56
57
|
}
|
|
58
|
+
function managementDisposition(observed, expectedTags) {
|
|
59
|
+
const actualManagement = observed.tags[model_js_1.SECRET_METADATA_TAG_KEYS.management];
|
|
60
|
+
const expectedManagement = expectedTags[model_js_1.SECRET_METADATA_TAG_KEYS.management];
|
|
61
|
+
const actualGeneration = observed.tags[model_js_1.SECRET_METADATA_TAG_KEYS.generation];
|
|
62
|
+
const expectedGeneration = expectedTags[model_js_1.SECRET_METADATA_TAG_KEYS.generation];
|
|
63
|
+
if (actualManagement === expectedManagement &&
|
|
64
|
+
actualGeneration === expectedGeneration) {
|
|
65
|
+
return 'owned';
|
|
66
|
+
}
|
|
67
|
+
return 'conflicting';
|
|
68
|
+
}
|
|
57
69
|
function tagsDiffer(observed, expected) {
|
|
58
70
|
return Object.entries(expected).some(([key, value]) => observed.tags[key] !== value);
|
|
59
71
|
}
|
|
@@ -83,12 +95,17 @@ function reconcileSecretMetadata(input) {
|
|
|
83
95
|
const actual = observed.get(name);
|
|
84
96
|
if (actual === undefined) {
|
|
85
97
|
findings.push(finding('missing-container', name, declaration.logicalName, 'blocking'));
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
98
|
+
// A generated value and its container are one atomic Secrets Manager
|
|
99
|
+
// creation. Metadata reconciliation may create only value-free operator
|
|
100
|
+
// containers; the generated initializer owns the generated container.
|
|
101
|
+
if (declaration.source !== 'generated') {
|
|
102
|
+
proposedMutations.push({
|
|
103
|
+
description: `EBK ${declaration.source} secret ${declaration.logicalName}`,
|
|
104
|
+
kind: 'create-empty-container',
|
|
105
|
+
name,
|
|
106
|
+
tags: expectedTags,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
92
109
|
continue;
|
|
93
110
|
}
|
|
94
111
|
const ownership = identityDisposition(actual, expectedTags);
|
|
@@ -100,6 +117,11 @@ function reconcileSecretMetadata(input) {
|
|
|
100
117
|
findings.push(finding('identity-conflict', name, declaration.logicalName, 'blocking'));
|
|
101
118
|
continue;
|
|
102
119
|
}
|
|
120
|
+
const management = managementDisposition(actual, expectedTags);
|
|
121
|
+
if (management === 'conflicting') {
|
|
122
|
+
findings.push(finding('identity-conflict', name, declaration.logicalName, 'blocking'));
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
103
125
|
if (tagsDiffer(actual, expectedTags)) {
|
|
104
126
|
findings.push(finding('tag-drift', name, declaration.logicalName, 'warning'));
|
|
105
127
|
proposedMutations.push({
|
|
@@ -118,8 +140,10 @@ function reconcileSecretMetadata(input) {
|
|
|
118
140
|
input.scope.workspace &&
|
|
119
141
|
actual.tags[model_js_1.SECRET_METADATA_TAG_KEYS.stage] === input.scope.stage &&
|
|
120
142
|
actual.tags[model_js_1.SECRET_METADATA_TAG_KEYS.slice] === input.scope.slice &&
|
|
121
|
-
actual.tags[model_js_1.SECRET_METADATA_TAG_KEYS.management] ===
|
|
122
|
-
model_js_1.OPERATOR_SECRET_MANAGEMENT_CLASS
|
|
143
|
+
(actual.tags[model_js_1.SECRET_METADATA_TAG_KEYS.management] ===
|
|
144
|
+
model_js_1.OPERATOR_SECRET_MANAGEMENT_CLASS ||
|
|
145
|
+
actual.tags[model_js_1.SECRET_METADATA_TAG_KEYS.management] ===
|
|
146
|
+
model_js_1.GENERATED_SECRET_MANAGEMENT_CLASS)) {
|
|
123
147
|
findings.push(finding('orphan-container', actual.name, actual.tags[model_js_1.SECRET_METADATA_TAG_KEYS.logicalName], 'warning'));
|
|
124
148
|
}
|
|
125
149
|
}
|
|
@@ -156,6 +180,10 @@ function preflightSecretMetadata(input) {
|
|
|
156
180
|
findings.push(finding('identity-conflict', name, declaration.logicalName, 'blocking'));
|
|
157
181
|
continue;
|
|
158
182
|
}
|
|
183
|
+
if (managementDisposition(actual, expectedTags) === 'conflicting') {
|
|
184
|
+
findings.push(finding('identity-conflict', name, declaration.logicalName, 'blocking'));
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
159
187
|
if (!actual.versionStages.includes('AWSCURRENT')) {
|
|
160
188
|
findings.push(finding('missing-current-version', name, declaration.logicalName, 'blocking'));
|
|
161
189
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../../packages/nx/src/secrets/metadata.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../../packages/nx/src/secrets/metadata.ts"],"names":[],"mappings":";;;AA4LA,0DA+HC;AAED,0DAwEC;AArYD,yCAcoB;AAEP,QAAA,6BAA6B,GAAG;IAC3C,mBAAmB;IACnB,mBAAmB;IACnB,yBAAyB;IACzB,kBAAkB;IAClB,qBAAqB;IACrB,2BAA2B;IAC3B,WAAW;CACH,CAAC;AAuDX,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O,CACL,2BAA2B,EAC3B,IAAI,EACJ,WAAW,CAAC,WAAW,EACvB,UAAU,CACX,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACjC,KAAK,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC;KAC7B,CAAC,CAAC;AACL,CAAC"}
|
package/src/secrets/model.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export declare const OPERATOR_SECRET_MANAGEMENT_CLASS: "operator-secret";
|
|
2
|
+
export declare const GENERATED_SECRET_MANAGEMENT_CLASS: "generated-secret";
|
|
3
|
+
export declare const GENERATED_HMAC_SECRET_LOGICAL_NAME: "GeneratedPerformanceLoadHmacKeys";
|
|
2
4
|
export declare const SECRET_CANONICAL_STAGES: readonly ["development", "staging", "production"];
|
|
3
5
|
export type SecretCanonicalStage = (typeof SECRET_CANONICAL_STAGES)[number];
|
|
4
6
|
export declare const SECRET_METADATA_TAG_KEYS: {
|
|
7
|
+
readonly generation: "ebk:generation";
|
|
5
8
|
readonly logicalName: "ebk:logical-name";
|
|
6
9
|
readonly management: "ebk:management";
|
|
7
10
|
readonly owner: "ebk:owner";
|
|
@@ -15,11 +18,14 @@ export type SecretMetadataRotation = {
|
|
|
15
18
|
mode: 'provider-managed';
|
|
16
19
|
};
|
|
17
20
|
export interface SecretMetadataDeclaration {
|
|
21
|
+
generation?: {
|
|
22
|
+
kind: 'hmac-key-ring-v1';
|
|
23
|
+
};
|
|
18
24
|
logicalName: string;
|
|
19
25
|
owner: string;
|
|
20
26
|
requiredStages: readonly string[];
|
|
21
27
|
rotation: SecretMetadataRotation;
|
|
22
|
-
source: 'aws-managed' | 'database-bootstrap' | 'operator';
|
|
28
|
+
source: 'aws-managed' | 'database-bootstrap' | 'generated' | 'operator';
|
|
23
29
|
valueKind: 'binary' | 'json' | 'string';
|
|
24
30
|
}
|
|
25
31
|
export interface SecretManagementScope {
|
|
@@ -29,6 +35,7 @@ export interface SecretManagementScope {
|
|
|
29
35
|
}
|
|
30
36
|
export interface ObservedSecretMetadata {
|
|
31
37
|
arn: string;
|
|
38
|
+
deletionPendingUntil?: string;
|
|
32
39
|
name: string;
|
|
33
40
|
rotationEnabled: boolean;
|
|
34
41
|
tags: Readonly<Record<string, string>>;
|
package/src/secrets/model.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SecretMetadataModelError = exports.SECRET_METADATA_TAG_KEYS = exports.SECRET_CANONICAL_STAGES = exports.OPERATOR_SECRET_MANAGEMENT_CLASS = void 0;
|
|
3
|
+
exports.SecretMetadataModelError = exports.SECRET_METADATA_TAG_KEYS = exports.SECRET_CANONICAL_STAGES = exports.GENERATED_HMAC_SECRET_LOGICAL_NAME = exports.GENERATED_SECRET_MANAGEMENT_CLASS = exports.OPERATOR_SECRET_MANAGEMENT_CLASS = void 0;
|
|
4
4
|
exports.isSecretCanonicalStage = isSecretCanonicalStage;
|
|
5
5
|
exports.validateSecretManagementScope = validateSecretManagementScope;
|
|
6
6
|
exports.validateSecretMetadataDeclaration = validateSecretMetadataDeclaration;
|
|
@@ -10,12 +10,15 @@ exports.canonicalOperatorSecretTags = canonicalOperatorSecretTags;
|
|
|
10
10
|
exports.isExactSecretArn = isExactSecretArn;
|
|
11
11
|
exports.isRotationCompliant = isRotationCompliant;
|
|
12
12
|
exports.OPERATOR_SECRET_MANAGEMENT_CLASS = 'operator-secret';
|
|
13
|
+
exports.GENERATED_SECRET_MANAGEMENT_CLASS = 'generated-secret';
|
|
14
|
+
exports.GENERATED_HMAC_SECRET_LOGICAL_NAME = 'GeneratedPerformanceLoadHmacKeys';
|
|
13
15
|
exports.SECRET_CANONICAL_STAGES = [
|
|
14
16
|
'development',
|
|
15
17
|
'staging',
|
|
16
18
|
'production',
|
|
17
19
|
];
|
|
18
20
|
exports.SECRET_METADATA_TAG_KEYS = {
|
|
21
|
+
generation: 'ebk:generation',
|
|
19
22
|
logicalName: 'ebk:logical-name',
|
|
20
23
|
management: 'ebk:management',
|
|
21
24
|
owner: 'ebk:owner',
|
|
@@ -64,12 +67,20 @@ function validateSecretMetadataDeclaration(declaration) {
|
|
|
64
67
|
declaration.requiredStages.length) {
|
|
65
68
|
throw new SecretMetadataModelError('declaration.requiredStages', 'must contain unique canonical deployed stages');
|
|
66
69
|
}
|
|
67
|
-
if (!['aws-managed', 'database-bootstrap', 'operator'].includes(declaration.source)) {
|
|
70
|
+
if (!['aws-managed', 'database-bootstrap', 'generated', 'operator'].includes(declaration.source)) {
|
|
68
71
|
throw new SecretMetadataModelError('declaration.source', 'must name a supported value authority');
|
|
69
72
|
}
|
|
70
73
|
if (!['binary', 'json', 'string'].includes(declaration.valueKind)) {
|
|
71
74
|
throw new SecretMetadataModelError('declaration.valueKind', 'must name a supported value shape');
|
|
72
75
|
}
|
|
76
|
+
if ((declaration.source === 'generated') !==
|
|
77
|
+
(declaration.generation !== undefined) ||
|
|
78
|
+
(declaration.generation !== undefined &&
|
|
79
|
+
(declaration.generation.kind !== 'hmac-key-ring-v1' ||
|
|
80
|
+
Object.keys(declaration.generation).length !== 1 ||
|
|
81
|
+
declaration.valueKind !== 'json'))) {
|
|
82
|
+
throw new SecretMetadataModelError('declaration.generation', 'must select the supported value-blind JSON generator exactly when source is generated');
|
|
83
|
+
}
|
|
73
84
|
if (!['manual', 'provider-managed'].includes(declaration.rotation.mode)) {
|
|
74
85
|
throw new SecretMetadataModelError('declaration.rotation.mode', 'must be manual or provider-managed');
|
|
75
86
|
}
|
|
@@ -82,6 +93,9 @@ function validateObservedSecretMetadata(observed) {
|
|
|
82
93
|
throw new SecretMetadataModelError('observed.name', 'must be a concrete secret name');
|
|
83
94
|
}
|
|
84
95
|
if (typeof observed.rotationEnabled !== 'boolean' ||
|
|
96
|
+
(observed.deletionPendingUntil !== undefined &&
|
|
97
|
+
(typeof observed.deletionPendingUntil !== 'string' ||
|
|
98
|
+
Number.isNaN(Date.parse(observed.deletionPendingUntil)))) ||
|
|
85
99
|
typeof observed.tags !== 'object' ||
|
|
86
100
|
observed.tags === null ||
|
|
87
101
|
Array.isArray(observed.tags) ||
|
|
@@ -106,8 +120,15 @@ function canonicalOperatorSecretTags(scope, declaration) {
|
|
|
106
120
|
validateSecretManagementScope(scope);
|
|
107
121
|
validateSecretMetadataDeclaration(declaration);
|
|
108
122
|
return Object.freeze({
|
|
123
|
+
...(declaration.generation === undefined
|
|
124
|
+
? {}
|
|
125
|
+
: {
|
|
126
|
+
[exports.SECRET_METADATA_TAG_KEYS.generation]: declaration.generation.kind,
|
|
127
|
+
}),
|
|
109
128
|
[exports.SECRET_METADATA_TAG_KEYS.logicalName]: declaration.logicalName,
|
|
110
|
-
[exports.SECRET_METADATA_TAG_KEYS.management]:
|
|
129
|
+
[exports.SECRET_METADATA_TAG_KEYS.management]: declaration.source === 'generated'
|
|
130
|
+
? exports.GENERATED_SECRET_MANAGEMENT_CLASS
|
|
131
|
+
: exports.OPERATOR_SECRET_MANAGEMENT_CLASS,
|
|
111
132
|
[exports.SECRET_METADATA_TAG_KEYS.owner]: declaration.owner,
|
|
112
133
|
[exports.SECRET_METADATA_TAG_KEYS.slice]: scope.slice,
|
|
113
134
|
[exports.SECRET_METADATA_TAG_KEYS.stage]: scope.stage,
|
package/src/secrets/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../../packages/nx/src/secrets/model.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../../packages/nx/src/secrets/model.ts"],"names":[],"mappings":";;;AAyDA,wDAIC;AAcD,sEAiBC;AAED,8EA+DC;AAED,wEA8CC;AAED,kEAYC;AAED,kEAsBC;AAED,4CAEC;AAED,kDAOC;AAhQY,QAAA,gCAAg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C;AAED,SAAgB,2BAA2B,CACzC,KAA4B,EAC5B,WAAsC;IAEtC,6BAA6B,CAAC,KAAK,CAAC,CAAC;IACrC,iCAAiC,CAAC,WAAW,CAAC,CAAC;IAC/C,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,CAAC,WAAW,CAAC,UAAU,KAAK,SAAS;YACtC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE,CAAC,gCAAwB,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,IAAI;aACnE,CAAC;QACN,CAAC,gCAAwB,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,WAAW;QAC/D,CAAC,gCAAwB,CAAC,UAAU,CAAC,EACnC,WAAW,CAAC,MAAM,KAAK,WAAW;YAChC,CAAC,CAAC,yCAAiC;YACnC,CAAC,CAAC,wCAAgC;QACtC,CAAC,gCAAwB,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK;QACnD,CAAC,gCAAwB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK;QAC7C,CAAC,gCAAwB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK;QAC7C,CAAC,gCAAwB,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS;KACtD,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAa;IAC5C,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAED,SAAgB,mBAAmB,CACjC,WAAsC,EACtC,QAAgC;IAEhC,OAAO,WAAW,CAAC,QAAQ,CAAC,IAAI,KAAK,kBAAkB;QACrD,CAAC,CAAC,QAAQ,CAAC,eAAe;QAC1B,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;AAChC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type SecretMetadataMutationIntent, type SecretMetadataPreflightResult, type SecretMetadataReconciliationResult } from './metadata.js';
|
|
1
|
+
import { type SecretMetadataFinding, type SecretMetadataMutationIntent, type SecretMetadataPreflightResult, type SecretMetadataReconciliationResult } from './metadata.js';
|
|
2
2
|
import { type ObservedSecretMetadata, type SecretManagementScope, type SecretMetadataDeclaration } from './model.js';
|
|
3
3
|
export interface ListedSecretContainer {
|
|
4
4
|
arn: string;
|
|
@@ -20,12 +20,40 @@ export interface SecretMetadataControlPlane {
|
|
|
20
20
|
describe(input: {
|
|
21
21
|
arn: string;
|
|
22
22
|
}): Promise<ObservedSecretMetadata>;
|
|
23
|
+
describeExact(input: {
|
|
24
|
+
includePlannedDeletion?: boolean;
|
|
25
|
+
name: string;
|
|
26
|
+
}): Promise<ObservedSecretMetadata | undefined>;
|
|
23
27
|
list(input: {
|
|
24
28
|
includePlannedDeletion?: boolean;
|
|
25
29
|
namePrefix: string;
|
|
26
30
|
}): Promise<readonly ListedSecretContainer[]>;
|
|
27
31
|
tag(input: TagSecretContainerInput): Promise<void>;
|
|
28
32
|
}
|
|
33
|
+
export interface GeneratedSecretInitializationControlPlane {
|
|
34
|
+
/**
|
|
35
|
+
* Atomically create the container and generated value inside the concrete
|
|
36
|
+
* control-plane adapter. The plaintext must never be returned to this
|
|
37
|
+
* orchestration layer.
|
|
38
|
+
*/
|
|
39
|
+
initializeGenerated(input: {
|
|
40
|
+
description: string;
|
|
41
|
+
generation: 'hmac-key-ring-v1';
|
|
42
|
+
name: string;
|
|
43
|
+
tags: Readonly<Record<string, string>>;
|
|
44
|
+
}): Promise<'applied' | 'unchanged'>;
|
|
45
|
+
/**
|
|
46
|
+
* Describe and validate the exact named container, provenance metadata, and
|
|
47
|
+
* deterministic generated version. Implementations must not use an
|
|
48
|
+
* eventually consistent inventory/list operation for this attestation.
|
|
49
|
+
*/
|
|
50
|
+
inspect(input: {
|
|
51
|
+
description: string;
|
|
52
|
+
generation: 'hmac-key-ring-v1';
|
|
53
|
+
name: string;
|
|
54
|
+
tags: Readonly<Record<string, string>>;
|
|
55
|
+
}): Promise<'conflicting' | 'current' | 'missing'>;
|
|
56
|
+
}
|
|
29
57
|
export interface ProtectedSecretLifecycleControlPlane extends SecretMetadataControlPlane {
|
|
30
58
|
restore(input: {
|
|
31
59
|
arn: string;
|
|
@@ -37,6 +65,14 @@ export interface ProtectedSecretLifecycleControlPlane extends SecretMetadataCont
|
|
|
37
65
|
recoveryUntil: string;
|
|
38
66
|
}>;
|
|
39
67
|
}
|
|
68
|
+
export interface GeneratedSecretRetirementControlPlane extends Pick<ProtectedSecretLifecycleControlPlane, 'describeExact' | 'scheduleRetirement'> {
|
|
69
|
+
deleteImmediately(input: {
|
|
70
|
+
arn: string;
|
|
71
|
+
}): Promise<void>;
|
|
72
|
+
restore(input: {
|
|
73
|
+
arn: string;
|
|
74
|
+
}): Promise<void>;
|
|
75
|
+
}
|
|
40
76
|
export interface ProtectedSecretOperatorAuthorization {
|
|
41
77
|
approved: true;
|
|
42
78
|
authority: 'protected-secret-operator';
|
|
@@ -45,9 +81,9 @@ export interface ProtectedSecretOperatorAuthorization {
|
|
|
45
81
|
}
|
|
46
82
|
export type SecretProtectedLifecycleAction = 'deploy' | 'recover' | 'remove' | 'unlock';
|
|
47
83
|
export declare class SecretOperatorControlPlaneError extends Error {
|
|
48
|
-
readonly operation: 'create-empty' | 'describe' | 'inventory' | 'list' | 'recover' | 'retire' | 'tag';
|
|
84
|
+
readonly operation: 'create-empty' | 'describe' | 'inventory' | 'initialize-generated' | 'list' | 'recover' | 'retire' | 'tag';
|
|
49
85
|
readonly code: 'secret-control-plane-apply-failed' | 'secret-control-plane-inventory-failed' | 'secret-control-plane-inventory-invalid' | 'secret-control-plane-protected-action-failed';
|
|
50
|
-
constructor(code: SecretOperatorControlPlaneError['code'], operation: 'create-empty' | 'describe' | 'inventory' | 'list' | 'recover' | 'retire' | 'tag');
|
|
86
|
+
constructor(code: SecretOperatorControlPlaneError['code'], operation: 'create-empty' | 'describe' | 'inventory' | 'initialize-generated' | 'list' | 'recover' | 'retire' | 'tag');
|
|
51
87
|
}
|
|
52
88
|
export interface SecretMetadataOperatorResult {
|
|
53
89
|
after?: SecretMetadataReconciliationResult;
|
|
@@ -56,6 +92,33 @@ export interface SecretMetadataOperatorResult {
|
|
|
56
92
|
mode: 'apply' | 'report';
|
|
57
93
|
outcome: 'applied' | 'applied-with-findings' | 'blocked' | 'reported';
|
|
58
94
|
}
|
|
95
|
+
export interface GeneratedSecretInitializationResult {
|
|
96
|
+
findings: readonly SecretMetadataFinding[];
|
|
97
|
+
initialized: readonly {
|
|
98
|
+
logicalName: string;
|
|
99
|
+
name: string;
|
|
100
|
+
}[];
|
|
101
|
+
mode: 'apply' | 'report';
|
|
102
|
+
outcome: 'applied' | 'blocked' | 'reported' | 'unchanged';
|
|
103
|
+
proposed: readonly {
|
|
104
|
+
logicalName: string;
|
|
105
|
+
name: string;
|
|
106
|
+
}[];
|
|
107
|
+
}
|
|
108
|
+
export interface GeneratedSecretRetirementResult {
|
|
109
|
+
deletionMode: 'immediate' | 'recovery-window';
|
|
110
|
+
outcome: 'not-applicable' | 'retired';
|
|
111
|
+
recoveryWindowDays?: 7;
|
|
112
|
+
secrets: readonly {
|
|
113
|
+
generation: 'hmac-key-ring-v1';
|
|
114
|
+
logicalName: string;
|
|
115
|
+
name: string;
|
|
116
|
+
outcome: 'already-scheduled' | 'deleted' | 'not-found' | 'scheduled';
|
|
117
|
+
recoveryUntil?: string;
|
|
118
|
+
source: 'generated';
|
|
119
|
+
}[];
|
|
120
|
+
stage: string;
|
|
121
|
+
}
|
|
59
122
|
export interface SecretDeployPreflightResult extends SecretMetadataPreflightResult {
|
|
60
123
|
action: SecretProtectedLifecycleAction;
|
|
61
124
|
bypassed: boolean;
|
|
@@ -79,12 +142,35 @@ export declare function runSecretMetadataOperator(input: {
|
|
|
79
142
|
mode?: 'apply' | 'report';
|
|
80
143
|
scope: SecretManagementScope;
|
|
81
144
|
}): Promise<SecretMetadataOperatorResult>;
|
|
145
|
+
export declare function runGeneratedSecretInitializer(input: {
|
|
146
|
+
initializationControlPlane: GeneratedSecretInitializationControlPlane;
|
|
147
|
+
logicalName: string;
|
|
148
|
+
metadataControlPlane: SecretMetadataControlPlane;
|
|
149
|
+
declarations: readonly SecretMetadataDeclaration[];
|
|
150
|
+
mode?: 'apply' | 'report';
|
|
151
|
+
scope: SecretManagementScope;
|
|
152
|
+
}): Promise<GeneratedSecretInitializationResult>;
|
|
82
153
|
export declare function runSecretDeployPreflight(input: {
|
|
83
154
|
action: SecretProtectedLifecycleAction;
|
|
84
155
|
controlPlane: SecretMetadataControlPlane;
|
|
85
156
|
declarations: readonly SecretMetadataDeclaration[];
|
|
86
157
|
scope: SecretManagementScope;
|
|
87
158
|
}): Promise<SecretDeployPreflightResult>;
|
|
159
|
+
/**
|
|
160
|
+
* Retires only exact framework-generated stage secrets after a
|
|
161
|
+
* successful native Slice removal. This path never reads a secret value,
|
|
162
|
+
* inventories a prefix, or operates on operator/database-bootstrap secrets.
|
|
163
|
+
*/
|
|
164
|
+
export declare function runGeneratedSecretRetirement(input: {
|
|
165
|
+
accountId: string;
|
|
166
|
+
controlPlane: GeneratedSecretRetirementControlPlane;
|
|
167
|
+
declarations: readonly SecretMetadataDeclaration[];
|
|
168
|
+
now?: () => number;
|
|
169
|
+
partition: 'aws' | 'aws-cn' | 'aws-us-gov';
|
|
170
|
+
region: string;
|
|
171
|
+
scope: SecretManagementScope;
|
|
172
|
+
waitBeforeRetry?: (delayMs: number) => Promise<void>;
|
|
173
|
+
}): Promise<GeneratedSecretRetirementResult>;
|
|
88
174
|
export declare function runProtectedSecretLifecycle(input: {
|
|
89
175
|
action: 'recover';
|
|
90
176
|
authorization: ProtectedSecretOperatorAuthorization;
|