@wildo-ai/platform-config-lib 1.1.11 → 1.1.12

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.
Files changed (389) hide show
  1. package/dist/esm/_unimplemented/soft-warn.d.ts +24 -49
  2. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
  3. package/dist/esm/_unimplemented/soft-warn.js +24 -49
  4. package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
  5. package/dist/esm/blueprint/anchored-region.d.ts.map +1 -1
  6. package/dist/esm/blueprint/anchored-region.js.map +1 -1
  7. package/dist/esm/blueprint/blueprint.schemas.d.ts +0 -89
  8. package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -1
  9. package/dist/esm/blueprint/blueprint.schemas.js.map +1 -1
  10. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  11. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  12. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  13. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  14. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  17. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  18. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +8 -1
  19. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  20. package/dist/esm/bootstrap/bootstrap.schemas.js +15 -1
  21. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  22. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +10 -2
  23. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +10 -2
  25. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  26. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
  27. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  28. package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
  29. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  30. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
  31. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
  32. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
  33. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
  34. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
  35. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  36. package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
  37. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  38. package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
  39. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  40. package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
  41. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  42. package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
  43. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  44. package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
  45. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  46. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
  47. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  48. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
  49. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  50. package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
  51. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  52. package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -1
  53. package/dist/esm/bootstrap/runtime-response-integrity.js +3 -3
  54. package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -1
  55. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -1
  56. package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -1
  57. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  58. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  59. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
  60. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  61. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -1
  62. package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -1
  63. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  64. package/dist/esm/config-authoring.entry.js.map +1 -1
  65. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  66. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  67. package/dist/esm/index.d.ts +5 -1
  68. package/dist/esm/index.d.ts.map +1 -1
  69. package/dist/esm/index.js +5 -1
  70. package/dist/esm/index.js.map +1 -1
  71. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
  72. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
  73. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
  74. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
  75. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
  76. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
  77. package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
  78. package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
  79. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
  80. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
  81. package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
  82. package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
  83. package/dist/esm/key-management/approval-seal-verifier.d.ts +101 -39
  84. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
  85. package/dist/esm/key-management/approval-seal-verifier.js +134 -12
  86. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -1
  87. package/dist/esm/key-management/approval-seal.contracts.d.ts +12 -15
  88. package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -1
  89. package/dist/esm/key-management/approval-seal.contracts.js +20 -0
  90. package/dist/esm/key-management/approval-seal.contracts.js.map +1 -1
  91. package/dist/esm/key-management/data-key.contracts.d.ts +0 -2
  92. package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -1
  93. package/dist/esm/key-management/data-key.contracts.js.map +1 -1
  94. package/dist/esm/key-management/es256-jws.d.ts.map +1 -1
  95. package/dist/esm/key-management/es256-jws.js.map +1 -1
  96. package/dist/esm/key-management/key-provider.spi.d.ts +8 -1
  97. package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -1
  98. package/dist/esm/key-management/key-provider.spi.js.map +1 -1
  99. package/dist/esm/key-management/keyring-rotation.contracts.d.ts +2 -12
  100. package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -1
  101. package/dist/esm/key-management/keyring-rotation.contracts.js +3 -3
  102. package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -1
  103. package/dist/esm/key-management/keyring-status.contracts.d.ts +0 -7
  104. package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -1
  105. package/dist/esm/key-management/keyring-status.contracts.js.map +1 -1
  106. package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
  107. package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
  108. package/dist/esm/key-management/pdf-incremental-update.js +730 -0
  109. package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
  110. package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
  111. package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
  112. package/dist/esm/key-management/pdf-truetype-font.js +152 -0
  113. package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
  114. package/dist/esm/key-management/qr-code.d.ts +38 -0
  115. package/dist/esm/key-management/qr-code.d.ts.map +1 -0
  116. package/dist/esm/key-management/qr-code.js +325 -0
  117. package/dist/esm/key-management/qr-code.js.map +1 -0
  118. package/dist/esm/key-management/signature-request.contracts.d.ts +0 -4
  119. package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -1
  120. package/dist/esm/key-management/signature-request.contracts.js.map +1 -1
  121. package/dist/esm/key-management/signing-log-export.contracts.d.ts +0 -1
  122. package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -1
  123. package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -1
  124. package/dist/esm/key-management/vault-custody.contracts.d.ts +43 -0
  125. package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -1
  126. package/dist/esm/key-management/vault-custody.contracts.js +66 -0
  127. package/dist/esm/key-management/vault-custody.contracts.js.map +1 -1
  128. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  129. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  130. package/dist/esm/lockfile/canonical-json.d.ts +1 -1
  131. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  132. package/dist/esm/lockfile/canonical-json.js +1 -1
  133. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  134. package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
  135. package/dist/esm/lockfile/file-lock-hold.js +2 -1
  136. package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
  137. package/dist/esm/lockfile/lockfile-io.d.ts +6 -8
  138. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  139. package/dist/esm/lockfile/lockfile-io.js +6 -8
  140. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  141. package/dist/esm/lockfile/materialize-infra-section.d.ts +5 -6
  142. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  143. package/dist/esm/lockfile/materialize-infra-section.js +4 -5
  144. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  145. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +1 -247
  146. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  147. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +1 -1
  148. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  149. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
  150. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
  151. package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
  152. package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
  153. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  154. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +15 -3
  155. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  156. package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -1
  157. package/dist/esm/project-config/application-served-public-documents.loader.js +16 -8
  158. package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -1
  159. package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
  160. package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
  161. package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
  162. package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
  163. package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
  164. package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
  165. package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
  166. package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
  167. package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
  168. package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
  169. package/dist/esm/project-config/config-module-resolution.js +33 -0
  170. package/dist/esm/project-config/config-module-resolution.js.map +1 -0
  171. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  172. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  173. package/dist/esm/project-config/define-infra-env-config.d.ts +109 -55
  174. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  175. package/dist/esm/project-config/define-infra-env-config.js +108 -70
  176. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  177. package/dist/esm/project-config/define-minion-config.d.ts +26 -36
  178. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  179. package/dist/esm/project-config/define-minion-config.js +64 -25
  180. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  181. package/dist/esm/project-config/define-saas-config.d.ts +41 -437
  182. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  183. package/dist/esm/project-config/define-saas-config.js +102 -94
  184. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  185. package/dist/esm/project-config/define-worker-config.d.ts +10 -20
  186. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  187. package/dist/esm/project-config/define-worker-config.js +10 -12
  188. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  189. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  190. package/dist/esm/project-config/hosted-infra-env-config.js +1 -1
  191. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  192. package/dist/esm/project-config/index.d.ts +2 -0
  193. package/dist/esm/project-config/index.d.ts.map +1 -1
  194. package/dist/esm/project-config/index.js +2 -0
  195. package/dist/esm/project-config/index.js.map +1 -1
  196. package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
  197. package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
  198. package/dist/esm/project-config/loader-instances-zod.js +40 -0
  199. package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
  200. package/dist/esm/project-config/loader.d.ts +131 -14
  201. package/dist/esm/project-config/loader.d.ts.map +1 -1
  202. package/dist/esm/project-config/loader.js +226 -12
  203. package/dist/esm/project-config/loader.js.map +1 -1
  204. package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
  205. package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
  206. package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
  207. package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
  208. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  209. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  210. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  211. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  212. package/dist/esm/project-config/owning-package-tsconfig.d.ts +7 -7
  213. package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -1
  214. package/dist/esm/project-config/owning-package-tsconfig.js +7 -7
  215. package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -1
  216. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
  217. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  218. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  219. package/dist/esm/project-config/provider-companion-discovery.js +3 -1
  220. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  221. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +71 -46
  222. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  223. package/dist/esm/project-config/provider-runtime-artifacts.js +150 -4
  224. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  225. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
  226. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  227. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  228. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  229. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  230. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  231. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  232. package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
  233. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  234. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  235. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
  236. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  237. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
  238. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  239. package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
  240. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  241. package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
  242. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  243. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  244. package/dist/esm/project-config/shared/csp-defaults.d.ts +34 -6
  245. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  246. package/dist/esm/project-config/shared/csp-defaults.js +52 -8
  247. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  248. package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
  249. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  250. package/dist/esm/project-config/shared/csp-emit.js +77 -24
  251. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  252. package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -84
  253. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  254. package/dist/esm/project-config/shared/csp.schemas.js +40 -12
  255. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  256. package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
  257. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  258. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  259. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  260. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  261. package/dist/esm/project-config/shared/environment.schemas.d.ts +95 -8
  262. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  263. package/dist/esm/project-config/shared/environment.schemas.js +122 -10
  264. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  265. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
  266. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  267. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  268. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
  269. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  270. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +1 -1
  271. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  272. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +1 -1
  273. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  274. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  275. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  276. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  277. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  278. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +20 -0
  279. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  280. package/dist/esm/project-config/shared/minion-resource-access.validation.js +21 -2
  281. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  282. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  283. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  284. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +62 -36
  285. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -1
  286. package/dist/esm/project-config/shared/platform-key-management.schemas.js +105 -3
  287. package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -1
  288. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  289. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  290. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
  291. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  292. package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
  293. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  294. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
  295. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  296. package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
  297. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  298. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
  299. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  300. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  301. package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
  302. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  303. package/dist/esm/project-config/static-asset-import-noop.js +36 -20
  304. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  305. package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
  306. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  307. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  308. package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
  309. package/dist/esm/registry/digest.schemas.js.map +1 -1
  310. package/dist/esm/registry/index.d.ts +2 -3
  311. package/dist/esm/registry/index.d.ts.map +1 -1
  312. package/dist/esm/registry/index.js +2 -3
  313. package/dist/esm/registry/index.js.map +1 -1
  314. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  315. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  316. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +1 -98
  317. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  318. package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
  319. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  320. package/dist/esm/registry/module-artifact.schemas.d.ts +17 -17
  321. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  322. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  323. package/dist/esm/registry/module-manifest.schemas.d.ts +151 -219
  324. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  325. package/dist/esm/registry/module-manifest.schemas.js +145 -13
  326. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  327. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  328. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  329. package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
  330. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  331. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  332. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  333. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  334. package/dist/esm/registry/registry-errors.d.ts +81 -3
  335. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  336. package/dist/esm/registry/registry-errors.js +185 -4
  337. package/dist/esm/registry/registry-errors.js.map +1 -1
  338. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
  339. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  340. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  341. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  342. package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -1
  343. package/dist/esm/registry/registry-url-resolution.js.map +1 -1
  344. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  345. package/dist/esm/release/framework-release.constants.js.map +1 -1
  346. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  347. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  348. package/dist/esm/schemas/framework-secrets.schemas.d.ts +0 -7
  349. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  350. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  351. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  352. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  353. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  354. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
  355. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  356. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  357. package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
  358. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  359. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  360. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
  361. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  362. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  363. package/dist/esm/workspace-scope/index.js.map +1 -1
  364. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  365. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  366. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  367. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  368. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  369. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  370. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  371. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  372. package/dist/tsconfig.build.tsbuildinfo +1 -1
  373. package/package.json +12 -12
  374. package/dist/esm/_unimplemented/index.d.ts +0 -3
  375. package/dist/esm/_unimplemented/index.d.ts.map +0 -1
  376. package/dist/esm/_unimplemented/index.js +0 -3
  377. package/dist/esm/_unimplemented/index.js.map +0 -1
  378. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
  379. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
  380. package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
  381. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
  382. package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
  383. package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
  384. package/dist/esm/project-config/shared/cdn.example.js +0 -38
  385. package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
  386. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
  387. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
  388. package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
  389. package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';
2
2
  import type { RuntimeAccessDeclaration } from './runtime-backing-service-access';
3
+ import { WildoRuntimeNetwork, type RuntimeNetworkMembershipOptions } from './runtime-network-topology';
3
4
  /**
4
5
  * The Kubernetes rendering of {@link WildoRuntimeNetwork} (Step 5-egress, half A).
5
6
  *
@@ -26,9 +27,19 @@ export declare const RUNTIME_NETWORK_LABEL_PREFIX = "wildo.ai/net-";
26
27
  * a policy that allowed `net-mongo != 'true'` would admit every pod that simply
27
28
  * never set the label.
28
29
  */
29
- export declare function buildRuntimeNetworkPodLabels(principal: ApplicationRuntimePrincipal | undefined, declaration?: RuntimeAccessDeclaration | undefined, options?: {
30
- readonly servesHttp?: boolean;
31
- }): Record<string, string>;
30
+ export declare function buildRuntimeNetworkPodLabels(principal: ApplicationRuntimePrincipal | undefined, declaration: RuntimeAccessDeclaration | undefined, options: RuntimeNetworkMembershipOptions): Record<string, string>;
31
+ /**
32
+ * Pod labels for a pod that is not an application runtime principal (a backing service, a platform service, a one-shot
33
+ * init Job), from the segments it belongs to (#3372).
34
+ *
35
+ * The same `wildo.ai/net-<segment>: "true"` vocabulary as {@link buildRuntimeNetworkPodLabels}, deliberately: a
36
+ * Kubernetes segment is FLAT, exactly like the compose network it renders (every member reaches every member), so the
37
+ * service and its clients are described by one string. A label per role (`serves-` / `joins-`) was considered and
38
+ * rejected: compose leaves every intra-segment call implicit (the backend dispatching to a worker over the platform
39
+ * segment, mongod and mongot dialling each other over the Mongo one), so a role split would have to enumerate edges
40
+ * nobody has written down, and a missed one is an outage the compose lane does not have.
41
+ */
42
+ export declare function buildNetworkMembershipPodLabels(networks: Iterable<WildoRuntimeNetwork>): Record<string, string>;
32
43
  /** A `NetworkPolicy` document, in the shape the manifest renderer serialises. */
33
44
  export interface RuntimeNetworkPolicyDocument {
34
45
  readonly apiVersion: 'networking.k8s.io/v1';
@@ -39,6 +50,79 @@ export interface RuntimeNetworkPolicyDocument {
39
50
  };
40
51
  readonly spec: Record<string, unknown>;
41
52
  }
53
+ /**
54
+ * Where the cluster DNS answers, for the egress allow every pod needs (#3372).
55
+ *
56
+ * The control plane sets an immutable `kubernetes.io/metadata.name` label on every namespace, so a policy can name
57
+ * `kube-system`; CoreDNS keeps `k8s-app: kube-dns` for backward compatibility with the kube-dns it replaced. Port 53 on
58
+ * BOTH protocols: UDP for ordinary lookups, TCP for a truncated answer.
59
+ *
60
+ * spec-cite: https://kubernetes.io/docs/concepts/services-networking/network-policies/ — "Targeting a Namespace by its
61
+ * name"; https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/ — "Check if the DNS pod is
62
+ * running" (the `k8s-app=kube-dns` value for CoreDNS).
63
+ */
64
+ export declare const CLUSTER_DNS_SELECTOR: {
65
+ readonly NAMESPACE_LABELS: {
66
+ readonly 'kubernetes.io/metadata.name': "kube-system";
67
+ };
68
+ readonly POD_LABELS: {
69
+ readonly 'k8s-app': "kube-dns";
70
+ };
71
+ readonly PORT: 53;
72
+ };
73
+ /** The name of the segment-allow policy for one network, shared by the builder and anything that reads its output. */
74
+ export declare function runtimeNetworkPolicyName(network: WildoRuntimeNetwork): string;
75
+ /** The name of the namespace-wide DNS egress allow. */
76
+ export declare const RUNTIME_NETWORK_DNS_POLICY_NAME = "wildo-allow-dns";
77
+ /**
78
+ * A backing service a segment's members reach OFF the cluster (#3511): an environment that declares it MANAGED (a
79
+ * MongoDB Atlas cluster, a managed PostgreSQL, a managed broker) has no pod for it in the namespace, so the segment's
80
+ * pod-selector allow reaches nothing and the default-deny would cut its clients off. The deployment lane derives these
81
+ * from the environment's declared providers; this module only renders them.
82
+ */
83
+ export interface RuntimeNetworkOffClusterService {
84
+ /** The INTERNAL segment whose members are the service's clients. */
85
+ readonly network: WildoRuntimeNetwork;
86
+ /** The TCP ports the service answers on. */
87
+ readonly ports: readonly number[];
88
+ }
89
+ /** What the namespace's policy set depends on beyond the segment vocabulary. */
90
+ export interface RuntimeNetworkPolicyOptions {
91
+ /** The backing services served off the cluster, one egress allow per segment. Empty when everything is self-hosted. */
92
+ readonly offClusterServices?: readonly RuntimeNetworkOffClusterService[];
93
+ /**
94
+ * Whether certificates are issued in this namespace by an ACME HTTP-01 issuer (the remote cluster's cert-manager
95
+ * `ClusterIssuer`). cert-manager then creates a temporary solver pod in the namespace, which the ingress controller
96
+ * must reach for the challenge to be answered; under the default-deny it could not, and no certificate would issue.
97
+ */
98
+ readonly admitsAcmeHttp01Solver?: boolean;
99
+ }
100
+ /** The name of the off-cluster egress allow of one segment. */
101
+ export declare function runtimeNetworkOffClusterPolicyName(network: WildoRuntimeNetwork): string;
102
+ /**
103
+ * Every address, in both families: the destination of an off-cluster allow, which is then bounded by the service's
104
+ * ports and by the segment label rather than by an address range.
105
+ */
106
+ export declare const OFF_CLUSTER_ADDRESS_BLOCKS: readonly ["0.0.0.0/0", "::/0"];
107
+ /**
108
+ * cert-manager's ACME HTTP-01 solver pod: the label cert-manager puts on it and the port it listens on, read from
109
+ * cert-manager's source (`SolverIdentificationLabelKey`, `acmeSolverListenPort`). The pod is created in the namespace
110
+ * of the Challenge, which is the namespace of the Ingress that asked for the certificate, so this namespace.
111
+ *
112
+ * spec-cite: https://github.com/cert-manager/cert-manager/blob/master/pkg/apis/acme/v1/types.go —
113
+ * `SolverIdentificationLabelKey = "acme.cert-manager.io/http01-solver"`;
114
+ * https://github.com/cert-manager/cert-manager/blob/master/pkg/issuer/acme/http/http.go — `acmeSolverListenPort = 8089`;
115
+ * https://cert-manager.io/docs/configuration/acme/http01/ — "Network Policy Considerations" (allow the ingress controller
116
+ * to reach the temporary solver resources).
117
+ */
118
+ export declare const ACME_HTTP01_SOLVER_SELECTOR: {
119
+ readonly POD_LABELS: {
120
+ readonly 'acme.cert-manager.io/http01-solver': "true";
121
+ };
122
+ readonly PORT: 8089;
123
+ };
124
+ /** The name of the ingress allow for cert-manager's ACME HTTP-01 solver pods. */
125
+ export declare const ACME_HTTP01_SOLVER_POLICY_NAME = "wildo-allow-acme-http01-solver";
42
126
  /**
43
127
  * The static policy set for a namespace.
44
128
  *
@@ -47,17 +131,38 @@ export interface RuntimeNetworkPolicyDocument {
47
131
  * 1. **A default-deny for ingress AND egress.** Both, because an egress-only
48
132
  * policy still lets an unlabelled pod be REACHED, and the pair is what makes
49
133
  * 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
134
+ * 2. **A DNS egress allow for every pod** (#3372). A default-deny egress also
135
+ * denies the lookup that precedes every connection, so without it no pod can
136
+ * resolve the Service of a backing service it is otherwise allowed to reach.
137
+ * It opens the cluster DNS pods on port 53 and nothing else.
138
+ * 3. **One policy per INTERNAL network, in BOTH directions** (#3372): a pod carrying
139
+ * the network's label may reach, and be reached by, every other pod carrying
140
+ * it. Until #3372 this was ingress-only, and under a default-deny egress that
141
+ * meant no client could open a connection to its backing service at all; the
142
+ * backing-service pods carried no label either, so they were unreachable from
143
+ * both ends.
144
+ * 4. **An ingress allow for `wildo-edge`** (#3372): a pod serving a public route is
145
+ * reached through the ingress controller, which runs in another namespace (or
146
+ * on the node's network), so its ingress is open to every source. The edge is
147
+ * public by definition; segmenting it here would only cut the route the
148
+ * ingress object exists to provide. It grants the edge pod no egress.
149
+ * 5. **One egress policy for `wildo-egress`**, the only door off the cluster
54
150
  * below the edge, admitting only pods that AUTHORED the need.
151
+ * 6. **One egress policy per segment whose backing service is served OFF the
152
+ * cluster** (#3511), from `options.offClusterServices`: the segment's members
153
+ * may open a connection to any address on that service's ports, and nothing
154
+ * else. See {@link buildOffClusterServicePolicy} for why the destination is
155
+ * every address.
156
+ * 7. **An ingress allow for cert-manager's ACME HTTP-01 solver pods** (#3511),
157
+ * when `options.admitsAcmeHttp01Solver`: open to every source on the solver's
158
+ * port, for the same reason as the edge (the challenge arrives through the
159
+ * ingress controller, from the ACME server on the internet).
55
160
  *
56
161
  * ⚠️ 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.
162
+ * {@link buildRuntimeNetworkPodLabels} / {@link buildNetworkMembershipPodLabels}.
163
+ * Emitting the policies WITHOUT wiring the labels denies everything at the first
164
+ * deployment — which is what #3372 found: the application runtimes were
165
+ * labelled, the backing services they dial were not.
61
166
  */
62
- export declare function buildRuntimeNetworkPolicyDocuments(namespace?: string): readonly RuntimeNetworkPolicyDocument[];
167
+ export declare function buildRuntimeNetworkPolicyDocuments(namespace?: string, options?: RuntimeNetworkPolicyOptions): readonly RuntimeNetworkPolicyDocument[];
63
168
  //# sourceMappingURL=runtime-network-policy.d.ts.map
@@ -1 +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"}
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;AACjF,OAAO,EACL,mBAAmB,EAGnB,KAAK,+BAA+B,EACrC,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H;IACvH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,+BAA+B,EAAE,CAAC;IACzE;;;;OAIG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAC3C;AAED,+DAA+D;AAC/D,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAEvF;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,gCAAiC,CAAC;AAEzE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B;;;;;CAG9B,CAAC;AAEX,iFAAiF;AACjF,eAAO,MAAM,8BAA8B,mCAAmC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,kCAAkC,CAChD,SAAS,CAAC,EAAE,MAAM,EAClB,OAAO,GAAE,2BAAgC,GACxC,SAAS,4BAA4B,EAAE,CAuHzC"}
@@ -32,6 +32,72 @@ export function buildRuntimeNetworkPodLabels(principal, declaration, options) {
32
32
  }
33
33
  return labels;
34
34
  }
35
+ /**
36
+ * Pod labels for a pod that is not an application runtime principal (a backing service, a platform service, a one-shot
37
+ * init Job), from the segments it belongs to (#3372).
38
+ *
39
+ * The same `wildo.ai/net-<segment>: "true"` vocabulary as {@link buildRuntimeNetworkPodLabels}, deliberately: a
40
+ * Kubernetes segment is FLAT, exactly like the compose network it renders (every member reaches every member), so the
41
+ * service and its clients are described by one string. A label per role (`serves-` / `joins-`) was considered and
42
+ * rejected: compose leaves every intra-segment call implicit (the backend dispatching to a worker over the platform
43
+ * segment, mongod and mongot dialling each other over the Mongo one), so a role split would have to enumerate edges
44
+ * nobody has written down, and a missed one is an outage the compose lane does not have.
45
+ */
46
+ export function buildNetworkMembershipPodLabels(networks) {
47
+ const labels = {};
48
+ for (const network of networks) {
49
+ labels[`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`] = 'true';
50
+ }
51
+ return labels;
52
+ }
53
+ /**
54
+ * Where the cluster DNS answers, for the egress allow every pod needs (#3372).
55
+ *
56
+ * The control plane sets an immutable `kubernetes.io/metadata.name` label on every namespace, so a policy can name
57
+ * `kube-system`; CoreDNS keeps `k8s-app: kube-dns` for backward compatibility with the kube-dns it replaced. Port 53 on
58
+ * BOTH protocols: UDP for ordinary lookups, TCP for a truncated answer.
59
+ *
60
+ * spec-cite: https://kubernetes.io/docs/concepts/services-networking/network-policies/ — "Targeting a Namespace by its
61
+ * name"; https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/ — "Check if the DNS pod is
62
+ * running" (the `k8s-app=kube-dns` value for CoreDNS).
63
+ */
64
+ export const CLUSTER_DNS_SELECTOR = {
65
+ NAMESPACE_LABELS: { 'kubernetes.io/metadata.name': 'kube-system' },
66
+ POD_LABELS: { 'k8s-app': 'kube-dns' },
67
+ PORT: 53,
68
+ };
69
+ /** The name of the segment-allow policy for one network, shared by the builder and anything that reads its output. */
70
+ export function runtimeNetworkPolicyName(network) {
71
+ return `wildo-allow-${network}`;
72
+ }
73
+ /** The name of the namespace-wide DNS egress allow. */
74
+ export const RUNTIME_NETWORK_DNS_POLICY_NAME = 'wildo-allow-dns';
75
+ /** The name of the off-cluster egress allow of one segment. */
76
+ export function runtimeNetworkOffClusterPolicyName(network) {
77
+ return `${runtimeNetworkPolicyName(network)}-off-cluster`;
78
+ }
79
+ /**
80
+ * Every address, in both families: the destination of an off-cluster allow, which is then bounded by the service's
81
+ * ports and by the segment label rather than by an address range.
82
+ */
83
+ export const OFF_CLUSTER_ADDRESS_BLOCKS = ['0.0.0.0/0', '::/0'];
84
+ /**
85
+ * cert-manager's ACME HTTP-01 solver pod: the label cert-manager puts on it and the port it listens on, read from
86
+ * cert-manager's source (`SolverIdentificationLabelKey`, `acmeSolverListenPort`). The pod is created in the namespace
87
+ * of the Challenge, which is the namespace of the Ingress that asked for the certificate, so this namespace.
88
+ *
89
+ * spec-cite: https://github.com/cert-manager/cert-manager/blob/master/pkg/apis/acme/v1/types.go —
90
+ * `SolverIdentificationLabelKey = "acme.cert-manager.io/http01-solver"`;
91
+ * https://github.com/cert-manager/cert-manager/blob/master/pkg/issuer/acme/http/http.go — `acmeSolverListenPort = 8089`;
92
+ * https://cert-manager.io/docs/configuration/acme/http01/ — "Network Policy Considerations" (allow the ingress controller
93
+ * to reach the temporary solver resources).
94
+ */
95
+ export const ACME_HTTP01_SOLVER_SELECTOR = {
96
+ POD_LABELS: { 'acme.cert-manager.io/http01-solver': 'true' },
97
+ PORT: 8089,
98
+ };
99
+ /** The name of the ingress allow for cert-manager's ACME HTTP-01 solver pods. */
100
+ export const ACME_HTTP01_SOLVER_POLICY_NAME = 'wildo-allow-acme-http01-solver';
35
101
  /**
36
102
  * The static policy set for a namespace.
37
103
  *
@@ -40,20 +106,44 @@ export function buildRuntimeNetworkPodLabels(principal, declaration, options) {
40
106
  * 1. **A default-deny for ingress AND egress.** Both, because an egress-only
41
107
  * policy still lets an unlabelled pod be REACHED, and the pair is what makes
42
108
  * 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
109
+ * 2. **A DNS egress allow for every pod** (#3372). A default-deny egress also
110
+ * denies the lookup that precedes every connection, so without it no pod can
111
+ * resolve the Service of a backing service it is otherwise allowed to reach.
112
+ * It opens the cluster DNS pods on port 53 and nothing else.
113
+ * 3. **One policy per INTERNAL network, in BOTH directions** (#3372): a pod carrying
114
+ * the network's label may reach, and be reached by, every other pod carrying
115
+ * it. Until #3372 this was ingress-only, and under a default-deny egress that
116
+ * meant no client could open a connection to its backing service at all; the
117
+ * backing-service pods carried no label either, so they were unreachable from
118
+ * both ends.
119
+ * 4. **An ingress allow for `wildo-edge`** (#3372): a pod serving a public route is
120
+ * reached through the ingress controller, which runs in another namespace (or
121
+ * on the node's network), so its ingress is open to every source. The edge is
122
+ * public by definition; segmenting it here would only cut the route the
123
+ * ingress object exists to provide. It grants the edge pod no egress.
124
+ * 5. **One egress policy for `wildo-egress`**, the only door off the cluster
47
125
  * below the edge, admitting only pods that AUTHORED the need.
126
+ * 6. **One egress policy per segment whose backing service is served OFF the
127
+ * cluster** (#3511), from `options.offClusterServices`: the segment's members
128
+ * may open a connection to any address on that service's ports, and nothing
129
+ * else. See {@link buildOffClusterServicePolicy} for why the destination is
130
+ * every address.
131
+ * 7. **An ingress allow for cert-manager's ACME HTTP-01 solver pods** (#3511),
132
+ * when `options.admitsAcmeHttp01Solver`: open to every source on the solver's
133
+ * port, for the same reason as the edge (the challenge arrives through the
134
+ * ingress controller, from the ACME server on the internet).
48
135
  *
49
136
  * ⚠️ 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.
137
+ * {@link buildRuntimeNetworkPodLabels} / {@link buildNetworkMembershipPodLabels}.
138
+ * Emitting the policies WITHOUT wiring the labels denies everything at the first
139
+ * deployment — which is what #3372 found: the application runtimes were
140
+ * labelled, the backing services they dial were not.
54
141
  */
55
- export function buildRuntimeNetworkPolicyDocuments(namespace) {
142
+ export function buildRuntimeNetworkPolicyDocuments(namespace, options = {}) {
56
143
  const meta = (name) => namespace ? { name, namespace } : { name };
144
+ const member = (network) => ({
145
+ matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' },
146
+ });
57
147
  const documents = [
58
148
  {
59
149
  apiVersion: 'networking.k8s.io/v1',
@@ -63,6 +153,31 @@ export function buildRuntimeNetworkPolicyDocuments(namespace) {
63
153
  // policy types with no rules denies both directions.
64
154
  spec: { podSelector: {}, policyTypes: ['Ingress', 'Egress'] },
65
155
  },
156
+ {
157
+ apiVersion: 'networking.k8s.io/v1',
158
+ kind: 'NetworkPolicy',
159
+ metadata: meta(RUNTIME_NETWORK_DNS_POLICY_NAME),
160
+ spec: {
161
+ podSelector: {},
162
+ policyTypes: ['Egress'],
163
+ egress: [
164
+ {
165
+ // ONE peer carrying both selectors: the DNS pods IN kube-system. Two
166
+ // peers would mean "any pod in kube-system, OR any kube-dns pod".
167
+ to: [
168
+ {
169
+ namespaceSelector: { matchLabels: { ...CLUSTER_DNS_SELECTOR.NAMESPACE_LABELS } },
170
+ podSelector: { matchLabels: { ...CLUSTER_DNS_SELECTOR.POD_LABELS } },
171
+ },
172
+ ],
173
+ ports: [
174
+ { protocol: 'UDP', port: CLUSTER_DNS_SELECTOR.PORT },
175
+ { protocol: 'TCP', port: CLUSTER_DNS_SELECTOR.PORT },
176
+ ],
177
+ },
178
+ ],
179
+ },
180
+ },
66
181
  ];
67
182
  for (const network of Object.values(WildoRuntimeNetwork)) {
68
183
  if (!isInternalNetwork(network))
@@ -70,28 +185,32 @@ export function buildRuntimeNetworkPolicyDocuments(namespace) {
70
185
  documents.push({
71
186
  apiVersion: 'networking.k8s.io/v1',
72
187
  kind: 'NetworkPolicy',
73
- metadata: meta(`wildo-allow-${network}`),
188
+ metadata: meta(runtimeNetworkPolicyName(network)),
74
189
  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
- ],
190
+ podSelector: member(network),
191
+ policyTypes: ['Ingress', 'Egress'],
192
+ ingress: [{ from: [{ podSelector: member(network) }] }],
193
+ egress: [{ to: [{ podSelector: member(network) }] }],
84
194
  },
85
195
  });
86
196
  }
87
197
  documents.push({
88
198
  apiVersion: 'networking.k8s.io/v1',
89
199
  kind: 'NetworkPolicy',
90
- metadata: meta(`wildo-allow-${WildoRuntimeNetwork.EGRESS}`),
200
+ metadata: meta(runtimeNetworkPolicyName(WildoRuntimeNetwork.EDGE)),
91
201
  spec: {
92
- podSelector: {
93
- matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${WildoRuntimeNetwork.EGRESS}`]: 'true' },
94
- },
202
+ podSelector: member(WildoRuntimeNetwork.EDGE),
203
+ policyTypes: ['Ingress'],
204
+ // One rule with no `from`: every source. See point 4 above.
205
+ ingress: [{}],
206
+ },
207
+ });
208
+ documents.push({
209
+ apiVersion: 'networking.k8s.io/v1',
210
+ kind: 'NetworkPolicy',
211
+ metadata: meta(runtimeNetworkPolicyName(WildoRuntimeNetwork.EGRESS)),
212
+ spec: {
213
+ podSelector: member(WildoRuntimeNetwork.EGRESS),
95
214
  policyTypes: ['Egress'],
96
215
  // Unrestricted destination, deliberately: this is the AUTHORED door, and
97
216
  // narrowing it by CIDR would be a claim about the internet nobody can keep
@@ -99,6 +218,86 @@ export function buildRuntimeNetworkPolicyDocuments(namespace) {
99
218
  egress: [{}],
100
219
  },
101
220
  });
221
+ // One policy per segment, its ports merged: two declarations naming the same segment are one door, not two.
222
+ const offClusterPorts = new Map();
223
+ for (const service of options.offClusterServices ?? []) {
224
+ if (!isInternalNetwork(service.network)) {
225
+ throw new Error(`An off-cluster service is reached by the members of an internal segment, not of '${service.network}'.`);
226
+ }
227
+ if (service.ports.length === 0) {
228
+ throw new Error(`The off-cluster service of '${service.network}' declares no port; an allow without one would open every port.`);
229
+ }
230
+ const ports = offClusterPorts.get(service.network) ?? new Set();
231
+ for (const port of service.ports)
232
+ ports.add(port);
233
+ offClusterPorts.set(service.network, ports);
234
+ }
235
+ for (const network of Object.values(WildoRuntimeNetwork)) {
236
+ const ports = offClusterPorts.get(network);
237
+ if (ports)
238
+ documents.push(buildOffClusterServicePolicy(meta, member(network), network, [...ports].sort((a, b) => a - b)));
239
+ }
240
+ if (options.admitsAcmeHttp01Solver) {
241
+ documents.push({
242
+ apiVersion: 'networking.k8s.io/v1',
243
+ kind: 'NetworkPolicy',
244
+ metadata: meta(ACME_HTTP01_SOLVER_POLICY_NAME),
245
+ spec: {
246
+ podSelector: { matchLabels: { ...ACME_HTTP01_SOLVER_SELECTOR.POD_LABELS } },
247
+ policyTypes: ['Ingress'],
248
+ // Every source, on the solver's port only: the challenge request is the ACME server's, relayed by the ingress
249
+ // controller from another namespace, and cert-manager's own self-check takes the same path. No egress: the pod
250
+ // only answers.
251
+ ingress: [{ ports: [{ protocol: 'TCP', port: ACME_HTTP01_SOLVER_SELECTOR.PORT }] }],
252
+ },
253
+ });
254
+ }
102
255
  return documents;
103
256
  }
257
+ /**
258
+ * The egress allow of a segment whose backing service lives off the cluster (#3511).
259
+ *
260
+ * ## Why the destination is every address, bounded by port
261
+ *
262
+ * A NetworkPolicy cannot name a destination by DNS name, and a managed service has no address the deployment knows:
263
+ * the endpoint is a name (`*.mongodb.net`, a provider's database host) whose addresses the provider changes, an Atlas
264
+ * `mongodb+srv` URL resolves to a set of hosts only at connect time, and a private endpoint (VPC peering, Private Link)
265
+ * answers on a private address. So the rule names every address on the service's ports, and the segment label decides
266
+ * WHO may use it: a worker, which is on no data segment, still reaches no database port anywhere.
267
+ *
268
+ * spec-cite: https://kubernetes.io/docs/concepts/services-networking/network-policies/ — "What you can't do with network
269
+ * policies": "Targeting of services by name"; "Behavior of `to` and `from` selectors": ipBlock "selects particular IP
270
+ * CIDR ranges to allow as ingress sources or egress destinations. These should be cluster-external IPs".
271
+ *
272
+ * ## Rejected alternatives
273
+ *
274
+ * - **`0.0.0.0/0` except the RFC 1918 ranges** (the usual "internet only" shape). It would cut a managed service reached
275
+ * over a private endpoint, which is the recommended production setup for Atlas and for every cloud database.
276
+ * - **`0.0.0.0/0` except the cluster's pod and service CIDRs.** Nothing in an environment declares them, and inventing a
277
+ * field for them would ask the operator for a fact the cluster already holds. What the exception would prevent is a
278
+ * segment member reaching an IN-CLUSTER pod on the same port through the address rule — a pod outside this namespace,
279
+ * since every non-public pod here sits behind the namespace's default-deny ingress. Whether an ipBlock matches pod
280
+ * addresses at all is left to the network plugin by the API ("it is not defined whether this happens before or after
281
+ * NetworkPolicy processing"). Where it does, a segment member reaches, on the service's port only, a public-route pod
282
+ * of this namespace (which every internet client reaches anyway) and a pod of another namespace that its own ingress
283
+ * policy leaves open. Recorded as the residual rather than closed by a guess; `k8s-network-policy-graph.test.ts`
284
+ * evaluates the set under that pessimistic reading.
285
+ */
286
+ function buildOffClusterServicePolicy(meta, podSelector, network, ports) {
287
+ return {
288
+ apiVersion: 'networking.k8s.io/v1',
289
+ kind: 'NetworkPolicy',
290
+ metadata: meta(runtimeNetworkOffClusterPolicyName(network)),
291
+ spec: {
292
+ podSelector,
293
+ policyTypes: ['Egress'],
294
+ egress: [
295
+ {
296
+ to: OFF_CLUSTER_ADDRESS_BLOCKS.map((cidr) => ({ ipBlock: { cidr } })),
297
+ ports: ports.map((port) => ({ protocol: 'TCP', port })),
298
+ },
299
+ ],
300
+ },
301
+ };
302
+ }
104
303
  //# sourceMappingURL=runtime-network-policy.js.map
@@ -1 +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;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rB,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"]}
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,GAEhC,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;;;;GAeG;AAEH,gEAAgE;AAChE,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAC1C,SAAkD,EAClD,WAAiD,EACjD,OAAwC;IAExC,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,M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","sourcesContent":["import type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';\nimport type { RuntimeAccessDeclaration } from './runtime-backing-service-access';\nimport {\n WildoRuntimeNetwork,\n isInternalNetwork,\n resolveRuntimeNetworkMembership,\n type RuntimeNetworkMembershipOptions,\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: RuntimeNetworkMembershipOptions,\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/**\n * Pod labels for a pod that is not an application runtime principal (a backing service, a platform service, a one-shot\n * init Job), from the segments it belongs to (#3372).\n *\n * The same `wildo.ai/net-<segment>: \"true\"` vocabulary as {@link buildRuntimeNetworkPodLabels}, deliberately: a\n * Kubernetes segment is FLAT, exactly like the compose network it renders (every member reaches every member), so the\n * service and its clients are described by one string. A label per role (`serves-` / `joins-`) was considered and\n * rejected: compose leaves every intra-segment call implicit (the backend dispatching to a worker over the platform\n * segment, mongod and mongot dialling each other over the Mongo one), so a role split would have to enumerate edges\n * nobody has written down, and a missed one is an outage the compose lane does not have.\n */\nexport function buildNetworkMembershipPodLabels(networks: Iterable<WildoRuntimeNetwork>): Record<string, string> {\n const labels: Record<string, string> = {};\n for (const network of networks) {\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 * Where the cluster DNS answers, for the egress allow every pod needs (#3372).\n *\n * The control plane sets an immutable `kubernetes.io/metadata.name` label on every namespace, so a policy can name\n * `kube-system`; CoreDNS keeps `k8s-app: kube-dns` for backward compatibility with the kube-dns it replaced. Port 53 on\n * BOTH protocols: UDP for ordinary lookups, TCP for a truncated answer.\n *\n * spec-cite: https://kubernetes.io/docs/concepts/services-networking/network-policies/ — \"Targeting a Namespace by its\n * name\"; https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/ — \"Check if the DNS pod is\n * running\" (the `k8s-app=kube-dns` value for CoreDNS).\n */\nexport const CLUSTER_DNS_SELECTOR = {\n NAMESPACE_LABELS: { 'kubernetes.io/metadata.name': 'kube-system' },\n POD_LABELS: { 'k8s-app': 'kube-dns' },\n PORT: 53,\n} as const;\n\n/** The name of the segment-allow policy for one network, shared by the builder and anything that reads its output. */\nexport function runtimeNetworkPolicyName(network: WildoRuntimeNetwork): string {\n return `wildo-allow-${network}`;\n}\n\n/** The name of the namespace-wide DNS egress allow. */\nexport const RUNTIME_NETWORK_DNS_POLICY_NAME = 'wildo-allow-dns';\n\n/**\n * A backing service a segment's members reach OFF the cluster (#3511): an environment that declares it MANAGED (a\n * MongoDB Atlas cluster, a managed PostgreSQL, a managed broker) has no pod for it in the namespace, so the segment's\n * pod-selector allow reaches nothing and the default-deny would cut its clients off. The deployment lane derives these\n * from the environment's declared providers; this module only renders them.\n */\nexport interface RuntimeNetworkOffClusterService {\n /** The INTERNAL segment whose members are the service's clients. */\n readonly network: WildoRuntimeNetwork;\n /** The TCP ports the service answers on. */\n readonly ports: readonly number[];\n}\n\n/** What the namespace's policy set depends on beyond the segment vocabulary. */\nexport interface RuntimeNetworkPolicyOptions {\n /** The backing services served off the cluster, one egress allow per segment. Empty when everything is self-hosted. */\n readonly offClusterServices?: readonly RuntimeNetworkOffClusterService[];\n /**\n * Whether certificates are issued in this namespace by an ACME HTTP-01 issuer (the remote cluster's cert-manager\n * `ClusterIssuer`). cert-manager then creates a temporary solver pod in the namespace, which the ingress controller\n * must reach for the challenge to be answered; under the default-deny it could not, and no certificate would issue.\n */\n readonly admitsAcmeHttp01Solver?: boolean;\n}\n\n/** The name of the off-cluster egress allow of one segment. */\nexport function runtimeNetworkOffClusterPolicyName(network: WildoRuntimeNetwork): string {\n return `${runtimeNetworkPolicyName(network)}-off-cluster`;\n}\n\n/**\n * Every address, in both families: the destination of an off-cluster allow, which is then bounded by the service's\n * ports and by the segment label rather than by an address range.\n */\nexport const OFF_CLUSTER_ADDRESS_BLOCKS = ['0.0.0.0/0', '::/0'] as const;\n\n/**\n * cert-manager's ACME HTTP-01 solver pod: the label cert-manager puts on it and the port it listens on, read from\n * cert-manager's source (`SolverIdentificationLabelKey`, `acmeSolverListenPort`). The pod is created in the namespace\n * of the Challenge, which is the namespace of the Ingress that asked for the certificate, so this namespace.\n *\n * spec-cite: https://github.com/cert-manager/cert-manager/blob/master/pkg/apis/acme/v1/types.go —\n * `SolverIdentificationLabelKey = \"acme.cert-manager.io/http01-solver\"`;\n * https://github.com/cert-manager/cert-manager/blob/master/pkg/issuer/acme/http/http.go — `acmeSolverListenPort = 8089`;\n * https://cert-manager.io/docs/configuration/acme/http01/ — \"Network Policy Considerations\" (allow the ingress controller\n * to reach the temporary solver resources).\n */\nexport const ACME_HTTP01_SOLVER_SELECTOR = {\n POD_LABELS: { 'acme.cert-manager.io/http01-solver': 'true' },\n PORT: 8089,\n} as const;\n\n/** The name of the ingress allow for cert-manager's ACME HTTP-01 solver pods. */\nexport const ACME_HTTP01_SOLVER_POLICY_NAME = 'wildo-allow-acme-http01-solver';\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. **A DNS egress allow for every pod** (#3372). A default-deny egress also\n * denies the lookup that precedes every connection, so without it no pod can\n * resolve the Service of a backing service it is otherwise allowed to reach.\n * It opens the cluster DNS pods on port 53 and nothing else.\n * 3. **One policy per INTERNAL network, in BOTH directions** (#3372): a pod carrying\n * the network's label may reach, and be reached by, every other pod carrying\n * it. Until #3372 this was ingress-only, and under a default-deny egress that\n * meant no client could open a connection to its backing service at all; the\n * backing-service pods carried no label either, so they were unreachable from\n * both ends.\n * 4. **An ingress allow for `wildo-edge`** (#3372): a pod serving a public route is\n * reached through the ingress controller, which runs in another namespace (or\n * on the node's network), so its ingress is open to every source. The edge is\n * public by definition; segmenting it here would only cut the route the\n * ingress object exists to provide. It grants the edge pod no egress.\n * 5. **One egress policy for `wildo-egress`**, the only door off the cluster\n * below the edge, admitting only pods that AUTHORED the need.\n * 6. **One egress policy per segment whose backing service is served OFF the\n * cluster** (#3511), from `options.offClusterServices`: the segment's members\n * may open a connection to any address on that service's ports, and nothing\n * else. See {@link buildOffClusterServicePolicy} for why the destination is\n * every address.\n * 7. **An ingress allow for cert-manager's ACME HTTP-01 solver pods** (#3511),\n * when `options.admitsAcmeHttp01Solver`: open to every source on the solver's\n * port, for the same reason as the edge (the challenge arrives through the\n * ingress controller, from the ACME server on the internet).\n *\n * ⚠️ The default-deny is inert until pods carry labels from\n * {@link buildRuntimeNetworkPodLabels} / {@link buildNetworkMembershipPodLabels}.\n * Emitting the policies WITHOUT wiring the labels denies everything at the first\n * deployment — which is what #3372 found: the application runtimes were\n * labelled, the backing services they dial were not.\n */\nexport function buildRuntimeNetworkPolicyDocuments(\n namespace?: string,\n options: RuntimeNetworkPolicyOptions = {},\n): readonly RuntimeNetworkPolicyDocument[] {\n const meta = (name: string): RuntimeNetworkPolicyDocument['metadata'] =>\n namespace ? { name, namespace } : { name };\n const member = (network: WildoRuntimeNetwork): { matchLabels: Record<string, string> } => ({\n matchLabels: { [`${RUNTIME_NETWORK_LABEL_PREFIX}${network}`]: 'true' },\n });\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 apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(RUNTIME_NETWORK_DNS_POLICY_NAME),\n spec: {\n podSelector: {},\n policyTypes: ['Egress'],\n egress: [\n {\n // ONE peer carrying both selectors: the DNS pods IN kube-system. Two\n // peers would mean \"any pod in kube-system, OR any kube-dns pod\".\n to: [\n {\n namespaceSelector: { matchLabels: { ...CLUSTER_DNS_SELECTOR.NAMESPACE_LABELS } },\n podSelector: { matchLabels: { ...CLUSTER_DNS_SELECTOR.POD_LABELS } },\n },\n ],\n ports: [\n { protocol: 'UDP', port: CLUSTER_DNS_SELECTOR.PORT },\n { protocol: 'TCP', port: CLUSTER_DNS_SELECTOR.PORT },\n ],\n },\n ],\n },\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(runtimeNetworkPolicyName(network)),\n spec: {\n podSelector: member(network),\n policyTypes: ['Ingress', 'Egress'],\n ingress: [{ from: [{ podSelector: member(network) }] }],\n egress: [{ to: [{ podSelector: member(network) }] }],\n },\n });\n }\n\n documents.push({\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(runtimeNetworkPolicyName(WildoRuntimeNetwork.EDGE)),\n spec: {\n podSelector: member(WildoRuntimeNetwork.EDGE),\n policyTypes: ['Ingress'],\n // One rule with no `from`: every source. See point 4 above.\n ingress: [{}],\n },\n });\n\n documents.push({\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(runtimeNetworkPolicyName(WildoRuntimeNetwork.EGRESS)),\n spec: {\n podSelector: member(WildoRuntimeNetwork.EGRESS),\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 // One policy per segment, its ports merged: two declarations naming the same segment are one door, not two.\n const offClusterPorts = new Map<WildoRuntimeNetwork, Set<number>>();\n for (const service of options.offClusterServices ?? []) {\n if (!isInternalNetwork(service.network)) {\n throw new Error(`An off-cluster service is reached by the members of an internal segment, not of '${service.network}'.`);\n }\n if (service.ports.length === 0) {\n throw new Error(`The off-cluster service of '${service.network}' declares no port; an allow without one would open every port.`);\n }\n const ports = offClusterPorts.get(service.network) ?? new Set<number>();\n for (const port of service.ports) ports.add(port);\n offClusterPorts.set(service.network, ports);\n }\n for (const network of Object.values(WildoRuntimeNetwork)) {\n const ports = offClusterPorts.get(network);\n if (ports) documents.push(buildOffClusterServicePolicy(meta, member(network), network, [...ports].sort((a, b) => a - b)));\n }\n\n if (options.admitsAcmeHttp01Solver) {\n documents.push({\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(ACME_HTTP01_SOLVER_POLICY_NAME),\n spec: {\n podSelector: { matchLabels: { ...ACME_HTTP01_SOLVER_SELECTOR.POD_LABELS } },\n policyTypes: ['Ingress'],\n // Every source, on the solver's port only: the challenge request is the ACME server's, relayed by the ingress\n // controller from another namespace, and cert-manager's own self-check takes the same path. No egress: the pod\n // only answers.\n ingress: [{ ports: [{ protocol: 'TCP', port: ACME_HTTP01_SOLVER_SELECTOR.PORT }] }],\n },\n });\n }\n\n return documents;\n}\n\n/**\n * The egress allow of a segment whose backing service lives off the cluster (#3511).\n *\n * ## Why the destination is every address, bounded by port\n *\n * A NetworkPolicy cannot name a destination by DNS name, and a managed service has no address the deployment knows:\n * the endpoint is a name (`*.mongodb.net`, a provider's database host) whose addresses the provider changes, an Atlas\n * `mongodb+srv` URL resolves to a set of hosts only at connect time, and a private endpoint (VPC peering, Private Link)\n * answers on a private address. So the rule names every address on the service's ports, and the segment label decides\n * WHO may use it: a worker, which is on no data segment, still reaches no database port anywhere.\n *\n * spec-cite: https://kubernetes.io/docs/concepts/services-networking/network-policies/ — \"What you can't do with network\n * policies\": \"Targeting of services by name\"; \"Behavior of `to` and `from` selectors\": ipBlock \"selects particular IP\n * CIDR ranges to allow as ingress sources or egress destinations. These should be cluster-external IPs\".\n *\n * ## Rejected alternatives\n *\n * - **`0.0.0.0/0` except the RFC 1918 ranges** (the usual \"internet only\" shape). It would cut a managed service reached\n * over a private endpoint, which is the recommended production setup for Atlas and for every cloud database.\n * - **`0.0.0.0/0` except the cluster's pod and service CIDRs.** Nothing in an environment declares them, and inventing a\n * field for them would ask the operator for a fact the cluster already holds. What the exception would prevent is a\n * segment member reaching an IN-CLUSTER pod on the same port through the address rule — a pod outside this namespace,\n * since every non-public pod here sits behind the namespace's default-deny ingress. Whether an ipBlock matches pod\n * addresses at all is left to the network plugin by the API (\"it is not defined whether this happens before or after\n * NetworkPolicy processing\"). Where it does, a segment member reaches, on the service's port only, a public-route pod\n * of this namespace (which every internet client reaches anyway) and a pod of another namespace that its own ingress\n * policy leaves open. Recorded as the residual rather than closed by a guess; `k8s-network-policy-graph.test.ts`\n * evaluates the set under that pessimistic reading.\n */\nfunction buildOffClusterServicePolicy(\n meta: (name: string) => RuntimeNetworkPolicyDocument['metadata'],\n podSelector: { matchLabels: Record<string, string> },\n network: WildoRuntimeNetwork,\n ports: readonly number[],\n): RuntimeNetworkPolicyDocument {\n return {\n apiVersion: 'networking.k8s.io/v1',\n kind: 'NetworkPolicy',\n metadata: meta(runtimeNetworkOffClusterPolicyName(network)),\n spec: {\n podSelector,\n policyTypes: ['Egress'],\n egress: [\n {\n to: OFF_CLUSTER_ADDRESS_BLOCKS.map((cidr) => ({ ipBlock: { cidr } })),\n ports: ports.map((port) => ({ protocol: 'TCP', port })),\n },\n ],\n },\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { InfraCapability } from '../project-config/shared/infra-providers.schemas';
2
2
  import type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';
3
- import { type RuntimeAccessDeclaration } from './runtime-backing-service-access';
3
+ import { type RuntimeAccessDeclaration, type RuntimeApplicationStores } from './runtime-backing-service-access';
4
4
  /**
5
5
  * The network segments a Wildo deployment is divided into (Step 5-egress).
6
6
  *
@@ -31,6 +31,13 @@ export declare enum WildoRuntimeNetwork {
31
31
  DATA_AUDIT = "wildo-data-audit",
32
32
  /** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */
33
33
  DATA_TELEMETRY = "wildo-data-telemetry",
34
+ /**
35
+ * The platform's own key custodian (#2933, the self-hosted OpenBao). No application runtime joins it: no
36
+ * {@link InfraCapability} maps here, so {@link resolveRuntimeNetworkMembership} can never return it. Its members are
37
+ * the Vault itself and apps-manager, its only client (#3372 named it here so the Kubernetes lane can segment it the
38
+ * way the compose lane always has).
39
+ */
40
+ DATA_KEYS = "wildo-data-keys",
34
41
  /**
35
42
  * The ONLY non-internal network below the edge. Attachment to any non-internal
36
43
  * network restores NAT, so "can this runtime reach the internet?" is decided
@@ -49,6 +56,13 @@ export declare enum WildoRuntimeNetwork {
49
56
  * needs no network of its own, and every `null` states why.
50
57
  */
51
58
  export declare const NETWORK_FOR_CAPABILITY: Record<InfraCapability, WildoRuntimeNetwork | null>;
59
+ /**
60
+ * What a deployment lane knows beyond the runtime's own declaration: the application's store (#3367), required so no
61
+ * lane can omit it and keep a route to the other store, and whether a proxy routes HTTP to the container.
62
+ */
63
+ export interface RuntimeNetworkMembershipOptions extends RuntimeApplicationStores {
64
+ readonly servesHttp?: boolean;
65
+ }
52
66
  /**
53
67
  * The networks a runtime's container joins.
54
68
  *
@@ -63,9 +77,7 @@ export declare const NETWORK_FOR_CAPABILITY: Record<InfraCapability, WildoRuntim
63
77
  * bootstrap material. Withholding it would strand every runtime at boot, and it
64
78
  * grants no application data.
65
79
  */
66
- export declare function resolveRuntimeNetworkMembership(principal: ApplicationRuntimePrincipal | undefined, declaration?: RuntimeAccessDeclaration | undefined, options?: {
67
- readonly servesHttp?: boolean;
68
- }): ReadonlySet<WildoRuntimeNetwork>;
80
+ export declare function resolveRuntimeNetworkMembership(principal: ApplicationRuntimePrincipal | undefined, declaration: RuntimeAccessDeclaration | undefined, options: RuntimeNetworkMembershipOptions): ReadonlySet<WildoRuntimeNetwork>;
69
81
  /**
70
82
  * Networks that must be declared `internal: true`.
71
83
  *
@@ -74,4 +86,19 @@ export declare function resolveRuntimeNetworkMembership(principal: ApplicationRu
74
86
  * one you get by not thinking about it.
75
87
  */
76
88
  export declare function isInternalNetwork(network: WildoRuntimeNetwork): boolean;
89
+ /**
90
+ * The Docker Compose network NAME of each runtime segment, for the compose lanes (the platform stack's app runtimes and
91
+ * the self-hosted application stack).
92
+ *
93
+ * Total over {@link WildoRuntimeNetwork}, so a segment added there is a compile error here rather than a membership a
94
+ * compose file silently drops. `null` means compose declares no such network: `EGRESS`, because the compose data
95
+ * segments are `internal: true` and no compose file declares an egress network, so an authored `requiresInternetEgress`
96
+ * cannot be expressed there; it stays a Kubernetes `NetworkPolicy` fact.
97
+ */
98
+ export declare const COMPOSE_NETWORK_NAME: Record<WildoRuntimeNetwork, string | null>;
99
+ /**
100
+ * A runtime's compose networks: {@link resolveRuntimeNetworkMembership}, the one derivation the Kubernetes pod labels and
101
+ * the runtime's environment also read, named for compose and in segment order so a rendered file is stable between syncs.
102
+ */
103
+ export declare function resolveRuntimeComposeNetworks(principal: ApplicationRuntimePrincipal | undefined, declaration: RuntimeAccessDeclaration | undefined, options: RuntimeNetworkMembershipOptions): string[];
77
104
  //# sourceMappingURL=runtime-network-topology.d.ts.map
@@ -1 +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,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,CAwBtF,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"}
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,EAC7B,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,8FAA8F;IAC9F,UAAU,qBAAqB;IAC/B,0FAA0F;IAC1F,cAAc,yBAAyB;IACvC;;;;;OAKG;IACH,SAAS,oBAAoB;IAC7B;;;;;OAKG;IACH,MAAM,iBAAiB;CACxB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,eAAe,EAAE,mBAAmB,GAAG,IAAI,CAwBtF,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,+BAAgC,SAAQ,wBAAwB;IAC/E,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,2BAA2B,GAAG,SAAS,EAClD,WAAW,EAAE,wBAAwB,GAAG,SAAS,EACjD,OAAO,EA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