@kensio/yulin 1.18.0 → 1.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (389) hide show
  1. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.d.ts +8 -2
  2. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.d.ts.map +1 -1
  3. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.js +9 -3
  4. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.js.map +1 -1
  5. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-web-acl.d.ts +25 -0
  6. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-web-acl.d.ts.map +1 -0
  7. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-web-acl.js +36 -0
  8. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-web-acl.js.map +1 -0
  9. package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.d.ts.map +1 -1
  10. package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.js +6 -5
  11. package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.js.map +1 -1
  12. package/dist/service/cognito/cfn/client/sim-cfn-cognito-client-properties.d.ts.map +1 -1
  13. package/dist/service/cognito/cfn/client/sim-cfn-cognito-client-properties.js +10 -0
  14. package/dist/service/cognito/cfn/client/sim-cfn-cognito-client-properties.js.map +1 -1
  15. package/dist/service/cognito/cfn/client/sim-cfn-cognito-refresh-token-rotation.d.ts +27 -0
  16. package/dist/service/cognito/cfn/client/sim-cfn-cognito-refresh-token-rotation.d.ts.map +1 -0
  17. package/dist/service/cognito/cfn/client/sim-cfn-cognito-refresh-token-rotation.js +35 -0
  18. package/dist/service/cognito/cfn/client/sim-cfn-cognito-refresh-token-rotation.js.map +1 -0
  19. package/dist/service/cognito/command/auth/auth.command.d.ts +31 -0
  20. package/dist/service/cognito/command/auth/auth.command.d.ts.map +1 -1
  21. package/dist/service/cognito/command/auth/sim-cognito-auth-commands.d.ts +2 -0
  22. package/dist/service/cognito/command/auth/sim-cognito-auth-commands.d.ts.map +1 -1
  23. package/dist/service/cognito/command/auth/sim-cognito-auth-commands.js +13 -1
  24. package/dist/service/cognito/command/auth/sim-cognito-auth-commands.js.map +1 -1
  25. package/dist/service/cognito/command/auth/sim-cognito-get-tokens-from-refresh-token.d.ts +35 -0
  26. package/dist/service/cognito/command/auth/sim-cognito-get-tokens-from-refresh-token.d.ts.map +1 -0
  27. package/dist/service/cognito/command/auth/sim-cognito-get-tokens-from-refresh-token.js +51 -0
  28. package/dist/service/cognito/command/auth/sim-cognito-get-tokens-from-refresh-token.js.map +1 -0
  29. package/dist/service/cognito/command/auth/sim-cognito-refresh-sign-in.d.ts +3 -8
  30. package/dist/service/cognito/command/auth/sim-cognito-refresh-sign-in.d.ts.map +1 -1
  31. package/dist/service/cognito/command/auth/sim-cognito-refresh-sign-in.js +24 -17
  32. package/dist/service/cognito/command/auth/sim-cognito-refresh-sign-in.js.map +1 -1
  33. package/dist/service/cognito/command/auth/sim-cognito-refreshed-tokens.d.ts +56 -0
  34. package/dist/service/cognito/command/auth/sim-cognito-refreshed-tokens.d.ts.map +1 -0
  35. package/dist/service/cognito/command/auth/sim-cognito-refreshed-tokens.js +50 -0
  36. package/dist/service/cognito/command/auth/sim-cognito-refreshed-tokens.js.map +1 -0
  37. package/dist/service/cognito/command/client/sim-cognito-unsimulated-client-options.d.ts.map +1 -1
  38. package/dist/service/cognito/command/client/sim-cognito-unsimulated-client-options.js +0 -1
  39. package/dist/service/cognito/command/client/sim-cognito-unsimulated-client-options.js.map +1 -1
  40. package/dist/service/cognito/command/client/sim-cognito-user-pool-client-view.d.ts +4 -3
  41. package/dist/service/cognito/command/client/sim-cognito-user-pool-client-view.d.ts.map +1 -1
  42. package/dist/service/cognito/command/client/sim-cognito-user-pool-client-view.js +5 -3
  43. package/dist/service/cognito/command/client/sim-cognito-user-pool-client-view.js.map +1 -1
  44. package/dist/service/cognito/command/client/user-pool-client.command.d.ts +3 -1
  45. package/dist/service/cognito/command/client/user-pool-client.command.d.ts.map +1 -1
  46. package/dist/service/cognito/command/hosted/sim-cognito-presented-grant.js +1 -1
  47. package/dist/service/cognito/command/hosted/sim-cognito-presented-grant.js.map +1 -1
  48. package/dist/service/cognito/command/hosted/sim-cognito-token-grants.d.ts +3 -3
  49. package/dist/service/cognito/command/hosted/sim-cognito-token-grants.d.ts.map +1 -1
  50. package/dist/service/cognito/command/hosted/sim-cognito-token-grants.js +5 -4
  51. package/dist/service/cognito/command/hosted/sim-cognito-token-grants.js.map +1 -1
  52. package/dist/service/cognito/command/sim-cognito-command.types.d.ts +1 -1
  53. package/dist/service/cognito/command/sim-cognito-command.types.d.ts.map +1 -1
  54. package/dist/service/cognito/index.d.ts +1 -0
  55. package/dist/service/cognito/index.d.ts.map +1 -1
  56. package/dist/service/cognito/index.js +1 -0
  57. package/dist/service/cognito/index.js.map +1 -1
  58. package/dist/service/cognito/sdk/sim-cognito-sdk-auth-routes.d.ts.map +1 -1
  59. package/dist/service/cognito/sdk/sim-cognito-sdk-auth-routes.js +4 -0
  60. package/dist/service/cognito/sdk/sim-cognito-sdk-auth-routes.js.map +1 -1
  61. package/dist/service/cognito/sim-cognito-authentication.d.ts +8 -0
  62. package/dist/service/cognito/sim-cognito-authentication.d.ts.map +1 -1
  63. package/dist/service/cognito/sim-cognito-authentication.js +11 -0
  64. package/dist/service/cognito/sim-cognito-authentication.js.map +1 -1
  65. package/dist/service/cognito/user-pool/auth/sim-cognito-issued-token-store.d.ts +11 -1
  66. package/dist/service/cognito/user-pool/auth/sim-cognito-issued-token-store.d.ts.map +1 -1
  67. package/dist/service/cognito/user-pool/auth/sim-cognito-issued-token-store.js +17 -2
  68. package/dist/service/cognito/user-pool/auth/sim-cognito-issued-token-store.js.map +1 -1
  69. package/dist/service/cognito/user-pool/auth/sim-cognito-issued-token.d.ts +41 -0
  70. package/dist/service/cognito/user-pool/auth/sim-cognito-issued-token.d.ts.map +1 -1
  71. package/dist/service/cognito/user-pool/auth/sim-cognito-issued-token.js +62 -0
  72. package/dist/service/cognito/user-pool/auth/sim-cognito-issued-token.js.map +1 -1
  73. package/dist/service/cognito/user-pool/auth/sim-cognito-pool-auth.d.ts +5 -0
  74. package/dist/service/cognito/user-pool/auth/sim-cognito-pool-auth.d.ts.map +1 -1
  75. package/dist/service/cognito/user-pool/auth/sim-cognito-pool-auth.js +7 -0
  76. package/dist/service/cognito/user-pool/auth/sim-cognito-pool-auth.js.map +1 -1
  77. package/dist/service/cognito/user-pool/auth/sim-cognito-refresh-token-input.d.ts +11 -0
  78. package/dist/service/cognito/user-pool/auth/sim-cognito-refresh-token-input.d.ts.map +1 -0
  79. package/dist/service/cognito/user-pool/auth/sim-cognito-refresh-token-input.js +17 -0
  80. package/dist/service/cognito/user-pool/auth/sim-cognito-refresh-token-input.js.map +1 -0
  81. package/dist/service/cognito/user-pool/auth/sim-cognito-refreshable-session.factory.d.ts +61 -0
  82. package/dist/service/cognito/user-pool/auth/sim-cognito-refreshable-session.factory.d.ts.map +1 -0
  83. package/dist/service/cognito/user-pool/auth/sim-cognito-refreshable-session.factory.js +80 -0
  84. package/dist/service/cognito/user-pool/auth/sim-cognito-refreshable-session.factory.js.map +1 -0
  85. package/dist/service/cognito/user-pool/client/sim-cognito-client-secret.d.ts +10 -0
  86. package/dist/service/cognito/user-pool/client/sim-cognito-client-secret.d.ts.map +1 -1
  87. package/dist/service/cognito/user-pool/client/sim-cognito-client-secret.js +22 -0
  88. package/dist/service/cognito/user-pool/client/sim-cognito-client-secret.js.map +1 -1
  89. package/dist/service/cognito/user-pool/client/sim-cognito-refresh-token-rotation.d.ts +48 -0
  90. package/dist/service/cognito/user-pool/client/sim-cognito-refresh-token-rotation.d.ts.map +1 -0
  91. package/dist/service/cognito/user-pool/client/sim-cognito-refresh-token-rotation.js +79 -0
  92. package/dist/service/cognito/user-pool/client/sim-cognito-refresh-token-rotation.js.map +1 -0
  93. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-settings.d.ts +7 -0
  94. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-settings.d.ts.map +1 -1
  95. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-settings.js +7 -0
  96. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-settings.js.map +1 -1
  97. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client.d.ts +6 -0
  98. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client.d.ts.map +1 -1
  99. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client.js +7 -0
  100. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client.js.map +1 -1
  101. package/dist/service/cognito/user-pool/token/sim-cognito-token-issuer.d.ts +34 -0
  102. package/dist/service/cognito/user-pool/token/sim-cognito-token-issuer.d.ts.map +1 -1
  103. package/dist/service/cognito/user-pool/token/sim-cognito-token-issuer.js +40 -1
  104. package/dist/service/cognito/user-pool/token/sim-cognito-token-issuer.js.map +1 -1
  105. package/dist/service/lambda/command/create-function/create-function-input.js +1 -1
  106. package/dist/service/lambda/command/create-function/create-function-input.js.map +1 -1
  107. package/dist/service/lambda/command/function/sim-lambda-function-commands.d.ts +17 -0
  108. package/dist/service/lambda/command/function/sim-lambda-function-commands.d.ts.map +1 -1
  109. package/dist/service/lambda/command/function/sim-lambda-function-commands.js +43 -0
  110. package/dist/service/lambda/command/function/sim-lambda-function-commands.js.map +1 -1
  111. package/dist/service/lambda/command/list-functions/list-functions-authorizer.d.ts +31 -0
  112. package/dist/service/lambda/command/list-functions/list-functions-authorizer.d.ts.map +1 -0
  113. package/dist/service/lambda/command/list-functions/list-functions-authorizer.js +41 -0
  114. package/dist/service/lambda/command/list-functions/list-functions-authorizer.js.map +1 -0
  115. package/dist/service/lambda/command/list-functions/list-functions.command.d.ts +34 -0
  116. package/dist/service/lambda/command/list-functions/list-functions.command.d.ts.map +1 -0
  117. package/dist/service/lambda/command/list-functions/list-functions.command.js +5 -0
  118. package/dist/service/lambda/command/list-functions/list-functions.command.js.map +1 -0
  119. package/dist/service/lambda/command/list-functions/list-functions.handler.d.ts +35 -0
  120. package/dist/service/lambda/command/list-functions/list-functions.handler.d.ts.map +1 -0
  121. package/dist/service/lambda/command/list-functions/list-functions.handler.js +46 -0
  122. package/dist/service/lambda/command/list-functions/list-functions.handler.js.map +1 -0
  123. package/dist/service/lambda/command/sim-lambda-command.types.d.ts +3 -0
  124. package/dist/service/lambda/command/sim-lambda-command.types.d.ts.map +1 -1
  125. package/dist/service/lambda/command/update-function-code/update-function-code-authorizer.d.ts +27 -0
  126. package/dist/service/lambda/command/update-function-code/update-function-code-authorizer.d.ts.map +1 -0
  127. package/dist/service/lambda/command/update-function-code/update-function-code-authorizer.js +37 -0
  128. package/dist/service/lambda/command/update-function-code/update-function-code-authorizer.js.map +1 -0
  129. package/dist/service/lambda/command/update-function-code/update-function-code-input.d.ts +16 -0
  130. package/dist/service/lambda/command/update-function-code/update-function-code-input.d.ts.map +1 -0
  131. package/dist/service/lambda/command/update-function-code/update-function-code-input.js +30 -0
  132. package/dist/service/lambda/command/update-function-code/update-function-code-input.js.map +1 -0
  133. package/dist/service/lambda/command/update-function-code/update-function-code.command.d.ts +41 -0
  134. package/dist/service/lambda/command/update-function-code/update-function-code.command.d.ts.map +1 -0
  135. package/dist/service/lambda/command/update-function-code/update-function-code.command.js +5 -0
  136. package/dist/service/lambda/command/update-function-code/update-function-code.command.js.map +1 -0
  137. package/dist/service/lambda/command/update-function-code/update-function-code.handler.d.ts +52 -0
  138. package/dist/service/lambda/command/update-function-code/update-function-code.handler.d.ts.map +1 -0
  139. package/dist/service/lambda/command/update-function-code/update-function-code.handler.js +72 -0
  140. package/dist/service/lambda/command/update-function-code/update-function-code.handler.js.map +1 -0
  141. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.d.ts +28 -0
  142. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.d.ts.map +1 -0
  143. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.js +38 -0
  144. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.js.map +1 -0
  145. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-input.d.ts +23 -0
  146. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-input.d.ts.map +1 -0
  147. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-input.js +29 -0
  148. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-input.js.map +1 -0
  149. package/dist/service/lambda/command/update-function-configuration/update-function-configuration.command.d.ts +42 -0
  150. package/dist/service/lambda/command/update-function-configuration/update-function-configuration.command.d.ts.map +1 -0
  151. package/dist/service/lambda/command/update-function-configuration/update-function-configuration.command.js +5 -0
  152. package/dist/service/lambda/command/update-function-configuration/update-function-configuration.command.js.map +1 -0
  153. package/dist/service/lambda/command/update-function-configuration/update-function-configuration.handler.d.ts +50 -0
  154. package/dist/service/lambda/command/update-function-configuration/update-function-configuration.handler.d.ts.map +1 -0
  155. package/dist/service/lambda/command/update-function-configuration/update-function-configuration.handler.js +61 -0
  156. package/dist/service/lambda/command/update-function-configuration/update-function-configuration.handler.js.map +1 -0
  157. package/dist/service/lambda/function/code/lambda-code-source.d.ts +15 -2
  158. package/dist/service/lambda/function/code/lambda-code-source.d.ts.map +1 -1
  159. package/dist/service/lambda/function/code/lambda-code-source.js +19 -14
  160. package/dist/service/lambda/function/code/lambda-code-source.js.map +1 -1
  161. package/dist/service/lambda/function/code/sim-lambda-code-resolver.d.ts +6 -0
  162. package/dist/service/lambda/function/code/sim-lambda-code-resolver.d.ts.map +1 -1
  163. package/dist/service/lambda/function/code/sim-lambda-code-resolver.js.map +1 -1
  164. package/dist/service/lambda/function/code/sim-lambda-executable-code.d.ts +28 -0
  165. package/dist/service/lambda/function/code/sim-lambda-executable-code.d.ts.map +1 -1
  166. package/dist/service/lambda/function/code/sim-lambda-executable-code.js +10 -0
  167. package/dist/service/lambda/function/code/sim-lambda-executable-code.js.map +1 -1
  168. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code-factory.d.ts.map +1 -1
  169. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code-factory.js +2 -1
  170. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code-factory.js.map +1 -1
  171. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.d.ts +11 -1
  172. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.d.ts.map +1 -1
  173. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.js +16 -0
  174. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.js.map +1 -1
  175. package/dist/service/lambda/{command/create-function/create-function-environment-names.d.ts → function/environment/lambda-environment-variable-names.d.ts} +1 -1
  176. package/dist/service/lambda/function/environment/lambda-environment-variable-names.d.ts.map +1 -0
  177. package/dist/service/lambda/{command/create-function/create-function-environment-names.js → function/environment/lambda-environment-variable-names.js} +1 -1
  178. package/dist/service/lambda/function/environment/lambda-environment-variable-names.js.map +1 -0
  179. package/dist/service/lambda/{command/create-function/create-function-environment.d.ts → function/environment/lambda-environment-variables.d.ts} +2 -2
  180. package/dist/service/lambda/function/environment/lambda-environment-variables.d.ts.map +1 -0
  181. package/dist/service/lambda/{command/create-function/create-function-environment.js → function/environment/lambda-environment-variables.js} +2 -2
  182. package/dist/service/lambda/function/environment/lambda-environment-variables.js.map +1 -0
  183. package/dist/service/lambda/function/environment/lambda-reserved-variable-names.d.ts.map +1 -0
  184. package/dist/service/lambda/function/environment/lambda-reserved-variable-names.js.map +1 -0
  185. package/dist/service/lambda/function/sim-lambda-function-reconfiguration.d.ts +35 -0
  186. package/dist/service/lambda/function/sim-lambda-function-reconfiguration.d.ts.map +1 -0
  187. package/dist/service/lambda/function/sim-lambda-function-reconfiguration.js +54 -0
  188. package/dist/service/lambda/function/sim-lambda-function-reconfiguration.js.map +1 -0
  189. package/dist/service/lambda/function/sim-lambda-function.d.ts +34 -56
  190. package/dist/service/lambda/function/sim-lambda-function.d.ts.map +1 -1
  191. package/dist/service/lambda/function/sim-lambda-function.js +43 -9
  192. package/dist/service/lambda/function/sim-lambda-function.js.map +1 -1
  193. package/dist/service/lambda/function/sim-lambda-function.type.d.ts +53 -0
  194. package/dist/service/lambda/function/sim-lambda-function.type.d.ts.map +1 -0
  195. package/dist/service/lambda/function/sim-lambda-function.type.js +2 -0
  196. package/dist/service/lambda/function/sim-lambda-function.type.js.map +1 -0
  197. package/dist/service/lambda/sdk/sim-lambda-sdk-command-router.d.ts.map +1 -1
  198. package/dist/service/lambda/sdk/sim-lambda-sdk-command-router.js +12 -0
  199. package/dist/service/lambda/sdk/sim-lambda-sdk-command-router.js.map +1 -1
  200. package/dist/service/lambda/serve/api/sim-lambda-api-function-input.d.ts +27 -0
  201. package/dist/service/lambda/serve/api/sim-lambda-api-function-input.d.ts.map +1 -0
  202. package/dist/service/lambda/serve/api/sim-lambda-api-function-input.js +76 -0
  203. package/dist/service/lambda/serve/api/sim-lambda-api-function-input.js.map +1 -0
  204. package/dist/service/lambda/serve/api/sim-lambda-api-function-routes.d.ts.map +1 -1
  205. package/dist/service/lambda/serve/api/sim-lambda-api-function-routes.js +19 -58
  206. package/dist/service/lambda/serve/api/sim-lambda-api-function-routes.js.map +1 -1
  207. package/dist/service/lambda/sim-lambda-commands.d.ts.map +1 -1
  208. package/dist/service/lambda/sim-lambda-commands.js +1 -0
  209. package/dist/service/lambda/sim-lambda-commands.js.map +1 -1
  210. package/dist/service/lambda/sim-lambda.d.ts +6 -0
  211. package/dist/service/lambda/sim-lambda.d.ts.map +1 -1
  212. package/dist/service/lambda/sim-lambda.js +12 -0
  213. package/dist/service/lambda/sim-lambda.js.map +1 -1
  214. package/dist/service/s3/bucket/notification/sim-s3-notification-event.d.ts +1 -1
  215. package/dist/service/s3/bucket/notification/sim-s3-notification-event.d.ts.map +1 -1
  216. package/dist/service/s3/bucket/notification/sim-s3-notification-event.js +7 -1
  217. package/dist/service/s3/bucket/notification/sim-s3-notification-event.js.map +1 -1
  218. package/dist/service/s3/bucket/notification/sim-s3-unsimulated-notification-events.d.ts.map +1 -1
  219. package/dist/service/s3/bucket/notification/sim-s3-unsimulated-notification-events.js +0 -1
  220. package/dist/service/s3/bucket/notification/sim-s3-unsimulated-notification-events.js.map +1 -1
  221. package/dist/service/s3/command/copy-object/copy-object-builder.d.ts +34 -0
  222. package/dist/service/s3/command/copy-object/copy-object-builder.d.ts.map +1 -0
  223. package/dist/service/s3/command/copy-object/copy-object-builder.js +40 -0
  224. package/dist/service/s3/command/copy-object/copy-object-builder.js.map +1 -0
  225. package/dist/service/s3/command/copy-object/copy-object-source.d.ts +37 -0
  226. package/dist/service/s3/command/copy-object/copy-object-source.d.ts.map +1 -0
  227. package/dist/service/s3/command/copy-object/copy-object-source.js +80 -0
  228. package/dist/service/s3/command/copy-object/copy-object-source.js.map +1 -0
  229. package/dist/service/s3/command/copy-object/copy-object.command.d.ts +41 -0
  230. package/dist/service/s3/command/copy-object/copy-object.command.d.ts.map +1 -0
  231. package/dist/service/s3/command/copy-object/copy-object.command.js +2 -0
  232. package/dist/service/s3/command/copy-object/copy-object.command.js.map +1 -0
  233. package/dist/service/s3/command/copy-object/copy-object.handler.d.ts +43 -0
  234. package/dist/service/s3/command/copy-object/copy-object.handler.d.ts.map +1 -0
  235. package/dist/service/s3/command/copy-object/copy-object.handler.js +76 -0
  236. package/dist/service/s3/command/copy-object/copy-object.handler.js.map +1 -0
  237. package/dist/service/s3/command/list-objects/list-objects-authorizer.d.ts +6 -4
  238. package/dist/service/s3/command/list-objects/list-objects-authorizer.d.ts.map +1 -1
  239. package/dist/service/s3/command/list-objects/list-objects-authorizer.js +6 -4
  240. package/dist/service/s3/command/list-objects/list-objects-authorizer.js.map +1 -1
  241. package/dist/service/s3/command/list-objects/list-objects-page-builder.d.ts +4 -2
  242. package/dist/service/s3/command/list-objects/list-objects-page-builder.d.ts.map +1 -1
  243. package/dist/service/s3/command/list-objects/list-objects-page-builder.js +8 -2
  244. package/dist/service/s3/command/list-objects/list-objects-page-builder.js.map +1 -1
  245. package/dist/service/s3/command/list-objects/list-objects.command.d.ts +7 -0
  246. package/dist/service/s3/command/list-objects/list-objects.command.d.ts.map +1 -1
  247. package/dist/service/s3/command/list-objects/list-objects.handler.d.ts.map +1 -1
  248. package/dist/service/s3/command/list-objects/list-objects.handler.js +2 -0
  249. package/dist/service/s3/command/list-objects/list-objects.handler.js.map +1 -1
  250. package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.d.ts +1 -0
  251. package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.d.ts.map +1 -1
  252. package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.js +6 -1
  253. package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.js.map +1 -1
  254. package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.d.ts +8 -2
  255. package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.d.ts.map +1 -1
  256. package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.d.ts.map +1 -1
  257. package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.js +2 -0
  258. package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.js.map +1 -1
  259. package/dist/service/s3/command/object/sim-s3-object-commands.d.ts +4 -0
  260. package/dist/service/s3/command/object/sim-s3-object-commands.d.ts.map +1 -1
  261. package/dist/service/s3/command/object/sim-s3-object-commands.js +7 -0
  262. package/dist/service/s3/command/object/sim-s3-object-commands.js.map +1 -1
  263. package/dist/service/s3/command/sim-s3-command.types.d.ts +1 -0
  264. package/dist/service/s3/command/sim-s3-command.types.d.ts.map +1 -1
  265. package/dist/service/s3/error/sim-s3.error.d.ts +11 -0
  266. package/dist/service/s3/error/sim-s3.error.d.ts.map +1 -1
  267. package/dist/service/s3/error/sim-s3.error.js +13 -0
  268. package/dist/service/s3/error/sim-s3.error.js.map +1 -1
  269. package/dist/service/s3/object/s3-common-prefix.d.ts +22 -0
  270. package/dist/service/s3/object/s3-common-prefix.d.ts.map +1 -0
  271. package/dist/service/s3/object/s3-common-prefix.js +16 -0
  272. package/dist/service/s3/object/s3-common-prefix.js.map +1 -0
  273. package/dist/service/s3/object/s3-object-listing.d.ts +9 -2
  274. package/dist/service/s3/object/s3-object-listing.d.ts.map +1 -1
  275. package/dist/service/s3/object/s3-object-listing.js +70 -13
  276. package/dist/service/s3/object/s3-object-listing.js.map +1 -1
  277. package/dist/service/s3/sdk/sim-s3-sdk-command-router.d.ts.map +1 -1
  278. package/dist/service/s3/sdk/sim-s3-sdk-command-router.js +4 -0
  279. package/dist/service/s3/sdk/sim-s3-sdk-command-router.js.map +1 -1
  280. package/dist/service/s3/serve/api/sim-s3-api-input.d.ts.map +1 -1
  281. package/dist/service/s3/serve/api/sim-s3-api-input.js +2 -0
  282. package/dist/service/s3/serve/api/sim-s3-api-input.js.map +1 -1
  283. package/dist/service/s3/serve/api/sim-s3-api-listing.d.ts +5 -0
  284. package/dist/service/s3/serve/api/sim-s3-api-listing.d.ts.map +1 -1
  285. package/dist/service/s3/serve/api/sim-s3-api-listing.js +6 -1
  286. package/dist/service/s3/serve/api/sim-s3-api-listing.js.map +1 -1
  287. package/dist/service/s3/sim-s3-operations.d.ts +2 -0
  288. package/dist/service/s3/sim-s3-operations.d.ts.map +1 -1
  289. package/dist/service/s3/sim-s3-operations.js +4 -0
  290. package/dist/service/s3/sim-s3-operations.js.map +1 -1
  291. package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-creator.d.ts +4 -0
  292. package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-creator.d.ts.map +1 -1
  293. package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-creator.js +9 -0
  294. package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-creator.js.map +1 -1
  295. package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-skip.d.ts +22 -0
  296. package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-skip.d.ts.map +1 -0
  297. package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-skip.js +28 -0
  298. package/dist/service/wafv2/cfn/association/sim-cfn-waf-association-skip.js.map +1 -0
  299. package/dist/service/wafv2/cfn/sim-cfn-waf-resource-error.d.ts +25 -6
  300. package/dist/service/wafv2/cfn/sim-cfn-waf-resource-error.d.ts.map +1 -1
  301. package/dist/service/wafv2/cfn/sim-cfn-waf-resource-error.js +32 -7
  302. package/dist/service/wafv2/cfn/sim-cfn-waf-resource-error.js.map +1 -1
  303. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-evaluatable-rules.d.ts +16 -0
  304. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-evaluatable-rules.d.ts.map +1 -0
  305. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-evaluatable-rules.js +22 -0
  306. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-evaluatable-rules.js.map +1 -0
  307. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-config.d.ts +13 -4
  308. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-config.d.ts.map +1 -1
  309. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-config.js +21 -11
  310. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-config.js.map +1 -1
  311. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.d.ts +11 -1
  312. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.d.ts.map +1 -1
  313. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.js +19 -2
  314. package/dist/service/wafv2/cfn/web-acl/sim-cfn-waf-web-acl-creator.js.map +1 -1
  315. package/dist/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.d.ts +9 -0
  316. package/dist/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.d.ts.map +1 -1
  317. package/dist/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.js +9 -0
  318. package/dist/service/wafv2/command/web-acl/sim-wafv2-unsimulated-web-acl-input.js.map +1 -1
  319. package/dist/service/wafv2/command/web-acl/sim-wafv2-web-acl-commands.d.ts +2 -0
  320. package/dist/service/wafv2/command/web-acl/sim-wafv2-web-acl-commands.d.ts.map +1 -1
  321. package/dist/service/wafv2/command/web-acl/sim-wafv2-web-acl-commands.js +3 -0
  322. package/dist/service/wafv2/command/web-acl/sim-wafv2-web-acl-commands.js.map +1 -1
  323. package/dist/service/wafv2/index.d.ts +1 -0
  324. package/dist/service/wafv2/index.d.ts.map +1 -1
  325. package/dist/service/wafv2/index.js.map +1 -1
  326. package/dist/service/wafv2/managed/sim-waf-managed-group-statement.d.ts.map +1 -1
  327. package/dist/service/wafv2/managed/sim-waf-managed-group-statement.js +1 -0
  328. package/dist/service/wafv2/managed/sim-waf-managed-group-statement.js.map +1 -1
  329. package/dist/service/wafv2/sim-wafv2-commands.d.ts.map +1 -1
  330. package/dist/service/wafv2/sim-wafv2-commands.js +3 -0
  331. package/dist/service/wafv2/sim-wafv2-commands.js.map +1 -1
  332. package/dist/service/wafv2/sim-wafv2.d.ts +12 -0
  333. package/dist/service/wafv2/sim-wafv2.d.ts.map +1 -1
  334. package/dist/service/wafv2/sim-wafv2.js +18 -0
  335. package/dist/service/wafv2/sim-wafv2.js.map +1 -1
  336. package/dist/service/wafv2/statement/sim-waf-rate-based-input.d.ts +49 -0
  337. package/dist/service/wafv2/statement/sim-waf-rate-based-input.d.ts.map +1 -0
  338. package/dist/service/wafv2/statement/sim-waf-rate-based-input.js +94 -0
  339. package/dist/service/wafv2/statement/sim-waf-rate-based-input.js.map +1 -0
  340. package/dist/service/wafv2/statement/sim-waf-rate-based.d.ts +22 -0
  341. package/dist/service/wafv2/statement/sim-waf-rate-based.d.ts.map +1 -0
  342. package/dist/service/wafv2/statement/sim-waf-rate-based.js +41 -0
  343. package/dist/service/wafv2/statement/sim-waf-rate-based.js.map +1 -0
  344. package/dist/service/wafv2/statement/sim-waf-rate-based.type.d.ts +18 -0
  345. package/dist/service/wafv2/statement/sim-waf-rate-based.type.d.ts.map +1 -0
  346. package/dist/service/wafv2/statement/sim-waf-rate-based.type.js +2 -0
  347. package/dist/service/wafv2/statement/sim-waf-rate-based.type.js.map +1 -0
  348. package/dist/service/wafv2/statement/sim-waf-rate-counter.d.ts +29 -0
  349. package/dist/service/wafv2/statement/sim-waf-rate-counter.d.ts.map +1 -0
  350. package/dist/service/wafv2/statement/sim-waf-rate-counter.js +35 -0
  351. package/dist/service/wafv2/statement/sim-waf-rate-counter.js.map +1 -0
  352. package/dist/service/wafv2/statement/sim-waf-statement.d.ts +6 -0
  353. package/dist/service/wafv2/statement/sim-waf-statement.d.ts.map +1 -1
  354. package/dist/service/wafv2/statement/sim-waf-statement.js +4 -0
  355. package/dist/service/wafv2/statement/sim-waf-statement.js.map +1 -1
  356. package/dist/service/wafv2/statement/sim-waf-statement.type.d.ts +2 -1
  357. package/dist/service/wafv2/statement/sim-waf-statement.type.d.ts.map +1 -1
  358. package/dist/service/wafv2/statement/sim-waf-unsimulated-rate-based.d.ts +10 -0
  359. package/dist/service/wafv2/statement/sim-waf-unsimulated-rate-based.d.ts.map +1 -0
  360. package/dist/service/wafv2/statement/sim-waf-unsimulated-rate-based.js +40 -0
  361. package/dist/service/wafv2/statement/sim-waf-unsimulated-rate-based.js.map +1 -0
  362. package/dist/service/wafv2/statement/sim-waf-unsimulated-statement.d.ts.map +1 -1
  363. package/dist/service/wafv2/statement/sim-waf-unsimulated-statement.js +0 -5
  364. package/dist/service/wafv2/statement/sim-waf-unsimulated-statement.js.map +1 -1
  365. package/dist/service/wafv2/web-acl/sim-waf-rule-evaluator.d.ts.map +1 -1
  366. package/dist/service/wafv2/web-acl/sim-waf-rule-evaluator.js +25 -2
  367. package/dist/service/wafv2/web-acl/sim-waf-rule-evaluator.js.map +1 -1
  368. package/dist/service/wafv2/web-acl/sim-waf-rule.type.d.ts +6 -0
  369. package/dist/service/wafv2/web-acl/sim-waf-rule.type.d.ts.map +1 -1
  370. package/dist/service/wafv2/web-acl/sim-waf-unevaluatable-rules.d.ts +26 -0
  371. package/dist/service/wafv2/web-acl/sim-waf-unevaluatable-rules.d.ts.map +1 -0
  372. package/dist/service/wafv2/web-acl/sim-waf-unevaluatable-rules.js +34 -0
  373. package/dist/service/wafv2/web-acl/sim-waf-unevaluatable-rules.js.map +1 -0
  374. package/dist/service/wafv2/web-acl/sim-waf-web-acl-capacity.d.ts.map +1 -1
  375. package/dist/service/wafv2/web-acl/sim-waf-web-acl-capacity.js +16 -1
  376. package/dist/service/wafv2/web-acl/sim-waf-web-acl-capacity.js.map +1 -1
  377. package/dist/util/clock/sim-clock-control.d.ts +8 -0
  378. package/dist/util/clock/sim-clock-control.d.ts.map +1 -1
  379. package/dist/util/clock/sim-clock-control.js +10 -1
  380. package/dist/util/clock/sim-clock-control.js.map +1 -1
  381. package/package.json +1 -1
  382. package/dist/service/lambda/command/create-function/create-function-environment-names.d.ts.map +0 -1
  383. package/dist/service/lambda/command/create-function/create-function-environment-names.js.map +0 -1
  384. package/dist/service/lambda/command/create-function/create-function-environment.d.ts.map +0 -1
  385. package/dist/service/lambda/command/create-function/create-function-environment.js.map +0 -1
  386. package/dist/service/lambda/command/create-function/lambda-reserved-variable-names.d.ts.map +0 -1
  387. package/dist/service/lambda/command/create-function/lambda-reserved-variable-names.js.map +0 -1
  388. /package/dist/service/lambda/{command/create-function → function/environment}/lambda-reserved-variable-names.d.ts +0 -0
  389. /package/dist/service/lambda/{command/create-function → function/environment}/lambda-reserved-variable-names.js +0 -0
@@ -49,6 +49,9 @@ export class SimWafCommands {
49
49
  managedRules: this.managedRules,
50
50
  authorizer,
51
51
  accountRegionScope,
52
+ // The background scheduler is this simulation's source of time as well
53
+ // as its scheduler, and a rate-based rule counts against it.
54
+ clock: background,
52
55
  });
53
56
  this.managedRuleGroupCommands = new SimWafManagedRuleGroupCommands({
54
57
  authorizer,
@@ -1 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AC,uBAAuB,GAAG,IAAI,6BAA6B,CAAC;YAC/D,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,UAAU;YACV,kBAAkB;SACnB,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -12,6 +12,8 @@ import { type SimWafV2Properties } from "./sim-wafv2-commands.js";
12
12
  import { SimWafCfnResourceFactory } from "./cfn/sim-waf-cfn-resource-factory.js";
13
13
  import { SimWafSets } from "./sim-wafv2-sets.js";
14
14
  import type { SimWafWebAcl } from "./web-acl/sim-waf-web-acl.js";
15
+ import { type SimWafUnevaluatableRule } from "./web-acl/sim-waf-unevaluatable-rules.js";
16
+ import type { SimWafWebAclWriteInput } from "./command/web-acl/web-acl.command.js";
15
17
  export type { SimWafEvaluationRequest } from "./evaluate/sim-waf-evaluation-request.js";
16
18
  /**
17
19
  * Simulated AWS WAFv2. Handles SDK commands. Emulates AWS behaviour and state.
@@ -87,6 +89,16 @@ export declare class SimWafV2 extends SimWafSets {
87
89
  * nothing here, and `rules()` reports what is covered of each.
88
90
  */
89
91
  managedRules(): SimWafManagedRules;
92
+ /**
93
+ * The rules of a web ACL input this simulation cannot evaluate.
94
+ *
95
+ * The simulator's own accessor rather than a WAFv2 operation. `CreateWebACL`
96
+ * refuses a web ACL carrying such a rule, because a web ACL that accepted
97
+ * one would allow a request AWS blocks. A template is deployed rule by rule
98
+ * instead, so the CloudFormation layer asks this first and leaves the rules
99
+ * it names out of the web ACL it writes.
100
+ */
101
+ unevaluatableWebAclRules(input: SimWafWebAclWriteInput): readonly SimWafUnevaluatableRule[];
90
102
  /**
91
103
  * Handle a CreateWebACL Command from the SDK.
92
104
  */
@@ -1 +1 @@
1
- {"version":3,"file":"sim-wafv2.d.ts","sourceRoot":"","sources":["../../../src/service/wafv2/sim-wafv2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCA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,cAAc,CAAC,sCAAsC,CAAC,CAMhE;IAED;;OAEG;IACH,kBAAkB,IAAI,wBAAwB,CAE7C;IAED;;OAEG;IACH,gBAAgB,IAAI,mBAAmB,CAEtC;CACF"}
@@ -4,6 +4,7 @@ import { SimWafSdkCommandRouter } from "./sdk/sim-wafv2-sdk-command-router.js";
4
4
  import { SimWafCommands, } from "./sim-wafv2-commands.js";
5
5
  import { SimWafCfnResourceFactory } from "./cfn/sim-waf-cfn-resource-factory.js";
6
6
  import { SimWafSets } from "./sim-wafv2-sets.js";
7
+ import { unevaluatableSimWafRules, } from "./web-acl/sim-waf-unevaluatable-rules.js";
7
8
  /**
8
9
  * Simulated AWS WAFv2. Handles SDK commands. Emulates AWS behaviour and state.
9
10
  *
@@ -100,6 +101,23 @@ export class SimWafV2 extends SimWafSets {
100
101
  managedRules() {
101
102
  return this.commands.managedRules;
102
103
  }
104
+ /**
105
+ * The rules of a web ACL input this simulation cannot evaluate.
106
+ *
107
+ * The simulator's own accessor rather than a WAFv2 operation. `CreateWebACL`
108
+ * refuses a web ACL carrying such a rule, because a web ACL that accepted
109
+ * one would allow a request AWS blocks. A template is deployed rule by rule
110
+ * instead, so the CloudFormation layer asks this first and leaves the rules
111
+ * it names out of the web ACL it writes.
112
+ */
113
+ unevaluatableWebAclRules(input) {
114
+ return unevaluatableSimWafRules(input.Rules, {
115
+ regexPatternSets: this.commands.regexPatternSets,
116
+ managedRules: this.commands.managedRules,
117
+ clock: this.commands.background,
118
+ customResponseBodies: input.CustomResponseBodies ?? {},
119
+ });
120
+ }
103
121
  /**
104
122
  * Handle a CreateWebACL Command from the SDK.
105
123
  */
@@ -1 +1 @@
1
- {"version":3,"file":"sim-wafv2.js","sourceRoot":"","sources":["../../../src/service/wafv2/sim-wafv2.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAG5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAKjF,OAA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,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,sBAAsB,CAC7D,OAAO,EACP,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,49 @@
1
+ import type { SimWafInspectedRequest } from "../evaluate/sim-waf-inspected-request.js";
2
+ import type { SimWafRateBasedStatementInput } from "./sim-waf-rate-based.type.js";
3
+ import type { SimWafStatementInput } from "./sim-waf-statement.type.js";
4
+ /**
5
+ * What a rule joining a rate limit to anything else is refused with.
6
+ *
7
+ * Real WAFv2 draws the line in both directions, and so does this. A
8
+ * `RateBasedStatement` beside another kind would leave that kind unread and
9
+ * the rate limit counting requests the rule meant to leave alone. Nesting one
10
+ * inside a logical statement would count only the requests that reached it. A
11
+ * rate limit narrows what it counts with its own `ScopeDownStatement`.
12
+ */
13
+ export declare const simWafRateBasedIsWholeStatement: string;
14
+ /**
15
+ * Refuse a rule that names a rate limit and another statement kind together.
16
+ */
17
+ export declare function refuseJoinedSimWafRateBased(statement: SimWafStatementInput, ruleName: string): void;
18
+ /**
19
+ * Which aggregation instance one request is counted under.
20
+ */
21
+ export type SimWafRateAggregation = (request: SimWafInspectedRequest) => string;
22
+ /**
23
+ * Read how many requests a rate-based statement counts up to.
24
+ *
25
+ * AWS holds the limit to at least ten. A rule below that would limit a client
26
+ * that had barely arrived.
27
+ */
28
+ export declare function simWafRateLimit(statement: SimWafRateBasedStatementInput, ruleName: string): number;
29
+ /**
30
+ * Read how long a rate-based statement counts over, in milliseconds.
31
+ *
32
+ * AWS takes four windows and no others, and a statement naming none counts
33
+ * over five minutes.
34
+ */
35
+ export declare function simWafRateWindowMilliseconds(statement: SimWafRateBasedStatementInput, ruleName: string): number;
36
+ /**
37
+ * Read how a rate-based statement groups the requests it counts.
38
+ *
39
+ * `IP` counts each client address on its own. Every request in this simulation
40
+ * reports `simAwsProxiedSourceIp`, leaving one client for the whole
41
+ * simulation. A rate limiting test sends its requests from one client and
42
+ * expects the rule to trip, so that is the case anybody would write.
43
+ *
44
+ * `CONSTANT` counts every request the statement sees together, and AWS asks
45
+ * for a scope-down statement alongside it to say which requests those are. A
46
+ * rule without one would limit everything the web ACL serves.
47
+ */
48
+ export declare function simWafRateAggregation(statement: SimWafRateBasedStatementInput, ruleName: string): SimWafRateAggregation;
49
+ //# sourceMappingURL=sim-waf-rate-based-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-waf-rate-based-input.d.ts","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-rate-based-input.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAIxE;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B,QAEF,CAAC;AAE3C;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,oBAAoB,EAC/B,QAAQ,EAAE,MAAM,GACf,IAAI,CAYN;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,sBAAsB,KAAK,MAAM,CAAC;AAchF;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,6BAA6B,EACxC,QAAQ,EAAE,MAAM,GACf,MAAM,CAgBR;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,6BAA6B,EACxC,QAAQ,EAAE,MAAM,GACf,MAAM,CAYR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,6BAA6B,EACxC,QAAQ,EAAE,MAAM,GACf,qBAAqB,CA0BvB"}
@@ -0,0 +1,94 @@
1
+ import { simAwsProxiedSourceIp } from "../../../serve/http/sim-aws-proxied-connection.js";
2
+ import { invalidSimWafRule } from "./sim-waf-rule-refusals.js";
3
+ import { refuseUnsimulatedSimWafRateKeyType } from "./sim-waf-unsimulated-rate-based.js";
4
+ /**
5
+ * What a rule joining a rate limit to anything else is refused with.
6
+ *
7
+ * Real WAFv2 draws the line in both directions, and so does this. A
8
+ * `RateBasedStatement` beside another kind would leave that kind unread and
9
+ * the rate limit counting requests the rule meant to leave alone. Nesting one
10
+ * inside a logical statement would count only the requests that reached it. A
11
+ * rate limit narrows what it counts with its own `ScopeDownStatement`.
12
+ */
13
+ export const simWafRateBasedIsWholeStatement = "A RateBasedStatement is the whole of a rule's statement, and cannot be " +
14
+ "joined to or nested inside another one";
15
+ /**
16
+ * Refuse a rule that names a rate limit and another statement kind together.
17
+ */
18
+ export function refuseJoinedSimWafRateBased(statement, ruleName) {
19
+ if (statement.RateBasedStatement === undefined) {
20
+ return;
21
+ }
22
+ const joined = Object.entries(statement).some(([kind, value]) => kind !== "RateBasedStatement" && value !== undefined);
23
+ if (joined) {
24
+ invalidSimWafRule(ruleName, simWafRateBasedIsWholeStatement);
25
+ }
26
+ }
27
+ /** The windows AWS counts over, in seconds. */
28
+ const evaluationWindows = new Set([60, 120, 300, 600]);
29
+ /** What AWS counts over when a statement names no window. */
30
+ const defaultEvaluationWindowSec = 300;
31
+ const millisecondsPerSecond = 1000;
32
+ /** The smallest and largest limits AWS takes. */
33
+ const smallestLimit = 10;
34
+ const largestLimit = 2_000_000_000;
35
+ /**
36
+ * Read how many requests a rate-based statement counts up to.
37
+ *
38
+ * AWS holds the limit to at least ten. A rule below that would limit a client
39
+ * that had barely arrived.
40
+ */
41
+ export function simWafRateLimit(statement, ruleName) {
42
+ const limit = statement.Limit;
43
+ if (limit === undefined || !Number.isSafeInteger(limit)) {
44
+ invalidSimWafRule(ruleName, "A RateBasedStatement needs a whole Limit");
45
+ }
46
+ if (limit < smallestLimit || limit > largestLimit) {
47
+ invalidSimWafRule(ruleName, `A RateBasedStatement Limit is between ${smallestLimit} and ` +
48
+ `${largestLimit}, and this one is ${limit}`);
49
+ }
50
+ return limit;
51
+ }
52
+ /**
53
+ * Read how long a rate-based statement counts over, in milliseconds.
54
+ *
55
+ * AWS takes four windows and no others, and a statement naming none counts
56
+ * over five minutes.
57
+ */
58
+ export function simWafRateWindowMilliseconds(statement, ruleName) {
59
+ const seconds = statement.EvaluationWindowSec ?? defaultEvaluationWindowSec;
60
+ if (!evaluationWindows.has(seconds)) {
61
+ invalidSimWafRule(ruleName, `A RateBasedStatement EvaluationWindowSec is one of ` +
62
+ `${[...evaluationWindows].join(", ")}, and this one is ${seconds}`);
63
+ }
64
+ return seconds * millisecondsPerSecond;
65
+ }
66
+ /**
67
+ * Read how a rate-based statement groups the requests it counts.
68
+ *
69
+ * `IP` counts each client address on its own. Every request in this simulation
70
+ * reports `simAwsProxiedSourceIp`, leaving one client for the whole
71
+ * simulation. A rate limiting test sends its requests from one client and
72
+ * expects the rule to trip, so that is the case anybody would write.
73
+ *
74
+ * `CONSTANT` counts every request the statement sees together, and AWS asks
75
+ * for a scope-down statement alongside it to say which requests those are. A
76
+ * rule without one would limit everything the web ACL serves.
77
+ */
78
+ export function simWafRateAggregation(statement, ruleName) {
79
+ const keyType = statement.AggregateKeyType;
80
+ refuseUnsimulatedSimWafRateKeyType(keyType, ruleName);
81
+ if (keyType === "IP") {
82
+ return () => simAwsProxiedSourceIp;
83
+ }
84
+ if (keyType === "CONSTANT") {
85
+ if (statement.ScopeDownStatement === undefined) {
86
+ invalidSimWafRule(ruleName, "A RateBasedStatement aggregating on CONSTANT needs a " +
87
+ "ScopeDownStatement to say which requests it counts");
88
+ }
89
+ return () => "CONSTANT";
90
+ }
91
+ invalidSimWafRule(ruleName, `A RateBasedStatement AggregateKeyType is IP or CONSTANT, and this one ` +
92
+ `is ${String(keyType)}`);
93
+ }
94
+ //# sourceMappingURL=sim-waf-rate-based-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-waf-rate-based-input.js","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-rate-based-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAI1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAEzF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,yEAAyE;IACzE,wCAAwC,CAAC;AAE3C;;GAEG;AACH,MAAM,UAAU,2BAA2B,CACzC,SAA+B,EAC/B,QAAgB;IAEhB,IAAI,SAAS,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QAC/C,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAC3C,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,oBAAoB,IAAI,KAAK,KAAK,SAAS,CACxE,CAAC;IAEF,IAAI,MAAM,EAAE,CAAC;QACX,iBAAiB,CAAC,QAAQ,EAAE,+BAA+B,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC;AAOD,+CAA+C;AAC/C,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEvD,6DAA6D;AAC7D,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAEvC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC,iDAAiD;AACjD,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,YAAY,GAAG,aAAa,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CA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C;YAC/C,iBAAiB,CACf,QAAQ,EACR,uDAAuD;gBACrD,oDAAoD,CACvD,CAAC;QACJ,CAAC;QAED,OAAO,GAAW,EAAE,CAAC,UAAU,CAAC;IAClC,CAAC;IAED,iBAAiB,CACf,QAAQ,EACR,wEAAwE;QACtE,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,CAC1B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { SimWafMatcher } from "./sim-waf-field-match.js";
2
+ import type { SimWafRateBasedStatementInput } from "./sim-waf-rate-based.type.js";
3
+ import { type SimWafStatementScope } from "./sim-waf-statement.js";
4
+ /**
5
+ * Compile a rule that limits how many requests one client may make.
6
+ *
7
+ * The statement counts the requests it sees against the aggregation instance
8
+ * their key selects, and claims a request once the count over the evaluation
9
+ * window has gone past `Limit`. The rule's own action then applies. A blocking
10
+ * rule blocks, and a counting rule records the match and lets the next rule
11
+ * have a look.
12
+ *
13
+ * A scope-down statement decides which requests the rule sees at all. One it
14
+ * leaves alone is neither counted nor limited. That is what keeps a rate limit
15
+ * on `/signup` off the rest of a site.
16
+ *
17
+ * Counting is against the simulated clock. A test that has sent enough
18
+ * requests to trip the rule is served again once time has moved past the
19
+ * window.
20
+ */
21
+ export declare function compileSimWafRateBasedStatement(statement: SimWafRateBasedStatementInput, scope: SimWafStatementScope): SimWafMatcher;
22
+ //# sourceMappingURL=sim-waf-rate-based.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-waf-rate-based.d.ts","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-rate-based.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAM9D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAElF,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAGhC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,6BAA6B,EACxC,KAAK,EAAE,oBAAoB,GAC1B,aAAa,CAuBf"}
@@ -0,0 +1,41 @@
1
+ import { simWafRateAggregation, simWafRateLimit, simWafRateWindowMilliseconds, } from "./sim-waf-rate-based-input.js";
2
+ import { SimWafRateCounter } from "./sim-waf-rate-counter.js";
3
+ import { compileSimWafStatement, } from "./sim-waf-statement.js";
4
+ import { refuseUnsimulatedSimWafRateMembers } from "./sim-waf-unsimulated-rate-based.js";
5
+ /**
6
+ * Compile a rule that limits how many requests one client may make.
7
+ *
8
+ * The statement counts the requests it sees against the aggregation instance
9
+ * their key selects, and claims a request once the count over the evaluation
10
+ * window has gone past `Limit`. The rule's own action then applies. A blocking
11
+ * rule blocks, and a counting rule records the match and lets the next rule
12
+ * have a look.
13
+ *
14
+ * A scope-down statement decides which requests the rule sees at all. One it
15
+ * leaves alone is neither counted nor limited. That is what keeps a rate limit
16
+ * on `/signup` off the rest of a site.
17
+ *
18
+ * Counting is against the simulated clock. A test that has sent enough
19
+ * requests to trip the rule is served again once time has moved past the
20
+ * window.
21
+ */
22
+ export function compileSimWafRateBasedStatement(statement, scope) {
23
+ const { ruleName } = scope;
24
+ refuseUnsimulatedSimWafRateMembers(statement, ruleName);
25
+ const limit = simWafRateLimit(statement, ruleName);
26
+ const keyOf = simWafRateAggregation(statement, ruleName);
27
+ const counter = new SimWafRateCounter({
28
+ clock: scope.clock,
29
+ windowMilliseconds: simWafRateWindowMilliseconds(statement, ruleName),
30
+ });
31
+ const scopeDown = statement.ScopeDownStatement === undefined
32
+ ? undefined
33
+ : compileSimWafStatement(statement.ScopeDownStatement, scope);
34
+ return (request) => {
35
+ if (scopeDown !== undefined && !scopeDown(request)) {
36
+ return false;
37
+ }
38
+ return counter.count(keyOf(request)) > limit;
39
+ };
40
+ }
41
+ //# sourceMappingURL=sim-waf-rate-based.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-waf-rate-based.js","sourceRoot":"","sources":["../../../../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./sim-waf-statement.type.js";
2
+ /**
3
+ * Minimal structural WAFv2 RateBasedStatement.
4
+ *
5
+ * The members Yulin refuses are declared here rather than left out, so a
6
+ * statement that names one is refused by name.
7
+ *
8
+ * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/wafv2/Interface/RateBasedStatement/
9
+ */
10
+ export interface SimWafRateBasedStatementInput {
11
+ readonly Limit?: number | undefined;
12
+ readonly EvaluationWindowSec?: number | undefined;
13
+ readonly AggregateKeyType?: string | undefined;
14
+ readonly ScopeDownStatement?: SimWafStatementInput | undefined;
15
+ readonly CustomKeys?: readonly unknown[] | undefined;
16
+ readonly ForwardedIPConfig?: unknown;
17
+ }
18
+ //# sourceMappingURL=sim-waf-rate-based.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-waf-rate-based.type.d.ts","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-rate-based.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE;;;;;;;GAOG;AACH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAC/D,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,SAAS,CAAC;IACrD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sim-waf-rate-based.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-waf-rate-based.type.js","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-rate-based.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import type { SimClock } from "../../../util/clock/sim-clock.js";
2
+ interface SimWafRateCounterProperties {
3
+ readonly clock: SimClock;
4
+ readonly windowMilliseconds: number;
5
+ }
6
+ /**
7
+ * What one rate-based rule has counted, by aggregation instance.
8
+ *
9
+ * A count is a window over the simulated clock rather than a running total.
10
+ * The instant of each request is kept, and the instants that have fallen out
11
+ * of the window are dropped as the key is read, so a simulation whose clock
12
+ * has been advanced past the window finds the rule counting from nothing
13
+ * again.
14
+ *
15
+ * The counts belong to the compiled rule, so writing a new set of rules over a
16
+ * web ACL starts them again. Real WAF does the same with a rule it has just
17
+ * been given.
18
+ */
19
+ export declare class SimWafRateCounter {
20
+ #private;
21
+ constructor(properties: SimWafRateCounterProperties);
22
+ /**
23
+ * Count one request against an aggregation key, and answer with what the
24
+ * window holds for that key once it has been counted.
25
+ */
26
+ count(key: string): number;
27
+ }
28
+ export {};
29
+ //# sourceMappingURL=sim-waf-rate-counter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-waf-rate-counter.d.ts","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-rate-counter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAEjE,UAAU,2BAA2B;IACnC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,iBAAiB;;IAK5B,YAAY,UAAU,EAAE,2BAA2B,EAGlD;IAED;;;OAGG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CASzB;CACF"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * What one rate-based rule has counted, by aggregation instance.
3
+ *
4
+ * A count is a window over the simulated clock rather than a running total.
5
+ * The instant of each request is kept, and the instants that have fallen out
6
+ * of the window are dropped as the key is read, so a simulation whose clock
7
+ * has been advanced past the window finds the rule counting from nothing
8
+ * again.
9
+ *
10
+ * The counts belong to the compiled rule, so writing a new set of rules over a
11
+ * web ACL starts them again. Real WAF does the same with a rule it has just
12
+ * been given.
13
+ */
14
+ export class SimWafRateCounter {
15
+ #clock;
16
+ #windowMilliseconds;
17
+ #counted = new Map();
18
+ constructor(properties) {
19
+ this.#clock = properties.clock;
20
+ this.#windowMilliseconds = properties.windowMilliseconds;
21
+ }
22
+ /**
23
+ * Count one request against an aggregation key, and answer with what the
24
+ * window holds for that key once it has been counted.
25
+ */
26
+ count(key) {
27
+ const now = this.#clock.now().getTime();
28
+ const since = now - this.#windowMilliseconds;
29
+ const within = (this.#counted.get(key) ?? []).filter((at) => at > since);
30
+ within.push(now);
31
+ this.#counted.set(key, within);
32
+ return within.length;
33
+ }
34
+ }
35
+ //# sourceMappingURL=sim-waf-rate-counter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-waf-rate-counter.js","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-rate-counter.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,iBAAiB;IACnB,MAAM,CAAW;IACjB,mBAAmB,CAAS;IAC5B,QAAQ,GAAG,IAAI,GAAG,EAAoB,CAAC;IAEhD,YAAY,UAAuC;QACjD,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC;QAC/B,IAAI,CAAC,mBAAmB,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,GAAW;QACf,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,mBAAmB,CAAC;QAC7C,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC;QAEzE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAE/B,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;CACF"}
@@ -1,3 +1,4 @@
1
+ import type { SimClock } from "../../../util/clock/sim-clock.js";
1
2
  import type { SimWafRegexPatternSet } from "../regex-pattern-set/sim-waf-regex-pattern-set.js";
2
3
  import type { SimWafResourceStore } from "../resource/sim-waf-resource-store.js";
3
4
  import { type SimWafMatcher } from "./sim-waf-field-match.js";
@@ -8,6 +9,11 @@ import type { SimWafStatementInput } from "./sim-waf-statement.type.js";
8
9
  export interface SimWafStatementScope {
9
10
  readonly regexPatternSets: SimWafResourceStore<SimWafRegexPatternSet>;
10
11
  readonly ruleName: string;
12
+ /**
13
+ * The simulation's sense of time, which a rate-based statement counts
14
+ * against.
15
+ */
16
+ readonly clock: SimClock;
11
17
  }
12
18
  /**
13
19
  * Turn one statement into the matcher a rule evaluates a request with.
@@ -1 +1 @@
1
- {"version":3,"file":"sim-waf-statement.d.ts","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-statement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAEjF,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AASlC,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AAGrC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;IACtE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,oBAAoB,GAAG,SAAS,EAC3C,KAAK,EAAE,oBAAoB,GAC1B,aAAa,CA4Bf"}
1
+ {"version":3,"file":"sim-waf-statement.d.ts","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-statement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAEjF,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAUlC,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AAGrC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;IACtE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,oBAAoB,GAAG,SAAS,EAC3C,KAAK,EAAE,oBAAoB,GAC1B,aAAa,CAgCf"}
@@ -3,6 +3,7 @@ import { compileSimWafFieldMatcher, } from "./sim-waf-field-match.js";
3
3
  import { simWafRegexPatternSetTest, simWafRegexTest, } from "./sim-waf-regex-match.js";
4
4
  import { compileSimWafLabelMatch } from "./sim-waf-label-match.js";
5
5
  import { compileSimWafLogicalStatement } from "./sim-waf-logical-statement.js";
6
+ import { simWafRateBasedIsWholeStatement } from "./sim-waf-rate-based-input.js";
6
7
  import { invalidSimWafRule } from "./sim-waf-rule-refusals.js";
7
8
  import { simWafSizeTest } from "./sim-waf-size-constraint.js";
8
9
  import { refuseUnsimulatedSimWafStatement } from "./sim-waf-unsimulated-statement.js";
@@ -27,6 +28,9 @@ export function compileSimWafStatement(statement, scope) {
27
28
  invalidSimWafRule(ruleName, "A ManagedRuleGroupStatement is the whole of a rule's statement, and " +
28
29
  "cannot be joined to or nested inside another one");
29
30
  }
31
+ if (statement.RateBasedStatement !== undefined) {
32
+ invalidSimWafRule(ruleName, simWafRateBasedIsWholeStatement);
33
+ }
30
34
  if (statement.LabelMatchStatement !== undefined) {
31
35
  return compileSimWafLabelMatch(statement.LabelMatchStatement, ruleName);
32
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sim-waf-statement.js","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-statement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EACL,yBAAyB,GAE1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAK9D,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAUtF;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,SAA2C,EAC3C,KAA2B;IAE3B,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE3B,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,iBAAiB,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAC;IAC1D,CAAC;IAED,gCAAgC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEtD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KAAK,SAAS,EAAE,CAAC;QAC9D,MAAM,SAAS,GAAG,SAAS,CAAC,iCAAiC,CAAC;QAE9D,OAAO,YAAY,CACjB,SAAS,EACT,QAAQ,EACR,yBAAyB,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,CACvE,CAAC;IACJ,CAAC;IAED,IAAI,SAAS,CAAC,uBAAuB,KAAK,SAAS,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,SAAS,CAAC,uBAAuB,CAAC;QAE/C,OAAO,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,YAAY,CACnB,SAAoC,EACpC,QAAgB,EAChB,IAAgC;IAEhC,OAAO,yBAAyB,CAAC;QAC/B,KAAK,EAAE,SAAS,CAAC,YAAY;QAC7B,eAAe,EAAE,SAAS,CAAC,mBAAmB;QAC9C,QAAQ;QACR,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { SimWafManagedRuleGroupStatementInput } from "../managed/sim-waf-managed-group.type.js";
2
2
  import type { SimWafByteMatchStatementInput } from "./sim-waf-byte-match.js";
3
+ import type { SimWafRateBasedStatementInput } from "./sim-waf-rate-based.type.js";
3
4
  import type { SimWafLabelMatchStatementInput } from "./sim-waf-label-match.js";
4
5
  import type { SimWafFieldToMatchInput } from "./sim-waf-field-to-match.type.js";
5
6
  import type { SimWafRegexMatchStatementInput, SimWafRegexPatternSetReferenceInput } from "./sim-waf-regex-match.js";
@@ -38,7 +39,7 @@ export interface SimWafStatementInput {
38
39
  readonly IPSetReferenceStatement?: unknown;
39
40
  readonly GeoMatchStatement?: unknown;
40
41
  readonly AsnMatchStatement?: unknown;
41
- readonly RateBasedStatement?: unknown;
42
+ readonly RateBasedStatement?: SimWafRateBasedStatementInput | undefined;
42
43
  readonly SqliMatchStatement?: unknown;
43
44
  readonly XssMatchStatement?: unknown;
44
45
  readonly LabelMatchStatement?: SimWafLabelMatchStatementInput | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"sim-waf-statement.type.d.ts","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-statement.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,0CAA0C,CAAC;AACrG,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,KAAK,EACV,8BAA8B,EAC9B,mCAAmC,EACpC,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAEtF;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC5D,QAAQ,CAAC,mBAAmB,CAAC,EACzB,SAAS,6BAA6B,EAAE,GACxC,SAAS,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,kBAAkB,CAAC,EACxB,CAAC,6BAA6B,GAAG,yBAAyB,CAAC,GAC3D,SAAS,CAAC;IACd,QAAQ,CAAC,mBAAmB,CAAC,EACzB,CAAC,8BAA8B,GAAG,yBAAyB,CAAC,GAC5D,SAAS,CAAC;IACd,QAAQ,CAAC,iCAAiC,CAAC,EACvC,CAAC,mCAAmC,GAAG,yBAAyB,CAAC,GACjE,SAAS,CAAC;IACd,QAAQ,CAAC,uBAAuB,CAAC,EAC7B,CAAC,kCAAkC,GAAG,yBAAyB,CAAC,GAChE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G,SAAS,CAAA;KAAE,GACzD,SAAS,CAAC;IACd,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAC3C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,6BAA6B,GAAG,SAAS,CAAC;IACxE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IACtC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,8BAA8B,GAAG,SAAS,CAAC;IAC1E,QAAQ,CAAC,yBAAyB,CAAC,EAC/B,oCAAoC,GACpC,SAAS,CAAC;IACd,QAAQ,CAAC,2BAA2B,CAAC,EAAE,OAAO,CAAC;CAChD"}
@@ -0,0 +1,10 @@
1
+ import type { SimWafRateBasedStatementInput } from "./sim-waf-rate-based.type.js";
2
+ /**
3
+ * Refuse the parts of a rate-based statement this simulation cannot evaluate.
4
+ */
5
+ export declare function refuseUnsimulatedSimWafRateMembers(statement: SimWafRateBasedStatementInput, ruleName: string): void;
6
+ /**
7
+ * Refuse an aggregation key type this simulation cannot count by.
8
+ */
9
+ export declare function refuseUnsimulatedSimWafRateKeyType(keyType: string | undefined, ruleName: string): void;
10
+ //# sourceMappingURL=sim-waf-unsimulated-rate-based.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-waf-unsimulated-rate-based.d.ts","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-unsimulated-rate-based.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AA2BlF;;GAEG;AACH,wBAAgB,kCAAkC,CAChD,SAAS,EAAE,6BAA6B,EACxC,QAAQ,EAAE,MAAM,GACf,IAAI,CAQN;AAED;;GAEG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,MAAM,GACf,IAAI,CAUN"}
@@ -0,0 +1,40 @@
1
+ import { refuseSimWafRuleInput } from "./sim-waf-rule-refusals.js";
2
+ const forwardedAddress = "it reads the address from a forwarding header, and needs the source " +
3
+ "address variety IPSetReferenceStatement is waiting on";
4
+ const customAggregation = "aggregating on headers, cookies and query arguments is feasible and is " +
5
+ "not part of this";
6
+ /**
7
+ * The aggregation key types real WAFv2 has and this simulation does not.
8
+ */
9
+ const refusedKeyTypes = new Map([
10
+ ["FORWARDED_IP", forwardedAddress],
11
+ ["CUSTOM_KEYS", customAggregation],
12
+ ]);
13
+ /**
14
+ * The rate-based members real WAFv2 takes and this simulation does not.
15
+ */
16
+ const refusedMembers = new Map([
17
+ ["CustomKeys", customAggregation],
18
+ ["ForwardedIPConfig", forwardedAddress],
19
+ ]);
20
+ /**
21
+ * Refuse the parts of a rate-based statement this simulation cannot evaluate.
22
+ */
23
+ export function refuseUnsimulatedSimWafRateMembers(statement, ruleName) {
24
+ for (const [member, value] of Object.entries(statement)) {
25
+ const reason = refusedMembers.get(member);
26
+ if (reason !== undefined && value !== undefined) {
27
+ refuseSimWafRuleInput(ruleName, `RateBasedStatement ${member}`, reason);
28
+ }
29
+ }
30
+ }
31
+ /**
32
+ * Refuse an aggregation key type this simulation cannot count by.
33
+ */
34
+ export function refuseUnsimulatedSimWafRateKeyType(keyType, ruleName) {
35
+ const reason = refusedKeyTypes.get(keyType ?? "");
36
+ if (reason !== undefined) {
37
+ refuseSimWafRuleInput(ruleName, `the aggregation key type ${keyType}`, reason);
38
+ }
39
+ }
40
+ //# sourceMappingURL=sim-waf-unsimulated-rate-based.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-waf-unsimulated-rate-based.js","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-unsimulated-rate-based.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MA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waf-unsimulated-statement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAgCxE;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,oBAAoB,EAC/B,QAAQ,EAAE,MAAM,GACf,IAAI,CAQN"}
1
+ {"version":3,"file":"sim-waf-unsimulated-statement.d.ts","sourceRoot":"","sources":["../../../../src/service/wafv2/statement/sim-waf-unsimulated-statement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AA2BxE;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,oBAAoB,EAC/B,QAAQ,EAAE,MAAM,GACf,IAAI,CAQN"}