@wildo-ai/platform-config-lib 1.0.1 → 1.1.0
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/LICENSE +34 -0
- package/dist/esm/.builder.pid +9 -0
- package/dist/esm/_unimplemented/index.d.ts +3 -0
- package/dist/esm/_unimplemented/index.d.ts.map +1 -0
- package/dist/esm/_unimplemented/index.js +3 -0
- package/dist/esm/_unimplemented/index.js.map +1 -0
- package/dist/esm/_unimplemented/soft-warn.d.ts +124 -0
- package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -0
- package/dist/esm/_unimplemented/soft-warn.js +170 -0
- package/dist/esm/_unimplemented/soft-warn.js.map +1 -0
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +137 -0
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -0
- package/dist/esm/_unimplemented/unimplemented-field-warning.js +153 -0
- package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -0
- package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.js +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts +13 -0
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.js +14 -0
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -0
- package/dist/esm/bootstrap/bootstrap-planner.d.ts +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.js +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts +141 -37
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js +104 -18
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +430 -421
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +383 -21
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +213 -8
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +230 -5
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +79 -0
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-backing-service-access.js +83 -0
- package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -0
- package/dist/esm/bootstrap/runtime-network-policy.d.ts +63 -0
- package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-network-policy.js +104 -0
- package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -0
- package/dist/esm/bootstrap/runtime-network-topology.d.ts +78 -0
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-network-topology.js +134 -0
- package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -0
- package/dist/esm/bootstrap/runtime-platform-access.d.ts +67 -0
- package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-platform-access.js +57 -0
- package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -0
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +173 -0
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-principal.contracts.js +218 -0
- package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -0
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +112 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.js +141 -8
- package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts +3 -0
- package/dist/esm/config-authoring.entry.d.ts.map +1 -0
- package/dist/esm/config-authoring.entry.js +5 -0
- package/dist/esm/config-authoring.entry.js.map +1 -0
- package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
- package/dist/esm/credentials/credential-generator.service.js +1 -1
- package/dist/esm/credentials/credential-generator.service.js.map +1 -1
- package/dist/esm/index.d.ts +30 -15
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +16 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts +41 -0
- package/dist/esm/lockfile/canonical-json.d.ts.map +1 -0
- package/dist/esm/lockfile/canonical-json.js +56 -0
- package/dist/esm/lockfile/canonical-json.js.map +1 -0
- package/dist/esm/lockfile/lockfile-io.d.ts +231 -0
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -0
- package/dist/esm/lockfile/lockfile-io.js +303 -0
- package/dist/esm/lockfile/lockfile-io.js.map +1 -0
- package/dist/esm/lockfile/materialize-infra-section.d.ts +99 -0
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -0
- package/dist/esm/lockfile/materialize-infra-section.js +153 -0
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -0
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +522 -0
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -0
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +116 -0
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -0
- package/dist/esm/project-config/define-framework-config.d.ts +36 -10
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-framework-config.js +67 -3
- package/dist/esm/project-config/define-framework-config.js.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +570 -0
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -0
- package/dist/esm/project-config/define-infra-env-config.js +726 -0
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -0
- package/dist/esm/project-config/define-minion-config.d.ts +221 -23
- package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-minion-config.js +228 -11
- package/dist/esm/project-config/define-minion-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts +427 -218
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +704 -75
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/define-worker-config.d.ts +106 -10
- package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-worker-config.js +99 -9
- package/dist/esm/project-config/define-worker-config.js.map +1 -1
- package/dist/esm/project-config/index.d.ts +28 -21
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js +14 -7
- package/dist/esm/project-config/index.js.map +1 -1
- package/dist/esm/project-config/loader.d.ts +120 -10
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/loader.js +290 -38
- package/dist/esm/project-config/loader.js.map +1 -1
- package/dist/esm/project-config/minion-local-provider-registration.d.ts +69 -0
- package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -0
- package/dist/esm/project-config/minion-local-provider-registration.js +72 -0
- package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -0
- package/dist/esm/project-config/provider-catalog-types.d.ts +12 -0
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -0
- package/dist/esm/project-config/provider-catalog-types.js +49 -0
- package/dist/esm/project-config/provider-catalog-types.js.map +1 -0
- package/dist/esm/project-config/provider-companion-discovery.d.ts +24 -0
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -0
- package/dist/esm/project-config/provider-companion-discovery.js +244 -0
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -0
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +297 -0
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -0
- package/dist/esm/project-config/provider-runtime-artifacts.js +860 -0
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -0
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +18 -0
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/application-creation-verification.schemas.js +25 -0
- package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts +10 -2
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.js +12 -1
- package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.d.ts +2 -1
- package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.js +6 -1
- package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.d.ts +102 -0
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/auth.schemas.js +100 -0
- package/dist/esm/project-config/shared/auth.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts +316 -39
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js +359 -24
- package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/cdn.example.d.ts +14 -0
- package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -0
- package/dist/esm/project-config/shared/cdn.example.js +38 -0
- package/dist/esm/project-config/shared/cdn.example.js.map +1 -0
- package/dist/esm/project-config/shared/cdn.schemas.d.ts +182 -0
- package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/cdn.schemas.js +151 -0
- package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/csp-defaults.d.ts +92 -0
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -0
- package/dist/esm/project-config/shared/csp-defaults.js +195 -0
- package/dist/esm/project-config/shared/csp-defaults.js.map +1 -0
- package/dist/esm/project-config/shared/csp-emit.d.ts +106 -0
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -0
- package/dist/esm/project-config/shared/csp-emit.js +305 -0
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -0
- package/dist/esm/project-config/shared/csp.schemas.d.ts +266 -0
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/csp.schemas.js +281 -0
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/data-services.schemas.d.ts +45 -9
- package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.js +45 -9
- package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.d.ts +0 -1
- package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.js +1 -2
- package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +134 -8
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +185 -2
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +779 -0
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/infra-providers.schemas.js +210 -0
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts +18 -0
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/infra-service.schemas.js +16 -0
- package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +83 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +99 -2
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts +51 -7
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js +59 -12
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts +31 -0
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -0
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js +32 -0
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +142 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.js +159 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -0
- package/dist/esm/project-config/shared/object-storage-session-policy.d.ts +100 -0
- package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -0
- package/dist/esm/project-config/shared/object-storage-session-policy.js +130 -0
- package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -0
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts +9 -14
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js +13 -9
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts +15 -0
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/schema-version.schemas.js +40 -0
- package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +283 -8
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.js +325 -8
- package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts +54 -0
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -0
- package/dist/esm/registry/artifact-domain.schemas.js +40 -0
- package/dist/esm/registry/artifact-domain.schemas.js.map +1 -0
- package/dist/esm/registry/companion-api.schemas.d.ts +176 -0
- package/dist/esm/registry/companion-api.schemas.d.ts.map +1 -0
- package/dist/esm/registry/companion-api.schemas.js +165 -0
- package/dist/esm/registry/companion-api.schemas.js.map +1 -0
- package/dist/esm/registry/digest.schemas.d.ts +20 -0
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -0
- package/dist/esm/registry/digest.schemas.js +21 -0
- package/dist/esm/registry/digest.schemas.js.map +1 -0
- package/dist/esm/registry/index.d.ts +33 -0
- package/dist/esm/registry/index.d.ts.map +1 -0
- package/dist/esm/registry/index.js +33 -0
- package/dist/esm/registry/index.js.map +1 -0
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +107 -0
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -0
- package/dist/esm/registry/lockfile-modules-section.schemas.js +67 -0
- package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -0
- package/dist/esm/registry/module-artifact.schemas.d.ts +94 -0
- package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -0
- package/dist/esm/registry/module-artifact.schemas.js +69 -0
- package/dist/esm/registry/module-artifact.schemas.js.map +1 -0
- package/dist/esm/registry/module-manifest.schemas.d.ts +134 -0
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -0
- package/dist/esm/registry/module-manifest.schemas.js +155 -0
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -0
- package/dist/esm/registry/registry-config.schemas.d.ts +31 -0
- package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -0
- package/dist/esm/registry/registry-config.schemas.js +24 -0
- package/dist/esm/registry/registry-config.schemas.js.map +1 -0
- package/dist/esm/registry/registry-defaults.constants.d.ts +37 -0
- package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -0
- package/dist/esm/registry/registry-defaults.constants.js +37 -0
- package/dist/esm/registry/registry-defaults.constants.js.map +1 -0
- package/dist/esm/registry/registry-errors.d.ts +109 -0
- package/dist/esm/registry/registry-errors.d.ts.map +1 -0
- package/dist/esm/registry/registry-errors.js +185 -0
- package/dist/esm/registry/registry-errors.js.map +1 -0
- package/dist/esm/registry/registry-section-schemas.constants.d.ts +39 -0
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -0
- package/dist/esm/registry/registry-section-schemas.constants.js +22 -0
- package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -0
- package/dist/esm/release/framework-release.constants.d.ts +26 -1
- package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.js +27 -2
- package/dist/esm/release/framework-release.constants.js.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.js +1 -1
- package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts +5 -5
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.js +11 -2
- package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +7 -7
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.js +17 -2
- package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.d.ts +12 -13
- package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.js +15 -3
- package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts +26 -0
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -0
- package/dist/esm/workspace-scope/application-subject-manifest.js +43 -0
- package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -0
- package/dist/esm/workspace-scope/index.d.ts +5 -2
- package/dist/esm/workspace-scope/index.d.ts.map +1 -1
- package/dist/esm/workspace-scope/index.js +4 -1
- package/dist/esm/workspace-scope/index.js.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.d.ts +20 -0
- package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -0
- package/dist/esm/workspace-scope/resolve-homes.js +62 -0
- package/dist/esm/workspace-scope/resolve-homes.js.map +1 -0
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +211 -0
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -0
- package/dist/esm/workspace-scope/workspace-homes.schemas.js +113 -0
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -0
- package/dist/esm/workspace-scope/workspace-scope-detector.d.ts +10 -5
- package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.js +22 -36
- package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts +147 -58
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.js +174 -78
- package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +31 -17
- package/dist/esm/credentials/credentials-provisioner.service.d.ts +0 -190
- package/dist/esm/credentials/credentials-provisioner.service.d.ts.map +0 -1
- package/dist/esm/credentials/credentials-provisioner.service.js +0 -278
- package/dist/esm/credentials/credentials-provisioner.service.js.map +0 -1
- package/dist/esm/infra-managers/infra-manager.models.d.ts +0 -146
- package/dist/esm/infra-managers/infra-manager.models.d.ts.map +0 -1
- package/dist/esm/infra-managers/infra-manager.models.js +0 -2
- package/dist/esm/infra-managers/infra-manager.models.js.map +0 -1
- package/dist/esm/infra-managers/mongo-atlas-manager.service.d.ts +0 -64
- package/dist/esm/infra-managers/mongo-atlas-manager.service.d.ts.map +0 -1
- package/dist/esm/infra-managers/mongo-atlas-manager.service.js +0 -307
- package/dist/esm/infra-managers/mongo-atlas-manager.service.js.map +0 -1
- package/dist/esm/infra-managers/postgresql-manager.service.d.ts +0 -115
- package/dist/esm/infra-managers/postgresql-manager.service.d.ts.map +0 -1
- package/dist/esm/infra-managers/postgresql-manager.service.js +0 -403
- package/dist/esm/infra-managers/postgresql-manager.service.js.map +0 -1
- package/dist/esm/infra-managers/rabbitmq-manager.service.d.ts +0 -64
- package/dist/esm/infra-managers/rabbitmq-manager.service.d.ts.map +0 -1
- package/dist/esm/infra-managers/rabbitmq-manager.service.js +0 -288
- package/dist/esm/infra-managers/rabbitmq-manager.service.js.map +0 -1
- package/dist/esm/infra-managers/redis-manager.service.d.ts +0 -78
- package/dist/esm/infra-managers/redis-manager.service.d.ts.map +0 -1
- package/dist/esm/infra-managers/redis-manager.service.js +0 -326
- package/dist/esm/infra-managers/redis-manager.service.js.map +0 -1
- package/dist/esm/project-config/define-infra-config.d.ts +0 -128
- package/dist/esm/project-config/define-infra-config.d.ts.map +0 -1
- package/dist/esm/project-config/define-infra-config.js +0 -87
- package/dist/esm/project-config/define-infra-config.js.map +0 -1
- package/dist/esm/project-config/define-platform-config.d.ts +0 -65
- package/dist/esm/project-config/define-platform-config.d.ts.map +0 -1
- package/dist/esm/project-config/define-platform-config.js +0 -22
- package/dist/esm/project-config/define-platform-config.js.map +0 -1
- package/dist/esm/project-config/define-platform-env-config.d.ts +0 -41
- package/dist/esm/project-config/define-platform-env-config.d.ts.map +0 -1
- package/dist/esm/project-config/define-platform-env-config.js +0 -45
- package/dist/esm/project-config/define-platform-env-config.js.map +0 -1
- package/dist/esm/project-config/define-project-config.d.ts +0 -38
- package/dist/esm/project-config/define-project-config.d.ts.map +0 -1
- package/dist/esm/project-config/define-project-config.js +0 -57
- package/dist/esm/project-config/define-project-config.js.map +0 -1
- package/dist/esm/project-config/define-sharing-policy.d.ts +0 -35
- package/dist/esm/project-config/define-sharing-policy.d.ts.map +0 -1
- package/dist/esm/project-config/define-sharing-policy.js +0 -30
- package/dist/esm/project-config/define-sharing-policy.js.map +0 -1
- package/dist/esm/project-config/sharing-policy-validation.d.ts +0 -40
- package/dist/esm/project-config/sharing-policy-validation.d.ts.map +0 -1
- package/dist/esm/project-config/sharing-policy-validation.js +0 -143
- package/dist/esm/project-config/sharing-policy-validation.js.map +0 -1
- package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.d.ts +0 -23
- package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.d.ts.map +0 -1
- package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.js +0 -13
- package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.js.map +0 -1
- package/src/bootstrap/application-backend-env.contracts.ts +0 -17
- package/src/bootstrap/bootstrap-planner.ts +0 -46
- package/src/bootstrap/bootstrap.contracts.ts +0 -251
- package/src/bootstrap/bootstrap.schemas.ts +0 -164
- package/src/bootstrap/platform-runtime-env.contracts.ts +0 -99
- package/src/bootstrap/runtime-topology.contracts.ts +0 -102
- package/src/credentials/credential-generator.service.ts +0 -39
- package/src/index.ts +0 -16
- package/src/project-config/__tests__/application-modules.utils.test.ts +0 -53
- package/src/project-config/__tests__/define-framework-config.test.ts +0 -43
- package/src/project-config/__tests__/define-saas-config.test.ts +0 -210
- package/src/project-config/__tests__/loader.test.ts +0 -100
- package/src/project-config/define-framework-config.ts +0 -44
- package/src/project-config/define-infra-config.ts +0 -168
- package/src/project-config/define-minion-config.ts +0 -27
- package/src/project-config/define-platform-config.ts +0 -28
- package/src/project-config/define-platform-env-config.ts +0 -59
- package/src/project-config/define-project-config.ts +0 -63
- package/src/project-config/define-saas-config.ts +0 -171
- package/src/project-config/define-sharing-policy.ts +0 -36
- package/src/project-config/define-worker-config.ts +0 -27
- package/src/project-config/index.ts +0 -23
- package/src/project-config/loader.ts +0 -220
- package/src/project-config/shared/application-modules.schemas.ts +0 -12
- package/src/project-config/shared/application-modules.utils.ts +0 -65
- package/src/project-config/shared/backing-services.schemas.ts +0 -59
- package/src/project-config/shared/data-services.schemas.ts +0 -58
- package/src/project-config/shared/env-example-defaults.ts +0 -50
- package/src/project-config/shared/environment.schemas.ts +0 -136
- package/src/project-config/shared/infrastructure-defaults.schemas.ts +0 -47
- package/src/project-config/shared/k8s-utils.ts +0 -56
- package/src/project-config/shared/platform-services.schemas.ts +0 -33
- package/src/project-config/shared/service-definitions.schemas.ts +0 -38
- package/src/project-config/sharing-policy-validation.ts +0 -159
- package/src/release/framework-release.constants.ts +0 -2
- package/src/schemas/__tests__/platform-config.schemas.test.ts +0 -90
- package/src/schemas/framework-info.schemas.ts +0 -13
- package/src/schemas/framework-secrets.schemas.ts +0 -19
- package/src/schemas/platform-application-config.schemas.ts +0 -25
- package/src/schemas/platform-application-secrets.schemas.ts +0 -78
- package/src/schemas/platform-config.schemas.ts +0 -45
- package/src/workspace-scope/index.ts +0 -2
- package/src/workspace-scope/workspace-scope-detector.ts +0 -98
- package/src/workspace-scope/workspace-scope.schemas.ts +0 -224
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { InfraCapability } from '../project-config/shared/infra-providers.schemas';
|
|
2
|
+
import { type ApplicationRuntimePrincipal } from './runtime-principal.contracts';
|
|
3
|
+
/**
|
|
4
|
+
* WHICH backing services a runtime may reach, derived from what it DECLARED.
|
|
5
|
+
*
|
|
6
|
+
* ## Why this exists as one function
|
|
7
|
+
*
|
|
8
|
+
* Three enforcement points must agree about a runtime's backing-service access:
|
|
9
|
+
* the CREDENTIALS apps-manager mints for it, the network MEMBERSHIP its container
|
|
10
|
+
* gets, and the connection TOPOLOGY written into its environment. Each is
|
|
11
|
+
* independently sufficient to deny, which is the point — but only while they
|
|
12
|
+
* describe the same set.
|
|
13
|
+
*
|
|
14
|
+
* They are also each capable of silently disagreeing. A runtime kept off a
|
|
15
|
+
* service's network while still receiving that service's connect URL is the worst
|
|
16
|
+
* of the three combinations: `isConfigured()` reports true, a health probe or a
|
|
17
|
+
* first use runs, and an unroutable host fails as a timeout for a runtime that was
|
|
18
|
+
* never supposed to have the service at all. The fix is not a compensating branch
|
|
19
|
+
* in a health check — it is that the two derive from HERE, so a non-declaring
|
|
20
|
+
* runtime is never configured in the first place and there is nothing to
|
|
21
|
+
* distinguish.
|
|
22
|
+
*
|
|
23
|
+
* So this is deliberately NOT a helper each consumer may reimplement "for its own
|
|
24
|
+
* needs". Consumers call it; none re-derives. That is the whole anti-bypass
|
|
25
|
+
* strategy, and the enumeration of who must call it lives in
|
|
26
|
+
* `.claude/plans/minion-nature-and-authority.md` (Step 5-egress).
|
|
27
|
+
*
|
|
28
|
+
* ## The vocabulary is `InfraCapability`, not a new enum
|
|
29
|
+
*
|
|
30
|
+
* That is already what an infra provider module declares it supplies, so a
|
|
31
|
+
* capability named here and a provider that serves it cannot drift into two
|
|
32
|
+
* spellings of one concept.
|
|
33
|
+
*/
|
|
34
|
+
export interface RuntimeBackingServiceAccess {
|
|
35
|
+
/**
|
|
36
|
+
* Capabilities this runtime may reach. Empty is a legitimate, meaningful answer
|
|
37
|
+
* — see the WORKER case — and must never be read as "unspecified, allow all".
|
|
38
|
+
*/
|
|
39
|
+
readonly capabilities: ReadonlySet<InfraCapability>;
|
|
40
|
+
/**
|
|
41
|
+
* Whether this runtime needs a route off the host at all.
|
|
42
|
+
*
|
|
43
|
+
* Authored, never inferred: a scraper minion legitimately reaches the public
|
|
44
|
+
* internet, and the point of the flag is not to refuse that but to stop egress
|
|
45
|
+
* being universal and unstated. Default false, so the safe answer is the one you
|
|
46
|
+
* get by not thinking about it.
|
|
47
|
+
*/
|
|
48
|
+
readonly requiresInternetEgress: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* What a minion declares about its access to the application's data.
|
|
52
|
+
*
|
|
53
|
+
* Structural rather than importing the app-declaration type, so this contract does
|
|
54
|
+
* not acquire the whole configuration graph for two fields.
|
|
55
|
+
*/
|
|
56
|
+
export interface RuntimeAccessDeclaration {
|
|
57
|
+
/**
|
|
58
|
+
* The minion's authored `resourceAccess`, or `undefined` when it declared none.
|
|
59
|
+
*
|
|
60
|
+
* The distinction is load-bearing and mirrors `deriveMinionResourceGrants`:
|
|
61
|
+
* ABSENT means application-data access was never requested (D11/R3), so no
|
|
62
|
+
* database credential is minted AND no database network is joined. An empty but
|
|
63
|
+
* PRESENT declaration is a different statement and is not this.
|
|
64
|
+
*/
|
|
65
|
+
readonly resourceAccess?: {
|
|
66
|
+
read?: readonly string[];
|
|
67
|
+
write?: readonly string[];
|
|
68
|
+
} | undefined;
|
|
69
|
+
/** Authored opt-in; see {@link RuntimeBackingServiceAccess.requiresInternetEgress}. */
|
|
70
|
+
readonly requiresInternetEgress?: boolean | undefined;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Derive a runtime's backing-service access from its principal and declaration.
|
|
74
|
+
*
|
|
75
|
+
* Fails CLOSED on every axis: an unknown principal kind, an absent declaration and
|
|
76
|
+
* an absent `resourceAccess` all narrow rather than widen.
|
|
77
|
+
*/
|
|
78
|
+
export declare function resolveRuntimeBackingServiceAccess(principal: ApplicationRuntimePrincipal | undefined, declaration?: RuntimeAccessDeclaration | undefined): RuntimeBackingServiceAccess;
|
|
79
|
+
//# sourceMappingURL=runtime-backing-service-access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-backing-service-access.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-backing-service-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAmC,KAAK,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAElH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IACpD;;;;;;;OAOG;IACH,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;CAC1C;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,GAAG,SAAS,CAAC;IAC9F,uFAAuF;IACvF,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACvD;AAqCD;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,SAAS,EAAE,2BAA2B,GAAG,SAAS,EAClD,WAAW,CAAC,EAAE,wBAAwB,GAAG,SAAS,GACjD,2BAA2B,CA2C7B"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { InfraCapability } from '../project-config/shared/infra-providers.schemas.js';
|
|
2
|
+
import { ApplicationRuntimePrincipalKind } from './runtime-principal.contracts.js';
|
|
3
|
+
/**
|
|
4
|
+
* Capabilities every MINION reaches regardless of what it declared.
|
|
5
|
+
*
|
|
6
|
+
* A minion is tick-driven and single-flighted: it consumes its tick queue and its
|
|
7
|
+
* own RPC reply queue (QUEUING_SYSTEM) and holds a per-principal Redis namespace
|
|
8
|
+
* (CACHE_MANAGER) used for its single-flight lease. Both credentials are minted
|
|
9
|
+
* unconditionally for every minion today, so withholding either network would
|
|
10
|
+
* strand a credential the platform issued — the incoherence this module exists to
|
|
11
|
+
* prevent, arriving from the other direction.
|
|
12
|
+
*/
|
|
13
|
+
const MINION_UNCONDITIONAL_CAPABILITIES = [
|
|
14
|
+
InfraCapability.QUEUING_SYSTEM,
|
|
15
|
+
InfraCapability.CACHE_MANAGER,
|
|
16
|
+
// Telemetry is unconditional for the same reason the platform segment is: every
|
|
17
|
+
// runtime emits it, it carries no application data, and withholding it breaks
|
|
18
|
+
// observability with NO signal — the collector appears in no readiness check, so
|
|
19
|
+
// the failure surfaces as "spans stopped" long after the change that caused it.
|
|
20
|
+
InfraCapability.METRICS_TELEMETRY,
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* Capabilities a minion reaches ONLY when it declared application-data access.
|
|
24
|
+
*
|
|
25
|
+
* Both database kinds are listed because an application is backed by one or the
|
|
26
|
+
* other and this layer does not know which; the consumer intersects with the
|
|
27
|
+
* capabilities the application actually provisions. Listing only the provisioned
|
|
28
|
+
* one here would make this function depend on infrastructure configuration to
|
|
29
|
+
* answer a question about a DECLARATION.
|
|
30
|
+
*/
|
|
31
|
+
const MINION_DATA_CAPABILITIES = [
|
|
32
|
+
InfraCapability.DOCUMENT_DATABASE,
|
|
33
|
+
InfraCapability.RELATIONAL_DATABASE,
|
|
34
|
+
InfraCapability.OBJECT_STORAGE,
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* Derive a runtime's backing-service access from its principal and declaration.
|
|
38
|
+
*
|
|
39
|
+
* Fails CLOSED on every axis: an unknown principal kind, an absent declaration and
|
|
40
|
+
* an absent `resourceAccess` all narrow rather than widen.
|
|
41
|
+
*/
|
|
42
|
+
export function resolveRuntimeBackingServiceAccess(principal, declaration) {
|
|
43
|
+
const requiresInternetEgress = declaration?.requiresInternetEgress === true;
|
|
44
|
+
switch (principal?.kind) {
|
|
45
|
+
case ApplicationRuntimePrincipalKind.APPLICATION_BACKEND:
|
|
46
|
+
// The general runtime: it serves every request the application exposes, so
|
|
47
|
+
// its access is the application's own provisioned set rather than anything
|
|
48
|
+
// narrowed here. Returning the full vocabulary and letting the consumer
|
|
49
|
+
// intersect with what the app provisions keeps THIS function about
|
|
50
|
+
// declarations and the consumer about infrastructure.
|
|
51
|
+
return {
|
|
52
|
+
capabilities: new Set(Object.values(InfraCapability)),
|
|
53
|
+
requiresInternetEgress,
|
|
54
|
+
};
|
|
55
|
+
case ApplicationRuntimePrincipalKind.MINION: {
|
|
56
|
+
const capabilities = new Set(MINION_UNCONDITIONAL_CAPABILITIES);
|
|
57
|
+
// ABSENT resourceAccess ⇒ no data capability at all. Same gate, same
|
|
58
|
+
// reasoning and the same source as the credential minting: a minion that
|
|
59
|
+
// never asked for application data must not hold a credential to it, and
|
|
60
|
+
// must not have a route to it either.
|
|
61
|
+
if (declaration?.resourceAccess) {
|
|
62
|
+
for (const capability of MINION_DATA_CAPABILITIES)
|
|
63
|
+
capabilities.add(capability);
|
|
64
|
+
}
|
|
65
|
+
return { capabilities, requiresInternetEgress };
|
|
66
|
+
}
|
|
67
|
+
case ApplicationRuntimePrincipalKind.WORKER:
|
|
68
|
+
// EMPTY, and this is a measured fact rather than a conservative guess: a
|
|
69
|
+
// worker never boots the application lifecycle — it is standalone by design
|
|
70
|
+
// with no backing-service access, which is why it has no member in
|
|
71
|
+
// `ApplicationRuntimeProfile` at all. D22/KD-3 says the same thing from the
|
|
72
|
+
// credential side. Segmentation turns that policy into a reachability fact
|
|
73
|
+
// instead of a promise about what nobody remembered to inject.
|
|
74
|
+
return { capabilities: new Set(), requiresInternetEgress };
|
|
75
|
+
default:
|
|
76
|
+
// An unrecognised or absent principal gets NOTHING. Every caller uses this
|
|
77
|
+
// to decide how narrowly a runtime is confined, so a permissive default
|
|
78
|
+
// would widen confinement silently — the one direction that cannot be
|
|
79
|
+
// detected by anything downstream.
|
|
80
|
+
return { capabilities: new Set(), requiresInternetEgress: false };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=runtime-backing-service-access.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-backing-service-access.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-backing-service-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,+BAA+B,EAAoC,MAAM,+BAA+B,CAAC;AAsElH;;;;;;;;;GASG;AACH,MAAM,iCAAiC,GAA+B;IACpE,eAAe,CAAC,cAAc;IAC9B,eAAe,CAAC,aAAa;IAC7B,gFAAgF;IAChF,8EAA8E;IAC9E,iFAAiF;IACjF,gFAAgF;IAChF,eAAe,CAAC,iBAAiB;CAClC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,wBAAwB,GAA+B;IAC3D,eAAe,CAAC,iBAAiB;IACjC,eAAe,CAAC,mBAAmB;IACnC,eAAe,CAAC,cAAc;CAC/B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,kCAAkC,CAChD,SAAkD,EAClD,WAAkD;IAElD,MAAM,sBAAsB,GAAG,WAAW,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAE5E,QAAQ,SAAS,EAAE,IAAI,EAAE,CAAC;QACxB,KAAK,+BAA+B,CAAC,mBAAmB;YACtD,2EAA2E;YAC3E,2EAA2E;YAC3E,wEAAwE;YACxE,mEAAmE;YACnE,sDAAsD;YACtD,OAAO;gBACL,YAAY,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;gBACrD,sBAAsB;aACvB,CAAC;QAEJ,KAAK,+BAA+B,CAAC,MAAM,CAAC,CAAC,CAAC;YAC5C,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,iCAAiC,CAAC,CAAC;YAChE,qEAAqE;YACrE,yEAAyE;YACzE,yEAAyE;YACzE,sCAAsC;YACtC,IAAI,WAAW,EAAE,cAAc,EAAE,CAAC;gBAChC,KAAK,MAAM,UAAU,IAAI,wBAAwB;oBAAE,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAClF,CAAC;YACD,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,CAAC;QAClD,CAAC;QAED,KAAK,+BAA+B,CAAC,MAAM;YACzC,yEAAyE;YACzE,4EAA4E;YAC5E,mEAAmE;YACnE,4EAA4E;YAC5E,2EAA2E;YAC3E,+DAA+D;YAC/D,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,EAAE,EAAE,sBAAsB,EAAE,CAAC;QAE7D;YACE,2EAA2E;YAC3E,wEAAwE;YACxE,sEAAsE;YACtE,mCAAmC;YACnC,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,EAAE,EAAE,sBAAsB,EAAE,KAAK,EAAE,CAAC;IACtE,CAAC;AACH,CAAC","sourcesContent":["import { InfraCapability } from '../project-config/shared/infra-providers.schemas';\nimport { ApplicationRuntimePrincipalKind, type ApplicationRuntimePrincipal } from './runtime-principal.contracts';\n\n/**\n * WHICH backing services a runtime may reach, derived from what it DECLARED.\n *\n * ## Why this exists as one function\n *\n * Three enforcement points must agree about a runtime's backing-service access:\n * the CREDENTIALS apps-manager mints for it, the network MEMBERSHIP its container\n * gets, and the connection TOPOLOGY written into its environment. Each is\n * independently sufficient to deny, which is the point — but only while they\n * describe the same set.\n *\n * They are also each capable of silently disagreeing. A runtime kept off a\n * service's network while still receiving that service's connect URL is the worst\n * of the three combinations: `isConfigured()` reports true, a health probe or a\n * first use runs, and an unroutable host fails as a timeout for a runtime that was\n * never supposed to have the service at all. The fix is not a compensating branch\n * in a health check — it is that the two derive from HERE, so a non-declaring\n * runtime is never configured in the first place and there is nothing to\n * distinguish.\n *\n * So this is deliberately NOT a helper each consumer may reimplement \"for its own\n * needs\". Consumers call it; none re-derives. That is the whole anti-bypass\n * strategy, and the enumeration of who must call it lives in\n * `.claude/plans/minion-nature-and-authority.md` (Step 5-egress).\n *\n * ## The vocabulary is `InfraCapability`, not a new enum\n *\n * That is already what an infra provider module declares it supplies, so a\n * capability named here and a provider that serves it cannot drift into two\n * spellings of one concept.\n */\nexport interface RuntimeBackingServiceAccess {\n /**\n * Capabilities this runtime may reach. Empty is a legitimate, meaningful answer\n * — see the WORKER case — and must never be read as \"unspecified, allow all\".\n */\n readonly capabilities: ReadonlySet<InfraCapability>;\n /**\n * Whether this runtime needs a route off the host at all.\n *\n * Authored, never inferred: a scraper minion legitimately reaches the public\n * internet, and the point of the flag is not to refuse that but to stop egress\n * being universal and unstated. Default false, so the safe answer is the one you\n * get by not thinking about it.\n */\n readonly requiresInternetEgress: boolean;\n}\n\n/**\n * What a minion declares about its access to the application's data.\n *\n * Structural rather than importing the app-declaration type, so this contract does\n * not acquire the whole configuration graph for two fields.\n */\nexport interface RuntimeAccessDeclaration {\n /**\n * The minion's authored `resourceAccess`, or `undefined` when it declared none.\n *\n * The distinction is load-bearing and mirrors `deriveMinionResourceGrants`:\n * ABSENT means application-data access was never requested (D11/R3), so no\n * database credential is minted AND no database network is joined. An empty but\n * PRESENT declaration is a different statement and is not this.\n */\n readonly resourceAccess?: { read?: readonly string[]; write?: readonly string[] } | undefined;\n /** Authored opt-in; see {@link RuntimeBackingServiceAccess.requiresInternetEgress}. */\n readonly requiresInternetEgress?: boolean | undefined;\n}\n\n/**\n * Capabilities every MINION reaches regardless of what it declared.\n *\n * A minion is tick-driven and single-flighted: it consumes its tick queue and its\n * own RPC reply queue (QUEUING_SYSTEM) and holds a per-principal Redis namespace\n * (CACHE_MANAGER) used for its single-flight lease. Both credentials are minted\n * unconditionally for every minion today, so withholding either network would\n * strand a credential the platform issued — the incoherence this module exists to\n * prevent, arriving from the other direction.\n */\nconst MINION_UNCONDITIONAL_CAPABILITIES: readonly InfraCapability[] = [\n InfraCapability.QUEUING_SYSTEM,\n InfraCapability.CACHE_MANAGER,\n // Telemetry is unconditional for the same reason the platform segment is: every\n // runtime emits it, it carries no application data, and withholding it breaks\n // observability with NO signal — the collector appears in no readiness check, so\n // the failure surfaces as \"spans stopped\" long after the change that caused it.\n InfraCapability.METRICS_TELEMETRY,\n];\n\n/**\n * Capabilities a minion reaches ONLY when it declared application-data access.\n *\n * Both database kinds are listed because an application is backed by one or the\n * other and this layer does not know which; the consumer intersects with the\n * capabilities the application actually provisions. Listing only the provisioned\n * one here would make this function depend on infrastructure configuration to\n * answer a question about a DECLARATION.\n */\nconst MINION_DATA_CAPABILITIES: readonly InfraCapability[] = [\n InfraCapability.DOCUMENT_DATABASE,\n InfraCapability.RELATIONAL_DATABASE,\n InfraCapability.OBJECT_STORAGE,\n];\n\n/**\n * Derive a runtime's backing-service access from its principal and declaration.\n *\n * Fails CLOSED on every axis: an unknown principal kind, an absent declaration and\n * an absent `resourceAccess` all narrow rather than widen.\n */\nexport function resolveRuntimeBackingServiceAccess(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration?: RuntimeAccessDeclaration | undefined,\n): RuntimeBackingServiceAccess {\n const requiresInternetEgress = declaration?.requiresInternetEgress === true;\n\n switch (principal?.kind) {\n case ApplicationRuntimePrincipalKind.APPLICATION_BACKEND:\n // The general runtime: it serves every request the application exposes, so\n // its access is the application's own provisioned set rather than anything\n // narrowed here. Returning the full vocabulary and letting the consumer\n // intersect with what the app provisions keeps THIS function about\n // declarations and the consumer about infrastructure.\n return {\n capabilities: new Set(Object.values(InfraCapability)),\n requiresInternetEgress,\n };\n\n case ApplicationRuntimePrincipalKind.MINION: {\n const capabilities = new Set(MINION_UNCONDITIONAL_CAPABILITIES);\n // ABSENT resourceAccess ⇒ no data capability at all. Same gate, same\n // reasoning and the same source as the credential minting: a minion that\n // never asked for application data must not hold a credential to it, and\n // must not have a route to it either.\n if (declaration?.resourceAccess) {\n for (const capability of MINION_DATA_CAPABILITIES) capabilities.add(capability);\n }\n return { capabilities, requiresInternetEgress };\n }\n\n case ApplicationRuntimePrincipalKind.WORKER:\n // EMPTY, and this is a measured fact rather than a conservative guess: a\n // worker never boots the application lifecycle — it is standalone by design\n // with no backing-service access, which is why it has no member in\n // `ApplicationRuntimeProfile` at all. D22/KD-3 says the same thing from the\n // credential side. Segmentation turns that policy into a reachability fact\n // instead of a promise about what nobody remembered to inject.\n return { capabilities: new Set(), requiresInternetEgress };\n\n default:\n // An unrecognised or absent principal gets NOTHING. Every caller uses this\n // to decide how narrowly a runtime is confined, so a permissive default\n // would widen confinement silently — the one direction that cannot be\n // detected by anything downstream.\n return { capabilities: new Set(), requiresInternetEgress: false };\n }\n}\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';
|
|
2
|
+
import type { RuntimeAccessDeclaration } from './runtime-backing-service-access';
|
|
3
|
+
/**
|
|
4
|
+
* The Kubernetes rendering of {@link WildoRuntimeNetwork} (Step 5-egress, half A).
|
|
5
|
+
*
|
|
6
|
+
* ## Why labels rather than a policy per runtime
|
|
7
|
+
*
|
|
8
|
+
* Compose expresses segmentation as network MEMBERSHIP; Kubernetes has no such
|
|
9
|
+
* concept — every pod shares one flat pod network and `NetworkPolicy` selects on
|
|
10
|
+
* LABELS. So the same declaration renders two ways: a network list for Compose,
|
|
11
|
+
* and a label set plus a static policy per network for Kubernetes.
|
|
12
|
+
*
|
|
13
|
+
* Keeping the policies STATIC and putting the per-runtime part entirely in labels
|
|
14
|
+
* is what lets the cluster-level manifest generator emit them without knowing the
|
|
15
|
+
* application's runtime inventory — the reason a policy-per-runtime shape was
|
|
16
|
+
* rejected. It also means adding a minion changes only its own pod labels, never
|
|
17
|
+
* a cluster policy, so the two cannot drift out of sync as runtimes come and go.
|
|
18
|
+
*/
|
|
19
|
+
/** Label prefix marking which segment a pod participates in. */
|
|
20
|
+
export declare const RUNTIME_NETWORK_LABEL_PREFIX = "wildo.ai/net-";
|
|
21
|
+
/**
|
|
22
|
+
* Pod labels for a runtime, derived from the SAME call Compose membership uses.
|
|
23
|
+
*
|
|
24
|
+
* A label is only ever `'true'`; ABSENCE is what denies. That asymmetry is
|
|
25
|
+
* deliberate — `'false'` would be a value a selector could match by mistake, and
|
|
26
|
+
* a policy that allowed `net-mongo != 'true'` would admit every pod that simply
|
|
27
|
+
* never set the label.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildRuntimeNetworkPodLabels(principal: ApplicationRuntimePrincipal | undefined, declaration?: RuntimeAccessDeclaration | undefined, options?: {
|
|
30
|
+
readonly servesHttp?: boolean;
|
|
31
|
+
}): Record<string, string>;
|
|
32
|
+
/** A `NetworkPolicy` document, in the shape the manifest renderer serialises. */
|
|
33
|
+
export interface RuntimeNetworkPolicyDocument {
|
|
34
|
+
readonly apiVersion: 'networking.k8s.io/v1';
|
|
35
|
+
readonly kind: 'NetworkPolicy';
|
|
36
|
+
readonly metadata: {
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly namespace?: string;
|
|
39
|
+
};
|
|
40
|
+
readonly spec: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The static policy set for a namespace.
|
|
44
|
+
*
|
|
45
|
+
* Emits, in order:
|
|
46
|
+
*
|
|
47
|
+
* 1. **A default-deny for ingress AND egress.** Both, because an egress-only
|
|
48
|
+
* policy still lets an unlabelled pod be REACHED, and the pair is what makes
|
|
49
|
+
* absence-of-label mean denial.
|
|
50
|
+
* 2. **One ingress policy per INTERNAL network**, admitting only pods carrying
|
|
51
|
+
* that network's label. The backing service itself is selected by the same
|
|
52
|
+
* label, so a service and its clients are described by one string.
|
|
53
|
+
* 3. **One egress policy for `wildo-egress`**, the only door off the cluster
|
|
54
|
+
* below the edge, admitting only pods that AUTHORED the need.
|
|
55
|
+
*
|
|
56
|
+
* ⚠️ The default-deny is inert until pods carry labels from
|
|
57
|
+
* {@link buildRuntimeNetworkPodLabels}. Emitting the policies WITHOUT wiring the
|
|
58
|
+
* labels would deny everything at the first deployment — so the two must land in
|
|
59
|
+
* the same change. This is the reverse of the usual vacuity trap: not a control
|
|
60
|
+
* that enforces nothing, but a control that enforces everything.
|
|
61
|
+
*/
|
|
62
|
+
export declare function buildRuntimeNetworkPolicyDocuments(namespace?: string): readonly RuntimeNetworkPolicyDocument[];
|
|
63
|
+
//# sourceMappingURL=runtime-network-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-network-policy.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-network-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAOjF;;;;;;;;;;;;;;;GAeG;AAEH,gEAAgE;AAChE,eAAO,MAAM,4BAA4B,kBAAkB,CAAC;AAE5D;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,2BAA2B,GAAG,SAAS,EAClD,WAAW,CAAC,EAAE,wBAAwB,GAAG,SAAS,EAClD,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAC1C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxB;AAED,iFAAiF;AACjF,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kCAAkC,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,4BAA4B,EAAE,CAoD9G"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { WildoRuntimeNetwork, isInternalNetwork, resolveRuntimeNetworkMembership, } from './runtime-network-topology.js';
|
|
2
|
+
/**
|
|
3
|
+
* The Kubernetes rendering of {@link WildoRuntimeNetwork} (Step 5-egress, half A).
|
|
4
|
+
*
|
|
5
|
+
* ## Why labels rather than a policy per runtime
|
|
6
|
+
*
|
|
7
|
+
* Compose expresses segmentation as network MEMBERSHIP; Kubernetes has no such
|
|
8
|
+
* concept — every pod shares one flat pod network and `NetworkPolicy` selects on
|
|
9
|
+
* LABELS. So the same declaration renders two ways: a network list for Compose,
|
|
10
|
+
* and a label set plus a static policy per network for Kubernetes.
|
|
11
|
+
*
|
|
12
|
+
* Keeping the policies STATIC and putting the per-runtime part entirely in labels
|
|
13
|
+
* is what lets the cluster-level manifest generator emit them without knowing the
|
|
14
|
+
* application's runtime inventory — the reason a policy-per-runtime shape was
|
|
15
|
+
* rejected. It also means adding a minion changes only its own pod labels, never
|
|
16
|
+
* a cluster policy, so the two cannot drift out of sync as runtimes come and go.
|
|
17
|
+
*/
|
|
18
|
+
/** Label prefix marking which segment a pod participates in. */
|
|
19
|
+
export const RUNTIME_NETWORK_LABEL_PREFIX = 'wildo.ai/net-';
|
|
20
|
+
/**
|
|
21
|
+
* Pod labels for a runtime, derived from the SAME call Compose membership uses.
|
|
22
|
+
*
|
|
23
|
+
* A label is only ever `'true'`; ABSENCE is what denies. That asymmetry is
|
|
24
|
+
* deliberate — `'false'` would be a value a selector could match by mistake, and
|
|
25
|
+
* a policy that allowed `net-mongo != 'true'` would admit every pod that simply
|
|
26
|
+
* never set the label.
|
|
27
|
+
*/
|
|
28
|
+
export function buildRuntimeNetworkPodLabels(principal, declaration, options) {
|
|
29
|
+
const labels = {};
|
|
30
|
+
for (const network of resolveRuntimeNetworkMembership(principal, declaration, options)) {
|
|
31
|
+
labels[`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`] = 'true';
|
|
32
|
+
}
|
|
33
|
+
return labels;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The static policy set for a namespace.
|
|
37
|
+
*
|
|
38
|
+
* Emits, in order:
|
|
39
|
+
*
|
|
40
|
+
* 1. **A default-deny for ingress AND egress.** Both, because an egress-only
|
|
41
|
+
* policy still lets an unlabelled pod be REACHED, and the pair is what makes
|
|
42
|
+
* absence-of-label mean denial.
|
|
43
|
+
* 2. **One ingress policy per INTERNAL network**, admitting only pods carrying
|
|
44
|
+
* that network's label. The backing service itself is selected by the same
|
|
45
|
+
* label, so a service and its clients are described by one string.
|
|
46
|
+
* 3. **One egress policy for `wildo-egress`**, the only door off the cluster
|
|
47
|
+
* below the edge, admitting only pods that AUTHORED the need.
|
|
48
|
+
*
|
|
49
|
+
* ⚠️ The default-deny is inert until pods carry labels from
|
|
50
|
+
* {@link buildRuntimeNetworkPodLabels}. Emitting the policies WITHOUT wiring the
|
|
51
|
+
* labels would deny everything at the first deployment — so the two must land in
|
|
52
|
+
* the same change. This is the reverse of the usual vacuity trap: not a control
|
|
53
|
+
* that enforces nothing, but a control that enforces everything.
|
|
54
|
+
*/
|
|
55
|
+
export function buildRuntimeNetworkPolicyDocuments(namespace) {
|
|
56
|
+
const meta = (name) => namespace ? { name, namespace } : { name };
|
|
57
|
+
const documents = [
|
|
58
|
+
{
|
|
59
|
+
apiVersion: 'networking.k8s.io/v1',
|
|
60
|
+
kind: 'NetworkPolicy',
|
|
61
|
+
metadata: meta('wildo-default-deny'),
|
|
62
|
+
// An empty podSelector selects EVERY pod in the namespace; naming both
|
|
63
|
+
// policy types with no rules denies both directions.
|
|
64
|
+
spec: { podSelector: {}, policyTypes: ['Ingress', 'Egress'] },
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
for (const network of Object.values(WildoRuntimeNetwork)) {
|
|
68
|
+
if (!isInternalNetwork(network))
|
|
69
|
+
continue;
|
|
70
|
+
documents.push({
|
|
71
|
+
apiVersion: 'networking.k8s.io/v1',
|
|
72
|
+
kind: 'NetworkPolicy',
|
|
73
|
+
metadata: meta(`wildo-allow-${network}`),
|
|
74
|
+
spec: {
|
|
75
|
+
podSelector: { matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' } },
|
|
76
|
+
policyTypes: ['Ingress'],
|
|
77
|
+
ingress: [
|
|
78
|
+
{
|
|
79
|
+
from: [
|
|
80
|
+
{ podSelector: { matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' } } },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
documents.push({
|
|
88
|
+
apiVersion: 'networking.k8s.io/v1',
|
|
89
|
+
kind: 'NetworkPolicy',
|
|
90
|
+
metadata: meta(`wildo-allow-${WildoRuntimeNetwork.EGRESS}`),
|
|
91
|
+
spec: {
|
|
92
|
+
podSelector: {
|
|
93
|
+
matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${WildoRuntimeNetwork.EGRESS}`]: 'true' },
|
|
94
|
+
},
|
|
95
|
+
policyTypes: ['Egress'],
|
|
96
|
+
// Unrestricted destination, deliberately: this is the AUTHORED door, and
|
|
97
|
+
// narrowing it by CIDR would be a claim about the internet nobody can keep
|
|
98
|
+
// current. What the declaration buys is that the door is not universal.
|
|
99
|
+
egress: [{}],
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
return documents;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=runtime-network-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-network-policy.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-network-policy.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;;;;GAeG;AAEH,gEAAgE;AAChE,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAC1C,SAAkD,EAClD,WAAkD,EAClD,OAA2C;IAE3C,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,OAAO,IAAI,+BAA+B,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;QACvF,MAAM,CAAC,GAAG,4BAA4B,GAAG,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC;IAC/D,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAUD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,kCAAkC,CAAC,SAAkB;IACnE,MAAM,IAAI,GAAG,CAAC,IAAY,EAA4C,EAAE,CACtE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IAE7C,MAAM,SAAS,GAAmC;QAChD;YACE,UAAU,EAAE,sBAAsB;YAClC,IAAI,EAAE,eAAe;YACrB,QAAQ,EAAE,IAAI,CAAC,oBAAoB,CAAC;YACpC,uEAAuE;YACvE,qDAAqD;YACrD,IAAI,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE;SAC9D;KACF,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACzD,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;YAAE,SAAS;QAC1C,SAAS,CAAC,IAAI,CAAC;YACb,UAAU,EAAE,sBAAsB;YAClC,IAAI,EAAE,eAAe;YACrB,QAAQ,EAAE,IAAI,CAAC,eAAe,OAAO,EAAE,CAAC;YACxC,IAAI,EAAE;gBACJ,WAAW,EAAE,EAAE,WAAW,EAAE,EAAE,CAAC,GAAG,4BAA4B,GAAG,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE;gBACvF,WAAW,EAAE,CAAC,SAAS,CAAC;gBACxB,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE;4BACJ,EAAE,WAAW,EAAE,EAAE,WAAW,EAAE,EAAE,CAAC,GAAG,4BAA4B,GAAG,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;yBAC5F;qBACF;iBACF;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAED,SAAS,CAAC,IAAI,CAAC;QACb,UAAU,EAAE,sBAAsB;QAClC,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,IAAI,CAAC,eAAe,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAC3D,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,WAAW,EAAE,EAAE,CAAC,GAAG,4BAA4B,GAAG,mBAAmB,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE;aAC1F;YACD,WAAW,EAAE,CAAC,QAAQ,CAAC;YACvB,yEAAyE;YACzE,2EAA2E;YAC3E,wEAAwE;YACxE,MAAM,EAAE,CAAC,EAAE,CAAC;SACb;KACF,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';\nimport type { RuntimeAccessDeclaration } from './runtime-backing-service-access';\nimport {\n WildoRuntimeNetwork,\n isInternalNetwork,\n resolveRuntimeNetworkMembership,\n} from './runtime-network-topology';\n\n/**\n * The Kubernetes rendering of {@link WildoRuntimeNetwork} (Step 5-egress, half A).\n *\n * ## Why labels rather than a policy per runtime\n *\n * Compose expresses segmentation as network MEMBERSHIP; Kubernetes has no such\n * concept — every pod shares one flat pod network and `NetworkPolicy` selects on\n * LABELS. So the same declaration renders two ways: a network list for Compose,\n * and a label set plus a static policy per network for Kubernetes.\n *\n * Keeping the policies STATIC and putting the per-runtime part entirely in labels\n * is what lets the cluster-level manifest generator emit them without knowing the\n * application's runtime inventory — the reason a policy-per-runtime shape was\n * rejected. It also means adding a minion changes only its own pod labels, never\n * a cluster policy, so the two cannot drift out of sync as runtimes come and go.\n */\n\n/** Label prefix marking which segment a pod participates in. */\nexport const RUNTIME_NETWORK_LABEL_PREFIX = 'wildo.ai/net-';\n\n/**\n * Pod labels for a runtime, derived from the SAME call Compose membership uses.\n *\n * A label is only ever `'true'`; ABSENCE is what denies. That asymmetry is\n * deliberate — `'false'` would be a value a selector could match by mistake, and\n * a policy that allowed `net-mongo != 'true'` would admit every pod that simply\n * never set the label.\n */\nexport function buildRuntimeNetworkPodLabels(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration?: RuntimeAccessDeclaration | undefined,\n options?: { readonly servesHttp?: boolean },\n): Record<string, string> {\n const labels: Record<string, string> = {};\n for (const network of resolveRuntimeNetworkMembership(principal, declaration, options)) {\n labels[`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`] = 'true';\n }\n return labels;\n}\n\n/** A `NetworkPolicy` document, in the shape the manifest renderer serialises. */\nexport interface RuntimeNetworkPolicyDocument {\n readonly apiVersion: 'networking.k8s.io/v1';\n readonly kind: 'NetworkPolicy';\n readonly metadata: { readonly name: string; readonly namespace?: string };\n readonly spec: Record<string, unknown>;\n}\n\n/**\n * The static policy set for a namespace.\n *\n * Emits, in order:\n *\n * 1. **A default-deny for ingress AND egress.** Both, because an egress-only\n * policy still lets an unlabelled pod be REACHED, and the pair is what makes\n * absence-of-label mean denial.\n * 2. **One ingress policy per INTERNAL network**, admitting only pods carrying\n * that network's label. The backing service itself is selected by the same\n * label, so a service and its clients are described by one string.\n * 3. **One egress policy for `wildo-egress`**, the only door off the cluster\n * below the edge, admitting only pods that AUTHORED the need.\n *\n * ⚠️ The default-deny is inert until pods carry labels from\n * {@link buildRuntimeNetworkPodLabels}. Emitting the policies WITHOUT wiring the\n * labels would deny everything at the first deployment — so the two must land in\n * the same change. This is the reverse of the usual vacuity trap: not a control\n * that enforces nothing, but a control that enforces everything.\n */\nexport function buildRuntimeNetworkPolicyDocuments(namespace?: string): readonly RuntimeNetworkPolicyDocument[] {\n const meta = (name: string): RuntimeNetworkPolicyDocument['metadata'] =>\n namespace ? { name, namespace } : { name };\n\n const documents: RuntimeNetworkPolicyDocument[] = [\n {\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta('wildo-default-deny'),\n // An empty podSelector selects EVERY pod in the namespace; naming both\n // policy types with no rules denies both directions.\n spec: { podSelector: {}, policyTypes: ['Ingress', 'Egress'] },\n },\n ];\n\n for (const network of Object.values(WildoRuntimeNetwork)) {\n if (!isInternalNetwork(network)) continue;\n documents.push({\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(`wildo-allow-${network}`),\n spec: {\n podSelector: { matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' } },\n policyTypes: ['Ingress'],\n ingress: [\n {\n from: [\n { podSelector: { matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' } } },\n ],\n },\n ],\n },\n });\n }\n\n documents.push({\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(`wildo-allow-${WildoRuntimeNetwork.EGRESS}`),\n spec: {\n podSelector: {\n matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${WildoRuntimeNetwork.EGRESS}`]: 'true' },\n },\n policyTypes: ['Egress'],\n // Unrestricted destination, deliberately: this is the AUTHORED door, and\n // narrowing it by CIDR would be a claim about the internet nobody can keep\n // current. What the declaration buys is that the door is not universal.\n egress: [{}],\n },\n });\n\n return documents;\n}\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { InfraCapability } from '../project-config/shared/infra-providers.schemas';
|
|
2
|
+
import type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';
|
|
3
|
+
import { type RuntimeAccessDeclaration } from './runtime-backing-service-access';
|
|
4
|
+
/**
|
|
5
|
+
* The network segments a Wildo deployment is divided into (Step 5-egress).
|
|
6
|
+
*
|
|
7
|
+
* Docker Compose has no `NetworkPolicy` object, but it has the mechanism that
|
|
8
|
+
* matters for the destination half: membership of user-defined bridge networks,
|
|
9
|
+
* with per-network embedded DNS. A container not attached to a network can
|
|
10
|
+
* neither resolve nor route to the services on it — deny-by-default at the
|
|
11
|
+
* network level. Kubernetes expresses the same division as `NetworkPolicy`
|
|
12
|
+
* egress rules. Both renderers derive from THIS enum so they cannot describe
|
|
13
|
+
* different topologies.
|
|
14
|
+
*/
|
|
15
|
+
export declare enum WildoRuntimeNetwork {
|
|
16
|
+
/** Reverse proxy + every container serving HTTP. Not internal: it faces the world. */
|
|
17
|
+
EDGE = "wildo-edge",
|
|
18
|
+
/**
|
|
19
|
+
* The control plane — apps-manager, module-registry, crontabs — plus every
|
|
20
|
+
* runtime that must fetch its secrets and configuration. Internal: nothing here
|
|
21
|
+
* needs a route off the host.
|
|
22
|
+
*/
|
|
23
|
+
PLATFORM = "wildo-platform",
|
|
24
|
+
DATA_MONGO = "wildo-data-mongo",
|
|
25
|
+
DATA_POSTGRES = "wildo-data-postgres",
|
|
26
|
+
DATA_REDIS = "wildo-data-redis",
|
|
27
|
+
DATA_RABBIT = "wildo-data-rabbit",
|
|
28
|
+
DATA_OBJECTS = "wildo-data-objects",
|
|
29
|
+
DATA_ANTIVIRUS = "wildo-data-antivirus",
|
|
30
|
+
DATA_RENDERING = "wildo-data-rendering",
|
|
31
|
+
/** Tamper-evident audit-log storage (immudb) — a service of its own, not a database table. */
|
|
32
|
+
DATA_AUDIT = "wildo-data-audit",
|
|
33
|
+
/** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */
|
|
34
|
+
DATA_TELEMETRY = "wildo-data-telemetry",
|
|
35
|
+
/**
|
|
36
|
+
* The ONLY non-internal network below the edge. Attachment to any non-internal
|
|
37
|
+
* network restores NAT, so "can this runtime reach the internet?" is decided
|
|
38
|
+
* here and nowhere else — marking the data networks internal is necessary but
|
|
39
|
+
* not sufficient.
|
|
40
|
+
*/
|
|
41
|
+
EGRESS = "wildo-egress"
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Which network serves each backing-service capability.
|
|
45
|
+
*
|
|
46
|
+
* A total `Record`, deliberately: adding a member to {@link InfraCapability}
|
|
47
|
+
* becomes a COMPILE ERROR here rather than a capability that silently reaches no
|
|
48
|
+
* network — or worse, one whose runtimes silently keep the flat-network
|
|
49
|
+
* reachability this segmentation exists to remove. `null` means the capability
|
|
50
|
+
* needs no network of its own, and every `null` states why.
|
|
51
|
+
*/
|
|
52
|
+
export declare const NETWORK_FOR_CAPABILITY: Record<InfraCapability, WildoRuntimeNetwork | null>;
|
|
53
|
+
/**
|
|
54
|
+
* The networks a runtime's container joins.
|
|
55
|
+
*
|
|
56
|
+
* Derived from the SAME declaration as its credentials and its environment
|
|
57
|
+
* topology — see {@link resolveRuntimeBackingServiceAccess}. That is the whole
|
|
58
|
+
* point: a runtime kept off a service's network must also not hold that service's
|
|
59
|
+
* credential nor receive its connect URL, and the only way three enforcement
|
|
60
|
+
* points stay in agreement is by not deriving the answer three times.
|
|
61
|
+
*
|
|
62
|
+
* `PLATFORM` is unconditional. Every runtime — including a worker, which holds no
|
|
63
|
+
* backing-service credentials at all — must reach apps-manager to fetch its own
|
|
64
|
+
* bootstrap material. Withholding it would strand every runtime at boot, and it
|
|
65
|
+
* grants no application data.
|
|
66
|
+
*/
|
|
67
|
+
export declare function resolveRuntimeNetworkMembership(principal: ApplicationRuntimePrincipal | undefined, declaration?: RuntimeAccessDeclaration | undefined, options?: {
|
|
68
|
+
readonly servesHttp?: boolean;
|
|
69
|
+
}): ReadonlySet<WildoRuntimeNetwork>;
|
|
70
|
+
/**
|
|
71
|
+
* Networks that must be declared `internal: true`.
|
|
72
|
+
*
|
|
73
|
+
* Derived by EXCLUSION from the two that legitimately carry a route off the host,
|
|
74
|
+
* so a network added to the enum is internal by default. The safe posture is the
|
|
75
|
+
* one you get by not thinking about it.
|
|
76
|
+
*/
|
|
77
|
+
export declare function isInternalNetwork(network: WildoRuntimeNetwork): boolean;
|
|
78
|
+
//# sourceMappingURL=runtime-network-topology.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-network-topology.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-network-topology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,oBAAY,mBAAmB;IAC7B,sFAAsF;IACtF,IAAI,eAAe;IACnB;;;;OAIG;IACH,QAAQ,mBAAmB;IAC3B,UAAU,qBAAqB;IAC/B,aAAa,wBAAwB;IACrC,UAAU,qBAAqB;IAC/B,WAAW,sBAAsB;IACjC,YAAY,uBAAuB;IACnC,cAAc,yBAAyB;IACvC,cAAc,yBAAyB;IACvC,8FAA8F;IAC9F,UAAU,qBAAqB;IAC/B,0FAA0F;IAC1F,cAAc,yBAAyB;IACvC;;;;;OAKG;IACH,MAAM,iBAAiB;CACxB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,eAAe,EAAE,mBAAmB,GAAG,IAAI,CAyBtF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,2BAA2B,GAAG,SAAS,EAClD,WAAW,CAAC,EAAE,wBAAwB,GAAG,SAAS,EAClD,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAC1C,WAAW,CAAC,mBAAmB,CAAC,CAgClC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAEvE"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { InfraCapability } from '../project-config/shared/infra-providers.schemas.js';
|
|
2
|
+
import { resolveRuntimeBackingServiceAccess, } from './runtime-backing-service-access.js';
|
|
3
|
+
/**
|
|
4
|
+
* The network segments a Wildo deployment is divided into (Step 5-egress).
|
|
5
|
+
*
|
|
6
|
+
* Docker Compose has no `NetworkPolicy` object, but it has the mechanism that
|
|
7
|
+
* matters for the destination half: membership of user-defined bridge networks,
|
|
8
|
+
* with per-network embedded DNS. A container not attached to a network can
|
|
9
|
+
* neither resolve nor route to the services on it — deny-by-default at the
|
|
10
|
+
* network level. Kubernetes expresses the same division as `NetworkPolicy`
|
|
11
|
+
* egress rules. Both renderers derive from THIS enum so they cannot describe
|
|
12
|
+
* different topologies.
|
|
13
|
+
*/
|
|
14
|
+
export var WildoRuntimeNetwork;
|
|
15
|
+
(function (WildoRuntimeNetwork) {
|
|
16
|
+
/** Reverse proxy + every container serving HTTP. Not internal: it faces the world. */
|
|
17
|
+
WildoRuntimeNetwork["EDGE"] = "wildo-edge";
|
|
18
|
+
/**
|
|
19
|
+
* The control plane — apps-manager, module-registry, crontabs — plus every
|
|
20
|
+
* runtime that must fetch its secrets and configuration. Internal: nothing here
|
|
21
|
+
* needs a route off the host.
|
|
22
|
+
*/
|
|
23
|
+
WildoRuntimeNetwork["PLATFORM"] = "wildo-platform";
|
|
24
|
+
WildoRuntimeNetwork["DATA_MONGO"] = "wildo-data-mongo";
|
|
25
|
+
WildoRuntimeNetwork["DATA_POSTGRES"] = "wildo-data-postgres";
|
|
26
|
+
WildoRuntimeNetwork["DATA_REDIS"] = "wildo-data-redis";
|
|
27
|
+
WildoRuntimeNetwork["DATA_RABBIT"] = "wildo-data-rabbit";
|
|
28
|
+
WildoRuntimeNetwork["DATA_OBJECTS"] = "wildo-data-objects";
|
|
29
|
+
WildoRuntimeNetwork["DATA_ANTIVIRUS"] = "wildo-data-antivirus";
|
|
30
|
+
WildoRuntimeNetwork["DATA_RENDERING"] = "wildo-data-rendering";
|
|
31
|
+
/** Tamper-evident audit-log storage (immudb) — a service of its own, not a database table. */
|
|
32
|
+
WildoRuntimeNetwork["DATA_AUDIT"] = "wildo-data-audit";
|
|
33
|
+
/** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */
|
|
34
|
+
WildoRuntimeNetwork["DATA_TELEMETRY"] = "wildo-data-telemetry";
|
|
35
|
+
/**
|
|
36
|
+
* The ONLY non-internal network below the edge. Attachment to any non-internal
|
|
37
|
+
* network restores NAT, so "can this runtime reach the internet?" is decided
|
|
38
|
+
* here and nowhere else — marking the data networks internal is necessary but
|
|
39
|
+
* not sufficient.
|
|
40
|
+
*/
|
|
41
|
+
WildoRuntimeNetwork["EGRESS"] = "wildo-egress";
|
|
42
|
+
})(WildoRuntimeNetwork || (WildoRuntimeNetwork = {}));
|
|
43
|
+
/**
|
|
44
|
+
* Which network serves each backing-service capability.
|
|
45
|
+
*
|
|
46
|
+
* A total `Record`, deliberately: adding a member to {@link InfraCapability}
|
|
47
|
+
* becomes a COMPILE ERROR here rather than a capability that silently reaches no
|
|
48
|
+
* network — or worse, one whose runtimes silently keep the flat-network
|
|
49
|
+
* reachability this segmentation exists to remove. `null` means the capability
|
|
50
|
+
* needs no network of its own, and every `null` states why.
|
|
51
|
+
*/
|
|
52
|
+
export const NETWORK_FOR_CAPABILITY = {
|
|
53
|
+
[InfraCapability.DOCUMENT_DATABASE]: WildoRuntimeNetwork.DATA_MONGO,
|
|
54
|
+
[InfraCapability.RELATIONAL_DATABASE]: WildoRuntimeNetwork.DATA_POSTGRES,
|
|
55
|
+
[InfraCapability.CACHE_MANAGER]: WildoRuntimeNetwork.DATA_REDIS,
|
|
56
|
+
[InfraCapability.QUEUING_SYSTEM]: WildoRuntimeNetwork.DATA_RABBIT,
|
|
57
|
+
[InfraCapability.OBJECT_STORAGE]: WildoRuntimeNetwork.DATA_OBJECTS,
|
|
58
|
+
[InfraCapability.ANTIVIRUS_SCANNING]: WildoRuntimeNetwork.DATA_ANTIVIRUS,
|
|
59
|
+
[InfraCapability.DOCUMENT_RENDERING]: WildoRuntimeNetwork.DATA_RENDERING,
|
|
60
|
+
// ⚠️ CORRECTED 2026-08-12. Both of the entries below were `null`, on reasoning
|
|
61
|
+
// that measurement disproved while building the 5B service table:
|
|
62
|
+
//
|
|
63
|
+
// - AUDIT_LOG_STORAGE was "served BY the document/relational database". It is
|
|
64
|
+
// not: `immudb` is a service of its own, with its own container, and a
|
|
65
|
+
// runtime that writes audit records dials IT rather than a database table.
|
|
66
|
+
// - METRICS_TELEMETRY was "no application runtime dials them directly today".
|
|
67
|
+
// Also false — runtimes emit spans and metrics to the collector, and that
|
|
68
|
+
// traffic is live in development. A `null` here would have cut tracing for
|
|
69
|
+
// every runtime the moment segmentation was enforced, with NO readiness
|
|
70
|
+
// check covering it: a first-use failure, silent until someone noticed spans
|
|
71
|
+
// had stopped.
|
|
72
|
+
[InfraCapability.AUDIT_LOG_STORAGE]: WildoRuntimeNetwork.DATA_AUDIT,
|
|
73
|
+
[InfraCapability.METRICS_TELEMETRY]: WildoRuntimeNetwork.DATA_TELEMETRY,
|
|
74
|
+
// Backup remains genuinely operator-side: no application runtime dials it, and
|
|
75
|
+
// the backup tooling runs outside the application's network entirely.
|
|
76
|
+
[InfraCapability.BACKUP_MANAGER]: null,
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* The networks a runtime's container joins.
|
|
80
|
+
*
|
|
81
|
+
* Derived from the SAME declaration as its credentials and its environment
|
|
82
|
+
* topology — see {@link resolveRuntimeBackingServiceAccess}. That is the whole
|
|
83
|
+
* point: a runtime kept off a service's network must also not hold that service's
|
|
84
|
+
* credential nor receive its connect URL, and the only way three enforcement
|
|
85
|
+
* points stay in agreement is by not deriving the answer three times.
|
|
86
|
+
*
|
|
87
|
+
* `PLATFORM` is unconditional. Every runtime — including a worker, which holds no
|
|
88
|
+
* backing-service credentials at all — must reach apps-manager to fetch its own
|
|
89
|
+
* bootstrap material. Withholding it would strand every runtime at boot, and it
|
|
90
|
+
* grants no application data.
|
|
91
|
+
*/
|
|
92
|
+
export function resolveRuntimeNetworkMembership(principal, declaration, options) {
|
|
93
|
+
const access = resolveRuntimeBackingServiceAccess(principal, declaration);
|
|
94
|
+
const networks = new Set();
|
|
95
|
+
// PLATFORM is for runtimes that FETCH their own bootstrap material — every
|
|
96
|
+
// runtime principal does, including a worker that holds no backing-service
|
|
97
|
+
// credentials at all. A caller with NO principal is not a runtime principal:
|
|
98
|
+
// today that is the static frontend, an nginx container that authenticates to
|
|
99
|
+
// nothing and has no bootstrap material to fetch.
|
|
100
|
+
//
|
|
101
|
+
// This was previously unconditional, which put that frontend on the platform
|
|
102
|
+
// segment. Harmless — the segment carries no application data and the container
|
|
103
|
+
// could not authenticate anyway — but it is reachability nobody asked for, and
|
|
104
|
+
// "unconditional because every case so far needed it" is exactly the default a
|
|
105
|
+
// later reader assumes was measured.
|
|
106
|
+
if (principal)
|
|
107
|
+
networks.add(WildoRuntimeNetwork.PLATFORM);
|
|
108
|
+
for (const capability of access.capabilities) {
|
|
109
|
+
const network = NETWORK_FOR_CAPABILITY[capability];
|
|
110
|
+
if (network)
|
|
111
|
+
networks.add(network);
|
|
112
|
+
}
|
|
113
|
+
// Serving HTTP is a property of the DEPLOYMENT (does a proxy route to it?),
|
|
114
|
+
// not of what the runtime declared, so it arrives separately rather than being
|
|
115
|
+
// inferred from the principal kind — an application backend that serves no
|
|
116
|
+
// public route should not be on the edge merely for being a backend.
|
|
117
|
+
if (options?.servesHttp)
|
|
118
|
+
networks.add(WildoRuntimeNetwork.EDGE);
|
|
119
|
+
// Authored, never inferred. See `RuntimeBackingServiceAccess`.
|
|
120
|
+
if (access.requiresInternetEgress)
|
|
121
|
+
networks.add(WildoRuntimeNetwork.EGRESS);
|
|
122
|
+
return networks;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Networks that must be declared `internal: true`.
|
|
126
|
+
*
|
|
127
|
+
* Derived by EXCLUSION from the two that legitimately carry a route off the host,
|
|
128
|
+
* so a network added to the enum is internal by default. The safe posture is the
|
|
129
|
+
* one you get by not thinking about it.
|
|
130
|
+
*/
|
|
131
|
+
export function isInternalNetwork(network) {
|
|
132
|
+
return network !== WildoRuntimeNetwork.EDGE && network !== WildoRuntimeNetwork.EGRESS;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=runtime-network-topology.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-network-topology.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-network-topology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EACL,kCAAkC,GAEnC,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,mBA2BX;AA3BD,WAAY,mBAAmB;IAC7B,sFAAsF;IACtF,0CAAmB,CAAA;IACnB;;;;OAIG;IACH,kDAA2B,CAAA;IAC3B,sDAA+B,CAAA;IAC/B,4DAAqC,CAAA;IACrC,sDAA+B,CAAA;IAC/B,wDAAiC,CAAA;IACjC,0DAAmC,CAAA;IACnC,8DAAuC,CAAA;IACvC,8DAAuC,CAAA;IACvC,8FAA8F;IAC9F,sDAA+B,CAAA;IAC/B,0FAA0F;IAC1F,8DAAuC,CAAA;IACvC;;;;;OAKG;IACH,8CAAuB,CAAA;AACzB,CAAC,EA3BW,mBAAmB,KAAnB,mBAAmB,QA2B9B;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAwD;IACzF,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,CAAC,UAAU;IACnE,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC,aAAa;IACxE,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,mBAAmB,CAAC,UAAU;IAC/D,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC,WAAW;IACjE,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC,YAAY;IAClE,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,mBAAmB,CAAC,cAAc;IACxE,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,mBAAmB,CAAC,cAAc;IACxE,+EAA+E;IAC/E,kEAAkE;IAClE,EAAE;IACF,+EAA+E;IAC/E,0EAA0E;IAC1E,8EAA8E;IAC9E,+EAA+E;IAC/E,6EAA6E;IAC7E,8EAA8E;IAC9E,2EAA2E;IAC3E,gFAAgF;IAChF,kBAAkB;IAClB,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,CAAC,UAAU;IACnE,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,CAAC,cAAc;IACvE,+EAA+E;IAC/E,sEAAsE;IACtE,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,IAAI;CACvC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,+BAA+B,CAC7C,SAAkD,EAClD,WAAkD,EAClD,OAA2C;IAE3C,MAAM,MAAM,GAAG,kCAAkC,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;IAEhD,2EAA2E;IAC3E,2EAA2E;IAC3E,6EAA6E;IAC7E,8EAA8E;IAC9E,kDAAkD;IAClD,EAAE;IACF,6EAA6E;IAC7E,gFAAgF;IAChF,+EAA+E;IAC/E,+EAA+E;IAC/E,qCAAqC;IACrC,IAAI,SAAS;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAE1D,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;QACnD,IAAI,OAAO;YAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,4EAA4E;IAC5E,+EAA+E;IAC/E,2EAA2E;IAC3E,qEAAqE;IACrE,IAAI,OAAO,EAAE,UAAU;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAEhE,+DAA+D;IAC/D,IAAI,MAAM,CAAC,sBAAsB;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAE5E,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA4B;IAC5D,OAAO,OAAO,KAAK,mBAAmB,CAAC,IAAI,IAAI,OAAO,KAAK,mBAAmB,CAAC,MAAM,CAAC;AACxF,CAAC","sourcesContent":["import { InfraCapability } from '../project-config/shared/infra-providers.schemas';\nimport type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';\nimport {\n resolveRuntimeBackingServiceAccess,\n type RuntimeAccessDeclaration,\n} from './runtime-backing-service-access';\n\n/**\n * The network segments a Wildo deployment is divided into (Step 5-egress).\n *\n * Docker Compose has no `NetworkPolicy` object, but it has the mechanism that\n * matters for the destination half: membership of user-defined bridge networks,\n * with per-network embedded DNS. A container not attached to a network can\n * neither resolve nor route to the services on it — deny-by-default at the\n * network level. Kubernetes expresses the same division as `NetworkPolicy`\n * egress rules. Both renderers derive from THIS enum so they cannot describe\n * different topologies.\n */\nexport enum WildoRuntimeNetwork {\n /** Reverse proxy + every container serving HTTP. Not internal: it faces the world. */\n EDGE = 'wildo-edge',\n /**\n * The control plane — apps-manager, module-registry, crontabs — plus every\n * runtime that must fetch its secrets and configuration. Internal: nothing here\n * needs a route off the host.\n */\n PLATFORM = 'wildo-platform',\n DATA_MONGO = 'wildo-data-mongo',\n DATA_POSTGRES = 'wildo-data-postgres',\n DATA_REDIS = 'wildo-data-redis',\n DATA_RABBIT = 'wildo-data-rabbit',\n DATA_OBJECTS = 'wildo-data-objects',\n DATA_ANTIVIRUS = 'wildo-data-antivirus',\n DATA_RENDERING = 'wildo-data-rendering',\n /** Tamper-evident audit-log storage (immudb) — a service of its own, not a database table. */\n DATA_AUDIT = 'wildo-data-audit',\n /** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */\n DATA_TELEMETRY = 'wildo-data-telemetry',\n /**\n * The ONLY non-internal network below the edge. Attachment to any non-internal\n * network restores NAT, so \"can this runtime reach the internet?\" is decided\n * here and nowhere else — marking the data networks internal is necessary but\n * not sufficient.\n */\n EGRESS = 'wildo-egress',\n}\n\n/**\n * Which network serves each backing-service capability.\n *\n * A total `Record`, deliberately: adding a member to {@link InfraCapability}\n * becomes a COMPILE ERROR here rather than a capability that silently reaches no\n * network — or worse, one whose runtimes silently keep the flat-network\n * reachability this segmentation exists to remove. `null` means the capability\n * needs no network of its own, and every `null` states why.\n */\nexport const NETWORK_FOR_CAPABILITY: Record<InfraCapability, WildoRuntimeNetwork | null> = {\n [InfraCapability.DOCUMENT_DATABASE]: WildoRuntimeNetwork.DATA_MONGO,\n [InfraCapability.RELATIONAL_DATABASE]: WildoRuntimeNetwork.DATA_POSTGRES,\n [InfraCapability.CACHE_MANAGER]: WildoRuntimeNetwork.DATA_REDIS,\n [InfraCapability.QUEUING_SYSTEM]: WildoRuntimeNetwork.DATA_RABBIT,\n [InfraCapability.OBJECT_STORAGE]: WildoRuntimeNetwork.DATA_OBJECTS,\n [InfraCapability.ANTIVIRUS_SCANNING]: WildoRuntimeNetwork.DATA_ANTIVIRUS,\n [InfraCapability.DOCUMENT_RENDERING]: WildoRuntimeNetwork.DATA_RENDERING,\n // ⚠️ CORRECTED 2026-08-12. Both of the entries below were `null`, on reasoning\n // that measurement disproved while building the 5B service table:\n //\n // - AUDIT_LOG_STORAGE was \"served BY the document/relational database\". It is\n // not: `immudb` is a service of its own, with its own container, and a\n // runtime that writes audit records dials IT rather than a database table.\n // - METRICS_TELEMETRY was \"no application runtime dials them directly today\".\n // Also false — runtimes emit spans and metrics to the collector, and that\n // traffic is live in development. A `null` here would have cut tracing for\n // every runtime the moment segmentation was enforced, with NO readiness\n // check covering it: a first-use failure, silent until someone noticed spans\n // had stopped.\n [InfraCapability.AUDIT_LOG_STORAGE]: WildoRuntimeNetwork.DATA_AUDIT,\n [InfraCapability.METRICS_TELEMETRY]: WildoRuntimeNetwork.DATA_TELEMETRY,\n // Backup remains genuinely operator-side: no application runtime dials it, and\n // the backup tooling runs outside the application's network entirely.\n [InfraCapability.BACKUP_MANAGER]: null,\n};\n\n/**\n * The networks a runtime's container joins.\n *\n * Derived from the SAME declaration as its credentials and its environment\n * topology — see {@link resolveRuntimeBackingServiceAccess}. That is the whole\n * point: a runtime kept off a service's network must also not hold that service's\n * credential nor receive its connect URL, and the only way three enforcement\n * points stay in agreement is by not deriving the answer three times.\n *\n * `PLATFORM` is unconditional. Every runtime — including a worker, which holds no\n * backing-service credentials at all — must reach apps-manager to fetch its own\n * bootstrap material. Withholding it would strand every runtime at boot, and it\n * grants no application data.\n */\nexport function resolveRuntimeNetworkMembership(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration?: RuntimeAccessDeclaration | undefined,\n options?: { readonly servesHttp?: boolean },\n): ReadonlySet<WildoRuntimeNetwork> {\n const access = resolveRuntimeBackingServiceAccess(principal, declaration);\n const networks = new Set<WildoRuntimeNetwork>();\n\n // PLATFORM is for runtimes that FETCH their own bootstrap material — every\n // runtime principal does, including a worker that holds no backing-service\n // credentials at all. A caller with NO principal is not a runtime principal:\n // today that is the static frontend, an nginx container that authenticates to\n // nothing and has no bootstrap material to fetch.\n //\n // This was previously unconditional, which put that frontend on the platform\n // segment. Harmless — the segment carries no application data and the container\n // could not authenticate anyway — but it is reachability nobody asked for, and\n // \"unconditional because every case so far needed it\" is exactly the default a\n // later reader assumes was measured.\n if (principal) networks.add(WildoRuntimeNetwork.PLATFORM);\n\n for (const capability of access.capabilities) {\n const network = NETWORK_FOR_CAPABILITY[capability];\n if (network) networks.add(network);\n }\n\n // Serving HTTP is a property of the DEPLOYMENT (does a proxy route to it?),\n // not of what the runtime declared, so it arrives separately rather than being\n // inferred from the principal kind — an application backend that serves no\n // public route should not be on the edge merely for being a backend.\n if (options?.servesHttp) networks.add(WildoRuntimeNetwork.EDGE);\n\n // Authored, never inferred. See `RuntimeBackingServiceAccess`.\n if (access.requiresInternetEgress) networks.add(WildoRuntimeNetwork.EGRESS);\n\n return networks;\n}\n\n/**\n * Networks that must be declared `internal: true`.\n *\n * Derived by EXCLUSION from the two that legitimately carry a route off the host,\n * so a network added to the enum is internal by default. The safe posture is the\n * one you get by not thinking about it.\n */\nexport function isInternalNetwork(network: WildoRuntimeNetwork): boolean {\n return network !== WildoRuntimeNetwork.EDGE && network !== WildoRuntimeNetwork.EGRESS;\n}\n"]}
|