@kensio/yulin 1.20.16 → 1.20.17

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 (312) hide show
  1. package/dist/service/aws/caller/sim-aws-ambient-caller.d.ts +23 -0
  2. package/dist/service/aws/caller/sim-aws-ambient-caller.js +12 -0
  3. package/dist/service/aws/caller/sim-aws-caller-resolver.d.ts +17 -6
  4. package/dist/service/aws/caller/sim-aws-caller-resolver.js +21 -26
  5. package/dist/service/aws/factory/sim-aws-account-region-service-builder.d.ts +6 -0
  6. package/dist/service/aws/factory/sim-aws-account-region-service-builder.js +3 -0
  7. package/dist/service/aws/factory/sim-aws-account-service-cache.d.ts +6 -0
  8. package/dist/service/aws/factory/sim-aws-account-service-cache.js +5 -1
  9. package/dist/service/aws/factory/sim-aws-registered-service-builder.js +3 -1
  10. package/dist/service/aws/factory/sim-aws-service-factory.js +9 -1
  11. package/dist/service/cloudformation/command/create-stack/create-stack.handler.d.ts +4 -0
  12. package/dist/service/cloudformation/command/create-stack/create-stack.handler.js +4 -1
  13. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-deployer.js +2 -1
  14. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.d.ts +11 -2
  15. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.js +2 -1
  16. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-stack-options.d.ts +6 -0
  17. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.d.ts +11 -0
  18. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.js +17 -15
  19. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.d.ts +12 -0
  20. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.js +2 -1
  21. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cache-policy-cfn.d.ts +23 -0
  22. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cache-policy-cfn.js +30 -0
  23. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cfn-value-adapter.js +8 -0
  24. package/dist/service/cloudformation/resource/name/sim-cfn-generated-resource-name.d.ts +29 -12
  25. package/dist/service/cloudformation/resource/name/sim-cfn-generated-resource-name.js +51 -20
  26. package/dist/service/cloudformation/stack/deploy/sim-cfn-resource-order.d.ts +19 -0
  27. package/dist/service/cloudformation/stack/deploy/sim-cfn-resource-order.js +6 -0
  28. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-batch-creator.d.ts +7 -0
  29. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-batch-creator.js +9 -2
  30. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-creator.d.ts +2 -0
  31. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-creator.js +2 -1
  32. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.d.ts +6 -0
  33. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.js +4 -1
  34. package/dist/service/cloudformation/stack/sim-cfn-stack.js +2 -1
  35. package/dist/service/cloudformation/stack/sim-cfn-stack.type.d.ts +6 -0
  36. package/dist/service/cloudfront/behaviour/sim-cloud-front-behavior.d.ts +5 -0
  37. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy-registry.d.ts +37 -0
  38. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy-registry.js +50 -0
  39. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.d.ts +25 -0
  40. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.js +21 -0
  41. package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.d.ts +28 -0
  42. package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.js +48 -0
  43. package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.d.ts +8 -0
  44. package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.js +13 -0
  45. package/dist/service/cloudfront/cff/sim-cf-function-commands.d.ts +52 -0
  46. package/dist/service/cloudfront/cff/sim-cf-function-commands.js +51 -0
  47. package/dist/service/cloudfront/cff/sim-cff-configuration.d.ts +41 -0
  48. package/dist/service/cloudfront/cff/sim-cff-configuration.js +34 -0
  49. package/dist/service/cloudfront/cff/sim-cff-stage.d.ts +23 -0
  50. package/dist/service/cloudfront/cff/sim-cff-stage.js +30 -0
  51. package/dist/service/cloudfront/cff/sim-cloudfront-function.d.ts +6 -1
  52. package/dist/service/cloudfront/cff/sim-cloudfront-function.js +6 -0
  53. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.d.ts +27 -0
  54. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.js +42 -0
  55. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-creator.d.ts +24 -0
  56. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-creator.js +32 -0
  57. package/dist/service/cloudfront/cfn/distro/{sim-cfn-cf-distro-response-headers-policy.d.ts → sim-cfn-cf-distro-behavior-policies.d.ts} +8 -7
  58. package/dist/service/cloudfront/cfn/distro/{sim-cfn-cf-distro-response-headers-policy.js → sim-cfn-cf-distro-behavior-policies.js} +11 -37
  59. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.d.ts +6 -5
  60. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.js +8 -7
  61. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-policy-drops.d.ts +23 -0
  62. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-policy-drops.js +50 -0
  63. package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.d.ts +1 -0
  64. package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.js +10 -0
  65. package/dist/service/cloudfront/command/create-distribution/create-distribution.command.d.ts +1 -0
  66. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts +2 -0
  67. package/dist/service/cloudfront/command/create-function/create-function.handler.js +7 -1
  68. package/dist/service/cloudfront/command/function/sim-cf-describe-function.d.ts +22 -0
  69. package/dist/service/cloudfront/command/function/sim-cf-describe-function.js +32 -0
  70. package/dist/service/cloudfront/command/function/sim-cf-function-access.d.ts +48 -0
  71. package/dist/service/cloudfront/command/function/sim-cf-function-access.js +48 -0
  72. package/dist/service/cloudfront/command/function/sim-cf-function-command.types.d.ts +97 -0
  73. package/dist/service/cloudfront/command/function/sim-cf-function-command.types.js +10 -0
  74. package/dist/service/cloudfront/command/function/sim-cf-function-lookup.d.ts +12 -0
  75. package/dist/service/cloudfront/command/function/sim-cf-function-lookup.js +21 -0
  76. package/dist/service/cloudfront/command/function/sim-cf-function-summary.d.ts +11 -0
  77. package/dist/service/cloudfront/command/function/sim-cf-function-summary.js +30 -0
  78. package/dist/service/cloudfront/command/function/sim-cf-get-function.d.ts +23 -0
  79. package/dist/service/cloudfront/command/function/sim-cf-get-function.js +33 -0
  80. package/dist/service/cloudfront/command/function/sim-cf-list-functions.d.ts +22 -0
  81. package/dist/service/cloudfront/command/function/sim-cf-list-functions.js +38 -0
  82. package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.d.ts +2 -0
  83. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-cache-policy.d.ts +18 -0
  84. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-cache-policy.js +30 -0
  85. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.d.ts +28 -0
  86. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.js +41 -0
  87. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.d.ts +2 -2
  88. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.js +6 -3
  89. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.d.ts +0 -10
  90. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.js +0 -19
  91. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.d.ts +2 -0
  92. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.js +4 -2
  93. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.d.ts +3 -3
  94. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.js +5 -5
  95. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.d.ts +3 -3
  96. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.js +4 -4
  97. package/dist/service/cloudfront/distribution/sim-cf-distribution-configuration-state.d.ts +3 -1
  98. package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.d.ts +2 -0
  99. package/dist/service/cloudfront/error/sim-cloudfront.error.d.ts +21 -0
  100. package/dist/service/cloudfront/error/sim-cloudfront.error.js +25 -0
  101. package/dist/service/cloudfront/key-value-store/sim-cf-key-value-store-access.js +2 -10
  102. package/dist/service/cloudfront/key-value-store/sim-cf-key-value-store.js +2 -1
  103. package/dist/service/cloudfront/sdk/sim-cloudfront-sdk-command-router.js +12 -0
  104. package/dist/service/cloudfront/sim-cf-authorize.d.ts +16 -0
  105. package/dist/service/cloudfront/sim-cf-authorize.js +19 -0
  106. package/dist/service/cloudfront/sim-cf-etag.d.ts +7 -0
  107. package/dist/service/cloudfront/sim-cf-etag.js +10 -0
  108. package/dist/service/cloudfront/sim-cloudfront-commands.d.ts +8 -12
  109. package/dist/service/cloudfront/sim-cloudfront-commands.js +8 -17
  110. package/dist/service/cloudfront/sim-cloudfront-policies.d.ts +43 -0
  111. package/dist/service/cloudfront/sim-cloudfront-policies.js +53 -0
  112. package/dist/service/cloudfront/sim-cloudfront.d.ts +13 -17
  113. package/dist/service/cloudfront/sim-cloudfront.js +22 -25
  114. package/dist/service/ecr/authorize/sim-ecr-authorizer.d.ts +31 -0
  115. package/dist/service/ecr/authorize/sim-ecr-authorizer.js +38 -0
  116. package/dist/service/ecr/cfn/repository/sim-cfn-ecr-repository-creator.d.ts +11 -2
  117. package/dist/service/ecr/cfn/repository/sim-cfn-ecr-repository-creator.js +11 -2
  118. package/dist/service/ecr/cfn/sim-ecr-cfn-resource-factory.d.ts +4 -2
  119. package/dist/service/ecr/cfn/sim-ecr-cfn-resource-factory.js +8 -9
  120. package/dist/service/ecr/cfn/sim-ecr-cfn-unsupported-resource.d.ts +7 -0
  121. package/dist/service/ecr/cfn/sim-ecr-cfn-unsupported-resource.js +9 -0
  122. package/dist/service/ecr/sim-ecr.d.ts +7 -0
  123. package/dist/service/ecr/sim-ecr.js +16 -4
  124. package/dist/service/ecs/command/authorize/sim-ecs-authorizer.d.ts +12 -0
  125. package/dist/service/ecs/command/authorize/sim-ecs-authorizer.js +21 -0
  126. package/dist/service/ecs/command/register-task-definition/register-task-definition.handler.js +1 -0
  127. package/dist/service/ecs/sim-ecs-service-principal.d.ts +8 -0
  128. package/dist/service/ecs/sim-ecs-service-principal.js +8 -0
  129. package/dist/service/eventbridge/command/authorize/sim-event-bridge-authorizer.d.ts +12 -0
  130. package/dist/service/eventbridge/command/authorize/sim-event-bridge-authorizer.js +21 -0
  131. package/dist/service/eventbridge/command/rule/sim-event-bridge-rule-access.d.ts +13 -0
  132. package/dist/service/eventbridge/command/rule/sim-event-bridge-rule-access.js +9 -0
  133. package/dist/service/eventbridge/command/target/sim-event-bridge-put-targets.js +1 -0
  134. package/dist/service/firehose/command/authorize/sim-firehose-authorizer.d.ts +12 -0
  135. package/dist/service/firehose/command/authorize/sim-firehose-authorizer.js +20 -0
  136. package/dist/service/firehose/command/sim-firehose-delivery-stream-access.d.ts +4 -0
  137. package/dist/service/firehose/command/sim-firehose-delivery-stream-access.js +6 -0
  138. package/dist/service/firehose/command/stream/sim-firehose-create-delivery-stream.js +3 -1
  139. package/dist/service/firehose/sim-firehose-service-principal.d.ts +8 -0
  140. package/dist/service/firehose/sim-firehose-service-principal.js +8 -0
  141. package/dist/service/firehose/source/sim-firehose-source.d.ts +5 -0
  142. package/dist/service/firehose/source/sim-firehose-source.js +5 -0
  143. package/dist/service/glue/cfn/database/sim-cfn-glue-database-properties.js +2 -2
  144. package/dist/service/glue/cfn/sim-cfn-glue-generated-name.d.ts +10 -0
  145. package/dist/service/glue/cfn/sim-cfn-glue-generated-name.js +25 -0
  146. package/dist/service/glue/cfn/table/sim-cfn-glue-table-properties.js +2 -3
  147. package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.d.ts +33 -2
  148. package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.js +33 -2
  149. package/dist/service/iam/authorize/allow/sim-iam-allow-statements.d.ts +4 -3
  150. package/dist/service/iam/authorize/allow/sim-iam-allow-statements.js +9 -3
  151. package/dist/service/iam/authorize/context/sim-iam-auth-z-allow-requirement.d.ts +14 -5
  152. package/dist/service/iam/authorize/context/sim-iam-auth-z-allow-requirement.js +16 -12
  153. package/dist/service/iam/authorize/context/sim-iam-auth-z-caller-context-builder.d.ts +9 -3
  154. package/dist/service/iam/authorize/context/sim-iam-auth-z-caller-context-builder.js +5 -3
  155. package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.d.ts +9 -71
  156. package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.js +2 -1
  157. package/dist/service/iam/authorize/context/sim-iam-auth-z-input.d.ts +87 -0
  158. package/dist/service/iam/authorize/context/sim-iam-auth-z-input.js +1 -0
  159. package/dist/service/iam/authorize/match/sim-iam-policy-principal-matcher.d.ts +11 -3
  160. package/dist/service/iam/authorize/match/sim-iam-policy-principal-matcher.js +20 -8
  161. package/dist/service/iam/authorize/match/sim-iam-principal-match.d.ts +29 -8
  162. package/dist/service/iam/authorize/match/sim-iam-principal-match.js +38 -13
  163. package/dist/service/iam/authorize/pass-role/sim-iam-pass-role-authorizer.d.ts +74 -0
  164. package/dist/service/iam/authorize/pass-role/sim-iam-pass-role-authorizer.js +92 -0
  165. package/dist/service/iam/authorize/sim-iam-account-auth-z.d.ts +14 -5
  166. package/dist/service/iam/authorize/sim-iam-account-auth-z.js +6 -4
  167. package/dist/service/iam/authorize/sim-iam-authorizer.d.ts +3 -1
  168. package/dist/service/iam/authorize/sim-iam-authorizer.js +2 -1
  169. package/dist/service/iam/authorize/sim-iam-inter-service-auth-z.d.ts +1 -1
  170. package/dist/service/iam/authorize/sim-iam-wildcard.js +39 -4
  171. package/dist/service/iam/cfn/managed-policy/sim-cfn-iam-managed-policy-creator.js +2 -1
  172. package/dist/service/iam/cfn/name/sim-cfn-iam-generated-name.d.ts +16 -0
  173. package/dist/service/iam/cfn/name/sim-cfn-iam-generated-name.js +36 -0
  174. package/dist/service/iam/cfn/role/sim-cfn-iam-role-properties-parser.js +9 -8
  175. package/dist/service/iam/cfn/sim-cfn-iam-optional-string.d.ts +17 -0
  176. package/dist/service/iam/cfn/sim-cfn-iam-optional-string.js +17 -0
  177. package/dist/service/iam/cfn/user/sim-cfn-iam-user-properties-parser.js +4 -8
  178. package/dist/service/iam/command/policy/create-policy/create-policy-input-resolver.js +2 -0
  179. package/dist/service/iam/command/policy/put-role-policy/put-role-policy.handler.js +5 -0
  180. package/dist/service/iam/command/policy/put-user-policy/put-user-policy.handler.js +5 -0
  181. package/dist/service/iam/command/role/create-role/create-role.handler.js +4 -1
  182. package/dist/service/iam/error/sim-iam.error.d.ts +11 -0
  183. package/dist/service/iam/error/sim-iam.error.js +13 -0
  184. package/dist/service/iam/index.d.ts +1 -0
  185. package/dist/service/iam/policy/sim-iam-policy-document-of-size.d.ts +18 -0
  186. package/dist/service/iam/policy/sim-iam-policy-document-of-size.js +41 -0
  187. package/dist/service/iam/role/sim-iam-deploy-role.d.ts +56 -0
  188. package/dist/service/iam/role/sim-iam-deploy-role.js +50 -0
  189. package/dist/service/iam/role/sim-iam-role-with-policy.factory.d.ts +3 -1
  190. package/dist/service/iam/sim-iam-account-parts.d.ts +8 -0
  191. package/dist/service/iam/sim-iam-account-parts.js +1 -0
  192. package/dist/service/iam/sim-iam.d.ts +12 -2
  193. package/dist/service/iam/sim-iam.js +12 -0
  194. package/dist/service/iam/validate/size/sim-iam-policy-document-size.d.ts +57 -0
  195. package/dist/service/iam/validate/size/sim-iam-policy-document-size.js +71 -0
  196. package/dist/service/kms/command/authorize/sim-kms-authorizer.d.ts +3 -1
  197. package/dist/service/kms/command/authorize/sim-kms-authorizer.js +4 -1
  198. package/dist/service/kms/command/sim-kms-request-options.d.ts +11 -0
  199. package/dist/service/kms/key/sim-kms-key-policy.d.ts +5 -4
  200. package/dist/service/kms/key/sim-kms-key-policy.js +4 -3
  201. package/dist/service/lambda/cfn/function/sim-cfn-lambda-function-properties-parser.d.ts +2 -2
  202. package/dist/service/lambda/cfn/function/sim-cfn-lambda-function-properties-parser.js +4 -3
  203. package/dist/service/lambda/cfn/function/sim-cfn-lambda-generated-function-name.d.ts +10 -0
  204. package/dist/service/lambda/cfn/function/sim-cfn-lambda-generated-function-name.js +25 -0
  205. package/dist/service/lambda/command/authorize/sim-lambda-resource-policies.d.ts +1 -1
  206. package/dist/service/lambda/command/create-function/create-function-authorizer.d.ts +9 -2
  207. package/dist/service/lambda/command/create-function/create-function-authorizer.js +16 -2
  208. package/dist/service/lambda/command/create-function/create-function.handler.js +1 -1
  209. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.d.ts +7 -2
  210. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.js +14 -2
  211. package/dist/service/lambda/command/update-function-configuration/update-function-configuration.handler.js +1 -1
  212. package/dist/service/lambda/function/logging/sim-lambda-function-logging.d.ts +10 -1
  213. package/dist/service/lambda/function/logging/sim-lambda-function-logging.js +25 -1
  214. package/dist/service/lambda/function/logging/sim-lambda-invoke-error-log.d.ts +13 -0
  215. package/dist/service/lambda/function/logging/sim-lambda-invoke-error-log.js +18 -0
  216. package/dist/service/lambda/sim-lambda-service-principal.d.ts +7 -0
  217. package/dist/service/lambda/sim-lambda-service-principal.js +7 -0
  218. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-authorization.d.ts +46 -0
  219. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-authorization.js +49 -0
  220. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-creator.d.ts +5 -0
  221. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-creator.js +6 -0
  222. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-destination-creator.d.ts +5 -0
  223. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-destination-creator.js +6 -0
  224. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-source-creator.d.ts +5 -0
  225. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-source-creator.js +6 -0
  226. package/dist/service/logs/cfn/group/sim-cfn-log-group-creator.d.ts +9 -2
  227. package/dist/service/logs/cfn/group/sim-cfn-log-group-creator.js +34 -5
  228. package/dist/service/logs/cfn/sim-logs-cfn-resource-deleter.js +1 -1
  229. package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.d.ts +4 -0
  230. package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.js +9 -4
  231. package/dist/service/logs/sim-logs-commands.d.ts +3 -0
  232. package/dist/service/logs/sim-logs-commands.js +4 -0
  233. package/dist/service/logs/sim-logs.js +6 -1
  234. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-creator.d.ts +2 -2
  235. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-creator.js +4 -3
  236. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-generated-name.d.ts +12 -0
  237. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-generated-name.js +22 -0
  238. package/dist/service/s3/command/authorize/sim-s3-bucket-resource-policies.d.ts +1 -1
  239. package/dist/service/scheduler/command/authorize/sim-scheduler-authorizer.d.ts +10 -1
  240. package/dist/service/scheduler/command/authorize/sim-scheduler-authorizer.js +19 -1
  241. package/dist/service/scheduler/command/schedule/sim-scheduler-create-schedule.js +1 -0
  242. package/dist/service/scheduler/command/schedule/sim-scheduler-schedule-access.d.ts +8 -0
  243. package/dist/service/scheduler/command/schedule/sim-scheduler-schedule-access.js +9 -0
  244. package/dist/service/scheduler/command/schedule/sim-scheduler-update-schedule.js +1 -0
  245. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-generated-name.d.ts +15 -0
  246. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-generated-name.js +22 -0
  247. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-properties.d.ts +4 -10
  248. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-properties.js +13 -31
  249. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-value.d.ts +17 -0
  250. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-value.js +30 -0
  251. package/dist/service/secretsmanager/secret/sim-secrets-manager-secret-name.d.ts +6 -0
  252. package/dist/service/secretsmanager/secret/sim-secrets-manager-secret-name.js +8 -3
  253. package/dist/service/sns/command/authorize/sim-sns-topic-resource-policies.d.ts +1 -1
  254. package/dist/service/sqs/command/authorize/sim-sqs-queue-resource-policies.d.ts +1 -1
  255. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-generated-parameter-name.d.ts +16 -0
  256. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-generated-parameter-name.js +23 -0
  257. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-parameter-properties.d.ts +2 -4
  258. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-parameter-properties.js +5 -5
  259. package/dist/service/ssm/parameter/sim-ssm-kms-crypto.d.ts +6 -4
  260. package/dist/service/ssm/parameter/sim-ssm-kms-crypto.js +4 -4
  261. package/dist/service/ssm/parameter/sim-ssm-parameter-arn.d.ts +17 -0
  262. package/dist/service/ssm/parameter/sim-ssm-parameter-arn.js +20 -0
  263. package/dist/service/ssm/parameter/sim-ssm-parameter-kms.d.ts +15 -9
  264. package/dist/service/ssm/parameter/sim-ssm-parameter-kms.js +20 -10
  265. package/dist/service/ssm/parameter/sim-ssm-parameter-name.js +3 -12
  266. package/dist/service/stepfunctions/command/authorize/sim-step-functions-authorizer.d.ts +41 -0
  267. package/dist/service/stepfunctions/command/authorize/sim-step-functions-authorizer.js +64 -0
  268. package/dist/service/stepfunctions/command/machine/sim-state-machine-create.d.ts +5 -2
  269. package/dist/service/stepfunctions/command/machine/sim-state-machine-create.js +6 -2
  270. package/dist/service/stepfunctions/command/machine/sim-state-machine-delete.d.ts +26 -0
  271. package/dist/service/stepfunctions/command/machine/sim-state-machine-delete.js +29 -0
  272. package/dist/service/stepfunctions/command/machine/sim-state-machine-lookup.d.ts +7 -0
  273. package/dist/service/stepfunctions/command/machine/sim-state-machine-lookup.js +12 -3
  274. package/dist/service/stepfunctions/command/machine/sim-state-machine-update.d.ts +19 -0
  275. package/dist/service/stepfunctions/command/machine/{sim-state-machine-writes.js → sim-state-machine-update.js} +3 -14
  276. package/dist/service/stepfunctions/sim-step-functions.d.ts +8 -2
  277. package/dist/service/stepfunctions/sim-step-functions.js +26 -9
  278. package/dist/service/sts/command/assume-role/assume-role.handler.d.ts +5 -0
  279. package/dist/service/sts/command/assume-role/assume-role.handler.js +1 -0
  280. package/dist/service/sts/command/get-caller-identity/get-caller-identity.handler.d.ts +5 -0
  281. package/dist/service/sts/command/get-caller-identity/get-caller-identity.handler.js +1 -0
  282. package/dist/service/sts/sim-sts.d.ts +9 -0
  283. package/dist/service/sts/sim-sts.js +4 -0
  284. package/dist/util/memo/bounded-memo.d.ts +36 -0
  285. package/dist/util/memo/bounded-memo.js +58 -0
  286. package/docs/sdk/README.md +3 -1
  287. package/docs/services/cloudformation/README.md +196 -11
  288. package/docs/services/cloudfront/README.md +230 -6
  289. package/docs/services/cloudwatch/README.md +6 -4
  290. package/docs/services/cognito/README.md +8 -7
  291. package/docs/services/dynamodb/README.md +6 -5
  292. package/docs/services/ecs/README.md +20 -9
  293. package/docs/services/elbv2/README.md +6 -2
  294. package/docs/services/eventbridge/README.md +9 -1
  295. package/docs/services/firehose/README.md +9 -3
  296. package/docs/services/glue/README.md +6 -0
  297. package/docs/services/iam/README.md +322 -27
  298. package/docs/services/kinesis/README.md +3 -2
  299. package/docs/services/kms/README.md +7 -2
  300. package/docs/services/lambda/README.md +76 -2
  301. package/docs/services/logs/README.md +16 -2
  302. package/docs/services/s3/README.md +7 -2
  303. package/docs/services/scheduler/README.md +12 -4
  304. package/docs/services/secretsmanager/README.md +6 -3
  305. package/docs/services/ses/README.md +3 -1
  306. package/docs/services/sns/README.md +5 -5
  307. package/docs/services/sqs/README.md +5 -5
  308. package/docs/services/ssm/README.md +40 -16
  309. package/docs/services/stepfunctions/README.md +11 -2
  310. package/docs/services/wafv2/README.md +5 -3
  311. package/package.json +1 -1
  312. package/dist/service/stepfunctions/command/machine/sim-state-machine-writes.d.ts +0 -25
@@ -7,6 +7,23 @@ import type { SimAwsAccountRegionScope } from "../../aws/sim-aws-account-region-
7
7
  * rather than `...:parameter//myapp/prod/db-host`.
8
8
  */
9
9
  export declare function ssmParameterArnPrefix(accountRegionScope: SimAwsAccountRegionScope): string;
10
+ /**
11
+ * The longest a parameter name may be, counting the ARN that precedes it.
12
+ *
13
+ * Real Parameter Store reserves the rest of the 2048 character ARN for its own
14
+ * use, and counts the ARN prefix towards the 1011 characters left. That is why
15
+ * this limit needs the Account and Region: the same name is legal in one
16
+ * Region and too long in another.
17
+ */
18
+ export declare const maximumSsmParameterArnLength = 1011;
19
+ /**
20
+ * The longest name a parameter may be given in this Account and Region.
21
+ *
22
+ * The ARN prefix comes out of the same allowance the name does, so the room
23
+ * left for a name depends on how long the Region's name is. A generated name
24
+ * is trimmed to this so that it is never one PutParameter would then refuse.
25
+ */
26
+ export declare function maximumSimSsmParameterNameLength(accountRegionScope: SimAwsAccountRegionScope): number;
10
27
  interface SimSsmParameterArnProperties {
11
28
  readonly resource: string;
12
29
  readonly accountRegionScope: SimAwsAccountRegionScope;
@@ -9,6 +9,26 @@ export function ssmParameterArnPrefix(accountRegionScope) {
9
9
  const { regionName, accountId } = accountRegionScope;
10
10
  return `arn:aws:ssm:${regionName}:${accountId}:parameter/`;
11
11
  }
12
+ /**
13
+ * The longest a parameter name may be, counting the ARN that precedes it.
14
+ *
15
+ * Real Parameter Store reserves the rest of the 2048 character ARN for its own
16
+ * use, and counts the ARN prefix towards the 1011 characters left. That is why
17
+ * this limit needs the Account and Region: the same name is legal in one
18
+ * Region and too long in another.
19
+ */
20
+ export const maximumSsmParameterArnLength = 1011;
21
+ /**
22
+ * The longest name a parameter may be given in this Account and Region.
23
+ *
24
+ * The ARN prefix comes out of the same allowance the name does, so the room
25
+ * left for a name depends on how long the Region's name is. A generated name
26
+ * is trimmed to this so that it is never one PutParameter would then refuse.
27
+ */
28
+ export function maximumSimSsmParameterNameLength(accountRegionScope) {
29
+ return (maximumSsmParameterArnLength -
30
+ ssmParameterArnPrefix(accountRegionScope).length);
31
+ }
12
32
  /**
13
33
  * The ARN of one simulated parameter.
14
34
  *
@@ -13,15 +13,20 @@ interface SimSsmParameterKmsProperties {
13
13
  /**
14
14
  * The KMS calls a SecureString parameter makes.
15
15
  *
16
- * The calls are made as the caller rather than as the service, which is the
17
- * point: under a customer managed key a standard tier write needs
18
- * `kms:Encrypt` on the key and a decrypting read needs `kms:Decrypt`, each on
19
- * top of the SSM permission for the parameter itself.
16
+ * The calls are made as the caller rather than as the service. Under a
17
+ * customer managed key a standard tier write needs `kms:Encrypt` on the key
18
+ * and a decrypting read needs `kms:Decrypt`, each on top of the SSM permission
19
+ * for the parameter itself.
20
20
  *
21
- * They are also made through the service, which is why the `aws/ssm` managed
22
- * key needs no KMS permission at all: its policy admits the Account's
23
- * principals when `kms:ViaService` names Systems Manager, and Parameter Store
24
- * is what supplies that.
21
+ * They are also made through the service, which is what reaches the `aws/ssm`
22
+ * managed key at all. That key's policy admits the Account's principals when
23
+ * `kms:ViaService` names Systems Manager, and Parameter Store is what supplies
24
+ * it. Reaching the key is not the same as being allowed to use it, and a
25
+ * decrypting read says so with `withCallerPermissions`, because that policy
26
+ * admits whoever the request came from rather than the caller behind it. A
27
+ * Role holding `ssm:GetParameter` and no `kms:Decrypt` reads the ciphertext
28
+ * and not the value. A write under that key asks the caller for no KMS
29
+ * permission here, where AWS documents `kms:Encrypt` for one.
25
30
  *
26
31
  * Standard tier Parameter Store encrypts under the key directly rather than
27
32
  * through a data key, so this is one Encrypt and one Decrypt and nothing more.
@@ -34,7 +39,8 @@ export declare class SimSsmParameterKms {
34
39
  */
35
40
  encrypt(parameterArn: string, plaintext: string, keyId: string | undefined, caller: SimAwsCaller | undefined): Promise<SimSsmParameterCiphertext>;
36
41
  /**
37
- * Decrypt a parameter value, which needs the same binding it was made with.
42
+ * Decrypt a parameter value, which needs the same binding it was made with,
43
+ * and the caller's own permission to use the key.
38
44
  */
39
45
  decrypt(parameterArn: string, ciphertext: string, caller: SimAwsCaller | undefined): Promise<string>;
40
46
  private contextFor;
@@ -13,15 +13,20 @@ const parameterArnContextKey = "PARAMETER_ARN";
13
13
  /**
14
14
  * The KMS calls a SecureString parameter makes.
15
15
  *
16
- * The calls are made as the caller rather than as the service, which is the
17
- * point: under a customer managed key a standard tier write needs
18
- * `kms:Encrypt` on the key and a decrypting read needs `kms:Decrypt`, each on
19
- * top of the SSM permission for the parameter itself.
16
+ * The calls are made as the caller rather than as the service. Under a
17
+ * customer managed key a standard tier write needs `kms:Encrypt` on the key
18
+ * and a decrypting read needs `kms:Decrypt`, each on top of the SSM permission
19
+ * for the parameter itself.
20
20
  *
21
- * They are also made through the service, which is why the `aws/ssm` managed
22
- * key needs no KMS permission at all: its policy admits the Account's
23
- * principals when `kms:ViaService` names Systems Manager, and Parameter Store
24
- * is what supplies that.
21
+ * They are also made through the service, which is what reaches the `aws/ssm`
22
+ * managed key at all. That key's policy admits the Account's principals when
23
+ * `kms:ViaService` names Systems Manager, and Parameter Store is what supplies
24
+ * it. Reaching the key is not the same as being allowed to use it, and a
25
+ * decrypting read says so with `withCallerPermissions`, because that policy
26
+ * admits whoever the request came from rather than the caller behind it. A
27
+ * Role holding `ssm:GetParameter` and no `kms:Decrypt` reads the ciphertext
28
+ * and not the value. A write under that key asks the caller for no KMS
29
+ * permission here, where AWS documents `kms:Encrypt` for one.
25
30
  *
26
31
  * Standard tier Parameter Store encrypts under the key directly rather than
27
32
  * through a data key, so this is one Encrypt and one Decrypt and nothing more.
@@ -49,7 +54,8 @@ export class SimSsmParameterKms {
49
54
  };
50
55
  }
51
56
  /**
52
- * Decrypt a parameter value, which needs the same binding it was made with.
57
+ * Decrypt a parameter value, which needs the same binding it was made with,
58
+ * and the caller's own permission to use the key.
53
59
  */
54
60
  async decrypt(parameterArn, ciphertext, caller) {
55
61
  const decrypted = await reportingKeyProblems(async () => await this.kms.decrypt({
@@ -57,7 +63,11 @@ export class SimSsmParameterKms {
57
63
  CiphertextBlob: Buffer.from(ciphertext, "base64"),
58
64
  EncryptionContext: this.contextFor(parameterArn),
59
65
  },
60
- }, { caller, viaService: ssmKmsViaService }));
66
+ }, {
67
+ caller,
68
+ viaService: ssmKmsViaService,
69
+ withCallerPermissions: true,
70
+ }));
61
71
  assertDefined(decrypted.Plaintext, `Simulated KMS decrypted ${parameterArn} to nothing`);
62
72
  return Buffer.from(decrypted.Plaintext).toString("utf8");
63
73
  }
@@ -1,17 +1,8 @@
1
1
  import { SimSsmHierarchyLevelLimitExceededException, SimSsmParameterPatternMismatchException, SimSsmValidationException, } from "../error/sim-ssm.error.js";
2
- import { ssmParameterArnPrefix } from "./sim-ssm-parameter-arn.js";
2
+ import { maximumSsmParameterArnLength, ssmParameterArnPrefix, } from "./sim-ssm-parameter-arn.js";
3
3
  const allowedCharacters = /^[\w./-]+$/;
4
4
  const maxHierarchyLevels = 15;
5
5
  const reservedPrefixes = ["aws", "ssm"];
6
- /**
7
- * The longest a parameter name may be, counting the ARN that precedes it.
8
- *
9
- * Real Parameter Store reserves the rest of the 2048 character ARN for its own
10
- * use, and counts the ARN prefix towards the 1011 characters left. That is why
11
- * this limit needs the Account and Region: the same name is legal in one
12
- * Region and too long in another.
13
- */
14
- const maxArnLength = 1011;
15
6
  /**
16
7
  * The name of one simulated parameter, validated as real Parameter Store
17
8
  * validates it.
@@ -106,11 +97,11 @@ export class SimSsmParameterName {
106
97
  }
107
98
  requireWithinArnLength(accountRegionScope) {
108
99
  const arnLength = ssmParameterArnPrefix(accountRegionScope).length + this.resource.length;
109
- if (arnLength <= maxArnLength) {
100
+ if (arnLength <= maximumSsmParameterArnLength) {
110
101
  return;
111
102
  }
112
103
  throw new SimSsmValidationException(`Parameter name '${this.value}' makes an ARN of ${String(arnLength)} ` +
113
- `characters; Parameter Store allows ${String(maxArnLength)} ` +
104
+ `characters; Parameter Store allows ${String(maximumSsmParameterArnLength)} ` +
114
105
  `including the ARN prefix for this Account and Region`);
115
106
  }
116
107
  }
@@ -0,0 +1,41 @@
1
+ import type { SimAwsCaller } from "../../../aws/caller/sim-aws-caller.js";
2
+ import type { SimAwsResolvedCaller } from "../../../aws/caller/sim-aws-caller-resolver.js";
3
+ import type { SimAwsAccountRegionScope } from "../../../aws/sim-aws-account-region-scope.js";
4
+ import type { SimIamInterServiceAuthZ } from "../../../iam/authorize/sim-iam-inter-service-auth-z.js";
5
+ interface SimStepFunctionsAuthorizerProperties {
6
+ readonly iam: SimIamInterServiceAuthZ;
7
+ readonly accountRegionScope: SimAwsAccountRegionScope;
8
+ }
9
+ /**
10
+ * Applies simulated IAM authorization to Step Functions requests.
11
+ *
12
+ * A state machine is named by its ARN, and that is the form a Step Functions
13
+ * policy is written in. `CreateStateMachine` has no ARN to be given. It
14
+ * authorizes against the one the state machine is about to have, which a
15
+ * policy naming `stateMachine:orders-*` covers.
16
+ *
17
+ * A state machine's `roleArn` is a second question. Step Functions keeps that
18
+ * Role and runs every execution as it, so the caller creating one needs
19
+ * `iam:PassRole` on it. The resource there is the Role.
20
+ */
21
+ export declare class SimStepFunctionsAuthorizer {
22
+ #private;
23
+ constructor(properties: SimStepFunctionsAuthorizerProperties);
24
+ /**
25
+ * Ensure the caller may hand Step Functions a state machine's role.
26
+ */
27
+ authorizePassRole(roleArn: string, caller?: SimAwsCaller): void;
28
+ /**
29
+ * Ensure the caller may perform an action on a state machine of this name.
30
+ */
31
+ authorizeStateMachineName(action: string, name: string, caller?: SimAwsCaller): SimAwsResolvedCaller;
32
+ /**
33
+ * Ensure the caller may perform an action on a state machine ARN.
34
+ *
35
+ * The state machine need not be there. Real IAM evaluates a request before
36
+ * the service handles it, so a caller with no permission is refused whether
37
+ * or not the ARN names anything.
38
+ */
39
+ authorizeStateMachineArn(action: string, stateMachineArn: string, caller?: SimAwsCaller): SimAwsResolvedCaller;
40
+ }
41
+ export {};
@@ -0,0 +1,64 @@
1
+ import { SimIamPassRoleAuthorizer } from "../../../iam/authorize/pass-role/sim-iam-pass-role-authorizer.js";
2
+ import { SimIamAccessDenied } from "../../../iam/error/sim-iam.error.js";
3
+ import { simStateMachineArn } from "../../machine/sim-state-machine-arn.js";
4
+ import { simStatesServicePrincipal } from "../../task/sim-states-execution-role.js";
5
+ /**
6
+ * Applies simulated IAM authorization to Step Functions requests.
7
+ *
8
+ * A state machine is named by its ARN, and that is the form a Step Functions
9
+ * policy is written in. `CreateStateMachine` has no ARN to be given. It
10
+ * authorizes against the one the state machine is about to have, which a
11
+ * policy naming `stateMachine:orders-*` covers.
12
+ *
13
+ * A state machine's `roleArn` is a second question. Step Functions keeps that
14
+ * Role and runs every execution as it, so the caller creating one needs
15
+ * `iam:PassRole` on it. The resource there is the Role.
16
+ */
17
+ export class SimStepFunctionsAuthorizer {
18
+ #iam;
19
+ #accountRegionScope;
20
+ #passRole;
21
+ constructor(properties) {
22
+ this.#iam = properties.iam;
23
+ this.#accountRegionScope = properties.accountRegionScope;
24
+ this.#passRole = new SimIamPassRoleAuthorizer({
25
+ iam: properties.iam,
26
+ passedToService: simStatesServicePrincipal,
27
+ });
28
+ }
29
+ /**
30
+ * Ensure the caller may hand Step Functions a state machine's role.
31
+ */
32
+ authorizePassRole(roleArn, caller) {
33
+ this.#passRole.authorize(roleArn, caller);
34
+ }
35
+ /**
36
+ * Ensure the caller may perform an action on a state machine of this name.
37
+ */
38
+ authorizeStateMachineName(action, name, caller) {
39
+ return this.authorizeStateMachineArn(action, simStateMachineArn(this.#accountRegionScope, name), caller);
40
+ }
41
+ /**
42
+ * Ensure the caller may perform an action on a state machine ARN.
43
+ *
44
+ * The state machine need not be there. Real IAM evaluates a request before
45
+ * the service handles it, so a caller with no permission is refused whether
46
+ * or not the ARN names anything.
47
+ */
48
+ authorizeStateMachineArn(action, stateMachineArn, caller) {
49
+ const decision = this.#iam.authorize({
50
+ action,
51
+ resource: stateMachineArn,
52
+ caller,
53
+ });
54
+ if (decision.isDenied) {
55
+ throw new SimIamAccessDenied({
56
+ principal: decision.caller.principal,
57
+ reason: decision.denialReason,
58
+ action,
59
+ resource: stateMachineArn,
60
+ });
61
+ }
62
+ return decision.caller;
63
+ }
64
+ }
@@ -1,9 +1,12 @@
1
1
  import type { BackgroundScheduler } from "../../../../util/background/background.js";
2
2
  import type { SimAwsAccountRegionScope } from "../../../aws/sim-aws-account-region-scope.js";
3
3
  import type { SimStateMachineStore } from "../../machine/sim-state-machine-store.js";
4
+ import type { SimStepFunctionsAuthorizer } from "../authorize/sim-step-functions-authorizer.js";
5
+ import type { SimStepFunctionsRequestOptions } from "../sim-step-functions-request-options.js";
4
6
  import type { SimCreateStateMachineCommand, SimCreateStateMachineCommandOutput } from "./machine.command.js";
5
7
  interface SimStateMachineCreateProperties {
6
8
  readonly stateMachines: SimStateMachineStore;
9
+ readonly authorizer: SimStepFunctionsAuthorizer;
7
10
  readonly accountRegionScope: SimAwsAccountRegionScope;
8
11
  readonly background: BackgroundScheduler;
9
12
  }
@@ -22,8 +25,8 @@ export declare class SimStateMachineCreate {
22
25
  *
23
26
  * `CreateStateMachine` is idempotent. A second request carrying the same
24
27
  * name, definition and type answers with the state machine that is already
25
- * there.
28
+ * there, and is authorized the same way as the first.
26
29
  */
27
- handle(command: SimCreateStateMachineCommand): SimCreateStateMachineCommandOutput;
30
+ handle(command: SimCreateStateMachineCommand, options?: SimStepFunctionsRequestOptions): SimCreateStateMachineCommandOutput;
28
31
  }
29
32
  export {};
@@ -7,10 +7,12 @@ import { readSimStateMachineCreateInput, } from "./sim-state-machine-input.js";
7
7
  */
8
8
  export class SimStateMachineCreate {
9
9
  #stateMachines;
10
+ #authorizer;
10
11
  #accountRegionScope;
11
12
  #background;
12
13
  constructor(properties) {
13
14
  this.#stateMachines = properties.stateMachines;
15
+ this.#authorizer = properties.authorizer;
14
16
  this.#accountRegionScope = properties.accountRegionScope;
15
17
  this.#background = properties.background;
16
18
  }
@@ -23,10 +25,12 @@ export class SimStateMachineCreate {
23
25
  *
24
26
  * `CreateStateMachine` is idempotent. A second request carrying the same
25
27
  * name, definition and type answers with the state machine that is already
26
- * there.
28
+ * there, and is authorized the same way as the first.
27
29
  */
28
- handle(command) {
30
+ handle(command, options) {
29
31
  const read = readSimStateMachineCreateInput(command.input);
32
+ this.#authorizer.authorizeStateMachineName("states:CreateStateMachine", read.name, options?.caller);
33
+ this.#authorizer.authorizePassRole(read.roleArn, options?.caller);
30
34
  const existing = this.#stateMachines.findByName(read.name);
31
35
  if (existing !== undefined) {
32
36
  return answerForExisting(existing, read);
@@ -0,0 +1,26 @@
1
+ import type { SimStatesExecutionStore } from "../../execution/sim-states-execution-store.js";
2
+ import type { SimStateMachineStore } from "../../machine/sim-state-machine-store.js";
3
+ import type { SimStepFunctionsAuthorizer } from "../authorize/sim-step-functions-authorizer.js";
4
+ import type { SimStepFunctionsRequestOptions } from "../sim-step-functions-request-options.js";
5
+ import type { SimDeleteStateMachineCommand, SimDeleteStateMachineCommandOutput } from "./machine.command.js";
6
+ interface SimStateMachineDeleteProperties {
7
+ readonly stateMachines: SimStateMachineStore;
8
+ readonly authorizer: SimStepFunctionsAuthorizer;
9
+ readonly executions: SimStatesExecutionStore;
10
+ }
11
+ /**
12
+ * The command that deletes a state machine.
13
+ */
14
+ export declare class SimStateMachineDelete {
15
+ #private;
16
+ constructor(properties: SimStateMachineDeleteProperties);
17
+ /**
18
+ * Delete a state machine and forget its executions.
19
+ *
20
+ * The caller is authorized against the ARN the request carries, before
21
+ * anything is looked up. A caller with no permission is refused whether or
22
+ * not the ARN names a state machine.
23
+ */
24
+ handle(command: SimDeleteStateMachineCommand, options?: SimStepFunctionsRequestOptions): SimDeleteStateMachineCommandOutput;
25
+ }
26
+ export {};
@@ -0,0 +1,29 @@
1
+ import { requireSimStateMachine, requiredSimStateMachineArn, } from "./sim-state-machine-lookup.js";
2
+ /**
3
+ * The command that deletes a state machine.
4
+ */
5
+ export class SimStateMachineDelete {
6
+ #stateMachines;
7
+ #authorizer;
8
+ #executions;
9
+ constructor(properties) {
10
+ this.#stateMachines = properties.stateMachines;
11
+ this.#authorizer = properties.authorizer;
12
+ this.#executions = properties.executions;
13
+ }
14
+ /**
15
+ * Delete a state machine and forget its executions.
16
+ *
17
+ * The caller is authorized against the ARN the request carries, before
18
+ * anything is looked up. A caller with no permission is refused whether or
19
+ * not the ARN names a state machine.
20
+ */
21
+ handle(command, options) {
22
+ const { stateMachineArn } = command.input;
23
+ this.#authorizer.authorizeStateMachineArn("states:DeleteStateMachine", requiredSimStateMachineArn(stateMachineArn, "DeleteStateMachine"), options?.caller);
24
+ const { arn } = requireSimStateMachine(this.#stateMachines, stateMachineArn, "DeleteStateMachine");
25
+ this.#stateMachines.remove(arn);
26
+ this.#executions.removeForStateMachine(arn);
27
+ return {};
28
+ }
29
+ }
@@ -1,5 +1,12 @@
1
1
  import type { SimStateMachine } from "../../machine/sim-state-machine.js";
2
2
  import type { SimStateMachineStore } from "../../machine/sim-state-machine-store.js";
3
+ /**
4
+ * The state machine ARN a request names, or a refusal saying it needs one.
5
+ *
6
+ * A command authorizes against this before looking anything up, the way real
7
+ * IAM decides a request before the service handles it.
8
+ */
9
+ export declare function requiredSimStateMachineArn(arn: string | undefined, commandName: string): string;
3
10
  /**
4
11
  * Find the state machine a request's ARN names, or say why it could not be.
5
12
  */
@@ -1,12 +1,21 @@
1
1
  import { SimStatesInvalidRequest, SimStatesResourceNotFound, } from "../../error/sim-step-functions.error.js";
2
2
  /**
3
- * Find the state machine a request's ARN names, or say why it could not be.
3
+ * The state machine ARN a request names, or a refusal saying it needs one.
4
+ *
5
+ * A command authorizes against this before looking anything up, the way real
6
+ * IAM decides a request before the service handles it.
4
7
  */
5
- export function requireSimStateMachine(stateMachines, arn, commandName) {
8
+ export function requiredSimStateMachineArn(arn, commandName) {
6
9
  if (arn === undefined) {
7
10
  throw new SimStatesInvalidRequest(`${commandName} needs a stateMachineArn.`);
8
11
  }
9
- const stateMachine = stateMachines.find(arn);
12
+ return arn;
13
+ }
14
+ /**
15
+ * Find the state machine a request's ARN names, or say why it could not be.
16
+ */
17
+ export function requireSimStateMachine(stateMachines, arn, commandName) {
18
+ const stateMachine = stateMachines.find(requiredSimStateMachineArn(arn, commandName));
10
19
  if (stateMachine === undefined) {
11
20
  throw new SimStatesResourceNotFound(`${arn} is not a simulated state machine in this Account and Region.`);
12
21
  }
@@ -0,0 +1,19 @@
1
+ import type { BackgroundScheduler } from "../../../../util/background/background.js";
2
+ import type { SimStateMachineStore } from "../../machine/sim-state-machine-store.js";
3
+ import type { SimUpdateStateMachineCommand, SimUpdateStateMachineCommandOutput } from "./machine.command.js";
4
+ interface SimStateMachineUpdateProperties {
5
+ readonly stateMachines: SimStateMachineStore;
6
+ readonly background: BackgroundScheduler;
7
+ }
8
+ /**
9
+ * The command that changes a state machine's definition or role.
10
+ */
11
+ export declare class SimStateMachineUpdate {
12
+ #private;
13
+ constructor(properties: SimStateMachineUpdateProperties);
14
+ /**
15
+ * Change a state machine's definition or role.
16
+ */
17
+ handle(command: SimUpdateStateMachineCommand): SimUpdateStateMachineCommandOutput;
18
+ }
19
+ export {};
@@ -2,21 +2,19 @@ import { parseSimStatesDefinition } from "../../definition/sim-states-definition
2
2
  import { SimStatesInvalidRequest } from "../../error/sim-step-functions.error.js";
3
3
  import { requireSimStateMachine } from "./sim-state-machine-lookup.js";
4
4
  /**
5
- * The commands that change and delete state machines.
5
+ * The command that changes a state machine's definition or role.
6
6
  */
7
- export class SimStateMachineWrites {
7
+ export class SimStateMachineUpdate {
8
8
  #stateMachines;
9
- #executions;
10
9
  #background;
11
10
  constructor(properties) {
12
11
  this.#stateMachines = properties.stateMachines;
13
- this.#executions = properties.executions;
14
12
  this.#background = properties.background;
15
13
  }
16
14
  /**
17
15
  * Change a state machine's definition or role.
18
16
  */
19
- update(command) {
17
+ handle(command) {
20
18
  const { stateMachineArn, definition, roleArn } = command.input;
21
19
  if (definition === undefined && roleArn === undefined) {
22
20
  throw new SimStatesInvalidRequest("UpdateStateMachine needs a definition or a roleArn to change.");
@@ -31,13 +29,4 @@ export class SimStateMachineWrites {
31
29
  });
32
30
  return { updateDate: this.#background.now() };
33
31
  }
34
- /**
35
- * Delete a state machine and forget its executions.
36
- */
37
- delete(command) {
38
- const found = requireSimStateMachine(this.#stateMachines, command.input.stateMachineArn, "DeleteStateMachine");
39
- this.#stateMachines.remove(found.arn);
40
- this.#executions.removeForStateMachine(found.arn);
41
- return {};
42
- }
43
32
  }
@@ -1,6 +1,7 @@
1
1
  import type { SimSdkCommandRouter } from "../../sdk/router/sim-sdk-command-router.type.js";
2
2
  import { type BackgroundScheduler } from "../../util/background/background.js";
3
3
  import type { SimAwsAccountRegionScope } from "../aws/sim-aws-account-region-scope.js";
4
+ import type { SimIamInterServiceAuthZ } from "../iam/authorize/sim-iam-inter-service-auth-z.js";
4
5
  import type * as simStatesCommands from "./command/sim-step-functions-command.types.js";
5
6
  import type { SimStepFunctionsRequestOptions } from "./command/sim-step-functions-request-options.js";
6
7
  import { type SimStatesDefinitionStore } from "./definition/store/sim-states-definition-store.js";
@@ -10,6 +11,7 @@ import type { SimStatesTaskTargets } from "./task/sim-states-task-invocation.js"
10
11
  import { SimStepFunctionsInspection } from "./sim-step-functions-inspection.js";
11
12
  interface SimStepFunctionsProperties {
12
13
  readonly accountRegionScope?: SimAwsAccountRegionScope;
14
+ readonly iam?: SimIamInterServiceAuthZ;
13
15
  readonly background?: BackgroundScheduler;
14
16
  /**
15
17
  * Where a `Task` state does its work. A simulated Step Functions built on
@@ -31,6 +33,10 @@ interface SimStepFunctionsProperties {
31
33
  * `Task`, `Choice`, `Wait`, `Succeed` and `Fail`, and a definition using any
32
34
  * other is refused by name.
33
35
  *
36
+ * Creating and deleting a state machine are decided by simulated IAM. The
37
+ * other operations here are not. A caller an account would refuse still
38
+ * reaches those.
39
+ *
34
40
  * An execution runs on the simulation's background scheduler rather than in
35
41
  * the `StartExecution` call. An execution with nothing to wait for settles
36
42
  * before the caller sees it. A failing execution records the failure and never
@@ -52,13 +58,13 @@ export declare class SimStepFunctions {
52
58
  */
53
59
  inspection(): SimStepFunctionsInspection;
54
60
  /** Handle a CreateStateMachine Command from the SDK. */
55
- createStateMachine(command: simStatesCommands.SimCreateStateMachineCommand, _options?: SimStepFunctionsRequestOptions): Promise<simStatesCommands.SimCreateStateMachineCommandOutput>;
61
+ createStateMachine(command: simStatesCommands.SimCreateStateMachineCommand, options?: SimStepFunctionsRequestOptions): Promise<simStatesCommands.SimCreateStateMachineCommandOutput>;
56
62
  /** Handle a DescribeStateMachine Command from the SDK. */
57
63
  describeStateMachine(command: simStatesCommands.SimDescribeStateMachineCommand, _options?: SimStepFunctionsRequestOptions): Promise<simStatesCommands.SimDescribeStateMachineCommandOutput>;
58
64
  /** Handle an UpdateStateMachine Command from the SDK. */
59
65
  updateStateMachine(command: simStatesCommands.SimUpdateStateMachineCommand, _options?: SimStepFunctionsRequestOptions): Promise<simStatesCommands.SimUpdateStateMachineCommandOutput>;
60
66
  /** Handle a DeleteStateMachine Command from the SDK. */
61
- deleteStateMachine(command: simStatesCommands.SimDeleteStateMachineCommand, _options?: SimStepFunctionsRequestOptions): Promise<simStatesCommands.SimDeleteStateMachineCommandOutput>;
67
+ deleteStateMachine(command: simStatesCommands.SimDeleteStateMachineCommand, options?: SimStepFunctionsRequestOptions): Promise<simStatesCommands.SimDeleteStateMachineCommandOutput>;
62
68
  /** Handle a ListStateMachines Command from the SDK. */
63
69
  listStateMachines(command: simStatesCommands.SimListStateMachinesCommand, _options?: SimStepFunctionsRequestOptions): Promise<simStatesCommands.SimListStateMachinesCommandOutput>;
64
70
  /** Handle a TagResource Command from the SDK. */
@@ -1,10 +1,13 @@
1
1
  import { BackgroundTasks, } from "../../util/background/background.js";
2
2
  import { simAwsAccountRegionScopeFactory } from "../aws/sim-aws-account-region-scope.factory.js";
3
+ import { simIamInRegion } from "../iam/authorize/sim-iam-region-auth-z.js";
4
+ import { SimStepFunctionsAuthorizer } from "./command/authorize/sim-step-functions-authorizer.js";
3
5
  import { SimStatesExecutionDescribe } from "./command/execution/sim-states-execution-describe.js";
4
6
  import { SimStatesExecutionStart } from "./command/execution/sim-states-execution-start.js";
5
7
  import { SimStateMachineCreate } from "./command/machine/sim-state-machine-create.js";
6
8
  import { SimStateMachineReads } from "./command/machine/sim-state-machine-reads.js";
7
- import { SimStateMachineWrites } from "./command/machine/sim-state-machine-writes.js";
9
+ import { SimStateMachineDelete } from "./command/machine/sim-state-machine-delete.js";
10
+ import { SimStateMachineUpdate } from "./command/machine/sim-state-machine-update.js";
8
11
  import { SimStateMachineTagCommands } from "./command/tag/sim-state-machine-tag-commands.js";
9
12
  import { SimStatesNoDefinitionStore, } from "./definition/store/sim-states-definition-store.js";
10
13
  import { SimStatesExecutionStore } from "./execution/sim-states-execution-store.js";
@@ -22,6 +25,10 @@ import { SimStepFunctionsInspection } from "./sim-step-functions-inspection.js";
22
25
  * `Task`, `Choice`, `Wait`, `Succeed` and `Fail`, and a definition using any
23
26
  * other is refused by name.
24
27
  *
28
+ * Creating and deleting a state machine are decided by simulated IAM. The
29
+ * other operations here are not. A caller an account would refuse still
30
+ * reaches those.
31
+ *
25
32
  * An execution runs on the simulation's background scheduler rather than in
26
33
  * the `StartExecution` call. An execution with nothing to wait for settles
27
34
  * before the caller sees it. A failing execution records the failure and never
@@ -32,7 +39,8 @@ export class SimStepFunctions {
32
39
  #stateMachines = new SimStateMachineStore();
33
40
  #executions = new SimStatesExecutionStore();
34
41
  #machineReads;
35
- #machineWrites;
42
+ #machineUpdate;
43
+ #machineDelete;
36
44
  #machineCreate;
37
45
  #executionStart;
38
46
  #executionDescribe;
@@ -43,19 +51,28 @@ export class SimStepFunctions {
43
51
  #inspection = new SimStepFunctionsInspection(this.#executions);
44
52
  constructor(properties = {}) {
45
53
  const { accountRegionScope = simAwsAccountRegionScopeFactory.make(), background = new BackgroundTasks(), taskTargets = new SimStatesNoTaskTargets(), definitions = new SimStatesNoDefinitionStore(), } = properties;
54
+ const authorizer = new SimStepFunctionsAuthorizer({
55
+ iam: simIamInRegion(properties.iam, accountRegionScope.regionName),
56
+ accountRegionScope,
57
+ });
46
58
  this.#background = background;
47
59
  this.#cfnFactory = new SimStepFunctionsCfnResourceFactory({
48
60
  stepFunctions: this,
49
61
  definitions,
50
62
  });
51
63
  this.#machineReads = new SimStateMachineReads(this.#stateMachines);
52
- this.#machineWrites = new SimStateMachineWrites({
64
+ this.#machineUpdate = new SimStateMachineUpdate({
53
65
  stateMachines: this.#stateMachines,
54
- executions: this.#executions,
55
66
  background,
56
67
  });
68
+ this.#machineDelete = new SimStateMachineDelete({
69
+ stateMachines: this.#stateMachines,
70
+ authorizer,
71
+ executions: this.#executions,
72
+ });
57
73
  this.#machineCreate = new SimStateMachineCreate({
58
74
  stateMachines: this.#stateMachines,
75
+ authorizer,
59
76
  accountRegionScope,
60
77
  background,
61
78
  });
@@ -84,9 +101,9 @@ export class SimStepFunctions {
84
101
  return this.#inspection;
85
102
  }
86
103
  /** Handle a CreateStateMachine Command from the SDK. */
87
- async createStateMachine(command, _options) {
104
+ async createStateMachine(command, options) {
88
105
  await this.#background.sequence();
89
- return this.#machineCreate.handle(command);
106
+ return this.#machineCreate.handle(command, options);
90
107
  }
91
108
  /** Handle a DescribeStateMachine Command from the SDK. */
92
109
  async describeStateMachine(command, _options) {
@@ -96,12 +113,12 @@ export class SimStepFunctions {
96
113
  /** Handle an UpdateStateMachine Command from the SDK. */
97
114
  async updateStateMachine(command, _options) {
98
115
  await this.#background.sequence();
99
- return this.#machineWrites.update(command);
116
+ return this.#machineUpdate.handle(command);
100
117
  }
101
118
  /** Handle a DeleteStateMachine Command from the SDK. */
102
- async deleteStateMachine(command, _options) {
119
+ async deleteStateMachine(command, options) {
103
120
  await this.#background.sequence();
104
- return this.#machineWrites.delete(command);
121
+ return this.#machineDelete.handle(command, options);
105
122
  }
106
123
  /** Handle a ListStateMachines Command from the SDK. */
107
124
  async listStateMachines(command, _options) {