typekro 0.44.0 → 0.45.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.
Files changed (462) hide show
  1. package/dist/core/kubernetes/bun-api-client.d.ts +0 -10
  2. package/dist/core/kubernetes/bun-api-client.d.ts.map +1 -1
  3. package/dist/core/kubernetes/bun-api-client.js +77 -3
  4. package/dist/core/kubernetes/bun-api-client.js.map +1 -1
  5. package/dist/core/kubernetes/bun-http-library.d.ts.map +1 -1
  6. package/dist/core/kubernetes/bun-http-library.js +5 -1
  7. package/dist/core/kubernetes/bun-http-library.js.map +1 -1
  8. package/dist/core/references/schema-proxy.d.ts +17 -0
  9. package/dist/core/references/schema-proxy.d.ts.map +1 -1
  10. package/dist/core/references/schema-proxy.js +53 -3
  11. package/dist/core/references/schema-proxy.js.map +1 -1
  12. package/dist/core/serialization/schema.d.ts.map +1 -1
  13. package/dist/core/serialization/schema.js +52 -20
  14. package/dist/core/serialization/schema.js.map +1 -1
  15. package/dist/core/types/serialization.d.ts +5 -2
  16. package/dist/core/types/serialization.d.ts.map +1 -1
  17. package/dist/factories/apisix/resources/helm.d.ts +2 -2
  18. package/dist/factories/apisix/resources/helm.d.ts.map +1 -1
  19. package/dist/factories/apisix/resources/helm.js +7 -11
  20. package/dist/factories/apisix/resources/helm.js.map +1 -1
  21. package/dist/factories/aws-load-balancer-controller/compositions/bootstrap.d.ts +38 -0
  22. package/dist/factories/aws-load-balancer-controller/compositions/bootstrap.d.ts.map +1 -0
  23. package/dist/factories/aws-load-balancer-controller/compositions/bootstrap.js +101 -0
  24. package/dist/factories/aws-load-balancer-controller/compositions/bootstrap.js.map +1 -0
  25. package/dist/factories/aws-load-balancer-controller/compositions/helm-repository.d.ts +10 -0
  26. package/dist/factories/aws-load-balancer-controller/compositions/helm-repository.d.ts.map +1 -0
  27. package/dist/factories/aws-load-balancer-controller/compositions/helm-repository.js +25 -0
  28. package/dist/factories/aws-load-balancer-controller/compositions/helm-repository.js.map +1 -0
  29. package/dist/factories/aws-load-balancer-controller/compositions/index.d.ts +3 -0
  30. package/dist/factories/aws-load-balancer-controller/compositions/index.d.ts.map +1 -0
  31. package/dist/factories/aws-load-balancer-controller/compositions/index.js +3 -0
  32. package/dist/factories/aws-load-balancer-controller/compositions/index.js.map +1 -0
  33. package/dist/factories/aws-load-balancer-controller/constants.d.ts +21 -0
  34. package/dist/factories/aws-load-balancer-controller/constants.d.ts.map +1 -0
  35. package/dist/factories/aws-load-balancer-controller/constants.js +29 -0
  36. package/dist/factories/aws-load-balancer-controller/constants.js.map +1 -0
  37. package/dist/factories/aws-load-balancer-controller/index.d.ts +17 -0
  38. package/dist/factories/aws-load-balancer-controller/index.d.ts.map +1 -0
  39. package/dist/factories/aws-load-balancer-controller/index.js +16 -0
  40. package/dist/factories/aws-load-balancer-controller/index.js.map +1 -0
  41. package/dist/factories/aws-load-balancer-controller/resources/elbv2.d.ts +45 -0
  42. package/dist/factories/aws-load-balancer-controller/resources/elbv2.d.ts.map +1 -0
  43. package/dist/factories/aws-load-balancer-controller/resources/elbv2.js +148 -0
  44. package/dist/factories/aws-load-balancer-controller/resources/elbv2.js.map +1 -0
  45. package/dist/factories/aws-load-balancer-controller/resources/helm.d.ts +36 -0
  46. package/dist/factories/aws-load-balancer-controller/resources/helm.d.ts.map +1 -0
  47. package/dist/factories/aws-load-balancer-controller/resources/helm.js +96 -0
  48. package/dist/factories/aws-load-balancer-controller/resources/helm.js.map +1 -0
  49. package/dist/factories/aws-load-balancer-controller/resources/index.d.ts +3 -0
  50. package/dist/factories/aws-load-balancer-controller/resources/index.d.ts.map +1 -0
  51. package/dist/factories/aws-load-balancer-controller/resources/index.js +3 -0
  52. package/dist/factories/aws-load-balancer-controller/resources/index.js.map +1 -0
  53. package/dist/factories/aws-load-balancer-controller/types.d.ts +267 -0
  54. package/dist/factories/aws-load-balancer-controller/types.d.ts.map +1 -0
  55. package/dist/factories/aws-load-balancer-controller/types.js +81 -0
  56. package/dist/factories/aws-load-balancer-controller/types.js.map +1 -0
  57. package/dist/factories/aws-load-balancer-controller/utils/helm-values-mapper.d.ts +27 -0
  58. package/dist/factories/aws-load-balancer-controller/utils/helm-values-mapper.d.ts.map +1 -0
  59. package/dist/factories/aws-load-balancer-controller/utils/helm-values-mapper.js +171 -0
  60. package/dist/factories/aws-load-balancer-controller/utils/helm-values-mapper.js.map +1 -0
  61. package/dist/factories/aws-load-balancer-controller/utils/index.d.ts +2 -0
  62. package/dist/factories/aws-load-balancer-controller/utils/index.d.ts.map +1 -0
  63. package/dist/factories/aws-load-balancer-controller/utils/index.js +2 -0
  64. package/dist/factories/aws-load-balancer-controller/utils/index.js.map +1 -0
  65. package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.d.ts +6 -4
  66. package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.d.ts.map +1 -1
  67. package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.js +22 -196
  68. package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.js.map +1 -1
  69. package/dist/factories/cert-manager/resources/helm.d.ts.map +1 -1
  70. package/dist/factories/cert-manager/resources/helm.js +30 -51
  71. package/dist/factories/cert-manager/resources/helm.js.map +1 -1
  72. package/dist/factories/cert-manager/types.d.ts +54 -6
  73. package/dist/factories/cert-manager/types.d.ts.map +1 -1
  74. package/dist/factories/cert-manager/types.js +45 -12
  75. package/dist/factories/cert-manager/types.js.map +1 -1
  76. package/dist/factories/cert-manager/utils/helm-values-mapper.js +203 -76
  77. package/dist/factories/cert-manager/utils/helm-values-mapper.js.map +1 -1
  78. package/dist/factories/cilium/resources/helm.d.ts.map +1 -1
  79. package/dist/factories/cilium/resources/helm.js +23 -0
  80. package/dist/factories/cilium/resources/helm.js.map +1 -1
  81. package/dist/factories/cilium/types.d.ts +2 -1
  82. package/dist/factories/cilium/types.d.ts.map +1 -1
  83. package/dist/factories/cilium/types.js.map +1 -1
  84. package/dist/factories/clickhouse/resources/helm.d.ts.map +1 -1
  85. package/dist/factories/clickhouse/resources/helm.js +2 -1
  86. package/dist/factories/clickhouse/resources/helm.js.map +1 -1
  87. package/dist/factories/clickhouse/types.d.ts +2 -1
  88. package/dist/factories/clickhouse/types.d.ts.map +1 -1
  89. package/dist/factories/clickhouse/types.js.map +1 -1
  90. package/dist/factories/clickstack/resources/helm.d.ts.map +1 -1
  91. package/dist/factories/clickstack/resources/helm.js +3 -2
  92. package/dist/factories/clickstack/resources/helm.js.map +1 -1
  93. package/dist/factories/clickstack/types.d.ts +3 -3
  94. package/dist/factories/clickstack/types.d.ts.map +1 -1
  95. package/dist/factories/clickstack/types.js.map +1 -1
  96. package/dist/factories/cnpg/resources/helm.d.ts.map +1 -1
  97. package/dist/factories/cnpg/resources/helm.js +2 -1
  98. package/dist/factories/cnpg/resources/helm.js.map +1 -1
  99. package/dist/factories/cnpg/types.d.ts +2 -1
  100. package/dist/factories/cnpg/types.d.ts.map +1 -1
  101. package/dist/factories/cnpg/types.js.map +1 -1
  102. package/dist/factories/crowdsec/compositions/crowdsec-bootstrap.d.ts +33 -0
  103. package/dist/factories/crowdsec/compositions/crowdsec-bootstrap.d.ts.map +1 -0
  104. package/dist/factories/crowdsec/compositions/crowdsec-bootstrap.js +174 -0
  105. package/dist/factories/crowdsec/compositions/crowdsec-bootstrap.js.map +1 -0
  106. package/dist/factories/crowdsec/compositions/crowdsec-helm-repository.d.ts +10 -0
  107. package/dist/factories/crowdsec/compositions/crowdsec-helm-repository.d.ts.map +1 -0
  108. package/dist/factories/crowdsec/compositions/crowdsec-helm-repository.js +25 -0
  109. package/dist/factories/crowdsec/compositions/crowdsec-helm-repository.js.map +1 -0
  110. package/dist/factories/crowdsec/compositions/index.d.ts +3 -0
  111. package/dist/factories/crowdsec/compositions/index.d.ts.map +1 -0
  112. package/dist/factories/crowdsec/compositions/index.js +3 -0
  113. package/dist/factories/crowdsec/compositions/index.js.map +1 -0
  114. package/dist/factories/crowdsec/constants.d.ts +38 -0
  115. package/dist/factories/crowdsec/constants.d.ts.map +1 -0
  116. package/dist/factories/crowdsec/constants.js +42 -0
  117. package/dist/factories/crowdsec/constants.js.map +1 -0
  118. package/dist/factories/crowdsec/index.d.ts +12 -0
  119. package/dist/factories/crowdsec/index.d.ts.map +1 -0
  120. package/dist/factories/crowdsec/index.js +12 -0
  121. package/dist/factories/crowdsec/index.js.map +1 -0
  122. package/dist/factories/crowdsec/resources/helm.d.ts +52 -0
  123. package/dist/factories/crowdsec/resources/helm.d.ts.map +1 -0
  124. package/dist/factories/crowdsec/resources/helm.js +78 -0
  125. package/dist/factories/crowdsec/resources/helm.js.map +1 -0
  126. package/dist/factories/crowdsec/resources/index.d.ts +2 -0
  127. package/dist/factories/crowdsec/resources/index.d.ts.map +1 -0
  128. package/dist/factories/crowdsec/resources/index.js +2 -0
  129. package/dist/factories/crowdsec/resources/index.js.map +1 -0
  130. package/dist/factories/crowdsec/types.d.ts +266 -0
  131. package/dist/factories/crowdsec/types.d.ts.map +1 -0
  132. package/dist/factories/crowdsec/types.js +43 -0
  133. package/dist/factories/crowdsec/types.js.map +1 -0
  134. package/dist/factories/crowdsec/utils/helm-values-mapper.d.ts +40 -0
  135. package/dist/factories/crowdsec/utils/helm-values-mapper.d.ts.map +1 -0
  136. package/dist/factories/crowdsec/utils/helm-values-mapper.js +473 -0
  137. package/dist/factories/crowdsec/utils/helm-values-mapper.js.map +1 -0
  138. package/dist/factories/crowdsec/utils/index.d.ts +3 -0
  139. package/dist/factories/crowdsec/utils/index.d.ts.map +1 -0
  140. package/dist/factories/crowdsec/utils/index.js +3 -0
  141. package/dist/factories/crowdsec/utils/index.js.map +1 -0
  142. package/dist/factories/crowdsec/utils/net.js +68 -0
  143. package/dist/factories/crowdsec/utils/net.js.map +1 -0
  144. package/dist/factories/crowdsec/utils/traefik-bouncer.d.ts +48 -0
  145. package/dist/factories/crowdsec/utils/traefik-bouncer.d.ts.map +1 -0
  146. package/dist/factories/crowdsec/utils/traefik-bouncer.js +302 -0
  147. package/dist/factories/crowdsec/utils/traefik-bouncer.js.map +1 -0
  148. package/dist/factories/dagster/resources/helm.d.ts.map +1 -1
  149. package/dist/factories/dagster/resources/helm.js +2 -0
  150. package/dist/factories/dagster/resources/helm.js.map +1 -1
  151. package/dist/factories/dagster/types.d.ts +2 -2
  152. package/dist/factories/dagster/types.d.ts.map +1 -1
  153. package/dist/factories/dagster/types.js.map +1 -1
  154. package/dist/factories/envoy-ai-gateway/resources/helm.d.ts.map +1 -1
  155. package/dist/factories/envoy-ai-gateway/resources/helm.js +17 -14
  156. package/dist/factories/envoy-ai-gateway/resources/helm.js.map +1 -1
  157. package/dist/factories/envoy-ai-gateway/types.d.ts +2 -2
  158. package/dist/factories/envoy-ai-gateway/types.d.ts.map +1 -1
  159. package/dist/factories/external-dns/resources/helm.d.ts.map +1 -1
  160. package/dist/factories/external-dns/resources/helm.js +2 -0
  161. package/dist/factories/external-dns/resources/helm.js.map +1 -1
  162. package/dist/factories/external-dns/types.d.ts +2 -1
  163. package/dist/factories/external-dns/types.d.ts.map +1 -1
  164. package/dist/factories/external-dns/types.js.map +1 -1
  165. package/dist/factories/harbor/resources/helm.d.ts.map +1 -1
  166. package/dist/factories/harbor/resources/helm.js +11 -7
  167. package/dist/factories/harbor/resources/helm.js.map +1 -1
  168. package/dist/factories/harbor/types.d.ts +2 -1
  169. package/dist/factories/harbor/types.d.ts.map +1 -1
  170. package/dist/factories/harbor/types.js.map +1 -1
  171. package/dist/factories/hatchet/resources/helm.d.ts.map +1 -1
  172. package/dist/factories/hatchet/resources/helm.js +13 -10
  173. package/dist/factories/hatchet/resources/helm.js.map +1 -1
  174. package/dist/factories/hatchet/types.d.ts +2 -1
  175. package/dist/factories/hatchet/types.d.ts.map +1 -1
  176. package/dist/factories/hatchet/types.js.map +1 -1
  177. package/dist/factories/helm/helm-release.d.ts.map +1 -1
  178. package/dist/factories/helm/helm-release.js +3 -31
  179. package/dist/factories/helm/helm-release.js.map +1 -1
  180. package/dist/factories/helm/index.d.ts +3 -1
  181. package/dist/factories/helm/index.d.ts.map +1 -1
  182. package/dist/factories/helm/index.js +1 -0
  183. package/dist/factories/helm/index.js.map +1 -1
  184. package/dist/factories/helm/lifecycle.d.ts +32 -0
  185. package/dist/factories/helm/lifecycle.d.ts.map +1 -0
  186. package/dist/factories/helm/lifecycle.js +165 -0
  187. package/dist/factories/helm/lifecycle.js.map +1 -0
  188. package/dist/factories/helm/types.d.ts +22 -0
  189. package/dist/factories/helm/types.d.ts.map +1 -1
  190. package/dist/factories/inngest/resources/helm.d.ts.map +1 -1
  191. package/dist/factories/inngest/resources/helm.js +2 -0
  192. package/dist/factories/inngest/resources/helm.js.map +1 -1
  193. package/dist/factories/inngest/types.d.ts +2 -1
  194. package/dist/factories/inngest/types.d.ts.map +1 -1
  195. package/dist/factories/inngest/types.js.map +1 -1
  196. package/dist/factories/karpenter/compositions/index.d.ts +3 -0
  197. package/dist/factories/karpenter/compositions/index.d.ts.map +1 -0
  198. package/dist/factories/karpenter/compositions/index.js +3 -0
  199. package/dist/factories/karpenter/compositions/index.js.map +1 -0
  200. package/dist/factories/karpenter/compositions/karpenter-bootstrap.d.ts +34 -0
  201. package/dist/factories/karpenter/compositions/karpenter-bootstrap.d.ts.map +1 -0
  202. package/dist/factories/karpenter/compositions/karpenter-bootstrap.js +150 -0
  203. package/dist/factories/karpenter/compositions/karpenter-bootstrap.js.map +1 -0
  204. package/dist/factories/karpenter/compositions/karpenter-helm-repository.d.ts +10 -0
  205. package/dist/factories/karpenter/compositions/karpenter-helm-repository.d.ts.map +1 -0
  206. package/dist/factories/karpenter/compositions/karpenter-helm-repository.js +25 -0
  207. package/dist/factories/karpenter/compositions/karpenter-helm-repository.js.map +1 -0
  208. package/dist/factories/karpenter/constants.d.ts +67 -0
  209. package/dist/factories/karpenter/constants.d.ts.map +1 -0
  210. package/dist/factories/karpenter/constants.js +65 -0
  211. package/dist/factories/karpenter/constants.js.map +1 -0
  212. package/dist/factories/karpenter/index.d.ts +14 -0
  213. package/dist/factories/karpenter/index.d.ts.map +1 -0
  214. package/dist/factories/karpenter/index.js +14 -0
  215. package/dist/factories/karpenter/index.js.map +1 -0
  216. package/dist/factories/karpenter/resources/ec2-node-class.d.ts +26 -0
  217. package/dist/factories/karpenter/resources/ec2-node-class.d.ts.map +1 -0
  218. package/dist/factories/karpenter/resources/ec2-node-class.js +48 -0
  219. package/dist/factories/karpenter/resources/ec2-node-class.js.map +1 -0
  220. package/dist/factories/karpenter/resources/helm.d.ts +48 -0
  221. package/dist/factories/karpenter/resources/helm.d.ts.map +1 -0
  222. package/dist/factories/karpenter/resources/helm.js +117 -0
  223. package/dist/factories/karpenter/resources/helm.js.map +1 -0
  224. package/dist/factories/karpenter/resources/index.d.ts +5 -0
  225. package/dist/factories/karpenter/resources/index.d.ts.map +1 -0
  226. package/dist/factories/karpenter/resources/index.js +5 -0
  227. package/dist/factories/karpenter/resources/index.js.map +1 -0
  228. package/dist/factories/karpenter/resources/node-pool.d.ts +32 -0
  229. package/dist/factories/karpenter/resources/node-pool.d.ts.map +1 -0
  230. package/dist/factories/karpenter/resources/node-pool.js +80 -0
  231. package/dist/factories/karpenter/resources/node-pool.js.map +1 -0
  232. package/dist/factories/karpenter/resources/readiness.d.ts +21 -0
  233. package/dist/factories/karpenter/resources/readiness.d.ts.map +1 -0
  234. package/dist/factories/karpenter/resources/readiness.js +60 -0
  235. package/dist/factories/karpenter/resources/readiness.js.map +1 -0
  236. package/dist/factories/karpenter/types.d.ts +433 -0
  237. package/dist/factories/karpenter/types.d.ts.map +1 -0
  238. package/dist/factories/karpenter/types.js +59 -0
  239. package/dist/factories/karpenter/types.js.map +1 -0
  240. package/dist/factories/karpenter/utils/helm-values-mapper.d.ts +24 -0
  241. package/dist/factories/karpenter/utils/helm-values-mapper.d.ts.map +1 -0
  242. package/dist/factories/karpenter/utils/helm-values-mapper.js +89 -0
  243. package/dist/factories/karpenter/utils/helm-values-mapper.js.map +1 -0
  244. package/dist/factories/karpenter/utils/index.d.ts +3 -0
  245. package/dist/factories/karpenter/utils/index.d.ts.map +1 -0
  246. package/dist/factories/karpenter/utils/index.js +3 -0
  247. package/dist/factories/karpenter/utils/index.js.map +1 -0
  248. package/dist/factories/karpenter/utils/validation.d.ts +42 -0
  249. package/dist/factories/karpenter/utils/validation.d.ts.map +1 -0
  250. package/dist/factories/karpenter/utils/validation.js +441 -0
  251. package/dist/factories/karpenter/utils/validation.js.map +1 -0
  252. package/dist/factories/keda/compositions/index.d.ts +3 -0
  253. package/dist/factories/keda/compositions/index.d.ts.map +1 -0
  254. package/dist/factories/keda/compositions/index.js +3 -0
  255. package/dist/factories/keda/compositions/index.js.map +1 -0
  256. package/dist/factories/keda/compositions/keda-bootstrap.d.ts +30 -0
  257. package/dist/factories/keda/compositions/keda-bootstrap.d.ts.map +1 -0
  258. package/dist/factories/keda/compositions/keda-bootstrap.js +102 -0
  259. package/dist/factories/keda/compositions/keda-bootstrap.js.map +1 -0
  260. package/dist/factories/keda/compositions/keda-helm-repository.d.ts +10 -0
  261. package/dist/factories/keda/compositions/keda-helm-repository.d.ts.map +1 -0
  262. package/dist/factories/keda/compositions/keda-helm-repository.js +25 -0
  263. package/dist/factories/keda/compositions/keda-helm-repository.js.map +1 -0
  264. package/dist/factories/keda/constants.d.ts +27 -0
  265. package/dist/factories/keda/constants.d.ts.map +1 -0
  266. package/dist/factories/keda/constants.js +27 -0
  267. package/dist/factories/keda/constants.js.map +1 -0
  268. package/dist/factories/keda/index.d.ts +14 -0
  269. package/dist/factories/keda/index.d.ts.map +1 -0
  270. package/dist/factories/keda/index.js +14 -0
  271. package/dist/factories/keda/index.js.map +1 -0
  272. package/dist/factories/keda/resources/helm.d.ts +26 -0
  273. package/dist/factories/keda/resources/helm.d.ts.map +1 -0
  274. package/dist/factories/keda/resources/helm.js +84 -0
  275. package/dist/factories/keda/resources/helm.js.map +1 -0
  276. package/dist/factories/keda/resources/index.d.ts +7 -0
  277. package/dist/factories/keda/resources/index.d.ts.map +1 -0
  278. package/dist/factories/keda/resources/index.js +7 -0
  279. package/dist/factories/keda/resources/index.js.map +1 -0
  280. package/dist/factories/keda/resources/readiness.d.ts +28 -0
  281. package/dist/factories/keda/resources/readiness.d.ts.map +1 -0
  282. package/dist/factories/keda/resources/readiness.js +70 -0
  283. package/dist/factories/keda/resources/readiness.js.map +1 -0
  284. package/dist/factories/keda/resources/scaled-job.d.ts +23 -0
  285. package/dist/factories/keda/resources/scaled-job.d.ts.map +1 -0
  286. package/dist/factories/keda/resources/scaled-job.js +43 -0
  287. package/dist/factories/keda/resources/scaled-job.js.map +1 -0
  288. package/dist/factories/keda/resources/scaled-object.d.ts +33 -0
  289. package/dist/factories/keda/resources/scaled-object.d.ts.map +1 -0
  290. package/dist/factories/keda/resources/scaled-object.js +78 -0
  291. package/dist/factories/keda/resources/scaled-object.js.map +1 -0
  292. package/dist/factories/keda/resources/trigger-authentication.d.ts +28 -0
  293. package/dist/factories/keda/resources/trigger-authentication.d.ts.map +1 -0
  294. package/dist/factories/keda/resources/trigger-authentication.js +52 -0
  295. package/dist/factories/keda/resources/trigger-authentication.js.map +1 -0
  296. package/dist/factories/keda/resources/triggers.d.ts +17 -0
  297. package/dist/factories/keda/resources/triggers.d.ts.map +1 -0
  298. package/dist/factories/keda/resources/triggers.js +21 -0
  299. package/dist/factories/keda/resources/triggers.js.map +1 -0
  300. package/dist/factories/keda/types.d.ts +580 -0
  301. package/dist/factories/keda/types.d.ts.map +1 -0
  302. package/dist/factories/keda/types.js +75 -0
  303. package/dist/factories/keda/types.js.map +1 -0
  304. package/dist/factories/keda/utils/helm-values-mapper.d.ts +21 -0
  305. package/dist/factories/keda/utils/helm-values-mapper.d.ts.map +1 -0
  306. package/dist/factories/keda/utils/helm-values-mapper.js +130 -0
  307. package/dist/factories/keda/utils/helm-values-mapper.js.map +1 -0
  308. package/dist/factories/keda/utils/index.d.ts +3 -0
  309. package/dist/factories/keda/utils/index.d.ts.map +1 -0
  310. package/dist/factories/keda/utils/index.js +3 -0
  311. package/dist/factories/keda/utils/index.js.map +1 -0
  312. package/dist/factories/keda/utils/validation.d.ts +52 -0
  313. package/dist/factories/keda/utils/validation.d.ts.map +1 -0
  314. package/dist/factories/keda/utils/validation.js +482 -0
  315. package/dist/factories/keda/utils/validation.js.map +1 -0
  316. package/dist/factories/kubernetes/policy/limit-range.d.ts.map +1 -1
  317. package/dist/factories/kubernetes/policy/limit-range.js +27 -1
  318. package/dist/factories/kubernetes/policy/limit-range.js.map +1 -1
  319. package/dist/factories/nats/resources/helm.d.ts +2 -2
  320. package/dist/factories/nats/resources/helm.d.ts.map +1 -1
  321. package/dist/factories/nats/resources/helm.js +2 -1
  322. package/dist/factories/nats/resources/helm.js.map +1 -1
  323. package/dist/factories/opensearch/resources/helm.d.ts.map +1 -1
  324. package/dist/factories/opensearch/resources/helm.js +2 -1
  325. package/dist/factories/opensearch/resources/helm.js.map +1 -1
  326. package/dist/factories/opensearch/types.d.ts +2 -1
  327. package/dist/factories/opensearch/types.d.ts.map +1 -1
  328. package/dist/factories/opensearch/types.js.map +1 -1
  329. package/dist/factories/ory/resources/helm.d.ts.map +1 -1
  330. package/dist/factories/ory/resources/helm.js +2 -0
  331. package/dist/factories/ory/resources/helm.js.map +1 -1
  332. package/dist/factories/ory/types.d.ts +2 -2
  333. package/dist/factories/ory/types.d.ts.map +1 -1
  334. package/dist/factories/ory/types.js.map +1 -1
  335. package/dist/factories/pebble/resources/helm.d.ts.map +1 -1
  336. package/dist/factories/pebble/resources/helm.js +2 -0
  337. package/dist/factories/pebble/resources/helm.js.map +1 -1
  338. package/dist/factories/pebble/types.d.ts +2 -1
  339. package/dist/factories/pebble/types.d.ts.map +1 -1
  340. package/dist/factories/pebble/types.js.map +1 -1
  341. package/dist/factories/rook/resources/helm.d.ts.map +1 -1
  342. package/dist/factories/rook/resources/helm.js +3 -2
  343. package/dist/factories/rook/resources/helm.js.map +1 -1
  344. package/dist/factories/rook/types.d.ts +2 -1
  345. package/dist/factories/rook/types.d.ts.map +1 -1
  346. package/dist/factories/rook/types.js.map +1 -1
  347. package/dist/factories/traefik/compositions/traefik-bootstrap.d.ts +43 -36
  348. package/dist/factories/traefik/compositions/traefik-bootstrap.d.ts.map +1 -1
  349. package/dist/factories/traefik/compositions/traefik-bootstrap.js +70 -38
  350. package/dist/factories/traefik/compositions/traefik-bootstrap.js.map +1 -1
  351. package/dist/factories/traefik/constants.d.ts +6 -0
  352. package/dist/factories/traefik/constants.d.ts.map +1 -1
  353. package/dist/factories/traefik/constants.js +6 -0
  354. package/dist/factories/traefik/constants.js.map +1 -1
  355. package/dist/factories/traefik/resources/common.d.ts +1 -1
  356. package/dist/factories/traefik/resources/common.js +1 -1
  357. package/dist/factories/traefik/resources/helm.d.ts.map +1 -1
  358. package/dist/factories/traefik/resources/helm.js +14 -9
  359. package/dist/factories/traefik/resources/helm.js.map +1 -1
  360. package/dist/factories/traefik/resources/middleware.d.ts +35 -1
  361. package/dist/factories/traefik/resources/middleware.d.ts.map +1 -1
  362. package/dist/factories/traefik/resources/middleware.js +71 -0
  363. package/dist/factories/traefik/resources/middleware.js.map +1 -1
  364. package/dist/factories/traefik/resources/tls.d.ts +22 -1
  365. package/dist/factories/traefik/resources/tls.d.ts.map +1 -1
  366. package/dist/factories/traefik/resources/tls.js +40 -0
  367. package/dist/factories/traefik/resources/tls.js.map +1 -1
  368. package/dist/factories/traefik/types.d.ts +176 -9
  369. package/dist/factories/traefik/types.d.ts.map +1 -1
  370. package/dist/factories/traefik/types.js +111 -2
  371. package/dist/factories/traefik/types.js.map +1 -1
  372. package/dist/factories/traefik/utils/access-log.d.ts +18 -0
  373. package/dist/factories/traefik/utils/access-log.d.ts.map +1 -0
  374. package/dist/factories/traefik/utils/access-log.js +98 -0
  375. package/dist/factories/traefik/utils/access-log.js.map +1 -0
  376. package/dist/factories/traefik/utils/aws-nlb.d.ts +55 -0
  377. package/dist/factories/traefik/utils/aws-nlb.d.ts.map +1 -0
  378. package/dist/factories/traefik/utils/aws-nlb.js +121 -0
  379. package/dist/factories/traefik/utils/aws-nlb.js.map +1 -0
  380. package/dist/factories/traefik/utils/helm-values-mapper.d.ts +30 -40
  381. package/dist/factories/traefik/utils/helm-values-mapper.d.ts.map +1 -1
  382. package/dist/factories/traefik/utils/helm-values-mapper.js +308 -41
  383. package/dist/factories/traefik/utils/helm-values-mapper.js.map +1 -1
  384. package/dist/factories/traefik/utils/index.d.ts +5 -0
  385. package/dist/factories/traefik/utils/index.d.ts.map +1 -1
  386. package/dist/factories/traefik/utils/index.js +5 -0
  387. package/dist/factories/traefik/utils/index.js.map +1 -1
  388. package/dist/factories/traefik/utils/middleware-validation.d.ts +0 -17
  389. package/dist/factories/traefik/utils/middleware-validation.d.ts.map +1 -1
  390. package/dist/factories/traefik/utils/middleware-validation.js +15 -17
  391. package/dist/factories/traefik/utils/middleware-validation.js.map +1 -1
  392. package/dist/factories/traefik/utils/plugins.d.ts +38 -0
  393. package/dist/factories/traefik/utils/plugins.d.ts.map +1 -0
  394. package/dist/factories/traefik/utils/plugins.js +175 -0
  395. package/dist/factories/traefik/utils/plugins.js.map +1 -0
  396. package/dist/factories/traefik/utils/proxy-trust.d.ts +48 -0
  397. package/dist/factories/traefik/utils/proxy-trust.d.ts.map +1 -0
  398. package/dist/factories/traefik/utils/proxy-trust.js +514 -0
  399. package/dist/factories/traefik/utils/proxy-trust.js.map +1 -0
  400. package/dist/factories/traefik/utils/trusted-range.d.ts +29 -0
  401. package/dist/factories/traefik/utils/trusted-range.d.ts.map +1 -0
  402. package/dist/factories/traefik/utils/trusted-range.js +80 -0
  403. package/dist/factories/traefik/utils/trusted-range.js.map +1 -0
  404. package/dist/factories/valkey/resources/helm.d.ts.map +1 -1
  405. package/dist/factories/valkey/resources/helm.js +2 -1
  406. package/dist/factories/valkey/resources/helm.js.map +1 -1
  407. package/dist/factories/valkey/types.d.ts +2 -1
  408. package/dist/factories/valkey/types.d.ts.map +1 -1
  409. package/dist/factories/valkey/types.js.map +1 -1
  410. package/dist/factories/vpa/compositions/index.d.ts +3 -0
  411. package/dist/factories/vpa/compositions/index.d.ts.map +1 -0
  412. package/dist/factories/vpa/compositions/index.js +3 -0
  413. package/dist/factories/vpa/compositions/index.js.map +1 -0
  414. package/dist/factories/vpa/compositions/vpa-bootstrap.d.ts +30 -0
  415. package/dist/factories/vpa/compositions/vpa-bootstrap.d.ts.map +1 -0
  416. package/dist/factories/vpa/compositions/vpa-bootstrap.js +104 -0
  417. package/dist/factories/vpa/compositions/vpa-bootstrap.js.map +1 -0
  418. package/dist/factories/vpa/compositions/vpa-helm-repository.d.ts +10 -0
  419. package/dist/factories/vpa/compositions/vpa-helm-repository.d.ts.map +1 -0
  420. package/dist/factories/vpa/compositions/vpa-helm-repository.js +25 -0
  421. package/dist/factories/vpa/compositions/vpa-helm-repository.js.map +1 -0
  422. package/dist/factories/vpa/constants.d.ts +77 -0
  423. package/dist/factories/vpa/constants.d.ts.map +1 -0
  424. package/dist/factories/vpa/constants.js +67 -0
  425. package/dist/factories/vpa/constants.js.map +1 -0
  426. package/dist/factories/vpa/index.d.ts +14 -0
  427. package/dist/factories/vpa/index.d.ts.map +1 -0
  428. package/dist/factories/vpa/index.js +14 -0
  429. package/dist/factories/vpa/index.js.map +1 -0
  430. package/dist/factories/vpa/resources/helm.d.ts +28 -0
  431. package/dist/factories/vpa/resources/helm.d.ts.map +1 -0
  432. package/dist/factories/vpa/resources/helm.js +88 -0
  433. package/dist/factories/vpa/resources/helm.js.map +1 -0
  434. package/dist/factories/vpa/resources/index.d.ts +4 -0
  435. package/dist/factories/vpa/resources/index.d.ts.map +1 -0
  436. package/dist/factories/vpa/resources/index.js +4 -0
  437. package/dist/factories/vpa/resources/index.js.map +1 -0
  438. package/dist/factories/vpa/resources/readiness.d.ts +24 -0
  439. package/dist/factories/vpa/resources/readiness.d.ts.map +1 -0
  440. package/dist/factories/vpa/resources/readiness.js +66 -0
  441. package/dist/factories/vpa/resources/readiness.js.map +1 -0
  442. package/dist/factories/vpa/resources/vertical-pod-autoscaler.d.ts +42 -0
  443. package/dist/factories/vpa/resources/vertical-pod-autoscaler.d.ts.map +1 -0
  444. package/dist/factories/vpa/resources/vertical-pod-autoscaler.js +93 -0
  445. package/dist/factories/vpa/resources/vertical-pod-autoscaler.js.map +1 -0
  446. package/dist/factories/vpa/types.d.ts +312 -0
  447. package/dist/factories/vpa/types.d.ts.map +1 -0
  448. package/dist/factories/vpa/types.js +96 -0
  449. package/dist/factories/vpa/types.js.map +1 -0
  450. package/dist/factories/vpa/utils/helm-values-mapper.d.ts +18 -0
  451. package/dist/factories/vpa/utils/helm-values-mapper.d.ts.map +1 -0
  452. package/dist/factories/vpa/utils/helm-values-mapper.js +121 -0
  453. package/dist/factories/vpa/utils/helm-values-mapper.js.map +1 -0
  454. package/dist/factories/vpa/utils/index.d.ts +3 -0
  455. package/dist/factories/vpa/utils/index.d.ts.map +1 -0
  456. package/dist/factories/vpa/utils/index.js +3 -0
  457. package/dist/factories/vpa/utils/index.js.map +1 -0
  458. package/dist/factories/vpa/utils/validation.d.ts +42 -0
  459. package/dist/factories/vpa/utils/validation.d.ts.map +1 -0
  460. package/dist/factories/vpa/utils/validation.js +225 -0
  461. package/dist/factories/vpa/utils/validation.js.map +1 -0
  462. package/package.json +21 -1
@@ -0,0 +1,514 @@
1
+ /**
2
+ * Which upstream sources a Traefik entrypoint believes.
3
+ */
4
+ // Traefik trusts two things from an upstream: a PROXY protocol header
5
+ // (`entryPoints.<name>.proxyProtocol`) and `X-Forwarded-*` headers
6
+ // (`entryPoints.<name>.forwardedHeaders`). Both are scoped by `trustedIPs`, and
7
+ // both have an `insecure` switch that trusts every source.
8
+ //
9
+ // Behind a load balancer the client address Traefik logs, rate-limits on and
10
+ // passes upstream comes from whichever of these it trusts. A range with a `/0`
11
+ // prefix (`0.0.0.0/0`, `::/0`) or `insecure: true` lets ANY client that reaches
12
+ // the entrypoint write that address itself: send a forged PROXY header or
13
+ // `X-Forwarded-For`, and the edge believes it. So both are refused unless the
14
+ // caller opts in with the clearly named `dangerouslyTrustAnySource`.
15
+ //
16
+ // The check has two halves because the values may not be concrete:
17
+ // - Direct mode runs the composition with concrete values, so
18
+ // `assertTraefikProxyTrust` inspects the final chart values in JavaScript.
19
+ // - KRO mode sees schema references there, which carry no value to inspect.
20
+ // `traefikProxyTrustSchemaFieldValidations` turns the same rule into
21
+ // `x-kubernetes-validations` on the generated CRD, so the API server refuses
22
+ // an instance that asks for it.
23
+ // Raw `values` and `additionalArguments` are build-time and concrete in both
24
+ // modes, so the `insecure` half is always checked in JavaScript.
25
+ //
26
+ // Environment variables are a third route (`TRAEFIK_ENTRYPOINTS_<NAME>_...`).
27
+ // Traefik reads them only when it has no CLI flags, and the chart always passes
28
+ // flags, so today they are inert. The guard does not rely on that. It refuses
29
+ // what it can see (a literal `insecure` or `/0` value) and also what it cannot:
30
+ // a non-empty `envFrom`, which can load any variable from a Secret or
31
+ // ConfigMap, and a trust variable whose value comes from `valueFrom` or a
32
+ // schema reference. The chart reads `env` and `envFrom` only at the top level
33
+ // of its values, for the Traefik container.
34
+ //
35
+ // A static configuration file is a fourth route, and it outranks the flags:
36
+ // when Traefik finds one it loads the file and ignores every flag
37
+ // (`pkg/cli/loader_file.go`). It looks at `--configFile`, then
38
+ // `/etc/traefik/traefik`, `$XDG_CONFIG_HOME/traefik`, `$HOME/.config/traefik`
39
+ // and `./traefik`, each with `.toml`, `.yaml` or `.yml`. The official image has
40
+ // no WORKDIR and the pinned UID 65532 has no passwd entry, so the working
41
+ // directory and HOME are `/` and XDG_CONFIG_HOME is unset (it expands to an
42
+ // empty string). The guard refuses `--configFile` and any raw-values mount at,
43
+ // or above, one of those files, since it cannot see what the file says.
44
+ //
45
+ // Raw `values` are trusted input. The guard catches misconfiguration, not
46
+ // deliberate YAML injection through raw values.
47
+ import { TypeKroError } from '../../../core/errors.js';
48
+ import { Cel } from '../../../core/references/cel.js';
49
+ import { KUBERNETES_REF_MARKER_SOURCE } from '../../../shared/brands.js';
50
+ import { isCelExpression, isKubernetesRef } from '../../../utils/type-guards.js';
51
+ import { parseTraefikTrustedRange, traefikEffectiveTrustedPrefix, traefikTrustedRangeCel, } from './trusted-range.js';
52
+ /**
53
+ * Admission rule on each KRO-mode `trustedIPs` list: every entry in the strict
54
+ * format and not `/0`.
55
+ *
56
+ * The API server estimates a CEL rule's cost from the schema, so the list
57
+ * carries `maxItems=64` and its items `maxLength=43` (through a SimpleSchema
58
+ * custom type); without those bounds `matches()` would exceed the CRD budget.
59
+ * The rendered values also keep only entries in the strict format (see
60
+ * `traefikStrictTrustedIPs`), as a second line of defence.
61
+ */
62
+ export const TRAEFIK_TRUSTED_IPS_VALIDATION_RULE = `self.all(range, ${traefikTrustedRangeCel('range')})`;
63
+ // Runtime spec paths that carry a `trustedIPs` list, for the KRO-mode rule.
64
+ const TRUSTED_IP_SPEC_PATHS = [
65
+ 'entrypoints.web.proxyProtocol.trustedIPs',
66
+ 'entrypoints.web.forwardedHeaders.trustedIPs',
67
+ 'entrypoints.websecure.proxyProtocol.trustedIPs',
68
+ 'entrypoints.websecure.forwardedHeaders.trustedIPs',
69
+ ];
70
+ // A flag argument: one or two dashes, the name, and an optional `=value`.
71
+ // `[\s\S]` so a newline in the value can't end the match early.
72
+ const FLAG_ARGUMENT = /^--?([^=]+)(?:=([\s\S]*))?$/;
73
+ // Flag names, matched lowercase (Traefik's flag parser is case-insensitive).
74
+ const INSECURE_FLAG = /^entrypoints\.[^.]+\.(proxyprotocol|forwardedheaders)\.insecure$/;
75
+ const TRUSTED_IPS_FLAG = /^entrypoints\.[^.]+\.(proxyprotocol|forwardedheaders)\.trustedips(\[[0-9]+\])?$/;
76
+ // Any flag under an entrypoint's proxyProtocol or forwardedHeaders.
77
+ const TRUST_FLAG = /^entrypoints\.[^.]+\.(proxyprotocol|forwardedheaders)\./;
78
+ // The values Go's `strconv.ParseBool` reads as false. Anything else on an
79
+ // `insecure` flag or variable either turns it on or makes it unreadable.
80
+ const FALSE_VALUE = /^(0|f|F|false|FALSE|False)$/;
81
+ // Control characters, newlines included. Traefik trims list items, so
82
+ // `'0.0.0.0/0\n'` is `/0`; values carrying one are refused outright.
83
+ function hasControlCharacter(value) {
84
+ for (let index = 0; index < value.length; index++) {
85
+ const code = value.charCodeAt(index);
86
+ if (code < 0x20 || code === 0x7f)
87
+ return true;
88
+ }
89
+ return false;
90
+ }
91
+ // The same settings through Traefik's environment-variable configuration.
92
+ // Traefik matches variable names case-insensitively.
93
+ const INSECURE_ENV = /^TRAEFIK_ENTRYPOINTS_.+_(PROXYPROTOCOL|FORWARDEDHEADERS)_INSECURE$/i;
94
+ const TRUSTED_IPS_ENV = /^TRAEFIK_ENTRYPOINTS_.+_(PROXYPROTOCOL|FORWARDEDHEADERS)_TRUSTEDIPS(_[0-9]+)?$/i;
95
+ // Any variable under an entrypoint's proxyProtocol or forwardedHeaders: the
96
+ // names whose value must be visible for the guard to vouch for it.
97
+ const TRUST_ENV = /^TRAEFIK_ENTRYPOINTS_.+_(PROXYPROTOCOL|FORWARDEDHEADERS)_/i;
98
+ const CONFIG_FILE_EXTENSIONS = ['toml', 'yaml', 'yml'];
99
+ const CONFIG_FILE_FIX = 'Traefik would load its static configuration from that file in place of its flags, and ' +
100
+ 'TypeKro cannot see what the file says. Mount files elsewhere.';
101
+ const HIDDEN_VALUE_FIX = 'TypeKro cannot see that value, so it cannot rule out trusting every source.';
102
+ /**
103
+ * The problem with one `trustedIPs` entry, or `undefined` when it is a valid,
104
+ * non-`/0` range. `where` names the setting in the message.
105
+ */
106
+ function rangeIssue(where, range) {
107
+ const parsed = parseTraefikTrustedRange(range);
108
+ if (parsed && parsed.prefix > 0)
109
+ return undefined;
110
+ // Name trust-all first: `/00`, an IPv4-mapped `/96` and a `/0` hidden in a
111
+ // comma-joined entry all end up trusting every source.
112
+ const trustsAll = range
113
+ .split(',')
114
+ .some((piece) => traefikEffectiveTrustedPrefix(piece)?.prefix === 0);
115
+ if (parsed || trustsAll)
116
+ return `${where} contains ${JSON.stringify(range)}, which trusts every source.`;
117
+ return (`${where} contains ${JSON.stringify(range)}, which is not one IP address or CIDR range ` +
118
+ 'in the strict format: no spaces, commas, leading zeros or IPv4-mapped addresses, and a ' +
119
+ 'prefix of at most 32 (IPv4) or 128 (IPv6).');
120
+ }
121
+ /** Issues for a comma-separated list of ranges, as env values and flags carry them. */
122
+ function rangeListIssues(where, list) {
123
+ if (hasControlCharacter(list)) {
124
+ return [
125
+ `${where} contains a control character such as a newline. Traefik trims list items, ` +
126
+ 'so it would read the value differently from what the guard checks.',
127
+ ];
128
+ }
129
+ if (list.includes('$(')) {
130
+ return [`${where} uses a $(VAR) reference, which Kubernetes expands. ${HIDDEN_VALUE_FIX}`];
131
+ }
132
+ // Traefik splits the list on "," and trims each item.
133
+ return list
134
+ .split(',')
135
+ .map((piece) => rangeIssue(where, piece.trim()))
136
+ .filter((issue) => issue !== undefined);
137
+ }
138
+ function isConcrete(value) {
139
+ return !isKubernetesRef(value) && !isCelExpression(value);
140
+ }
141
+ const REF_MARKER = new RegExp(KUBERNETES_REF_MARKER_SOURCE);
142
+ /** A plain string, not one carrying a serialized reference marker. */
143
+ function isLiteralString(value) {
144
+ return typeof value === 'string' && !REF_MARKER.test(value);
145
+ }
146
+ /**
147
+ * Problems with the proxy trust in final chart values; empty when there are none.
148
+ *
149
+ * Schema references under `ports` are skipped: KRO mode checks those on the
150
+ * CRD. In `env` and `envFrom` nothing on the CRD checks them, so a value the
151
+ * guard cannot see counts as a problem.
152
+ */
153
+ export function traefikProxyTrustIssues(values) {
154
+ const issues = [];
155
+ const ports = values.ports;
156
+ if (ports && isConcrete(ports)) {
157
+ for (const [name, port] of Object.entries(ports)) {
158
+ if (!port || !isConcrete(port))
159
+ continue;
160
+ for (const field of ['proxyProtocol', 'forwardedHeaders']) {
161
+ issues.push(...portTrustIssues(`ports.${name}.${field}`, port[field]));
162
+ }
163
+ }
164
+ }
165
+ issues.push(...envIssues(values));
166
+ issues.push(...argumentIssues(values.additionalArguments));
167
+ issues.push(...staticConfigIssues(values));
168
+ return issues;
169
+ }
170
+ /** Proxy-trust problems in one raw `ports.<name>.proxyProtocol` / `forwardedHeaders` block. */
171
+ function portTrustIssues(where, trust) {
172
+ if (trust === undefined || trust === null || !isConcrete(trust))
173
+ return [];
174
+ if (!isLiteralRecord(trust)) {
175
+ return [`${where} is not an object, so the guard cannot read its trust settings.`];
176
+ }
177
+ const issues = [];
178
+ // The chart tests `insecure` with Go template truthiness, so 'false', 1 or
179
+ // 'yes' all switch it on. Only an absent value or boolean false is safe.
180
+ const insecure = trust.insecure;
181
+ if (insecure !== undefined && insecure !== null && insecure !== false && isConcrete(insecure)) {
182
+ issues.push(`${where}.insecure is ${JSON.stringify(insecure)}, which trusts every source.`);
183
+ }
184
+ const ranges = trust.trustedIPs;
185
+ if (ranges === undefined || ranges === null || !isConcrete(ranges))
186
+ return issues;
187
+ // The chart joins the list with ","; a string is joined as one element.
188
+ const entries = Array.isArray(ranges) ? ranges : [ranges];
189
+ for (const range of entries) {
190
+ if (!isConcrete(range))
191
+ continue;
192
+ // Each entry must be one range on its own, so an entry carrying a comma
193
+ // (which the join would split into more ranges) is refused too.
194
+ const issue = typeof range === 'string'
195
+ ? rangeIssue(`${where}.trustedIPs`, range)
196
+ : `${where}.trustedIPs contains ${JSON.stringify(range)}, which is not a range.`;
197
+ if (issue)
198
+ issues.push(issue);
199
+ }
200
+ return issues;
201
+ }
202
+ /** Proxy-trust problems in `additionalArguments`. */
203
+ function argumentIssues(args) {
204
+ const issues = [];
205
+ if (args === undefined || args === null)
206
+ return issues;
207
+ if (!Array.isArray(args) || !isConcrete(args)) {
208
+ issues.push(`additionalArguments is not a literal list. ${HIDDEN_VALUE_FIX}`);
209
+ return issues;
210
+ }
211
+ args.forEach((arg, index) => {
212
+ if (!isConcrete(arg) || (typeof arg === 'string' && !isLiteralString(arg))) {
213
+ issues.push(`additionalArguments[${index}] is not a literal string. ${HIDDEN_VALUE_FIX}`);
214
+ return;
215
+ }
216
+ if (typeof arg !== 'string')
217
+ return;
218
+ // Traefik trims list values, and a newline would end a single-line match.
219
+ if (hasControlCharacter(arg)) {
220
+ issues.push(`additionalArguments[${index}] contains a control character such as a newline. ` +
221
+ 'Traefik would read it differently from what the guard checks.');
222
+ return;
223
+ }
224
+ const flagMatch = FLAG_ARGUMENT.exec(arg);
225
+ // Kubernetes expands $(VAR) in container arguments, so an argument that
226
+ // uses one outside a flag's value could become any flag.
227
+ if (!flagMatch || flagMatch[1]?.includes('$(')) {
228
+ if (arg.includes('$(')) {
229
+ issues.push(`additionalArguments[${index}] uses a $(VAR) reference, which Kubernetes expands. ${HIDDEN_VALUE_FIX}`);
230
+ }
231
+ return;
232
+ }
233
+ const flag = `--${flagMatch[1] ?? ''}`;
234
+ const name = (flagMatch[1] ?? '').toLowerCase();
235
+ const value = flagMatch[2];
236
+ if (TRUST_FLAG.test(name) && arg.includes('$(')) {
237
+ issues.push(`additionalArguments sets ${flag} from a $(VAR) reference, which Kubernetes expands. ${HIDDEN_VALUE_FIX}`);
238
+ return;
239
+ }
240
+ if (INSECURE_FLAG.test(name)) {
241
+ // Bare, true, or anything Go would not read as false.
242
+ if (value === undefined || !FALSE_VALUE.test(value)) {
243
+ issues.push(`additionalArguments contains ${arg}, which trusts every source.`);
244
+ }
245
+ return;
246
+ }
247
+ if (name === 'configfile') {
248
+ issues.push(`additionalArguments contains ${flag}. ${CONFIG_FILE_FIX}`);
249
+ return;
250
+ }
251
+ if (!TRUSTED_IPS_FLAG.test(name))
252
+ return;
253
+ const next = args[index + 1];
254
+ const ranges = value ?? (typeof next === 'string' ? next : '');
255
+ issues.push(...rangeListIssues(`additionalArguments ${flag}`, ranges));
256
+ });
257
+ return issues;
258
+ }
259
+ /** An absolute path with `.`, `..` and repeated slashes resolved; relative paths start at `/`. */
260
+ function normalizePath(path) {
261
+ const parts = [];
262
+ for (const part of path.trim().split('/')) {
263
+ if (part === '' || part === '.')
264
+ continue;
265
+ if (part === '..')
266
+ parts.pop();
267
+ else
268
+ parts.push(part);
269
+ }
270
+ return `/${parts.join('/')}`;
271
+ }
272
+ /** Whether a mount at `mountPath` would cover `file`: the same path or a parent of it. */
273
+ function covers(mountPath, file) {
274
+ return file === mountPath || file.startsWith(mountPath === '/' ? '/' : `${mountPath}/`);
275
+ }
276
+ /**
277
+ * The files Traefik would read its static configuration from, given the
278
+ * container's HOME and XDG_CONFIG_HOME (see the module comment for the defaults).
279
+ */
280
+ function staticConfigFiles(home, xdgConfigHome) {
281
+ const bases = [
282
+ '/etc/traefik/traefik',
283
+ `${xdgConfigHome}/traefik`,
284
+ `${home}/.config/traefik`,
285
+ '/traefik',
286
+ ];
287
+ return bases.flatMap((base) => CONFIG_FILE_EXTENSIONS.map((extension) => normalizePath(`${base}.${extension}`)));
288
+ }
289
+ /** Static-configuration-file problems: raw mounts over the files Traefik searches. */
290
+ function staticConfigIssues(values) {
291
+ const issues = [];
292
+ // A literal HOME or XDG_CONFIG_HOME moves the search; one from a reference
293
+ // hides it. A non-literal `env` list is already reported by `envIssues`.
294
+ const location = { HOME: '/', XDG_CONFIG_HOME: '' };
295
+ const env = values.env;
296
+ if (Array.isArray(env) && isConcrete(env)) {
297
+ for (const entry of env) {
298
+ if (!isLiteralRecord(entry))
299
+ continue;
300
+ const name = entry.name;
301
+ if (name !== 'HOME' && name !== 'XDG_CONFIG_HOME')
302
+ continue;
303
+ // Kubernetes expands $(VAR) in env values, so one would hide the path.
304
+ if (isLiteralString(entry.value) &&
305
+ entry.valueFrom === undefined &&
306
+ !entry.value.includes('$(') &&
307
+ !hasControlCharacter(entry.value)) {
308
+ location[name] = entry.value;
309
+ }
310
+ else {
311
+ issues.push(`env ${name} takes its value from a reference or a $(VAR) expansion, so TypeKro ` +
312
+ 'cannot see where Traefik ' +
313
+ 'looks for a static configuration file.');
314
+ }
315
+ }
316
+ }
317
+ const files = staticConfigFiles(location.HOME, location.XDG_CONFIG_HOME);
318
+ const checkPath = (where, path) => {
319
+ if (path === undefined || path === null)
320
+ return;
321
+ // The chart runs `additionalVolumeMounts` through `tpl`, so `{{ }}` is
322
+ // evaluated at render time.
323
+ if (!isLiteralString(path) || path.includes('{{')) {
324
+ issues.push(`${where} is not a literal path. ${CONFIG_FILE_FIX}`);
325
+ return;
326
+ }
327
+ const mountPath = normalizePath(path);
328
+ const file = files.find((candidate) => covers(mountPath, candidate));
329
+ if (file)
330
+ issues.push(`${where} mounts ${path} over ${file}. ${CONFIG_FILE_FIX}`);
331
+ };
332
+ const checkList = (where, list) => {
333
+ if (list === undefined || list === null)
334
+ return;
335
+ if (!Array.isArray(list) || !isConcrete(list)) {
336
+ issues.push(`${where} is not a literal list. ${CONFIG_FILE_FIX}`);
337
+ return;
338
+ }
339
+ list.forEach((entry, index) => {
340
+ if (entry === undefined || entry === null)
341
+ return;
342
+ checkPath(`${where}[${index}].mountPath`, isLiteralRecord(entry) ? entry.mountPath : entry);
343
+ });
344
+ };
345
+ const checkSection = (where, section, field) => {
346
+ if (section === undefined || section === null)
347
+ return;
348
+ if (!isLiteralRecord(section)) {
349
+ issues.push(`${where} is not a literal object. ${CONFIG_FILE_FIX}`);
350
+ return;
351
+ }
352
+ checkPath(`${where}.${field}`, section[field]);
353
+ };
354
+ // Every raw-values mount the chart adds to the Traefik container.
355
+ // `deployment.additionalVolumes` only declares volumes; they are mounted
356
+ // through `additionalVolumeMounts` or a `localPath` local plugin.
357
+ checkList('additionalVolumeMounts', values.additionalVolumeMounts);
358
+ checkList('volumes', values.volumes);
359
+ checkSection('persistence', values.persistence, 'path');
360
+ checkSection('hub', values.hub, 'tokenMountPath');
361
+ const experimental = values.experimental;
362
+ if (experimental !== undefined && experimental !== null) {
363
+ if (!isLiteralRecord(experimental)) {
364
+ issues.push(`experimental is not a literal object. ${CONFIG_FILE_FIX}`);
365
+ }
366
+ else {
367
+ const localPlugins = experimental.localPlugins;
368
+ if (localPlugins !== undefined && localPlugins !== null && !isLiteralRecord(localPlugins)) {
369
+ issues.push(`experimental.localPlugins is not a literal object. ${CONFIG_FILE_FIX}`);
370
+ }
371
+ else if (localPlugins) {
372
+ for (const [name, plugin] of Object.entries(localPlugins)) {
373
+ if (plugin === undefined || plugin === null)
374
+ continue;
375
+ checkPath(`experimental.localPlugins.${name}.mountPath`, isLiteralRecord(plugin) ? plugin.mountPath : plugin);
376
+ }
377
+ }
378
+ }
379
+ }
380
+ return issues;
381
+ }
382
+ /** A concrete object, as opposed to a schema reference or CEL expression. */
383
+ function isLiteralRecord(value) {
384
+ return typeof value === 'object' && value !== null && !Array.isArray(value) && isConcrete(value);
385
+ }
386
+ /** Proxy-trust problems in the Traefik container's `env` and `envFrom`. */
387
+ function envIssues(values) {
388
+ const issues = [];
389
+ const envFrom = values.envFrom;
390
+ if (envFrom !== undefined &&
391
+ envFrom !== null &&
392
+ !(Array.isArray(envFrom) && envFrom.length === 0)) {
393
+ issues.push('envFrom can load TRAEFIK_ENTRYPOINTS_* variables from a Secret or ConfigMap. ' +
394
+ `${HIDDEN_VALUE_FIX} Pass other variables as individual \`env\` entries, where \`valueFrom\` is fine.`);
395
+ }
396
+ const env = values.env;
397
+ if (env === undefined || env === null)
398
+ return issues;
399
+ if (!Array.isArray(env) || !isConcrete(env)) {
400
+ issues.push(`env is not a literal list, so its variable names are unknown. ${HIDDEN_VALUE_FIX}`);
401
+ return issues;
402
+ }
403
+ for (const entry of env) {
404
+ if (entry === undefined || entry === null)
405
+ continue;
406
+ const name = isLiteralRecord(entry) ? entry.name : undefined;
407
+ if (!isLiteralRecord(entry) || typeof name !== 'string') {
408
+ issues.push(`env has an entry whose name is not a literal string. ${HIDDEN_VALUE_FIX}`);
409
+ continue;
410
+ }
411
+ if (!TRUST_ENV.test(name))
412
+ continue;
413
+ const { value, valueFrom } = entry;
414
+ if (valueFrom !== undefined || (value !== undefined && !isLiteralString(value))) {
415
+ issues.push(`env ${name} takes its value from a reference. ${HIDDEN_VALUE_FIX}`);
416
+ continue;
417
+ }
418
+ if (typeof value !== 'string')
419
+ continue;
420
+ if (hasControlCharacter(value)) {
421
+ issues.push(`env ${name} contains a control character such as a newline. ${HIDDEN_VALUE_FIX}`);
422
+ }
423
+ else if (value.includes('$(')) {
424
+ issues.push(`env ${name} uses a $(VAR) reference, which Kubernetes expands. ${HIDDEN_VALUE_FIX}`);
425
+ }
426
+ else if (INSECURE_ENV.test(name) && !FALSE_VALUE.test(value)) {
427
+ issues.push(`env ${name}=${value} trusts every source.`);
428
+ }
429
+ else if (TRUSTED_IPS_ENV.test(name)) {
430
+ issues.push(...rangeListIssues(`env ${name}`, value));
431
+ }
432
+ }
433
+ return issues;
434
+ }
435
+ /**
436
+ * Throw when final chart values trust every source for PROXY protocol or forwarded headers,
437
+ * or carry trust settings whose value TypeKro cannot see.
438
+ *
439
+ * @throws {TypeKroError} With code `TRAEFIK_UNTRUSTED_PROXY_SOURCE`.
440
+ */
441
+ export function assertTraefikProxyTrust(values) {
442
+ const issues = traefikProxyTrustIssues(values);
443
+ if (issues.length === 0)
444
+ return;
445
+ throw new TypeKroError(`Traefik could trust any client to set its own source address: ${issues.join(' ')} ` +
446
+ 'Set the trust through the typed `entrypoints.<name>.proxyProtocol` / `forwardedHeaders` ' +
447
+ 'options instead, listing the load balancer or proxy ranges (for an AWS NLB with IP ' +
448
+ "targets, the NLB's subnet CIDRs). If trusting any source is intended, pass " +
449
+ '`dangerouslyTrustAnySource: true` to makeTraefikBootstrap, and only for a Traefik that no ' +
450
+ 'client can reach directly.', 'TRAEFIK_UNTRUSTED_PROXY_SOURCE', { issues });
451
+ }
452
+ /**
453
+ * Warnings for trusted ranges that are legal but very broad: an IPv4 prefix
454
+ * shorter than /8 or an IPv6 prefix shorter than /16.
455
+ */
456
+ export function traefikBroadTrustWarnings(values) {
457
+ const warnings = [];
458
+ const ports = values.ports;
459
+ if (!ports || !isConcrete(ports))
460
+ return warnings;
461
+ for (const [name, port] of Object.entries(ports)) {
462
+ if (!port || !isConcrete(port))
463
+ continue;
464
+ for (const field of ['proxyProtocol', 'forwardedHeaders']) {
465
+ const trustedIPs = port[field]?.trustedIPs;
466
+ if (trustedIPs === undefined || trustedIPs === null || !isConcrete(trustedIPs))
467
+ continue;
468
+ const ranges = Array.isArray(trustedIPs) ? trustedIPs : [trustedIPs];
469
+ for (const entry of ranges) {
470
+ if (typeof entry !== 'string')
471
+ continue;
472
+ // Read the way Go does: an IPv4-mapped `/96` is IPv4 `/0`.
473
+ for (const range of entry.split(',')) {
474
+ const effective = traefikEffectiveTrustedPrefix(range);
475
+ if (!effective)
476
+ continue;
477
+ const where = `ports.${name}.${field}.trustedIPs contains ${range.trim()}`;
478
+ if (effective.prefix === 0) {
479
+ warnings.push(`${where}, which trusts every source.`);
480
+ }
481
+ else if (effective.prefix < (effective.family === 6 ? 16 : 8)) {
482
+ warnings.push(`${where}, which trusts a very large address range. List the load balancer or proxy ranges instead.`);
483
+ }
484
+ }
485
+ }
486
+ }
487
+ }
488
+ return warnings;
489
+ }
490
+ /** `schemaFieldValidations` refusing `/0` trusted ranges on a KRO instance. */
491
+ export function traefikProxyTrustSchemaFieldValidations() {
492
+ return Object.fromEntries(TRUSTED_IP_SPEC_PATHS.map((path) => [path, TRAEFIK_TRUSTED_IPS_VALIDATION_RULE]));
493
+ }
494
+ /**
495
+ * A `trustedIPs` value for the chart, holding a KRO schema reference to the
496
+ * entries that pass the strict format.
497
+ *
498
+ * Direct mode sees concrete lists, which the guard checks whole. In KRO mode
499
+ * the CRD refuses the same entries at admission; this filter is the second
500
+ * line of defence, keeping only entries that are one valid range (and, unless
501
+ * `allowAnySource`, not `/0`). A dropped entry narrows trust; it never widens it.
502
+ */
503
+ export function traefikStrictTrustedIPs(ranges, allowAnySource) {
504
+ if (!isKubernetesRef(ranges) || ranges.resourceId !== '__schema__')
505
+ return ranges;
506
+ const path = `schema.${ranges.fieldPath}`;
507
+ const segments = path.split('.');
508
+ // `has()` on every optional level, as serialization does for a bare reference.
509
+ const guards = segments
510
+ .slice(2)
511
+ .map((_, index) => `has(${segments.slice(0, index + 3).join('.')})`);
512
+ return Cel.expr(`${guards.join(' && ')} ? `, ranges, `.filter(range, ${traefikTrustedRangeCel('range', allowAnySource)}) : omit()`);
513
+ }
514
+ //# sourceMappingURL=proxy-trust.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy-trust.js","sourceRoot":"","sources":["../../../../src/factories/traefik/utils/proxy-trust.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,sEAAsE;AACtE,mEAAmE;AACnE,gFAAgF;AAChF,2DAA2D;AAC3D,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,gFAAgF;AAChF,0EAA0E;AAC1E,8EAA8E;AAC9E,qEAAqE;AACrE,EAAE;AACF,mEAAmE;AACnE,8DAA8D;AAC9D,6EAA6E;AAC7E,4EAA4E;AAC5E,uEAAuE;AACvE,+EAA+E;AAC/E,kCAAkC;AAClC,6EAA6E;AAC7E,iEAAiE;AACjE,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,sEAAsE;AACtE,0EAA0E;AAC1E,8EAA8E;AAC9E,4CAA4C;AAC5C,EAAE;AACF,4EAA4E;AAC5E,kEAAkE;AAClE,+DAA+D;AAC/D,8EAA8E;AAC9E,gFAAgF;AAChF,0EAA0E;AAC1E,4EAA4E;AAC5E,+EAA+E;AAC/E,wEAAwE;AACxE,EAAE;AACF,0EAA0E;AAC1E,gDAAgD;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEjF,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,mBAAmB,sBAAsB,CAAC,OAAO,CAAC,GAAG,CAAC;AAEzG,4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AAM,CAAC,UAAU,KAAK,YAAY;QAAE,OAAO,MAAM,CAAC;IAClF,MAAM,IAAI,GAAG,UAAU,MAAM,CAAC,SAAS,EAAE,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,+EAA+E;IAC/E,MAAM,MAAM,GAAG,QAAQ;SACpB,KAAK,CAAC,CAAC,CAAC;SACR,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvE,OAAO,GAAG,CAAC,IAAI,CACb,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAC3B,MAAM,EACN,kBAAkB,sBAAsB,CAAC,OAAO,EAAE,cAAc,CAAC,YAAY,CAC9E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The strict format TypeKro accepts for a Traefik `trustedIPs` entry.
3
+ */
4
+ /** One IPv4 or IPv6 address or CIDR range, with a prefix of 0-32 or 0-128 and no leading zeros. */
5
+ export declare const TRAEFIK_TRUSTED_RANGE_PATTERN: string;
6
+ /** An IPv4-mapped IPv6 address (`::ffff:a.b.c.d`, `::ffff:0:0`, ...), which is refused outright. */
7
+ export declare const TRAEFIK_IPV4_MAPPED_PATTERN = "^[0:]*:[fF]{4}:";
8
+ /** Longest valid entry: a full IPv6 address and `/128`. */
9
+ export declare const TRAEFIK_TRUSTED_RANGE_MAX_LENGTH = 43;
10
+ /** A trusted range in the strict format. */
11
+ export interface TraefikTrustedRange {
12
+ readonly family: 4 | 6;
13
+ /** The prefix length; a bare address counts as `/32` or `/128`. */
14
+ readonly prefix: number;
15
+ }
16
+ /** Parse one `trustedIPs` entry, or `undefined` when it is not in the strict format. */
17
+ export declare function parseTraefikTrustedRange(value: string): TraefikTrustedRange | undefined;
18
+ /**
19
+ * The prefix Go would effectively apply to an entry, read leniently: leading
20
+ * zeros allowed, and an IPv4-mapped `/n` counted as IPv4 `/(n-96)` (or `/0`
21
+ * below 96). For warnings about entries the strict format may not cover.
22
+ */
23
+ export declare function traefikEffectiveTrustedPrefix(value: string): TraefikTrustedRange | undefined;
24
+ /**
25
+ * A CEL predicate over the string variable `name` that holds when it is in the
26
+ * strict format and, unless `allowAnySource`, is not a `/0` range.
27
+ */
28
+ export declare function traefikTrustedRangeCel(name: string, allowAnySource?: boolean): string;
29
+ //# sourceMappingURL=trusted-range.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trusted-range.d.ts","sourceRoot":"","sources":["../../../../src/factories/traefik/utils/trusted-range.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkCH,mGAAmG;AACnG,eAAO,MAAM,6BAA6B,QAA8D,CAAC;AACzG,oGAAoG;AACpG,eAAO,MAAM,2BAA2B,oBAAoB,CAAC;AAC7D,2DAA2D;AAC3D,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAKnD,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,wFAAwF;AACxF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAKvF;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAW5F;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,UAAQ,GAAG,MAAM,CAMnF"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * The strict format TypeKro accepts for a Traefik `trustedIPs` entry.
3
+ */
4
+ // Traefik parses each entry with Go's `net.ParseCIDR`, falling back to
5
+ // `net.ParseIP`. Go is more lenient than its output suggests:
6
+ // - `0.0.0.0/00` and `::/00` parse, with leading zeros, as `/0`.
7
+ // - `::ffff:0.0.0.0/96` (and `::ffff:0:0/96`) is an IPv4-mapped network. Go
8
+ // matches IPv4 clients against its last 32 bits, so `/96` is IPv4 `/0`.
9
+ // - The chart joins a list with "," and Traefik splits and trims it again, so
10
+ // `'0.0.0.0/0,10.0.0.0/8'` or `'0.0.0.0/0 '` in one entry still trusts all.
11
+ // So a suffix test on the text is not enough. An entry must be exactly one
12
+ // IPv4 or IPv6 address, optionally with a decimal prefix without leading
13
+ // zeros (0-32 or 0-128), with no spaces, commas, zone or embedded IPv4, and no
14
+ // IPv4-mapped address at all. A `/0` prefix passes the format; refusing it is
15
+ // the proxy-trust guard's job, which `dangerouslyTrustAnySource` turns off.
16
+ //
17
+ // The patterns use only RE2 syntax (no lookaround, no backslashes), so the same
18
+ // strings work in JavaScript, in CEL `matches()` and in a Kubernetes `pattern`.
19
+ const HEX = '[0-9a-fA-F]{1,4}';
20
+ const OCTET = '(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])';
21
+ const IPV4 = `${OCTET}([.]${OCTET}){3}`;
22
+ const IPV6 = [
23
+ `(${HEX}:){7}${HEX}`,
24
+ `(${HEX}:){1,7}:`,
25
+ `(${HEX}:){1,6}:${HEX}`,
26
+ `(${HEX}:){1,5}(:${HEX}){1,2}`,
27
+ `(${HEX}:){1,4}(:${HEX}){1,3}`,
28
+ `(${HEX}:){1,3}(:${HEX}){1,4}`,
29
+ `(${HEX}:){1,2}(:${HEX}){1,5}`,
30
+ `${HEX}:(:${HEX}){1,6}`,
31
+ `:((:${HEX}){1,7}|:)`,
32
+ ].join('|');
33
+ const IPV4_PREFIX = '(3[0-2]|[12][0-9]|[0-9])';
34
+ const IPV6_PREFIX = '(12[0-8]|1[01][0-9]|[1-9][0-9]|[0-9])';
35
+ /** One IPv4 or IPv6 address or CIDR range, with a prefix of 0-32 or 0-128 and no leading zeros. */
36
+ export const TRAEFIK_TRUSTED_RANGE_PATTERN = `^(${IPV4}(/${IPV4_PREFIX})?|(${IPV6})(/${IPV6_PREFIX})?)$`;
37
+ /** An IPv4-mapped IPv6 address (`::ffff:a.b.c.d`, `::ffff:0:0`, ...), which is refused outright. */
38
+ export const TRAEFIK_IPV4_MAPPED_PATTERN = '^[0:]*:[fF]{4}:';
39
+ /** Longest valid entry: a full IPv6 address and `/128`. */
40
+ export const TRAEFIK_TRUSTED_RANGE_MAX_LENGTH = 43;
41
+ const RANGE = new RegExp(TRAEFIK_TRUSTED_RANGE_PATTERN);
42
+ const IPV4_MAPPED = new RegExp(TRAEFIK_IPV4_MAPPED_PATTERN);
43
+ /** Parse one `trustedIPs` entry, or `undefined` when it is not in the strict format. */
44
+ export function parseTraefikTrustedRange(value) {
45
+ if (!RANGE.test(value) || IPV4_MAPPED.test(value))
46
+ return undefined;
47
+ const [address = '', prefix] = value.split('/');
48
+ const family = address.includes(':') ? 6 : 4;
49
+ return { family, prefix: prefix === undefined ? (family === 4 ? 32 : 128) : Number(prefix) };
50
+ }
51
+ /**
52
+ * The prefix Go would effectively apply to an entry, read leniently: leading
53
+ * zeros allowed, and an IPv4-mapped `/n` counted as IPv4 `/(n-96)` (or `/0`
54
+ * below 96). For warnings about entries the strict format may not cover.
55
+ */
56
+ export function traefikEffectiveTrustedPrefix(value) {
57
+ const match = /^([^/]*)(?:\/([0-9]+))?$/.exec(value.trim());
58
+ if (!match)
59
+ return undefined;
60
+ const address = match[1] ?? '';
61
+ const family = address.includes(':') ? 6 : 4;
62
+ const full = family === 4 ? 32 : 128;
63
+ const prefix = match[2] === undefined ? full : Number(match[2]);
64
+ if (family === 6 && IPV4_MAPPED.test(address)) {
65
+ return { family: 4, prefix: prefix >= 96 ? prefix - 96 : 0 };
66
+ }
67
+ return { family, prefix };
68
+ }
69
+ /**
70
+ * A CEL predicate over the string variable `name` that holds when it is in the
71
+ * strict format and, unless `allowAnySource`, is not a `/0` range.
72
+ */
73
+ export function traefikTrustedRangeCel(name, allowAnySource = false) {
74
+ return [
75
+ `${name}.matches('${TRAEFIK_TRUSTED_RANGE_PATTERN}')`,
76
+ `!${name}.matches('${TRAEFIK_IPV4_MAPPED_PATTERN}')`,
77
+ ...(allowAnySource ? [] : [`!${name}.endsWith('/0')`]),
78
+ ].join(' && ');
79
+ }
80
+ //# sourceMappingURL=trusted-range.js.map