@kensio/yulin 1.20.17 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/service/athena/engine/sim-athena-comparison-shims.d.ts +13 -0
  2. package/dist/service/athena/engine/sim-athena-comparison-shims.js +68 -0
  3. package/dist/service/athena/engine/sim-athena-shims.js +2 -0
  4. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cfn-value-adapter.js +8 -0
  5. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-orp-cfn.d.ts +24 -0
  6. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-orp-cfn.js +31 -0
  7. package/dist/service/cloudfront/behaviour/sim-cloud-front-behavior.d.ts +12 -1
  8. package/dist/service/cloudfront/cache/sim-cf-accept-encoding.d.ts +11 -0
  9. package/dist/service/cloudfront/cache/sim-cf-accept-encoding.js +27 -0
  10. package/dist/service/cloudfront/cache/sim-cf-cache-control.d.ts +28 -0
  11. package/dist/service/cloudfront/cache/sim-cf-cache-control.js +49 -0
  12. package/dist/service/cloudfront/cache/sim-cf-cache-entry-key-path.d.ts +11 -0
  13. package/dist/service/cloudfront/cache/sim-cf-cache-entry-key-path.js +22 -0
  14. package/dist/service/cloudfront/cache/sim-cf-cache-entry-key.d.ts +32 -0
  15. package/dist/service/cloudfront/cache/sim-cf-cache-entry-key.js +112 -0
  16. package/dist/service/cloudfront/cache/sim-cf-cache-status.d.ts +27 -0
  17. package/dist/service/cloudfront/cache/sim-cf-cache-status.js +53 -0
  18. package/dist/service/cloudfront/cache/sim-cf-cache-ttl.d.ts +28 -0
  19. package/dist/service/cloudfront/cache/sim-cf-cache-ttl.js +50 -0
  20. package/dist/service/cloudfront/cache/sim-cf-cacheable-request.d.ts +35 -0
  21. package/dist/service/cloudfront/cache/sim-cf-cacheable-request.js +32 -0
  22. package/dist/service/cloudfront/cache/sim-cf-distribution-cache.d.ts +57 -0
  23. package/dist/service/cloudfront/cache/sim-cf-distribution-cache.js +115 -0
  24. package/dist/service/cloudfront/cache/sim-cf-edge.d.ts +37 -0
  25. package/dist/service/cloudfront/cache/sim-cf-edge.js +34 -0
  26. package/dist/service/cloudfront/cache/sim-cf-error-cache-ttl.d.ts +36 -0
  27. package/dist/service/cloudfront/cache/sim-cf-error-cache-ttl.js +28 -0
  28. package/dist/service/cloudfront/cache/sim-cf-http-date.d.ts +15 -0
  29. package/dist/service/cloudfront/cache/sim-cf-http-date.js +40 -0
  30. package/dist/service/cloudfront/cache-policy/sim-cf-cache-key.d.ts +63 -0
  31. package/dist/service/cloudfront/cache-policy/sim-cf-cache-key.js +70 -0
  32. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.d.ts +13 -3
  33. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.js +31 -3
  34. package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.d.ts +8 -3
  35. package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.js +96 -12
  36. package/dist/service/cloudfront/cff/sim-cff-search-distribution.fixture.js +4 -0
  37. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.d.ts +9 -8
  38. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.js +40 -11
  39. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-key.d.ts +10 -0
  40. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-key.js +50 -0
  41. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-section.d.ts +28 -0
  42. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-section.js +29 -0
  43. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-behavior-policy-kinds.d.ts +16 -0
  44. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-behavior-policy-kinds.js +23 -0
  45. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-behavior-policies.d.ts +3 -2
  46. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-behavior-policies.js +3 -2
  47. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.d.ts +6 -6
  48. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.js +6 -6
  49. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-policy-drops.js +8 -23
  50. package/dist/service/cloudfront/cfn/origin-request-policy/sim-cfn-cf-orp-config.d.ts +28 -0
  51. package/dist/service/cloudfront/cfn/origin-request-policy/sim-cfn-cf-orp-config.js +46 -0
  52. package/dist/service/cloudfront/cfn/origin-request-policy/sim-cfn-cf-orp-creator.d.ts +24 -0
  53. package/dist/service/cloudfront/cfn/origin-request-policy/sim-cfn-cf-orp-creator.js +32 -0
  54. package/dist/service/cloudfront/cfn/origin-request-policy/sim-cfn-cf-orp-forwarding.d.ts +10 -0
  55. package/dist/service/cloudfront/cfn/origin-request-policy/sim-cfn-cf-orp-forwarding.js +51 -0
  56. package/dist/service/cloudfront/cfn/policy/sim-cfn-cf-policy-section.d.ts +22 -0
  57. package/dist/service/cloudfront/cfn/policy/sim-cfn-cf-policy-section.js +54 -0
  58. package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.d.ts +1 -0
  59. package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.js +12 -0
  60. package/dist/service/cloudfront/command/create-distribution/create-distribution.command.d.ts +1 -0
  61. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts +2 -0
  62. package/dist/service/cloudfront/command/invalidation/sim-cf-create-invalidation.d.ts +28 -0
  63. package/dist/service/cloudfront/command/invalidation/sim-cf-create-invalidation.js +59 -0
  64. package/dist/service/cloudfront/command/invalidation/sim-cf-get-invalidation.d.ts +19 -0
  65. package/dist/service/cloudfront/command/invalidation/sim-cf-get-invalidation.js +32 -0
  66. package/dist/service/cloudfront/command/invalidation/sim-cf-invalidation-access.d.ts +36 -0
  67. package/dist/service/cloudfront/command/invalidation/sim-cf-invalidation-access.js +45 -0
  68. package/dist/service/cloudfront/command/invalidation/sim-cf-invalidation-command.types.d.ts +80 -0
  69. package/dist/service/cloudfront/command/invalidation/sim-cf-invalidation-command.types.js +1 -0
  70. package/dist/service/cloudfront/command/invalidation/sim-cf-invalidation-commands.d.ts +39 -0
  71. package/dist/service/cloudfront/command/invalidation/sim-cf-invalidation-commands.js +35 -0
  72. package/dist/service/cloudfront/command/invalidation/sim-cf-list-invalidations.d.ts +23 -0
  73. package/dist/service/cloudfront/command/invalidation/sim-cf-list-invalidations.js +39 -0
  74. package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.d.ts +2 -0
  75. package/dist/service/cloudfront/controller/content/sim-cf-content-stage.d.ts +51 -0
  76. package/dist/service/cloudfront/controller/content/sim-cf-content-stage.js +65 -0
  77. package/dist/service/cloudfront/controller/dependency/sim-cf-controller-dependency.d.ts +2 -3
  78. package/dist/service/cloudfront/controller/dependency/sim-cf-controller-dependency.js +4 -4
  79. package/dist/service/cloudfront/controller/error/sim-cf-custom-error-responder.d.ts +4 -0
  80. package/dist/service/cloudfront/controller/error/sim-cf-custom-error-responder.js +12 -8
  81. package/dist/service/cloudfront/controller/origin/sim-cf-origin-stage.d.ts +2 -2
  82. package/dist/service/cloudfront/controller/origin/sim-cf-origin-stage.js +2 -2
  83. package/dist/service/cloudfront/controller/sim-cloudfront-request-pipeline.d.ts +6 -6
  84. package/dist/service/cloudfront/controller/sim-cloudfront-request-pipeline.js +35 -20
  85. package/dist/service/cloudfront/custom-error/sim-cloudfront-custom-error-response.d.ts +23 -5
  86. package/dist/service/cloudfront/custom-error/sim-cloudfront-custom-error-response.js +8 -0
  87. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-origin-request-policy.d.ts +18 -0
  88. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-origin-request-policy.js +30 -0
  89. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.d.ts +7 -5
  90. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.js +8 -5
  91. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.js +4 -1
  92. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.d.ts +2 -0
  93. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.js +6 -2
  94. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-custom-error-configurator.d.ts +13 -3
  95. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-custom-error-configurator.js +27 -6
  96. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-origin-configurator.d.ts +3 -1
  97. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-origin-configurator.js +4 -1
  98. package/dist/service/cloudfront/distribution/sim-cf-distribution-configuration-state.d.ts +5 -3
  99. package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.d.ts +2 -0
  100. package/dist/service/cloudfront/distribution/sim-cf-distribution-view.js +1 -1
  101. package/dist/service/cloudfront/distribution/sim-cloudfront-distribution.d.ts +25 -2
  102. package/dist/service/cloudfront/distribution/sim-cloudfront-distribution.js +24 -0
  103. package/dist/service/cloudfront/error/sim-cf-invalidation.error.d.ts +22 -0
  104. package/dist/service/cloudfront/error/sim-cf-invalidation.error.js +26 -0
  105. package/dist/service/cloudfront/error/sim-cf-origin-request-policy.error.d.ts +22 -0
  106. package/dist/service/cloudfront/error/sim-cf-origin-request-policy.error.js +26 -0
  107. package/dist/service/cloudfront/index.d.ts +2 -0
  108. package/dist/service/cloudfront/index.js +1 -0
  109. package/dist/service/cloudfront/invalidation/sim-cf-invalidation-path.d.ts +22 -0
  110. package/dist/service/cloudfront/invalidation/sim-cf-invalidation-path.js +32 -0
  111. package/dist/service/cloudfront/invalidation/sim-cf-invalidation-view.d.ts +43 -0
  112. package/dist/service/cloudfront/invalidation/sim-cf-invalidation-view.js +33 -0
  113. package/dist/service/cloudfront/invalidation/sim-cf-invalidation.d.ts +55 -0
  114. package/dist/service/cloudfront/invalidation/sim-cf-invalidation.js +56 -0
  115. package/dist/service/cloudfront/invalidation/sim-cf-invalidations.d.ts +41 -0
  116. package/dist/service/cloudfront/invalidation/sim-cf-invalidations.js +58 -0
  117. package/dist/service/cloudfront/invalidation/sim-cf-repeated-invalidation.d.ts +15 -0
  118. package/dist/service/cloudfront/invalidation/sim-cf-repeated-invalidation.js +23 -0
  119. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-forwarding.d.ts +19 -0
  120. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-forwarding.js +116 -0
  121. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.d.ts +15 -5
  122. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.js +13 -8
  123. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-signer.js +8 -5
  124. package/dist/service/cloudfront/origin/custom/sim-cloudfront-custom-origin.d.ts +13 -0
  125. package/dist/service/cloudfront/origin/custom/sim-cloudfront-custom-origin.js +8 -0
  126. package/dist/service/cloudfront/origin-request-policy/sim-cf-behavior-forwarded.d.ts +24 -0
  127. package/dist/service/cloudfront/origin-request-policy/sim-cf-behavior-forwarded.js +21 -0
  128. package/dist/service/cloudfront/origin-request-policy/sim-cf-forwarded-to-origin.d.ts +57 -0
  129. package/dist/service/cloudfront/origin-request-policy/sim-cf-forwarded-to-origin.js +129 -0
  130. package/dist/service/cloudfront/origin-request-policy/sim-cf-managed-origin-request-policies.d.ts +30 -0
  131. package/dist/service/cloudfront/origin-request-policy/sim-cf-managed-origin-request-policies.js +121 -0
  132. package/dist/service/cloudfront/origin-request-policy/sim-cf-origin-request-forwarding.d.ts +56 -0
  133. package/dist/service/cloudfront/origin-request-policy/sim-cf-origin-request-forwarding.js +67 -0
  134. package/dist/service/cloudfront/origin-request-policy/sim-cf-origin-request-policy-registry.d.ts +38 -0
  135. package/dist/service/cloudfront/origin-request-policy/sim-cf-origin-request-policy-registry.js +51 -0
  136. package/dist/service/cloudfront/origin-request-policy/sim-cf-origin-request-policy.d.ts +32 -0
  137. package/dist/service/cloudfront/origin-request-policy/sim-cf-origin-request-policy.js +30 -0
  138. package/dist/service/cloudfront/registry/sim-cloud-front-registry.d.ts +25 -0
  139. package/dist/service/cloudfront/registry/sim-cloud-front-registry.js +23 -0
  140. package/dist/service/cloudfront/sdk/sim-cloudfront-sdk-command-router.js +12 -0
  141. package/dist/service/cloudfront/sim-cloudfront-caching.d.ts +31 -0
  142. package/dist/service/cloudfront/sim-cloudfront-caching.js +38 -0
  143. package/dist/service/cloudfront/sim-cloudfront-commands.d.ts +12 -0
  144. package/dist/service/cloudfront/sim-cloudfront-commands.js +12 -0
  145. package/dist/service/cloudfront/sim-cloudfront-distributions.d.ts +21 -0
  146. package/dist/service/cloudfront/sim-cloudfront-distributions.js +23 -0
  147. package/dist/service/cloudfront/sim-cloudfront-origin-access-controls.d.ts +30 -0
  148. package/dist/service/cloudfront/sim-cloudfront-origin-access-controls.js +35 -0
  149. package/dist/service/cloudfront/sim-cloudfront-policies.d.ts +22 -5
  150. package/dist/service/cloudfront/sim-cloudfront-policies.js +27 -5
  151. package/dist/service/cloudfront/sim-cloudfront.d.ts +15 -31
  152. package/dist/service/cloudfront/sim-cloudfront.js +23 -41
  153. package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.d.ts +6 -5
  154. package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.js +6 -5
  155. package/dist/service/iam/authorize/context/sim-iam-auth-z-input.d.ts +6 -4
  156. package/dist/service/kms/command/sim-kms-request-options.d.ts +9 -5
  157. package/dist/service/logs/command/delivery/sim-logs-delivery-source-commands.d.ts +6 -4
  158. package/dist/service/logs/command/delivery/sim-logs-delivery-source-commands.js +13 -4
  159. package/dist/service/logs/delivery/cloudfront/sim-logs-vended-log-delivery.d.ts +23 -0
  160. package/dist/service/logs/delivery/cloudfront/sim-logs-vended-log-delivery.js +28 -0
  161. package/dist/service/ssm/parameter/sim-ssm-kms-crypto.d.ts +7 -10
  162. package/dist/service/ssm/parameter/sim-ssm-parameter-kms.d.ts +10 -11
  163. package/dist/service/ssm/parameter/sim-ssm-parameter-kms.js +11 -16
  164. package/docs/services/athena/README.md +7 -1
  165. package/docs/services/cloudformation/README.md +2 -1
  166. package/docs/services/cloudfront/README.md +903 -25
  167. package/docs/services/ecs/README.md +5 -2
  168. package/docs/services/kms/README.md +9 -5
  169. package/docs/services/logs/README.md +6 -0
  170. package/docs/services/ssm/README.md +26 -33
  171. package/package.json +1 -1
@@ -78,10 +78,12 @@ export interface SimIamAuthorizationInput {
78
78
  * resource policy admitting the caller is enough on its own. A service sets
79
79
  * this where it reaches another service as the caller. A resource policy
80
80
  * that admits whoever the request came from then grants nothing by itself,
81
- * because what it admits is the service. Reading a SecureString needs
82
- * kms:Decrypt for that reason, even under the aws/ssm key, whose policy
83
- * admits the Account's principals reaching KMS through Parameter Store. A
84
- * resource policy naming the caller still allows the request on its own.
81
+ * because what it admits is the service. A resource policy naming the caller
82
+ * still allows the request on its own.
83
+ *
84
+ * No simulated service sets this. Parameter Store is the case it was written
85
+ * for, and the aws/ssm key policy grants its cryptographic actions to a
86
+ * wildcard principal outright.
85
87
  */
86
88
  readonly withCallerPermissions?: boolean | undefined;
87
89
  }
@@ -24,11 +24,15 @@ export interface SimKmsRequestOptions {
24
24
  * Whether the service named by `viaService` is making the request with the
25
25
  * caller's own KMS permissions rather than with its own.
26
26
  *
27
- * Parameter Store decrypts a SecureString this way. A caller holding
28
- * ssm:GetParameter and no kms:Decrypt is refused even under the aws/ssm key,
29
- * whose policy admits the Account's principals reaching KMS through Systems
30
- * Manager. A key policy naming the caller still allows the request on its
31
- * own, as it does for any other KMS request.
27
+ * A key policy admitting whoever the request came from then grants nothing
28
+ * by itself, because what it admits is the service, and the caller has to
29
+ * hold the KMS action in an identity policy as well. A key policy naming the
30
+ * caller still allows the request on its own, as it does for any other KMS
31
+ * request.
32
+ *
33
+ * No simulated service sets this. Parameter Store is the case it was written
34
+ * for, and the aws/ssm key policy grants its cryptographic actions to a
35
+ * wildcard principal outright.
32
36
  */
33
37
  readonly withCallerPermissions?: boolean | undefined;
34
38
  }
@@ -22,10 +22,12 @@ export declare class SimLogsDeliverySourceCommands {
22
22
  * Put a delivery source over a resource whose logs are to be delivered.
23
23
  *
24
24
  * The service is read from the resource ARN, as real CloudWatch Logs reads
25
- * it, and the region the request was made in has to be one that service's
26
- * delivery can be set up from. The ARN is then resolved to a resource the
27
- * account holds. A source over a distribution the account never created
28
- * fails here, ahead of the delivery that would have carried nothing.
25
+ * it. The caller is then checked against that service as well, because
26
+ * delivering a resource's logs is a permission the service owning it holds.
27
+ * The region the request was made in has to be one that service's delivery
28
+ * can be set up from, and the ARN is then resolved to a resource the account
29
+ * holds. A source over a distribution the account never created fails here,
30
+ * ahead of the delivery that would have carried nothing.
29
31
  */
30
32
  putDeliverySource(command: SimPutDeliverySourceCommand, options?: SimLogsRequestOptions): SimPutDeliverySourceCommandOutput;
31
33
  /**
@@ -1,3 +1,4 @@
1
+ import { authorizeSimLogsVendedLogDelivery } from "../../delivery/cloudfront/sim-logs-vended-log-delivery.js";
1
2
  import { simLogsAnyDeliverySourceArn, simLogsDeliverySourceArn, } from "../../delivery/sim-logs-delivery-arn.js";
2
3
  import { requireSimLogsDeliverySource, requiredSimLogsDeliveredService, } from "../../delivery/sim-logs-delivery-source-service.js";
3
4
  import { SimLogsDeliverySource } from "../../delivery/sim-logs-delivery-source.js";
@@ -28,10 +29,12 @@ export class SimLogsDeliverySourceCommands {
28
29
  * Put a delivery source over a resource whose logs are to be delivered.
29
30
  *
30
31
  * The service is read from the resource ARN, as real CloudWatch Logs reads
31
- * it, and the region the request was made in has to be one that service's
32
- * delivery can be set up from. The ARN is then resolved to a resource the
33
- * account holds. A source over a distribution the account never created
34
- * fails here, ahead of the delivery that would have carried nothing.
32
+ * it. The caller is then checked against that service as well, because
33
+ * delivering a resource's logs is a permission the service owning it holds.
34
+ * The region the request was made in has to be one that service's delivery
35
+ * can be set up from, and the ARN is then resolved to a resource the account
36
+ * holds. A source over a distribution the account never created fails here,
37
+ * ahead of the delivery that would have carried nothing.
35
38
  */
36
39
  putDeliverySource(command, options) {
37
40
  const input = command.input;
@@ -41,6 +44,12 @@ export class SimLogsDeliverySourceCommands {
41
44
  refuseUnsimulatedDeliveryTags(input.tags, "PutDeliverySource");
42
45
  this.#authorizer.authorizeResource("logs:PutDeliverySource", simLogsDeliverySourceArn(this.#scope, name), options?.caller);
43
46
  const service = requiredSimLogsDeliveredService(resourceArn);
47
+ authorizeSimLogsVendedLogDelivery({
48
+ authorizer: this.#authorizer,
49
+ service,
50
+ resourceArn,
51
+ caller: options?.caller,
52
+ });
44
53
  requireSimLogsDeliverySource({
45
54
  service,
46
55
  regionName: this.#scope.regionName,
@@ -0,0 +1,23 @@
1
+ import type { SimAwsCaller } from "../../../aws/caller/sim-aws-caller.js";
2
+ import type { SimLogsAuthorizer } from "../../command/authorize/sim-logs-authorizer.js";
3
+ interface SimLogsVendedLogDeliveryAuthorization {
4
+ readonly authorizer: SimLogsAuthorizer;
5
+ readonly service: string;
6
+ readonly resourceArn: string;
7
+ readonly caller?: SimAwsCaller | undefined;
8
+ }
9
+ /**
10
+ * Authorize delivering the logs of the resource a delivery source names.
11
+ *
12
+ * Creating a delivery source calls CloudWatch Logs, and CloudWatch Logs then
13
+ * checks the caller against the service that owns the resource being logged.
14
+ * A policy is usually written by asking which service owns the resource type,
15
+ * and that question gives the wrong answer here. A caller allowed every
16
+ * `logs:` action and denied CloudFront outright is refused.
17
+ *
18
+ * CloudFront is the one delivered service checked, because it is the one the
19
+ * simulation can name a resource of. A source over an ARN of any other service
20
+ * carries on as it always did.
21
+ */
22
+ export declare function authorizeSimLogsVendedLogDelivery(properties: SimLogsVendedLogDeliveryAuthorization): void;
23
+ export {};
@@ -0,0 +1,28 @@
1
+ import { simLogsCloudFrontDeliveryService } from "../sim-logs-delivery-source-service.js";
2
+ /**
3
+ * The CloudFront action a delivery source over a distribution is checked for.
4
+ *
5
+ * CloudFront names it and nobody calls it. It exists so that setting up
6
+ * delivery from a distribution is a permission of its own, held apart from
7
+ * everything else a caller may do to that distribution.
8
+ */
9
+ const simLogsVendedLogDeliveryAction = "cloudfront:AllowVendedLogDeliveryForResource";
10
+ /**
11
+ * Authorize delivering the logs of the resource a delivery source names.
12
+ *
13
+ * Creating a delivery source calls CloudWatch Logs, and CloudWatch Logs then
14
+ * checks the caller against the service that owns the resource being logged.
15
+ * A policy is usually written by asking which service owns the resource type,
16
+ * and that question gives the wrong answer here. A caller allowed every
17
+ * `logs:` action and denied CloudFront outright is refused.
18
+ *
19
+ * CloudFront is the one delivered service checked, because it is the one the
20
+ * simulation can name a resource of. A source over an ARN of any other service
21
+ * carries on as it always did.
22
+ */
23
+ export function authorizeSimLogsVendedLogDelivery(properties) {
24
+ if (properties.service !== simLogsCloudFrontDeliveryService) {
25
+ return;
26
+ }
27
+ properties.authorizer.authorizeResource(simLogsVendedLogDeliveryAction, properties.resourceArn, properties.caller);
28
+ }
@@ -18,6 +18,10 @@ export declare const ssmDefaultKeyAlias = "alias/aws/ssm";
18
18
  * caller.
19
19
  */
20
20
  export declare const ssmKmsViaService = "ssm";
21
+ interface SimSsmKmsOptions {
22
+ readonly caller?: SimAwsCaller | undefined;
23
+ readonly viaService?: string | undefined;
24
+ }
21
25
  /**
22
26
  * The narrow slice of simulated KMS that SecureString parameters need.
23
27
  *
@@ -32,11 +36,7 @@ export interface SimSsmKmsCrypto {
32
36
  Plaintext?: Uint8Array | undefined;
33
37
  EncryptionContext?: Readonly<Record<string, string>> | undefined;
34
38
  };
35
- }, options?: {
36
- caller?: SimAwsCaller | undefined;
37
- viaService?: string | undefined;
38
- withCallerPermissions?: boolean | undefined;
39
- }): Promise<{
39
+ }, options?: SimSsmKmsOptions): Promise<{
40
40
  CiphertextBlob?: Uint8Array | undefined;
41
41
  KeyId?: string | undefined;
42
42
  }>;
@@ -45,12 +45,9 @@ export interface SimSsmKmsCrypto {
45
45
  CiphertextBlob?: Uint8Array | undefined;
46
46
  EncryptionContext?: Readonly<Record<string, string>> | undefined;
47
47
  };
48
- }, options?: {
49
- caller?: SimAwsCaller | undefined;
50
- viaService?: string | undefined;
51
- withCallerPermissions?: boolean | undefined;
52
- }): Promise<{
48
+ }, options?: SimSsmKmsOptions): Promise<{
53
49
  Plaintext?: Uint8Array | undefined;
54
50
  KeyId?: string | undefined;
55
51
  }>;
56
52
  }
53
+ export {};
@@ -18,15 +18,15 @@ interface SimSsmParameterKmsProperties {
18
18
  * and a decrypting read needs `kms:Decrypt`, each on top of the SSM permission
19
19
  * for the parameter itself.
20
20
  *
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.
21
+ * They are also made through the service, and passing through it is what
22
+ * reaches the `aws/ssm` managed key at all. That key's policy allows the
23
+ * cryptographic actions to a wildcard principal under `kms:ViaService` and
24
+ * `kms:CallerAccount` conditions, and Parameter Store supplies the first of
25
+ * them. A grant of that shape delegates nothing to IAM, and it admits the
26
+ * request by itself. A Role holding `ssm:GetParameter` and nothing on KMS
27
+ * reads the decrypted value, as it does in an account. A caller in another
28
+ * Account fails the `kms:CallerAccount` condition, and a caller reaching KMS
29
+ * directly carries no `kms:ViaService` for the policy to match.
30
30
  *
31
31
  * Standard tier Parameter Store encrypts under the key directly rather than
32
32
  * through a data key, so this is one Encrypt and one Decrypt and nothing more.
@@ -39,8 +39,7 @@ export declare class SimSsmParameterKms {
39
39
  */
40
40
  encrypt(parameterArn: string, plaintext: string, keyId: string | undefined, caller: SimAwsCaller | undefined): Promise<SimSsmParameterCiphertext>;
41
41
  /**
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.
42
+ * Decrypt a parameter value, which needs the same binding it was made with.
44
43
  */
45
44
  decrypt(parameterArn: string, ciphertext: string, caller: SimAwsCaller | undefined): Promise<string>;
46
45
  private contextFor;
@@ -18,15 +18,15 @@ const parameterArnContextKey = "PARAMETER_ARN";
18
18
  * and a decrypting read needs `kms:Decrypt`, each on top of the SSM permission
19
19
  * for the parameter itself.
20
20
  *
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.
21
+ * They are also made through the service, and passing through it is what
22
+ * reaches the `aws/ssm` managed key at all. That key's policy allows the
23
+ * cryptographic actions to a wildcard principal under `kms:ViaService` and
24
+ * `kms:CallerAccount` conditions, and Parameter Store supplies the first of
25
+ * them. A grant of that shape delegates nothing to IAM, and it admits the
26
+ * request by itself. A Role holding `ssm:GetParameter` and nothing on KMS
27
+ * reads the decrypted value, as it does in an account. A caller in another
28
+ * Account fails the `kms:CallerAccount` condition, and a caller reaching KMS
29
+ * directly carries no `kms:ViaService` for the policy to match.
30
30
  *
31
31
  * Standard tier Parameter Store encrypts under the key directly rather than
32
32
  * through a data key, so this is one Encrypt and one Decrypt and nothing more.
@@ -54,8 +54,7 @@ export class SimSsmParameterKms {
54
54
  };
55
55
  }
56
56
  /**
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.
57
+ * Decrypt a parameter value, which needs the same binding it was made with.
59
58
  */
60
59
  async decrypt(parameterArn, ciphertext, caller) {
61
60
  const decrypted = await reportingKeyProblems(async () => await this.kms.decrypt({
@@ -63,11 +62,7 @@ export class SimSsmParameterKms {
63
62
  CiphertextBlob: Buffer.from(ciphertext, "base64"),
64
63
  EncryptionContext: this.contextFor(parameterArn),
65
64
  },
66
- }, {
67
- caller,
68
- viaService: ssmKmsViaService,
69
- withCallerPermissions: true,
70
- }));
65
+ }, { caller, viaService: ssmKmsViaService }));
71
66
  assertDefined(decrypted.Plaintext, `Simulated KMS decrypted ${parameterArn} to nothing`);
72
67
  return Buffer.from(decrypted.Plaintext).toString("utf8");
73
68
  }
@@ -383,10 +383,15 @@ its declared result.
383
383
  | Binary | `md5`, `sha1`, `sha256`, `sha512`, `xxhash64`, `murmur3`, `crc32`, `to_hex`, `from_hex`, `to_base64`, `from_base64`, `to_utf8`, `from_utf8` |
384
384
  | URL | `url_extract_host`, `url_extract_path`, `url_extract_protocol`, `url_extract_port`, `url_extract_query`, `url_extract_fragment`, `url_extract_parameter`, `url_decode`, `url_encode` |
385
385
  | Approximate | `approx_distinct`, `approx_percentile` |
386
+ | Comparison | `least`, `greatest` |
386
387
 
387
388
  `substr` and `format` are SQLite's own. Both count from one and take the same `%s` and `%d` a
388
389
  statement writes, so shadowing either would replace something that works.
389
390
 
391
+ `least` and `greatest` take two arguments or more. Numbers order numerically and text orders by its
392
+ code units, matching SQLite's own `min` and `max` in their wider forms. Trino refuses a call mixing
393
+ the two types and this answers one, ordering everything as text. A `varbinary` argument raises.
394
+
390
395
  The hashing functions answer with bytes and `to_hex` writes those bytes in the upper case Trino
391
396
  writes them in. Node carries every digest here apart from xxHash64 and MurmurHash3, and both of
392
397
  those are written out by hand against their published vectors. Trino refuses text where a
@@ -404,7 +409,8 @@ instant the query started, which is what the execution records.
404
409
 
405
410
  A function that cannot answer faithfully raises rather than guessing, and the query falls back.
406
411
  `date_add` with a unit Trino does not name, `slice` starting at zero, `array_join` over an array of
407
- objects, and `regexp_extract` naming a capture group the pattern has not got all land there. A null
412
+ objects, `least` over a `varbinary`, and `regexp_extract` naming a capture group the pattern has not
413
+ got all land there. A null
408
414
  answer would be a wrong answer wearing the shape of a right one.
409
415
 
410
416
  A function answers null where any argument is null, the way Trino's do. An argument left out takes
@@ -3518,7 +3518,8 @@ The resource types it creates are:
3518
3518
  - `AWS::CertificateManager::Certificate`
3519
3519
  - `AWS::CloudFormation::WaitConditionHandle`
3520
3520
  - `AWS::CloudFront::Distribution`, `AWS::CloudFront::Function`,
3521
- `AWS::CloudFront::ResponseHeadersPolicy` and `AWS::CloudFront::CachePolicy`
3521
+ `AWS::CloudFront::ResponseHeadersPolicy`, `AWS::CloudFront::CachePolicy` and
3522
+ `AWS::CloudFront::OriginRequestPolicy`
3522
3523
  - `AWS::CloudWatch::Alarm`
3523
3524
  - `AWS::Cognito::UserPool`, `AWS::Cognito::UserPoolClient` and
3524
3525
  `AWS::Cognito::UserPoolGroup`