@kensio/yulin 1.10.2 → 1.10.4

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 (235) hide show
  1. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.d.ts +8 -17
  2. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.d.ts.map +1 -1
  3. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.js +24 -102
  4. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.js.map +1 -1
  5. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-cors-config.d.ts +13 -0
  6. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-cors-config.d.ts.map +1 -0
  7. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-cors-config.js +76 -0
  8. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-cors-config.js.map +1 -0
  9. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-custom-headers.d.ts +17 -0
  10. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-custom-headers.d.ts.map +1 -0
  11. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-custom-headers.js +45 -0
  12. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-custom-headers.js.map +1 -0
  13. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-field-reader.d.ts +37 -0
  14. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-field-reader.d.ts.map +1 -0
  15. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-field-reader.js +75 -0
  16. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-field-reader.js.map +1 -0
  17. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-headers.d.ts +11 -0
  18. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-headers.d.ts.map +1 -0
  19. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-headers.js +30 -0
  20. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-headers.js.map +1 -0
  21. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-values.d.ts +19 -0
  22. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-values.d.ts.map +1 -0
  23. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-values.js +72 -0
  24. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-values.js.map +1 -0
  25. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-server-timing.d.ts +13 -0
  26. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-server-timing.d.ts.map +1 -0
  27. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-server-timing.js +24 -0
  28. package/dist/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-server-timing.js.map +1 -0
  29. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts +2 -0
  30. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts.map +1 -1
  31. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.js.map +1 -1
  32. package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.d.ts +2 -0
  33. package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.d.ts.map +1 -1
  34. package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.js.map +1 -1
  35. package/dist/service/cloudfront/controller/response-headers/sim-cf-response-headers-applicator.d.ts +1 -1
  36. package/dist/service/cloudfront/controller/response-headers/sim-cf-response-headers-applicator.d.ts.map +1 -1
  37. package/dist/service/cloudfront/controller/response-headers/sim-cf-response-headers-applicator.js +2 -2
  38. package/dist/service/cloudfront/controller/response-headers/sim-cf-response-headers-applicator.js.map +1 -1
  39. package/dist/service/cloudfront/controller/sim-cloudfront-controller.d.ts +1 -0
  40. package/dist/service/cloudfront/controller/sim-cloudfront-controller.d.ts.map +1 -1
  41. package/dist/service/cloudfront/controller/sim-cloudfront-controller.js +8 -1
  42. package/dist/service/cloudfront/controller/sim-cloudfront-controller.js.map +1 -1
  43. package/dist/service/cloudfront/controller/sim-cloudfront-error-response.d.ts +22 -0
  44. package/dist/service/cloudfront/controller/sim-cloudfront-error-response.d.ts.map +1 -0
  45. package/dist/service/cloudfront/controller/sim-cloudfront-error-response.js +31 -0
  46. package/dist/service/cloudfront/controller/sim-cloudfront-error-response.js.map +1 -0
  47. package/dist/service/cloudfront/controller/sim-cloudfront-request-pipeline.d.ts.map +1 -1
  48. package/dist/service/cloudfront/controller/sim-cloudfront-request-pipeline.js +1 -1
  49. package/dist/service/cloudfront/controller/sim-cloudfront-request-pipeline.js.map +1 -1
  50. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.d.ts +9 -0
  51. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.d.ts.map +1 -0
  52. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.js +34 -0
  53. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.js.map +1 -0
  54. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.d.ts +29 -0
  55. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.d.ts.map +1 -0
  56. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.js +51 -0
  57. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.js.map +1 -0
  58. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.d.ts +2 -0
  59. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.d.ts.map +1 -1
  60. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.js +3 -1
  61. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.js.map +1 -1
  62. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.d.ts +3 -0
  63. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.d.ts.map +1 -1
  64. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.js +7 -32
  65. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.js.map +1 -1
  66. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.d.ts +14 -1
  67. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.d.ts.map +1 -1
  68. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.js +16 -1
  69. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.js.map +1 -1
  70. package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.d.ts +7 -3
  71. package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.d.ts.map +1 -1
  72. package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.js +6 -3
  73. package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.js.map +1 -1
  74. package/dist/service/cloudfront/error/sim-cloudfront.error.d.ts +11 -0
  75. package/dist/service/cloudfront/error/sim-cloudfront.error.d.ts.map +1 -1
  76. package/dist/service/cloudfront/error/sim-cloudfront.error.js +13 -0
  77. package/dist/service/cloudfront/error/sim-cloudfront.error.js.map +1 -1
  78. package/dist/service/cloudfront/origin/s3/sim-cf-s3-origin-responses.d.ts.map +1 -1
  79. package/dist/service/cloudfront/origin/s3/sim-cf-s3-origin-responses.js +7 -1
  80. package/dist/service/cloudfront/origin/s3/sim-cf-s3-origin-responses.js.map +1 -1
  81. package/dist/service/cloudfront/response-headers-policy/sim-cf-cors-origin-pattern.d.ts +27 -0
  82. package/dist/service/cloudfront/response-headers-policy/sim-cf-cors-origin-pattern.d.ts.map +1 -0
  83. package/dist/service/cloudfront/response-headers-policy/sim-cf-cors-origin-pattern.js +70 -0
  84. package/dist/service/cloudfront/response-headers-policy/sim-cf-cors-origin-pattern.js.map +1 -0
  85. package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy-cors.d.ts +44 -0
  86. package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy-cors.d.ts.map +1 -0
  87. package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy-cors.js +111 -0
  88. package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy-cors.js.map +1 -0
  89. package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy.d.ts +10 -2
  90. package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy.d.ts.map +1 -1
  91. package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy.js +14 -2
  92. package/dist/service/cloudfront/response-headers-policy/sim-cf-response-headers-policy.js.map +1 -1
  93. package/dist/service/cloudfront/sim-cloudfront-commands.d.ts +3 -0
  94. package/dist/service/cloudfront/sim-cloudfront-commands.d.ts.map +1 -1
  95. package/dist/service/cloudfront/sim-cloudfront-commands.js +3 -0
  96. package/dist/service/cloudfront/sim-cloudfront-commands.js.map +1 -1
  97. package/dist/service/cloudfront/sim-cloudfront.d.ts.map +1 -1
  98. package/dist/service/cloudfront/sim-cloudfront.js +1 -0
  99. package/dist/service/cloudfront/sim-cloudfront.js.map +1 -1
  100. package/dist/service/rekognition/label/sim-rekognition-label-declaration.d.ts +1 -1
  101. package/dist/service/rekognition/moderation/sim-rekognition-moderation-taxonomy.d.ts +2 -2
  102. package/dist/service/rekognition/moderation/sim-rekognition-moderation-taxonomy.js +3 -3
  103. package/dist/service/rekognition/moderation/sim-rekognition-moderation-taxonomy.js.map +1 -1
  104. package/dist/service/rekognition/sim-rekognition.d.ts +4 -4
  105. package/dist/service/rekognition/sim-rekognition.js +4 -4
  106. package/dist/service/s3/bucket/sim-s3-bucket-access.d.ts +16 -0
  107. package/dist/service/s3/bucket/sim-s3-bucket-access.d.ts.map +1 -1
  108. package/dist/service/s3/bucket/sim-s3-bucket-access.js +22 -1
  109. package/dist/service/s3/bucket/sim-s3-bucket-access.js.map +1 -1
  110. package/dist/service/s3/command/get-object/get-object-loader.d.ts +2 -1
  111. package/dist/service/s3/command/get-object/get-object-loader.d.ts.map +1 -1
  112. package/dist/service/s3/command/get-object/get-object-loader.js +5 -1
  113. package/dist/service/s3/command/get-object/get-object-loader.js.map +1 -1
  114. package/dist/service/s3/command/get-object/get-object.command.d.ts +5 -0
  115. package/dist/service/s3/command/get-object/get-object.command.d.ts.map +1 -1
  116. package/dist/service/s3/command/list-objects/list-objects-page-builder.d.ts +3 -3
  117. package/dist/service/s3/command/list-objects/list-objects-page-builder.d.ts.map +1 -1
  118. package/dist/service/s3/command/list-objects/list-objects-page-builder.js +13 -17
  119. package/dist/service/s3/command/list-objects/list-objects-page-builder.js.map +1 -1
  120. package/dist/service/s3/command/list-objects/list-objects.command.d.ts +3 -8
  121. package/dist/service/s3/command/list-objects/list-objects.command.d.ts.map +1 -1
  122. package/dist/service/s3/command/list-objects/list-objects.handler.d.ts +3 -0
  123. package/dist/service/s3/command/list-objects/list-objects.handler.d.ts.map +1 -1
  124. package/dist/service/s3/command/list-objects/list-objects.handler.js +6 -2
  125. package/dist/service/s3/command/list-objects/list-objects.handler.js.map +1 -1
  126. package/dist/service/s3/command/list-objects-v2/list-objects-v2-continuation-token.d.ts +20 -0
  127. package/dist/service/s3/command/list-objects-v2/list-objects-v2-continuation-token.d.ts.map +1 -0
  128. package/dist/service/s3/command/list-objects-v2/list-objects-v2-continuation-token.js +29 -0
  129. package/dist/service/s3/command/list-objects-v2/list-objects-v2-continuation-token.js.map +1 -0
  130. package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.d.ts +31 -0
  131. package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.d.ts.map +1 -0
  132. package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.js +48 -0
  133. package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.js.map +1 -0
  134. package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.d.ts +41 -0
  135. package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.d.ts.map +1 -0
  136. package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.js +2 -0
  137. package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.js.map +1 -0
  138. package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.d.ts +41 -0
  139. package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.d.ts.map +1 -0
  140. package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.js +64 -0
  141. package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.js.map +1 -0
  142. package/dist/service/s3/command/object/sim-s3-object-commands.d.ts +8 -0
  143. package/dist/service/s3/command/object/sim-s3-object-commands.d.ts.map +1 -1
  144. package/dist/service/s3/command/object/sim-s3-object-commands.js +13 -0
  145. package/dist/service/s3/command/object/sim-s3-object-commands.js.map +1 -1
  146. package/dist/service/s3/command/put-object/put-object-builder.d.ts +10 -0
  147. package/dist/service/s3/command/put-object/put-object-builder.d.ts.map +1 -1
  148. package/dist/service/s3/command/put-object/put-object-builder.js +8 -0
  149. package/dist/service/s3/command/put-object/put-object-builder.js.map +1 -1
  150. package/dist/service/s3/command/put-object/put-object.command.d.ts +4 -0
  151. package/dist/service/s3/command/put-object/put-object.command.d.ts.map +1 -1
  152. package/dist/service/s3/command/put-object/put-object.handler.d.ts.map +1 -1
  153. package/dist/service/s3/command/put-object/put-object.handler.js +4 -1
  154. package/dist/service/s3/command/put-object/put-object.handler.js.map +1 -1
  155. package/dist/service/s3/command/sim-s3-bucket-command-state.d.ts +4 -1
  156. package/dist/service/s3/command/sim-s3-bucket-command-state.d.ts.map +1 -1
  157. package/dist/service/s3/command/sim-s3-command.types.d.ts +2 -1
  158. package/dist/service/s3/command/sim-s3-command.types.d.ts.map +1 -1
  159. package/dist/service/s3/notification/event/sim-s3-object-event-builder.d.ts.map +1 -1
  160. package/dist/service/s3/notification/event/sim-s3-object-event-builder.js +1 -2
  161. package/dist/service/s3/notification/event/sim-s3-object-event-builder.js.map +1 -1
  162. package/dist/service/s3/object/s3-object-etag.d.ts +20 -0
  163. package/dist/service/s3/object/s3-object-etag.d.ts.map +1 -0
  164. package/dist/service/s3/object/s3-object-etag.js +25 -0
  165. package/dist/service/s3/object/s3-object-etag.js.map +1 -0
  166. package/dist/service/s3/object/s3-object-listing-limits.d.ts +26 -0
  167. package/dist/service/s3/object/s3-object-listing-limits.d.ts.map +1 -0
  168. package/dist/service/s3/object/s3-object-listing-limits.js +46 -0
  169. package/dist/service/s3/object/s3-object-listing-limits.js.map +1 -0
  170. package/dist/service/s3/object/s3-object-listing.d.ts +51 -0
  171. package/dist/service/s3/object/s3-object-listing.d.ts.map +1 -0
  172. package/dist/service/s3/object/s3-object-listing.js +64 -0
  173. package/dist/service/s3/object/s3-object-listing.js.map +1 -0
  174. package/dist/service/s3/object/s3-object-response-headers.d.ts +23 -6
  175. package/dist/service/s3/object/s3-object-response-headers.d.ts.map +1 -1
  176. package/dist/service/s3/object/s3-object-response-headers.js +18 -8
  177. package/dist/service/s3/object/s3-object-response-headers.js.map +1 -1
  178. package/dist/service/s3/object/s3-object-summary.d.ts +33 -0
  179. package/dist/service/s3/object/s3-object-summary.d.ts.map +1 -0
  180. package/dist/service/s3/object/s3-object-summary.js +40 -0
  181. package/dist/service/s3/object/s3-object-summary.js.map +1 -0
  182. package/dist/service/s3/object/s3-object.d.ts +25 -0
  183. package/dist/service/s3/object/s3-object.d.ts.map +1 -1
  184. package/dist/service/s3/object/s3-object.js +31 -1
  185. package/dist/service/s3/object/s3-object.js.map +1 -1
  186. package/dist/service/s3/sdk/sim-s3-sdk-command-router.d.ts.map +1 -1
  187. package/dist/service/s3/sdk/sim-s3-sdk-command-router.js +4 -0
  188. package/dist/service/s3/sdk/sim-s3-sdk-command-router.js.map +1 -1
  189. package/dist/service/s3/serve/sim-s3-rest-object-reader.d.ts.map +1 -1
  190. package/dist/service/s3/serve/sim-s3-rest-object-reader.js +6 -1
  191. package/dist/service/s3/serve/sim-s3-rest-object-reader.js.map +1 -1
  192. package/dist/service/s3/serve/website/sim-s3-website-object-loader.d.ts.map +1 -1
  193. package/dist/service/s3/serve/website/sim-s3-website-object-loader.js +6 -1
  194. package/dist/service/s3/serve/website/sim-s3-website-object-loader.js.map +1 -1
  195. package/dist/service/s3/serve/website/sim-s3-website-object.d.ts +13 -4
  196. package/dist/service/s3/serve/website/sim-s3-website-object.d.ts.map +1 -1
  197. package/dist/service/s3/serve/website/sim-s3-website-object.js +15 -6
  198. package/dist/service/s3/serve/website/sim-s3-website-object.js.map +1 -1
  199. package/dist/service/s3/sim-s3-commands.d.ts +6 -0
  200. package/dist/service/s3/sim-s3-commands.d.ts.map +1 -1
  201. package/dist/service/s3/sim-s3-commands.js +2 -0
  202. package/dist/service/s3/sim-s3-commands.js.map +1 -1
  203. package/dist/service/s3/sim-s3.d.ts +24 -34
  204. package/dist/service/s3/sim-s3.d.ts.map +1 -1
  205. package/dist/service/s3/sim-s3.js +32 -40
  206. package/dist/service/s3/sim-s3.js.map +1 -1
  207. package/dist/service/s3/storage/filesystem/filesystem-path-exists.d.ts +8 -0
  208. package/dist/service/s3/storage/filesystem/filesystem-path-exists.d.ts.map +1 -1
  209. package/dist/service/s3/storage/filesystem/filesystem-path-exists.js +11 -1
  210. package/dist/service/s3/storage/filesystem/filesystem-path-exists.js.map +1 -1
  211. package/dist/service/s3/storage/filesystem/s3-filesystem-object-file.d.ts +19 -0
  212. package/dist/service/s3/storage/filesystem/s3-filesystem-object-file.d.ts.map +1 -0
  213. package/dist/service/s3/storage/filesystem/s3-filesystem-object-file.js +55 -0
  214. package/dist/service/s3/storage/filesystem/s3-filesystem-object-file.js.map +1 -0
  215. package/dist/service/s3/storage/filesystem/s3-filesystem-object-keys.d.ts +14 -4
  216. package/dist/service/s3/storage/filesystem/s3-filesystem-object-keys.d.ts.map +1 -1
  217. package/dist/service/s3/storage/filesystem/s3-filesystem-object-keys.js +27 -5
  218. package/dist/service/s3/storage/filesystem/s3-filesystem-object-keys.js.map +1 -1
  219. package/dist/service/s3/storage/filesystem/s3-filesystem-storage.d.ts +1 -2
  220. package/dist/service/s3/storage/filesystem/s3-filesystem-storage.d.ts.map +1 -1
  221. package/dist/service/s3/storage/filesystem/s3-filesystem-storage.js +10 -36
  222. package/dist/service/s3/storage/filesystem/s3-filesystem-storage.js.map +1 -1
  223. package/dist/service/sns/signature/sim-sns-certificate.d.ts +9 -3
  224. package/dist/service/sns/signature/sim-sns-certificate.d.ts.map +1 -1
  225. package/dist/service/sns/signature/sim-sns-certificate.js +13 -8
  226. package/dist/service/sns/signature/sim-sns-certificate.js.map +1 -1
  227. package/dist/service/sns/signature/sim-sns-der.d.ts +16 -0
  228. package/dist/service/sns/signature/sim-sns-der.d.ts.map +1 -1
  229. package/dist/service/sns/signature/sim-sns-der.js +23 -0
  230. package/dist/service/sns/signature/sim-sns-der.js.map +1 -1
  231. package/package.json +1 -1
  232. package/dist/service/s3/notification/event/sim-s3-object-etag.d.ts +0 -8
  233. package/dist/service/s3/notification/event/sim-s3-object-etag.d.ts.map +0 -1
  234. package/dist/service/s3/notification/event/sim-s3-object-etag.js +0 -11
  235. package/dist/service/s3/notification/event/sim-s3-object-etag.js.map +0 -1
@@ -5,13 +5,18 @@ import { SimCloudFrontResponseHeadersPolicy } from "../../response-headers-polic
5
5
  * Reads an AWS::CloudFront::ResponseHeadersPolicy Resource into a simulated
6
6
  * policy.
7
7
  *
8
- * Only the custom headers and the removed headers are modelled. The other
9
- * sections are refused by name rather than stepped over, so a policy that would
10
- * serve different headers here than in AWS fails where it is written.
8
+ * Every section is read by its own function in this directory, each taking
9
+ * the whole config and finding its own section in it. This class only says
10
+ * which sections a policy has, and carries the refusal that names the
11
+ * Resource whichever section could not be read.
11
12
  */
12
13
  export declare class SimCfnCfResponseHeadersPolicyConfig {
13
14
  private readonly resource;
14
15
  private readonly properties;
16
+ /**
17
+ * Refuse this Resource, saying which part of it could not be read.
18
+ */
19
+ private readonly refuse;
15
20
  constructor(properties: {
16
21
  readonly resource: SimCfnResource;
17
22
  readonly properties: SimCfnTemplateValueRecord;
@@ -20,19 +25,5 @@ export declare class SimCfnCfResponseHeadersPolicyConfig {
20
25
  * Build the simulated policy this Resource describes.
21
26
  */
22
27
  build(): SimCloudFrontResponseHeadersPolicy;
23
- private policyConfig;
24
- private assertModelled;
25
- private policyName;
26
- private customHeaders;
27
- private customHeader;
28
- private headersToRemove;
29
- /**
30
- * The `Items` of one `<name>Config` section, or nothing when it is absent.
31
- */
32
- private configItems;
33
- /**
34
- * Refuse this Resource, saying which part of it could not be read.
35
- */
36
- private refuse;
37
28
  }
38
29
  //# sourceMappingURL=sim-cfn-cf-rh-policy-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cfn-cf-rh-policy-config.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kEAAkE,CAAC;AAElH,OAAO,EAAE,kCAAkC,EAAE,MAAM,iEAAiE,CAAC;AAgBrH;;;;;;;GAOG;AACH,qBAAa,mCAAmC;IAC9C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA4B;IAEvD,YAAY,UAAU,EAAE;QACtB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;QAClC,QAAQ,CAAC,UAAU,EAAE,yBAAyB,CAAC;KAChD,EAGA;IAED;;OAEG;IACH,KAAK,IAAI,kCAAkC,CAU1C;IAED,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IAqBpB,OAAO,CAAC,eAAe;IAYvB;;OAEG;IACH,OAAO,CAAC,WAAW;IA4BnB;;OAEG;IACH,OAAO,CAAC,MAAM;CAKf"}
1
+ {"version":3,"file":"sim-cfn-cf-rh-policy-config.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kEAAkE,CAAC;AAClH,OAAO,EAAE,kCAAkC,EAAE,MAAM,iEAAiE,CAAC;AAarH;;;;;;;;GAQG;AACH,qBAAa,mCAAmC;IAC9C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA4B;IAEvD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAIrB;IAEF,YAAY,UAAU,EAAE;QACtB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;QAClC,QAAQ,CAAC,UAAU,EAAE,yBAAyB,CAAC;KAChD,EAGA;IAED;;OAEG;IACH,KAAK,IAAI,kCAAkC,CA2B1C;CACF"}
@@ -1,30 +1,28 @@
1
1
  import { isRecord } from "../../../../util/type-guard/record.js";
2
- import { SimCloudFrontResponseHeader } from "../../response-headers-policy/sim-cf-response-header.js";
3
2
  import { SimCloudFrontResponseHeadersPolicy } from "../../response-headers-policy/sim-cf-response-headers-policy.js";
4
- /**
5
- * The sections of a ResponseHeadersPolicyConfig this simulation does not model.
6
- *
7
- * Each of these turns into response headers of its own, so ignoring one would
8
- * serve a response missing headers the policy promised. A CORS section that
9
- * quietly does nothing is the worst of them, because the request it breaks is
10
- * one a browser makes and a test does not.
11
- */
12
- const unmodelledSections = [
13
- "CorsConfig",
14
- "SecurityHeadersConfig",
15
- "ServerTimingHeadersConfig",
16
- ];
3
+ import { simCfnCfResponseHeadersPolicyCors } from "./sim-cfn-cf-rh-policy-cors-config.js";
4
+ import { simCfnCfResponseHeadersPolicyCustomHeaders, simCfnCfResponseHeadersPolicyRemoveHeaders, } from "./sim-cfn-cf-rh-policy-custom-headers.js";
5
+ import { requiredString, } from "./sim-cfn-cf-rh-policy-field-reader.js";
6
+ import { simCfnCfResponseHeadersPolicySecurityHeaders } from "./sim-cfn-cf-rh-policy-security-headers.js";
7
+ import { simCfnCfResponseHeadersPolicyServerTiming } from "./sim-cfn-cf-rh-policy-server-timing.js";
17
8
  /**
18
9
  * Reads an AWS::CloudFront::ResponseHeadersPolicy Resource into a simulated
19
10
  * policy.
20
11
  *
21
- * Only the custom headers and the removed headers are modelled. The other
22
- * sections are refused by name rather than stepped over, so a policy that would
23
- * serve different headers here than in AWS fails where it is written.
12
+ * Every section is read by its own function in this directory, each taking
13
+ * the whole config and finding its own section in it. This class only says
14
+ * which sections a policy has, and carries the refusal that names the
15
+ * Resource whichever section could not be read.
24
16
  */
25
17
  export class SimCfnCfResponseHeadersPolicyConfig {
26
18
  resource;
27
19
  properties;
20
+ /**
21
+ * Refuse this Resource, saying which part of it could not be read.
22
+ */
23
+ refuse = (detail) => {
24
+ throw new Error(`Invalid AWS::CloudFront::ResponseHeadersPolicy ${this.resource.logicalId}: ${detail}`);
25
+ };
28
26
  constructor(properties) {
29
27
  this.resource = properties.resource;
30
28
  this.properties = properties.properties;
@@ -33,95 +31,19 @@ export class SimCfnCfResponseHeadersPolicyConfig {
33
31
  * Build the simulated policy this Resource describes.
34
32
  */
35
33
  build() {
36
- const config = this.policyConfig();
37
- this.assertModelled(config);
38
- return new SimCloudFrontResponseHeadersPolicy({
39
- name: this.policyName(config),
40
- customHeaders: this.customHeaders(config),
41
- headersToRemove: this.headersToRemove(config),
42
- });
43
- }
44
- policyConfig() {
34
+ const { refuse } = this;
45
35
  const config = this.properties["ResponseHeadersPolicyConfig"];
46
36
  if (!isRecord(config)) {
47
- this.refuse(`ResponseHeadersPolicyConfig must be an object`);
48
- }
49
- return config;
50
- }
51
- assertModelled(config) {
52
- for (const section of unmodelledSections) {
53
- // oxlint-disable-next-line security/detect-object-injection
54
- if (config[section] !== undefined) {
55
- this.refuse(`${section} is not modelled by simulated response headers ` +
56
- `policies, so the headers it sets would be missing from the ` +
57
- `response`);
58
- }
59
- }
60
- }
61
- policyName(config) {
62
- const name = config["Name"];
63
- if (typeof name !== "string") {
64
- this.refuse(`ResponseHeadersPolicyConfig Name must be a string`);
37
+ return refuse(`ResponseHeadersPolicyConfig must be an object`);
65
38
  }
66
- return name;
67
- }
68
- customHeaders(config) {
69
- return this.configItems(config, "CustomHeadersConfig").map((item) => {
70
- if (!isRecord(item)) {
71
- this.refuse(`CustomHeadersConfig items must be objects`);
72
- }
73
- return this.customHeader(item);
74
- });
75
- }
76
- customHeader(item) {
77
- const name = item["Header"];
78
- const value = item["Value"];
79
- if (typeof name !== "string" || typeof value !== "string") {
80
- this.refuse(`CustomHeadersConfig items need a string Header and Value`);
81
- }
82
- // Override is required by the CloudFormation schema, so anything else here
83
- // is a template that would be refused before it reached a policy at all.
84
- const override = item["Override"];
85
- if (typeof override !== "boolean") {
86
- this.refuse(`CustomHeadersConfig item ${name} needs a boolean Override`);
87
- }
88
- return new SimCloudFrontResponseHeader({ name, value, override });
89
- }
90
- headersToRemove(config) {
91
- return this.configItems(config, "RemoveHeadersConfig").map((item) => {
92
- const name = isRecord(item) ? item["Header"] : undefined;
93
- if (typeof name !== "string") {
94
- this.refuse(`RemoveHeadersConfig items need a string Header`);
95
- }
96
- return name;
39
+ return new SimCloudFrontResponseHeadersPolicy({
40
+ name: requiredString(config, "Name", "ResponseHeadersPolicyConfig", refuse),
41
+ customHeaders: simCfnCfResponseHeadersPolicyCustomHeaders(config, refuse),
42
+ headersToRemove: simCfnCfResponseHeadersPolicyRemoveHeaders(config, refuse),
43
+ securityHeaders: simCfnCfResponseHeadersPolicySecurityHeaders(config, refuse),
44
+ serverTiming: simCfnCfResponseHeadersPolicyServerTiming(config, refuse),
45
+ cors: simCfnCfResponseHeadersPolicyCors(config, refuse),
97
46
  });
98
47
  }
99
- /**
100
- * The `Items` of one `<name>Config` section, or nothing when it is absent.
101
- */
102
- configItems(config, sectionName) {
103
- // oxlint-disable-next-line security/detect-object-injection
104
- const section = config[sectionName];
105
- if (section === undefined) {
106
- return [];
107
- }
108
- if (!isRecord(section)) {
109
- this.refuse(`${sectionName} must be an object`);
110
- }
111
- const items = section["Items"];
112
- if (items === undefined) {
113
- return [];
114
- }
115
- if (!Array.isArray(items)) {
116
- this.refuse(`${sectionName} Items must be an array`);
117
- }
118
- return items;
119
- }
120
- /**
121
- * Refuse this Resource, saying which part of it could not be read.
122
- */
123
- refuse(detail) {
124
- throw new Error(`Invalid AWS::CloudFront::ResponseHeadersPolicy ${this.resource.logicalId}: ${detail}`);
125
- }
126
48
  }
127
49
  //# sourceMappingURL=sim-cfn-cf-rh-policy-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cfn-cf-rh-policy-config.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAGjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AACtG,OAAO,EAAE,kCAAkC,EAAE,MAAM,iEAAiE,CAAC;AAErH;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG;IACzB,YAAY;IACZ,uBAAuB;IACvB,2BAA2B;CACnB,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,OAAO,mCAAmC;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AEzD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7B,IAAI,CAAC,MAAM,CAAC,gDAAgD,CAAC,CAAC;YAChE,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,WAAW,CACjB,MAA+B,EAC/B,WAAmB;QAEnB,4DAA4D;QAC5D,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;QAEpC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,oBAAoB,CAAC,CAAC;QAClD,CAAC;QAED,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAE/B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,MAAM,CAAC,GAAG,WAAW,yBAAyB,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACK,MAAM,CAAC,MAAc;QAC3B,MAAM,IAAI,KAAK,CACb,kDAAkD,IAAI,CAAC,QAAQ,CAAC,SAAS,KAAK,MAAM,EAAE,CACvF,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"sim-cfn-cf-rh-policy-config.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAGjE,OAAO,EAAE,kCAAkC,EAAE,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,iCAAiC,EAAE,MA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,IAAI,EAAE,iCAAiC,CAAC,MAAM,EAAE,MAAM,CAAC;SACxD,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import { SimCloudFrontResponseHeadersPolicyCors } from "../../response-headers-policy/sim-cf-response-headers-policy-cors.js";
2
+ import { type SimCfnCfRhPolicyFieldRefuse } from "./sim-cfn-cf-rh-policy-field-reader.js";
3
+ /**
4
+ * Reads a ResponseHeadersPolicyConfig's CorsConfig section into the CORS
5
+ * model that applies it at request time.
6
+ *
7
+ * Split from the config reader that calls it for the same reason as
8
+ * simCfnCfResponseHeadersPolicySecurityHeaders: this project holds every
9
+ * source file to a line count, and CORS has enough of its own fields to
10
+ * reach it alongside the rest of the policy.
11
+ */
12
+ export declare function simCfnCfResponseHeadersPolicyCors(config: Record<string, unknown>, refuse: SimCfnCfRhPolicyFieldRefuse): SimCloudFrontResponseHeadersPolicyCors | undefined;
13
+ //# sourceMappingURL=sim-cfn-cf-rh-policy-cors-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cfn-cf-rh-policy-cors-config.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-cors-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sCAAsC,EAAE,MAAM,sEAAsE,CAAC;AAC9H,OAAO,EAIL,KAAK,2BAA2B,EACjC,MAAM,wCAAwC,CAAC;AAEhD;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,EAAE,2BAA2B,GAClC,sCAAsC,GAAG,SAAS,CAoCpD"}
@@ -0,0 +1,76 @@
1
+ import { simCfCorsOriginPatternIsValid } from "../../response-headers-policy/sim-cf-cors-origin-pattern.js";
2
+ import { SimCloudFrontResponseHeadersPolicyCors } from "../../response-headers-policy/sim-cf-response-headers-policy-cors.js";
3
+ import { optionalObject, requiredBoolean, requiredInteger, } from "./sim-cfn-cf-rh-policy-field-reader.js";
4
+ /**
5
+ * Reads a ResponseHeadersPolicyConfig's CorsConfig section into the CORS
6
+ * model that applies it at request time.
7
+ *
8
+ * Split from the config reader that calls it for the same reason as
9
+ * simCfnCfResponseHeadersPolicySecurityHeaders: this project holds every
10
+ * source file to a line count, and CORS has enough of its own fields to
11
+ * reach it alongside the rest of the policy.
12
+ */
13
+ export function simCfnCfResponseHeadersPolicyCors(config, refuse) {
14
+ const section = optionalObject(config, "CorsConfig", "CorsConfig", refuse);
15
+ if (section === undefined) {
16
+ return undefined;
17
+ }
18
+ const maxAgeSec = section["AccessControlMaxAgeSec"] === undefined
19
+ ? undefined
20
+ : requiredInteger(section, "AccessControlMaxAgeSec", "CorsConfig", refuse);
21
+ return new SimCloudFrontResponseHeadersPolicyCors({
22
+ allowCredentials: requiredBoolean(section, "AccessControlAllowCredentials", "CorsConfig", refuse),
23
+ allowHeaders: requiredList(section, "AccessControlAllowHeaders", refuse),
24
+ allowMethods: requiredList(section, "AccessControlAllowMethods", refuse),
25
+ allowOrigins: allowOrigins(section, refuse),
26
+ exposeHeaders: optionalList(section, "AccessControlExposeHeaders", refuse),
27
+ ...(maxAgeSec !== undefined && { maxAgeSec }),
28
+ originOverride: requiredBoolean(section, "OriginOverride", "CorsConfig", refuse),
29
+ });
30
+ }
31
+ /**
32
+ * The allowed Origins, each of which must place its wildcard where CloudFront
33
+ * allows one, since an entry it would refuse could never match here either.
34
+ */
35
+ function allowOrigins(section, refuse) {
36
+ const origins = requiredList(section, "AccessControlAllowOrigins", refuse);
37
+ for (const origin of origins) {
38
+ if (!simCfCorsOriginPatternIsValid(origin)) {
39
+ refuse(`CorsConfig AccessControlAllowOrigins ${origin} may only use the ` +
40
+ `wildcard on its own or as the leftmost subdomain, as in ` +
41
+ `*.example.org`);
42
+ }
43
+ }
44
+ return origins;
45
+ }
46
+ /**
47
+ * The string `Items` of a field CloudFront requires a CORS section to carry.
48
+ */
49
+ function requiredList(section, fieldName, refuse) {
50
+ // oxlint-disable-next-line security/detect-object-injection
51
+ if (section[fieldName] === undefined) {
52
+ refuse(`CorsConfig needs an ${fieldName}`);
53
+ }
54
+ return optionalList(section, fieldName, refuse);
55
+ }
56
+ /**
57
+ * The string `Items` of one `AccessControl*` field, or nothing when the field
58
+ * is absent. `Items` itself is required whenever the field is present.
59
+ */
60
+ function optionalList(section, fieldName, refuse) {
61
+ const field = optionalObject(section, fieldName, `CorsConfig ${fieldName}`, refuse);
62
+ if (field === undefined) {
63
+ return [];
64
+ }
65
+ const items = field["Items"];
66
+ if (!Array.isArray(items)) {
67
+ refuse(`CorsConfig ${fieldName} needs an array Items`);
68
+ }
69
+ return items.map((item) => {
70
+ if (typeof item !== "string") {
71
+ refuse(`CorsConfig ${fieldName} Items must be strings`);
72
+ }
73
+ return item;
74
+ });
75
+ }
76
+ //# sourceMappingURL=sim-cfn-cf-rh-policy-cors-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cfn-cf-rh-policy-cors-config.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-cors-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AAC5G,OAAO,EAAE,sCAAsC,EAAE,MAAM,sEAAsE,CAAC;AAC9H,OAAO,EACL,cAAc,EACd,eAAe,EACf,eAAe,GAEhB,MAAM,wCAAwC,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,UAAU,iCAAiC,CAC/C,MAA+B,EAC/B,MAAmC;IAEnC,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IAE3E,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,SAAS,GACb,OAAO,CAAC,wBAAwB,CAAC,KAAK,SAAS;QAC7C,CA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AC7C,CAAC;IAED,OAAO,YAAY,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CACnB,OAAgC,EAChC,SAAiB,EACjB,MAAmC;IAEnC,MAAM,KAAK,GAAG,cAAc,CAC1B,OAAO,EACP,SAAS,EACT,cAAc,SAAS,EAAE,EACzB,MAAM,CACP,CAAC;IAEF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IAE7B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,CAAC,cAAc,SAAS,uBAAuB,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,CAAC,cAAc,SAAS,wBAAwB,CAAC,CAAC;QAC1D,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { SimCloudFrontResponseHeader } from "../../response-headers-policy/sim-cf-response-header.js";
2
+ import { type SimCfnCfRhPolicyFieldRefuse } from "./sim-cfn-cf-rh-policy-field-reader.js";
3
+ /**
4
+ * Reads a ResponseHeadersPolicyConfig's CustomHeadersConfig section into the
5
+ * headers it adds.
6
+ *
7
+ * Split from the config reader that calls it for the same reason as
8
+ * simCfnCfResponseHeadersPolicySecurityHeaders: this project holds every
9
+ * source file to a line count.
10
+ */
11
+ export declare function simCfnCfResponseHeadersPolicyCustomHeaders(config: Record<string, unknown>, refuse: SimCfnCfRhPolicyFieldRefuse): SimCloudFrontResponseHeader[];
12
+ /**
13
+ * Reads a ResponseHeadersPolicyConfig's RemoveHeadersConfig section into the
14
+ * header names it removes.
15
+ */
16
+ export declare function simCfnCfResponseHeadersPolicyRemoveHeaders(config: Record<string, unknown>, refuse: SimCfnCfRhPolicyFieldRefuse): string[];
17
+ //# sourceMappingURL=sim-cfn-cf-rh-policy-custom-headers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cfn-cf-rh-policy-custom-headers.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-custom-headers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AACtG,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,wCAAwC,CAAC;AAEhD;;;;;;;GAOG;AACH,wBAAgB,0CAA0C,CACxD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,EAAE,2BAA2B,GAClC,2BAA2B,EAAE,CAwB/B;AAED;;;GAGG;AACH,wBAAgB,0CAA0C,CACxD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,EAAE,2BAA2B,GAClC,MAAM,EAAE,CAUV"}
@@ -0,0 +1,45 @@
1
+ import { isRecord } from "../../../../util/type-guard/record.js";
2
+ import { SimCloudFrontResponseHeader } from "../../response-headers-policy/sim-cf-response-header.js";
3
+ import { sectionItems, } from "./sim-cfn-cf-rh-policy-field-reader.js";
4
+ /**
5
+ * Reads a ResponseHeadersPolicyConfig's CustomHeadersConfig section into the
6
+ * headers it adds.
7
+ *
8
+ * Split from the config reader that calls it for the same reason as
9
+ * simCfnCfResponseHeadersPolicySecurityHeaders: this project holds every
10
+ * source file to a line count.
11
+ */
12
+ export function simCfnCfResponseHeadersPolicyCustomHeaders(config, refuse) {
13
+ return sectionItems(config, "CustomHeadersConfig", refuse).map((item) => {
14
+ if (!isRecord(item)) {
15
+ refuse(`CustomHeadersConfig items must be objects`);
16
+ }
17
+ const name = item["Header"];
18
+ const value = item["Value"];
19
+ if (typeof name !== "string" || typeof value !== "string") {
20
+ refuse(`CustomHeadersConfig items need a string Header and Value`);
21
+ }
22
+ // Override is required by the CloudFormation schema, so anything else
23
+ // here is a template that would be refused before it reached a policy at
24
+ // all.
25
+ const override = item["Override"];
26
+ if (typeof override !== "boolean") {
27
+ refuse(`CustomHeadersConfig item ${name} needs a boolean Override`);
28
+ }
29
+ return new SimCloudFrontResponseHeader({ name, value, override });
30
+ });
31
+ }
32
+ /**
33
+ * Reads a ResponseHeadersPolicyConfig's RemoveHeadersConfig section into the
34
+ * header names it removes.
35
+ */
36
+ export function simCfnCfResponseHeadersPolicyRemoveHeaders(config, refuse) {
37
+ return sectionItems(config, "RemoveHeadersConfig", refuse).map((item) => {
38
+ const name = isRecord(item) ? item["Header"] : undefined;
39
+ if (typeof name !== "string") {
40
+ refuse(`RemoveHeadersConfig items need a string Header`);
41
+ }
42
+ return name;
43
+ });
44
+ }
45
+ //# sourceMappingURL=sim-cfn-cf-rh-policy-custom-headers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cfn-cf-rh-policy-custom-headers.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-custom-headers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AACtG,OAAO,EACL,YAAY,GAEb,MAAM,wCAAwC,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,UAAU,0CAA0C,CACxD,MAA+B,EAC/B,MAAmC;IAEnC,OAAO,YAAY,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,MAAM,CAAC,2CAA2C,CAAC,CAAC;QACtD,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;QAE5B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC1D,MAAM,CAAC,0DAA0D,CAAC,CAAC;QACrE,CAAC;QAED,sEAAsE;QACtE,yEAAyE;QACzE,OAAO;QACP,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;QAElC,IAAI,OAAO,QAAQ,KAAK,SAAS,EAAE,CAAC;YAClC,MAAM,CAAC,4BAA4B,IAAI,2BAA2B,CAAC,CAAC;QACtE,CAAC;QAED,OAAO,IAAI,2BAA2B,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0CAA0C,CACxD,MAA+B,EAC/B,MAAmC;IAEnC,OAAO,YAAY,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtE,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEzD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,CAAC,gDAAgD,CAAC,CAAC;QAC3D,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,37 @@
1
+ export type SimCfnCfRhPolicyFieldRefuse = (detail: string) => never;
2
+ /**
3
+ * Shared field readers for a ResponseHeadersPolicyConfig section, used by
4
+ * both the SecurityHeadersConfig and CorsConfig readers so the type checks
5
+ * every field needs are written once rather than once per section.
6
+ */
7
+ /**
8
+ * A named field that must be a string.
9
+ */
10
+ export declare function requiredString(item: Record<string, unknown>, field: string, context: string, refuse: SimCfnCfRhPolicyFieldRefuse): string;
11
+ /**
12
+ * A named field that must be a whole number of the kind CloudFormation calls
13
+ * an Integer.
14
+ *
15
+ * A template is often a JavaScript object rather than parsed JSON here, so a
16
+ * fraction, a NaN or an Infinity can reach this where JSON could not carry
17
+ * one, and each would reach a header as a value no client can read.
18
+ */
19
+ export declare function requiredInteger(item: Record<string, unknown>, field: string, context: string, refuse: SimCfnCfRhPolicyFieldRefuse): number;
20
+ /**
21
+ * One of a fixed set of values a field is allowed to take.
22
+ */
23
+ export declare function requiredEnum(item: Record<string, unknown>, field: string, allowed: readonly string[], context: string, refuse: SimCfnCfRhPolicyFieldRefuse): string;
24
+ /**
25
+ * A named field that must be a boolean.
26
+ */
27
+ export declare function requiredBoolean(item: Record<string, unknown>, field: string, context: string, refuse: SimCfnCfRhPolicyFieldRefuse): boolean;
28
+ /**
29
+ * A named field that must be an object, or nothing when the field is absent.
30
+ */
31
+ export declare function optionalObject(item: Record<string, unknown>, field: string, context: string, refuse: SimCfnCfRhPolicyFieldRefuse): Record<string, unknown> | undefined;
32
+ /**
33
+ * The `Items` of one `<name>Config` section, or nothing when the section or
34
+ * its `Items` is absent.
35
+ */
36
+ export declare function sectionItems(config: Record<string, unknown>, sectionName: string, refuse: SimCfnCfRhPolicyFieldRefuse): unknown[];
37
+ //# sourceMappingURL=sim-cfn-cf-rh-policy-field-reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cfn-cf-rh-policy-field-reader.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-field-reader.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,2BAA2B,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,KAAK,CAAC;AAEpE;;;;GAIG;AAEH;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,2BAA2B,GAClC,MAAM,CAOR;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,2BAA2B,GAClC,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,2BAA2B,GAClC,MAAM,CAMR;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAOT;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,2BAA2B,GAClC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CASrC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,2BAA2B,GAClC,OAAO,EAAE,CAYX"}
@@ -0,0 +1,75 @@
1
+ import { isRecord } from "../../../../util/type-guard/record.js";
2
+ /**
3
+ * Shared field readers for a ResponseHeadersPolicyConfig section, used by
4
+ * both the SecurityHeadersConfig and CorsConfig readers so the type checks
5
+ * every field needs are written once rather than once per section.
6
+ */
7
+ /**
8
+ * A named field that must be a string.
9
+ */
10
+ export function requiredString(item, field, context, refuse) {
11
+ // oxlint-disable-next-line security/detect-object-injection
12
+ const value = item[field];
13
+ return typeof value === "string"
14
+ ? value
15
+ : refuse(`${context} needs a string ${field}`);
16
+ }
17
+ /**
18
+ * A named field that must be a whole number of the kind CloudFormation calls
19
+ * an Integer.
20
+ *
21
+ * A template is often a JavaScript object rather than parsed JSON here, so a
22
+ * fraction, a NaN or an Infinity can reach this where JSON could not carry
23
+ * one, and each would reach a header as a value no client can read.
24
+ */
25
+ export function requiredInteger(item, field, context, refuse) {
26
+ // oxlint-disable-next-line security/detect-object-injection
27
+ const value = item[field];
28
+ return typeof value === "number" && Number.isSafeInteger(value)
29
+ ? value
30
+ : refuse(`${context} needs a whole number ${field}`);
31
+ }
32
+ /**
33
+ * One of a fixed set of values a field is allowed to take.
34
+ */
35
+ export function requiredEnum(item, field, allowed, context, refuse) {
36
+ const value = requiredString(item, field, context, refuse);
37
+ return allowed.includes(value)
38
+ ? value
39
+ : refuse(`${context} ${field} must be one of ${allowed.join(", ")}`);
40
+ }
41
+ /**
42
+ * A named field that must be a boolean.
43
+ */
44
+ export function requiredBoolean(item, field, context, refuse) {
45
+ // oxlint-disable-next-line security/detect-object-injection
46
+ const value = item[field];
47
+ return typeof value === "boolean"
48
+ ? value
49
+ : refuse(`${context} needs a boolean ${field}`);
50
+ }
51
+ /**
52
+ * A named field that must be an object, or nothing when the field is absent.
53
+ */
54
+ export function optionalObject(item, field, context, refuse) {
55
+ // oxlint-disable-next-line security/detect-object-injection
56
+ const value = item[field];
57
+ if (value === undefined) {
58
+ return undefined;
59
+ }
60
+ return isRecord(value) ? value : refuse(`${context} must be an object`);
61
+ }
62
+ /**
63
+ * The `Items` of one `<name>Config` section, or nothing when the section or
64
+ * its `Items` is absent.
65
+ */
66
+ export function sectionItems(config, sectionName, refuse) {
67
+ const items = optionalObject(config, sectionName, sectionName, refuse)?.["Items"];
68
+ if (items === undefined) {
69
+ return [];
70
+ }
71
+ return Array.isArray(items)
72
+ ? items
73
+ : refuse(`${sectionName} Items must be an array`);
74
+ }
75
+ //# sourceMappingURL=sim-cfn-cf-rh-policy-field-reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cfn-cf-rh-policy-field-reader.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-field-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAIjE;;;;GAIG;AAEH;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,IAA6B,EAC7B,KAAa,EACb,OAAe,EACf,MAAmC;IAEnC,4DAA4D;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IAE1B,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC9B,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,MAAM,CAAC,GAAG,OAAO,mBAAmB,KAAK,EAAE,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,IAA6B,EAC7B,KAAa,EACb,OAAe,EACf,MAAmC;IAEnC,4DAA4D;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IAE1B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;QAC7D,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,MAAM,CAAC,GAAG,OAAO,yBAAyB,KAAK,EAAE,CAAC,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,IAA6B,EAC7B,KAAa,EACb,OAA0B,EAC1B,OAAe,EACf,MAAmC;IAEnC,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAE3D,OAAO,OAAO,CAA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,WAAW,yBAAyB,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { SimCloudFrontResponseHeader } from "../../response-headers-policy/sim-cf-response-header.js";
2
+ import { type SimCfnCfRhPolicyFieldRefuse } from "./sim-cfn-cf-rh-policy-field-reader.js";
3
+ /**
4
+ * Reads a ResponseHeadersPolicyConfig's SecurityHeadersConfig section into
5
+ * the header CloudFront documents for each of its sub-sections.
6
+ *
7
+ * Every sub-section carries its own `Override`, unlike the CORS section whose
8
+ * one `OriginOverride` decides all of its headers together.
9
+ */
10
+ export declare function simCfnCfResponseHeadersPolicySecurityHeaders(config: Record<string, unknown>, refuse: SimCfnCfRhPolicyFieldRefuse): SimCloudFrontResponseHeader[];
11
+ //# sourceMappingURL=sim-cfn-cf-rh-policy-security-headers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cfn-cf-rh-policy-security-headers.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-headers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AACtG,OAAO,EAGL,KAAK,2BAA2B,EACjC,MAAM,wCAAwC,CAAC;AAGhD;;;;;;GAMG;AACH,wBAAgB,4CAA4C,CAC1D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,EAAE,2BAA2B,GAClC,2BAA2B,EAAE,CA0B/B"}
@@ -0,0 +1,30 @@
1
+ import { SimCloudFrontResponseHeader } from "../../response-headers-policy/sim-cf-response-header.js";
2
+ import { optionalObject, requiredBoolean, } from "./sim-cfn-cf-rh-policy-field-reader.js";
3
+ import { simCfnCfRhPolicySecurityHeaders } from "./sim-cfn-cf-rh-policy-security-values.js";
4
+ /**
5
+ * Reads a ResponseHeadersPolicyConfig's SecurityHeadersConfig section into
6
+ * the header CloudFront documents for each of its sub-sections.
7
+ *
8
+ * Every sub-section carries its own `Override`, unlike the CORS section whose
9
+ * one `OriginOverride` decides all of its headers together.
10
+ */
11
+ export function simCfnCfResponseHeadersPolicySecurityHeaders(config, refuse) {
12
+ const section = optionalObject(config, "SecurityHeadersConfig", "SecurityHeadersConfig", refuse);
13
+ if (section === undefined) {
14
+ return [];
15
+ }
16
+ return simCfnCfRhPolicySecurityHeaders
17
+ .map(([subsection, name, value]) => {
18
+ const context = `SecurityHeadersConfig ${subsection}`;
19
+ const item = optionalObject(section, subsection, context, refuse);
20
+ return item === undefined
21
+ ? undefined
22
+ : new SimCloudFrontResponseHeader({
23
+ name,
24
+ value: value(item, context, refuse),
25
+ override: requiredBoolean(item, "Override", context, refuse),
26
+ });
27
+ })
28
+ .filter((h) => h !== undefined);
29
+ }
30
+ //# sourceMappingURL=sim-cfn-cf-rh-policy-security-headers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cfn-cf-rh-policy-security-headers.js","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-headers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AACtG,OAAO,EACL,cAAc,EACd,eAAe,GAEhB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAE5F;;;;;;GAMG;AACH,MAAM,UAAU,4CAA4C,CAC1D,MAA+B,EAC/B,MAAmC;IAEnC,MAAM,OAAO,GAAG,cAAc,CAC5B,MAAM,EACN,uBAAuB,EACvB,uBAAuB,EACvB,MAAM,CACP,CAAC;IAEF,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,+BAA+B;SACnC,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;QACjC,MAAM,OAAO,GAAG,yBAAyB,UAAU,EAAE,CAAC;QACtD,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAElE,OAAO,IAAI,KAAK,SAAS;YACvB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,IAAI,2BAA2B,CAAC;gBAC9B,IAAI;gBACJ,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC;gBACnC,QAAQ,EAAE,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC;aAC7D,CAAC,CAAC;IACT,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,CAAC,EAAoC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type SimCfnCfRhPolicyFieldRefuse } from "./sim-cfn-cf-rh-policy-field-reader.js";
2
+ /**
3
+ * The header value each SecurityHeadersConfig sub-section describes.
4
+ *
5
+ * Split from the section reader that dispatches to them so that file stays a
6
+ * table of which sub-section sets which header, under the line count this
7
+ * project holds every source file to.
8
+ */
9
+ export type SimCfnCfRhPolicySecurityValue = (item: Record<string, unknown>, context: string, refuse: SimCfnCfRhPolicyFieldRefuse) => string;
10
+ /**
11
+ * Which sub-section of a SecurityHeadersConfig sets which response header,
12
+ * and what builds its value.
13
+ */
14
+ export declare const simCfnCfRhPolicySecurityHeaders: readonly (readonly [
15
+ string,
16
+ string,
17
+ SimCfnCfRhPolicySecurityValue
18
+ ])[];
19
+ //# sourceMappingURL=sim-cfn-cf-rh-policy-security-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cfn-cf-rh-policy-security-values.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cfn/response-headers-policy/sim-cfn-cf-rh-policy-security-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,2BAA2B,EACjC,MAAM,wCAAwC,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAC1C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,2BAA2B,KAChC,MAAM,CAAC;AAwFZ;;;GAGG;AACH,eAAO,MAAM,+BAA+B,EAAE,SAAS,CAAC,SAAS;IAC/D,MAAM;IACN,MAAM;IACN,6BAA6B;CAC9B,CAAC,EAeD,CAAC"}