@kensio/yulin 1.20.15 → 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.
- package/README.md +13 -0
- package/dist/sdk/module/sim-sdk-module-client-interceptor.d.ts +5 -0
- package/dist/sdk/module/sim-sdk-module-client-interceptor.js +14 -0
- package/dist/sdk/module/sim-sdk-static-client-factory.d.ts +26 -0
- package/dist/sdk/module/sim-sdk-static-client-factory.js +59 -0
- package/dist/sdk/send-patch.d.ts +8 -0
- package/dist/sdk/send-patch.js +11 -0
- package/dist/service/aws/caller/sim-aws-ambient-caller.d.ts +23 -0
- package/dist/service/aws/caller/sim-aws-ambient-caller.js +12 -0
- package/dist/service/aws/caller/sim-aws-caller-resolver.d.ts +39 -6
- package/dist/service/aws/caller/sim-aws-caller-resolver.js +32 -30
- package/dist/service/aws/caller/sim-aws-caller.d.ts +9 -0
- package/dist/service/aws/caller/sim-aws-resolved-caller.d.ts +19 -0
- package/dist/service/aws/caller/sim-aws-resolved-caller.js +26 -0
- package/dist/service/aws/factory/sim-aws-account-region-service-builder.d.ts +12 -0
- package/dist/service/aws/factory/sim-aws-account-region-service-builder.js +6 -0
- package/dist/service/aws/factory/sim-aws-account-service-cache.d.ts +12 -0
- package/dist/service/aws/factory/sim-aws-account-service-cache.js +9 -0
- package/dist/service/aws/factory/sim-aws-registered-service-builder.js +3 -1
- package/dist/service/aws/factory/sim-aws-service-factory.d.ts +5 -0
- package/dist/service/aws/factory/sim-aws-service-factory.js +14 -0
- package/dist/service/aws/sim-aws-properties.d.ts +15 -0
- package/dist/service/aws/sim-aws.js +2 -1
- package/dist/service/cloudformation/command/create-stack/create-stack.handler.d.ts +4 -0
- package/dist/service/cloudformation/command/create-stack/create-stack.handler.js +4 -1
- package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-deployer.js +2 -1
- package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.d.ts +11 -2
- package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.js +2 -1
- package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-stack-options.d.ts +6 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.d.ts +11 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.js +17 -15
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.d.ts +12 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.js +2 -1
- package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cache-policy-cfn.d.ts +23 -0
- package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cache-policy-cfn.js +30 -0
- package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cfn-value-adapter.js +8 -0
- package/dist/service/cloudformation/resource/name/sim-cfn-generated-resource-name.d.ts +29 -12
- package/dist/service/cloudformation/resource/name/sim-cfn-generated-resource-name.js +51 -20
- package/dist/service/cloudformation/stack/deploy/sim-cfn-resource-order.d.ts +19 -0
- package/dist/service/cloudformation/stack/deploy/sim-cfn-resource-order.js +6 -0
- package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-batch-creator.d.ts +7 -0
- package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-batch-creator.js +9 -2
- package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-creator.d.ts +2 -0
- package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-creator.js +2 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.d.ts +6 -0
- package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.js +4 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack.js +2 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack.type.d.ts +6 -0
- package/dist/service/cloudfront/behaviour/sim-cloud-front-behavior.d.ts +5 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy-registry.d.ts +37 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy-registry.js +50 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.d.ts +25 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.js +21 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.d.ts +28 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.js +48 -0
- package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.d.ts +8 -0
- package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.js +13 -0
- package/dist/service/cloudfront/cff/sim-cf-function-commands.d.ts +52 -0
- package/dist/service/cloudfront/cff/sim-cf-function-commands.js +51 -0
- package/dist/service/cloudfront/cff/sim-cff-configuration.d.ts +41 -0
- package/dist/service/cloudfront/cff/sim-cff-configuration.js +34 -0
- package/dist/service/cloudfront/cff/sim-cff-stage.d.ts +23 -0
- package/dist/service/cloudfront/cff/sim-cff-stage.js +30 -0
- package/dist/service/cloudfront/cff/sim-cloudfront-function.d.ts +6 -1
- package/dist/service/cloudfront/cff/sim-cloudfront-function.js +6 -0
- package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.d.ts +27 -0
- package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.js +42 -0
- package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-creator.d.ts +24 -0
- package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-creator.js +32 -0
- 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
- package/dist/service/cloudfront/cfn/distro/{sim-cfn-cf-distro-response-headers-policy.js → sim-cfn-cf-distro-behavior-policies.js} +11 -37
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.d.ts +6 -5
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.js +8 -7
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-policy-drops.d.ts +23 -0
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-policy-drops.js +50 -0
- package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.d.ts +1 -0
- package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.js +10 -0
- package/dist/service/cloudfront/command/create-distribution/create-distribution.command.d.ts +1 -0
- package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts +2 -0
- package/dist/service/cloudfront/command/create-function/create-function.handler.js +7 -1
- package/dist/service/cloudfront/command/function/sim-cf-describe-function.d.ts +22 -0
- package/dist/service/cloudfront/command/function/sim-cf-describe-function.js +32 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-access.d.ts +48 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-access.js +48 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-command.types.d.ts +97 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-command.types.js +10 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-lookup.d.ts +12 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-lookup.js +21 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-summary.d.ts +11 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-summary.js +30 -0
- package/dist/service/cloudfront/command/function/sim-cf-get-function.d.ts +23 -0
- package/dist/service/cloudfront/command/function/sim-cf-get-function.js +33 -0
- package/dist/service/cloudfront/command/function/sim-cf-list-functions.d.ts +22 -0
- package/dist/service/cloudfront/command/function/sim-cf-list-functions.js +38 -0
- package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.d.ts +2 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-cache-policy.d.ts +18 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-cache-policy.js +30 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.d.ts +28 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.js +41 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.d.ts +2 -2
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.js +6 -3
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.d.ts +0 -10
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.js +0 -19
- package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.d.ts +2 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.js +4 -2
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.d.ts +3 -3
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.js +5 -5
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.d.ts +3 -3
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.js +4 -4
- package/dist/service/cloudfront/distribution/sim-cf-distribution-configuration-state.d.ts +3 -1
- package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.d.ts +2 -0
- package/dist/service/cloudfront/error/sim-cloudfront.error.d.ts +21 -0
- package/dist/service/cloudfront/error/sim-cloudfront.error.js +25 -0
- package/dist/service/cloudfront/key-value-store/sim-cf-key-value-store-access.js +2 -10
- package/dist/service/cloudfront/key-value-store/sim-cf-key-value-store.js +2 -1
- package/dist/service/cloudfront/sdk/sim-cloudfront-sdk-command-router.js +12 -0
- package/dist/service/cloudfront/sim-cf-authorize.d.ts +16 -0
- package/dist/service/cloudfront/sim-cf-authorize.js +19 -0
- package/dist/service/cloudfront/sim-cf-etag.d.ts +7 -0
- package/dist/service/cloudfront/sim-cf-etag.js +10 -0
- package/dist/service/cloudfront/sim-cloudfront-commands.d.ts +8 -12
- package/dist/service/cloudfront/sim-cloudfront-commands.js +8 -17
- package/dist/service/cloudfront/sim-cloudfront-policies.d.ts +43 -0
- package/dist/service/cloudfront/sim-cloudfront-policies.js +53 -0
- package/dist/service/cloudfront/sim-cloudfront.d.ts +13 -17
- package/dist/service/cloudfront/sim-cloudfront.js +22 -25
- package/dist/service/ecr/authorize/sim-ecr-authorizer.d.ts +31 -0
- package/dist/service/ecr/authorize/sim-ecr-authorizer.js +38 -0
- package/dist/service/ecr/cfn/repository/sim-cfn-ecr-repository-creator.d.ts +11 -2
- package/dist/service/ecr/cfn/repository/sim-cfn-ecr-repository-creator.js +11 -2
- package/dist/service/ecr/cfn/sim-ecr-cfn-resource-factory.d.ts +4 -2
- package/dist/service/ecr/cfn/sim-ecr-cfn-resource-factory.js +8 -9
- package/dist/service/ecr/cfn/sim-ecr-cfn-unsupported-resource.d.ts +7 -0
- package/dist/service/ecr/cfn/sim-ecr-cfn-unsupported-resource.js +9 -0
- package/dist/service/ecr/sim-ecr.d.ts +7 -0
- package/dist/service/ecr/sim-ecr.js +16 -4
- package/dist/service/ecs/command/authorize/sim-ecs-authorizer.d.ts +12 -0
- package/dist/service/ecs/command/authorize/sim-ecs-authorizer.js +21 -0
- package/dist/service/ecs/command/register-task-definition/register-task-definition.handler.js +1 -0
- package/dist/service/ecs/sim-ecs-service-principal.d.ts +8 -0
- package/dist/service/ecs/sim-ecs-service-principal.js +8 -0
- package/dist/service/eventbridge/command/authorize/sim-event-bridge-authorizer.d.ts +12 -0
- package/dist/service/eventbridge/command/authorize/sim-event-bridge-authorizer.js +21 -0
- package/dist/service/eventbridge/command/rule/sim-event-bridge-rule-access.d.ts +13 -0
- package/dist/service/eventbridge/command/rule/sim-event-bridge-rule-access.js +9 -0
- package/dist/service/eventbridge/command/target/sim-event-bridge-put-targets.js +1 -0
- package/dist/service/firehose/command/authorize/sim-firehose-authorizer.d.ts +12 -0
- package/dist/service/firehose/command/authorize/sim-firehose-authorizer.js +20 -0
- package/dist/service/firehose/command/sim-firehose-delivery-stream-access.d.ts +4 -0
- package/dist/service/firehose/command/sim-firehose-delivery-stream-access.js +6 -0
- package/dist/service/firehose/command/stream/sim-firehose-create-delivery-stream.js +3 -1
- package/dist/service/firehose/sim-firehose-service-principal.d.ts +8 -0
- package/dist/service/firehose/sim-firehose-service-principal.js +8 -0
- package/dist/service/firehose/source/sim-firehose-source.d.ts +5 -0
- package/dist/service/firehose/source/sim-firehose-source.js +5 -0
- package/dist/service/glue/cfn/database/sim-cfn-glue-database-properties.js +2 -2
- package/dist/service/glue/cfn/sim-cfn-glue-generated-name.d.ts +10 -0
- package/dist/service/glue/cfn/sim-cfn-glue-generated-name.js +25 -0
- package/dist/service/glue/cfn/table/sim-cfn-glue-table-properties.js +2 -3
- package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.d.ts +33 -2
- package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.js +33 -2
- package/dist/service/iam/authorize/allow/sim-iam-allow-statements.d.ts +4 -3
- package/dist/service/iam/authorize/allow/sim-iam-allow-statements.js +9 -3
- package/dist/service/iam/authorize/context/sim-iam-auth-z-allow-requirement.d.ts +14 -5
- package/dist/service/iam/authorize/context/sim-iam-auth-z-allow-requirement.js +16 -12
- package/dist/service/iam/authorize/context/sim-iam-auth-z-caller-context-builder.d.ts +36 -7
- package/dist/service/iam/authorize/context/sim-iam-auth-z-caller-context-builder.js +22 -11
- package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.d.ts +10 -71
- package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.js +7 -2
- package/dist/service/iam/authorize/context/sim-iam-auth-z-input.d.ts +87 -0
- package/dist/service/iam/authorize/context/sim-iam-auth-z-input.js +1 -0
- package/dist/service/iam/authorize/match/sim-iam-policy-principal-matcher.d.ts +21 -3
- package/dist/service/iam/authorize/match/sim-iam-policy-principal-matcher.js +34 -10
- package/dist/service/iam/authorize/match/sim-iam-principal-match.d.ts +29 -8
- package/dist/service/iam/authorize/match/sim-iam-principal-match.js +38 -13
- package/dist/service/iam/authorize/pass-role/sim-iam-pass-role-authorizer.d.ts +74 -0
- package/dist/service/iam/authorize/pass-role/sim-iam-pass-role-authorizer.js +92 -0
- package/dist/service/iam/authorize/sim-iam-account-auth-z.d.ts +21 -5
- package/dist/service/iam/authorize/sim-iam-account-auth-z.js +7 -3
- package/dist/service/iam/authorize/sim-iam-authorizer.d.ts +5 -2
- package/dist/service/iam/authorize/sim-iam-authorizer.js +3 -1
- package/dist/service/iam/authorize/sim-iam-inter-service-auth-z.d.ts +1 -1
- package/dist/service/iam/authorize/sim-iam-wildcard.js +39 -4
- package/dist/service/iam/cfn/managed-policy/sim-cfn-iam-managed-policy-creator.js +2 -1
- package/dist/service/iam/cfn/name/sim-cfn-iam-generated-name.d.ts +16 -0
- package/dist/service/iam/cfn/name/sim-cfn-iam-generated-name.js +36 -0
- package/dist/service/iam/cfn/role/sim-cfn-iam-role-properties-parser.js +9 -8
- package/dist/service/iam/cfn/sim-cfn-iam-optional-string.d.ts +17 -0
- package/dist/service/iam/cfn/sim-cfn-iam-optional-string.js +17 -0
- package/dist/service/iam/cfn/user/sim-cfn-iam-user-properties-parser.js +4 -8
- package/dist/service/iam/command/policy/create-policy/create-policy-input-resolver.js +2 -0
- package/dist/service/iam/command/policy/put-role-policy/put-role-policy.handler.js +5 -0
- package/dist/service/iam/command/policy/put-user-policy/put-user-policy.handler.js +5 -0
- package/dist/service/iam/command/role/create-role/create-role.handler.js +4 -1
- package/dist/service/iam/error/sim-iam.error.d.ts +11 -0
- package/dist/service/iam/error/sim-iam.error.js +13 -0
- package/dist/service/iam/index.d.ts +1 -0
- package/dist/service/iam/policy/sim-iam-policy-document-of-size.d.ts +18 -0
- package/dist/service/iam/policy/sim-iam-policy-document-of-size.js +41 -0
- package/dist/service/iam/role/sim-iam-deploy-role.d.ts +56 -0
- package/dist/service/iam/role/sim-iam-deploy-role.js +50 -0
- package/dist/service/iam/role/sim-iam-role-with-policy.factory.d.ts +11 -0
- package/dist/service/iam/role/sim-iam-role-with-policy.factory.js +4 -2
- package/dist/service/iam/sim-iam-account-parts.d.ts +16 -0
- package/dist/service/iam/sim-iam-account-parts.js +2 -0
- package/dist/service/iam/sim-iam.d.ts +12 -2
- package/dist/service/iam/sim-iam.js +12 -0
- package/dist/service/iam/validate/size/sim-iam-policy-document-size.d.ts +57 -0
- package/dist/service/iam/validate/size/sim-iam-policy-document-size.js +71 -0
- package/dist/service/kms/command/authorize/sim-kms-authorizer.d.ts +3 -1
- package/dist/service/kms/command/authorize/sim-kms-authorizer.js +4 -1
- package/dist/service/kms/command/sim-kms-request-options.d.ts +11 -0
- package/dist/service/kms/key/sim-kms-key-policy.d.ts +5 -4
- package/dist/service/kms/key/sim-kms-key-policy.js +4 -3
- package/dist/service/lambda/cfn/function/sim-cfn-lambda-function-properties-parser.d.ts +2 -2
- package/dist/service/lambda/cfn/function/sim-cfn-lambda-function-properties-parser.js +4 -3
- package/dist/service/lambda/cfn/function/sim-cfn-lambda-generated-function-name.d.ts +10 -0
- package/dist/service/lambda/cfn/function/sim-cfn-lambda-generated-function-name.js +25 -0
- package/dist/service/lambda/command/authorize/sim-lambda-resource-policies.d.ts +1 -1
- package/dist/service/lambda/command/create-function/create-function-authorizer.d.ts +9 -2
- package/dist/service/lambda/command/create-function/create-function-authorizer.js +16 -2
- package/dist/service/lambda/command/create-function/create-function.handler.js +1 -1
- package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.d.ts +7 -2
- package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.js +14 -2
- package/dist/service/lambda/command/update-function-configuration/update-function-configuration.handler.js +1 -1
- package/dist/service/lambda/function/logging/sim-lambda-function-logging.d.ts +10 -1
- package/dist/service/lambda/function/logging/sim-lambda-function-logging.js +25 -1
- package/dist/service/lambda/function/logging/sim-lambda-invoke-error-log.d.ts +13 -0
- package/dist/service/lambda/function/logging/sim-lambda-invoke-error-log.js +18 -0
- package/dist/service/lambda/sim-lambda-service-principal.d.ts +7 -0
- package/dist/service/lambda/sim-lambda-service-principal.js +7 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-authorization.d.ts +46 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-authorization.js +49 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-creator.d.ts +5 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-creator.js +6 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-destination-creator.d.ts +5 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-destination-creator.js +6 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-source-creator.d.ts +5 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-source-creator.js +6 -0
- package/dist/service/logs/cfn/group/sim-cfn-log-group-creator.d.ts +9 -2
- package/dist/service/logs/cfn/group/sim-cfn-log-group-creator.js +34 -5
- package/dist/service/logs/cfn/sim-logs-cfn-resource-deleter.js +1 -1
- package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.d.ts +4 -0
- package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.js +9 -4
- package/dist/service/logs/sim-logs-commands.d.ts +3 -0
- package/dist/service/logs/sim-logs-commands.js +4 -0
- package/dist/service/logs/sim-logs.js +6 -1
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-creator.d.ts +2 -2
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-creator.js +4 -3
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-generated-name.d.ts +12 -0
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-generated-name.js +22 -0
- package/dist/service/s3/command/authorize/sim-s3-bucket-resource-policies.d.ts +1 -1
- package/dist/service/scheduler/command/authorize/sim-scheduler-authorizer.d.ts +10 -1
- package/dist/service/scheduler/command/authorize/sim-scheduler-authorizer.js +19 -1
- package/dist/service/scheduler/command/schedule/sim-scheduler-create-schedule.js +1 -0
- package/dist/service/scheduler/command/schedule/sim-scheduler-schedule-access.d.ts +8 -0
- package/dist/service/scheduler/command/schedule/sim-scheduler-schedule-access.js +9 -0
- package/dist/service/scheduler/command/schedule/sim-scheduler-update-schedule.js +1 -0
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-generated-name.d.ts +15 -0
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-generated-name.js +22 -0
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-properties.d.ts +4 -10
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-properties.js +13 -31
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-value.d.ts +17 -0
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-value.js +30 -0
- package/dist/service/secretsmanager/secret/sim-secrets-manager-secret-name.d.ts +6 -0
- package/dist/service/secretsmanager/secret/sim-secrets-manager-secret-name.js +8 -3
- package/dist/service/sns/command/authorize/sim-sns-topic-resource-policies.d.ts +1 -1
- package/dist/service/sqs/command/authorize/sim-sqs-queue-resource-policies.d.ts +1 -1
- package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-generated-parameter-name.d.ts +16 -0
- package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-generated-parameter-name.js +23 -0
- package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-parameter-properties.d.ts +2 -4
- package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-parameter-properties.js +5 -5
- package/dist/service/ssm/parameter/sim-ssm-kms-crypto.d.ts +6 -4
- package/dist/service/ssm/parameter/sim-ssm-kms-crypto.js +4 -4
- package/dist/service/ssm/parameter/sim-ssm-parameter-arn.d.ts +17 -0
- package/dist/service/ssm/parameter/sim-ssm-parameter-arn.js +20 -0
- package/dist/service/ssm/parameter/sim-ssm-parameter-kms.d.ts +15 -9
- package/dist/service/ssm/parameter/sim-ssm-parameter-kms.js +20 -10
- package/dist/service/ssm/parameter/sim-ssm-parameter-name.js +3 -12
- package/dist/service/stepfunctions/command/authorize/sim-step-functions-authorizer.d.ts +41 -0
- package/dist/service/stepfunctions/command/authorize/sim-step-functions-authorizer.js +64 -0
- package/dist/service/stepfunctions/command/machine/sim-state-machine-create.d.ts +5 -2
- package/dist/service/stepfunctions/command/machine/sim-state-machine-create.js +6 -2
- package/dist/service/stepfunctions/command/machine/sim-state-machine-delete.d.ts +26 -0
- package/dist/service/stepfunctions/command/machine/sim-state-machine-delete.js +29 -0
- package/dist/service/stepfunctions/command/machine/sim-state-machine-lookup.d.ts +7 -0
- package/dist/service/stepfunctions/command/machine/sim-state-machine-lookup.js +12 -3
- package/dist/service/stepfunctions/command/machine/sim-state-machine-update.d.ts +19 -0
- package/dist/service/stepfunctions/command/machine/{sim-state-machine-writes.js → sim-state-machine-update.js} +3 -14
- package/dist/service/stepfunctions/sim-step-functions.d.ts +8 -2
- package/dist/service/stepfunctions/sim-step-functions.js +26 -9
- package/dist/service/sts/auth-z/assume-role-auth-z-coordinator.d.ts +9 -2
- package/dist/service/sts/auth-z/assume-role-auth-z-coordinator.js +2 -2
- package/dist/service/sts/auth-z/assume-role-source-account-auth-z.d.ts +10 -4
- package/dist/service/sts/auth-z/assume-role-source-account-auth-z.js +8 -7
- package/dist/service/sts/auth-z/assume-role-target-auth-z.d.ts +2 -2
- package/dist/service/sts/auth-z/assume-role-trust-policy-authorizer.d.ts +6 -2
- package/dist/service/sts/auth-z/assume-role-trust-policy-authorizer.js +14 -11
- package/dist/service/sts/command/assume-role/assume-role.handler.d.ts +10 -1
- package/dist/service/sts/command/assume-role/assume-role.handler.js +6 -2
- package/dist/service/sts/command/get-caller-identity/get-caller-identity.handler.d.ts +10 -1
- package/dist/service/sts/command/get-caller-identity/get-caller-identity.handler.js +5 -1
- package/dist/service/sts/service-role/sim-service-role.js +5 -1
- package/dist/service/sts/sim-sts.d.ts +18 -1
- package/dist/service/sts/sim-sts.js +8 -0
- package/dist/util/memo/bounded-memo.d.ts +36 -0
- package/dist/util/memo/bounded-memo.js +58 -0
- package/docs/README.md +54 -0
- package/docs/ai-skill/README.md +69 -0
- package/docs/cli/README.md +284 -0
- package/docs/factories/README.md +140 -0
- package/docs/lint/README.md +176 -0
- package/docs/non-aws-dependencies/README.md +261 -0
- package/docs/sdk/README.md +274 -0
- package/docs/serve/README.md +1126 -0
- package/docs/services/acm/README.md +823 -0
- package/docs/services/apigateway/README.md +1919 -0
- package/docs/services/apigatewayv2/README.md +2678 -0
- package/docs/services/athena/README.md +1044 -0
- package/docs/services/bedrock/README.md +350 -0
- package/docs/services/cloudformation/README.md +3625 -0
- package/docs/services/cloudfront/README.md +3098 -0
- package/docs/services/cloudwatch/README.md +422 -0
- package/docs/services/cognito/README.md +4924 -0
- package/docs/services/dynamodb/README.md +3785 -0
- package/docs/services/ecr/README.md +302 -0
- package/docs/services/ecs/README.md +2021 -0
- package/docs/services/elbv2/README.md +1901 -0
- package/docs/services/eventbridge/README.md +1118 -0
- package/docs/services/firehose/README.md +811 -0
- package/docs/services/glue/README.md +507 -0
- package/docs/services/iam/README.md +1578 -0
- package/docs/services/kinesis/README.md +455 -0
- package/docs/services/kms/README.md +664 -0
- package/docs/services/lambda/README.md +3719 -0
- package/docs/services/logs/README.md +882 -0
- package/docs/services/organizations/README.md +574 -0
- package/docs/services/personalize/README.md +835 -0
- package/docs/services/rekognition/README.md +1070 -0
- package/docs/services/route53/README.md +1783 -0
- package/docs/services/s3/README.md +3029 -0
- package/docs/services/scheduler/README.md +814 -0
- package/docs/services/secretsmanager/README.md +670 -0
- package/docs/services/ses/README.md +1013 -0
- package/docs/services/sns/README.md +1904 -0
- package/docs/services/sqs/README.md +1185 -0
- package/docs/services/ssm/README.md +1096 -0
- package/docs/services/stepfunctions/README.md +1341 -0
- package/docs/services/sts/README.md +245 -0
- package/docs/services/wafv2/README.md +1380 -0
- package/docs/terraform/README.md +248 -0
- package/docs/time/README.md +284 -0
- package/llms.txt +59 -0
- package/package.json +7 -4
- package/dist/service/stepfunctions/command/machine/sim-state-machine-writes.d.ts +0 -25
package/README.md
CHANGED
|
@@ -22,6 +22,8 @@ npm i -D @kensio/yulin
|
|
|
22
22
|
- [ACM](https://yulinsim.dev/services/acm/ "Simulated ACM docs")
|
|
23
23
|
- [API Gateway HTTP APIs](https://yulinsim.dev/services/apigatewayv2/ "Simulated API Gateway HTTP API docs")
|
|
24
24
|
- [API Gateway REST APIs](https://yulinsim.dev/services/apigateway/ "Simulated API Gateway REST API docs")
|
|
25
|
+
- [Athena](https://yulinsim.dev/services/athena/ "Simulated Amazon Athena docs")
|
|
26
|
+
- [Bedrock](https://yulinsim.dev/services/bedrock/ "Simulated Amazon Bedrock docs")
|
|
25
27
|
- [CloudFormation](https://yulinsim.dev/services/cloudformation/ "Simulated CloudFormation docs")
|
|
26
28
|
- [CloudFront](https://yulinsim.dev/services/cloudfront/ "Simulated CloudFront docs")
|
|
27
29
|
- [CloudWatch metrics](https://yulinsim.dev/services/cloudwatch/ "Simulated CloudWatch metrics docs")
|
|
@@ -29,12 +31,16 @@ npm i -D @kensio/yulin
|
|
|
29
31
|
- [DynamoDB](https://yulinsim.dev/services/dynamodb/ "Simulated DynamoDB docs")
|
|
30
32
|
- [ECR](https://yulinsim.dev/services/ecr/ "Simulated ECR docs")
|
|
31
33
|
- [ECS](https://yulinsim.dev/services/ecs/ "Simulated ECS docs")
|
|
34
|
+
- [Elastic Load Balancing](https://yulinsim.dev/services/elbv2/ "Simulated Application Load Balancer docs")
|
|
32
35
|
- [EventBridge](https://yulinsim.dev/services/eventbridge/ "Simulated EventBridge docs")
|
|
33
36
|
- [Glue](https://yulinsim.dev/services/glue/ "Simulated Glue Data Catalog docs")
|
|
34
37
|
- [IAM](https://yulinsim.dev/services/iam/ "Simulated IAM docs")
|
|
38
|
+
- [Kinesis Data Firehose](https://yulinsim.dev/services/firehose/ "Simulated Kinesis Data Firehose docs")
|
|
39
|
+
- [Kinesis Data Streams](https://yulinsim.dev/services/kinesis/ "Simulated Kinesis Data Streams docs")
|
|
35
40
|
- [KMS](https://yulinsim.dev/services/kms/ "Simulated KMS docs")
|
|
36
41
|
- [Lambda](https://yulinsim.dev/services/lambda/ "Simulated Lambda docs")
|
|
37
42
|
- [CloudWatch Logs](https://yulinsim.dev/services/logs/ "Simulated CloudWatch Logs docs")
|
|
43
|
+
- [Organizations](https://yulinsim.dev/services/organizations/ "Simulated Organizations service control policies docs")
|
|
38
44
|
- [Personalize](https://yulinsim.dev/services/personalize/ "Simulated Amazon Personalize docs")
|
|
39
45
|
- [Rekognition](https://yulinsim.dev/services/rekognition/ "Simulated Rekognition docs")
|
|
40
46
|
- [Route53](https://yulinsim.dev/services/route53/ "Simulated Route53 docs")
|
|
@@ -54,10 +60,17 @@ npm i -D @kensio/yulin
|
|
|
54
60
|
- [AI skill](https://yulinsim.dev/ai-skill/ "Yulin AI skill docs")
|
|
55
61
|
- [The AWS CLI](https://yulinsim.dev/cli/ "The AWS CLI against simulated AWS docs")
|
|
56
62
|
- [AWS SDK interception](https://yulinsim.dev/sdk/ "Simulated AWS SDK docs")
|
|
63
|
+
- [Event factories](https://yulinsim.dev/factories/ "Test factories for AWS event shapes docs")
|
|
64
|
+
- [Linting CloudFront Functions JS2](https://yulinsim.dev/lint/ "CloudFront Functions JS2 lint config docs")
|
|
65
|
+
- [Non-AWS dependencies](https://yulinsim.dev/non-aws-dependencies/ "Dependencies Yulin does not simulate docs")
|
|
57
66
|
- [Serving on localhost](https://yulinsim.dev/serve/ "Serving simulated AWS on localhost docs")
|
|
58
67
|
- [Simulated time](https://yulinsim.dev/time/ "Simulated time docs")
|
|
59
68
|
- [Terraform](https://yulinsim.dev/terraform/ "Deploying Terraform into simulated AWS docs")
|
|
60
69
|
|
|
70
|
+
Every page listed above also ships inside the package as markdown, documenting the version
|
|
71
|
+
installed. `node_modules/@kensio/yulin/llms.txt` indexes them, and a coding agent with no network
|
|
72
|
+
reach can read them from there.
|
|
73
|
+
|
|
61
74
|
## Usage
|
|
62
75
|
|
|
63
76
|
### Intercept AWS SDK clients
|
|
@@ -40,6 +40,11 @@ export declare class SimSdkModuleClientInterceptor {
|
|
|
40
40
|
*
|
|
41
41
|
* Reflect.construct with the incoming new target preserves subclassing and
|
|
42
42
|
* instanceof against the real class.
|
|
43
|
+
*
|
|
44
|
+
* The class's own static methods are wrapped as well, so a client built by
|
|
45
|
+
* a static factory such as `DynamoDBDocumentClient.from` is patched too.
|
|
46
|
+
* Such a factory constructs from the class binding it closes over rather
|
|
47
|
+
* than through this proxy, so the construct trap never sees it.
|
|
43
48
|
*/
|
|
44
49
|
private wrapClientClass;
|
|
45
50
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { installSendPatch } from "../send-patch.js";
|
|
2
|
+
import { SimSdkStaticClientFactories } from "./sim-sdk-static-client-factory.js";
|
|
2
3
|
/**
|
|
3
4
|
* Intercepts the SDK client classes exported by an AWS SDK package module.
|
|
4
5
|
*
|
|
@@ -56,16 +57,29 @@ export class SimSdkModuleClientInterceptor {
|
|
|
56
57
|
*
|
|
57
58
|
* Reflect.construct with the incoming new target preserves subclassing and
|
|
58
59
|
* instanceof against the real class.
|
|
60
|
+
*
|
|
61
|
+
* The class's own static methods are wrapped as well, so a client built by
|
|
62
|
+
* a static factory such as `DynamoDBDocumentClient.from` is patched too.
|
|
63
|
+
* Such a factory constructs from the class binding it closes over rather
|
|
64
|
+
* than through this proxy, so the construct trap never sees it.
|
|
59
65
|
*/
|
|
60
66
|
wrapClientClass(clientClass) {
|
|
61
67
|
const sendHandler = this.sendHandler;
|
|
62
68
|
const configureArguments = (constructorArguments) => this.regionDefaultedArguments(constructorArguments);
|
|
69
|
+
const staticFactories = new SimSdkStaticClientFactories(sendHandler);
|
|
63
70
|
return new Proxy(clientClass, {
|
|
64
71
|
construct(target, constructorArguments, newTarget) {
|
|
65
72
|
const instance = Reflect.construct(target, configureArguments(constructorArguments), newTarget);
|
|
66
73
|
installSendPatch(instance, sendHandler);
|
|
67
74
|
return instance;
|
|
68
75
|
},
|
|
76
|
+
get(target, property, receiver) {
|
|
77
|
+
const value = Reflect.get(target, property, receiver);
|
|
78
|
+
if (typeof value !== "function" || !Object.hasOwn(target, property)) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
return staticFactories.wrap(value);
|
|
82
|
+
},
|
|
69
83
|
});
|
|
70
84
|
}
|
|
71
85
|
/**
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type SimSdkSendHandler } from "../send-patch.js";
|
|
2
|
+
/**
|
|
3
|
+
* The wrapped static methods of one intercepted SDK client class.
|
|
4
|
+
*
|
|
5
|
+
* A static factory such as `DynamoDBDocumentClient.from` constructs from the
|
|
6
|
+
* class binding it closes over rather than through the class the calling code
|
|
7
|
+
* holds, so the client it builds is never seen by the interception's construct
|
|
8
|
+
* trap. Wrapping the method send-patches that client on the way back out.
|
|
9
|
+
*
|
|
10
|
+
* Each method is wrapped once, so the class keeps handing out the same
|
|
11
|
+
* function for the same static.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SimSdkStaticClientFactories {
|
|
14
|
+
private readonly sendHandler;
|
|
15
|
+
private readonly wrappers;
|
|
16
|
+
constructor(sendHandler: SimSdkSendHandler);
|
|
17
|
+
/**
|
|
18
|
+
* The patching wrapper for one static method.
|
|
19
|
+
*/
|
|
20
|
+
wrap(method: object): unknown;
|
|
21
|
+
/**
|
|
22
|
+
* A Proxy rather than a plain function keeps the method's own identity
|
|
23
|
+
* surface, such as its name, length and any properties hung off it.
|
|
24
|
+
*/
|
|
25
|
+
private wrapMethod;
|
|
26
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { hasSendPatch, installSendPatch, } from "../send-patch.js";
|
|
2
|
+
/**
|
|
3
|
+
* The wrapped static methods of one intercepted SDK client class.
|
|
4
|
+
*
|
|
5
|
+
* A static factory such as `DynamoDBDocumentClient.from` constructs from the
|
|
6
|
+
* class binding it closes over rather than through the class the calling code
|
|
7
|
+
* holds, so the client it builds is never seen by the interception's construct
|
|
8
|
+
* trap. Wrapping the method send-patches that client on the way back out.
|
|
9
|
+
*
|
|
10
|
+
* Each method is wrapped once, so the class keeps handing out the same
|
|
11
|
+
* function for the same static.
|
|
12
|
+
*/
|
|
13
|
+
export class SimSdkStaticClientFactories {
|
|
14
|
+
sendHandler;
|
|
15
|
+
wrappers = new WeakMap();
|
|
16
|
+
constructor(sendHandler) {
|
|
17
|
+
this.sendHandler = sendHandler;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The patching wrapper for one static method.
|
|
21
|
+
*/
|
|
22
|
+
wrap(method) {
|
|
23
|
+
const wrapped = this.wrappers.get(method) ?? this.wrapMethod(method);
|
|
24
|
+
this.wrappers.set(method, wrapped);
|
|
25
|
+
return wrapped;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A Proxy rather than a plain function keeps the method's own identity
|
|
29
|
+
* surface, such as its name, length and any properties hung off it.
|
|
30
|
+
*/
|
|
31
|
+
wrapMethod(method) {
|
|
32
|
+
const sendHandler = this.sendHandler;
|
|
33
|
+
return new Proxy(method, {
|
|
34
|
+
apply(target, thisArgument, callArguments) {
|
|
35
|
+
const result = Reflect.apply(target, thisArgument, callArguments);
|
|
36
|
+
if (isUnpatchedClient(result)) {
|
|
37
|
+
installSendPatch(result, sendHandler);
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Whether a static method's return value is a client still to be patched.
|
|
46
|
+
*
|
|
47
|
+
* A factory building through the intercepted class itself has already been
|
|
48
|
+
* patched by the construct trap, so patching again is skipped rather than
|
|
49
|
+
* rejected as a double interception.
|
|
50
|
+
*/
|
|
51
|
+
function isUnpatchedClient(value) {
|
|
52
|
+
if (typeof value !== "object" || value === null) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
if (typeof value.send !== "function") {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
return !hasSendPatch(value);
|
|
59
|
+
}
|
package/dist/sdk/send-patch.d.ts
CHANGED
|
@@ -29,3 +29,11 @@ export interface SimSdkSendPatch {
|
|
|
29
29
|
* inherited send resolves again.
|
|
30
30
|
*/
|
|
31
31
|
export declare function installSendPatch(target: object, handler: SimSdkSendHandler): SimSdkSendPatch;
|
|
32
|
+
/**
|
|
33
|
+
* Whether a simulated send patch is currently installed on a target.
|
|
34
|
+
*
|
|
35
|
+
* Only an own patched send counts, which is the property installSendPatch
|
|
36
|
+
* writes, so an instance inheriting a patched send from a patched prototype
|
|
37
|
+
* reports false.
|
|
38
|
+
*/
|
|
39
|
+
export declare function hasSendPatch(target: object): boolean;
|
package/dist/sdk/send-patch.js
CHANGED
|
@@ -50,6 +50,17 @@ export function installSendPatch(target, handler) {
|
|
|
50
50
|
},
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Whether a simulated send patch is currently installed on a target.
|
|
55
|
+
*
|
|
56
|
+
* Only an own patched send counts, which is the property installSendPatch
|
|
57
|
+
* writes, so an instance inheriting a patched send from a patched prototype
|
|
58
|
+
* reports false.
|
|
59
|
+
*/
|
|
60
|
+
export function hasSendPatch(target) {
|
|
61
|
+
const send = Object.getOwnPropertyDescriptor(target, "send")?.value;
|
|
62
|
+
return typeof send === "function" && installedSends.has(send);
|
|
63
|
+
}
|
|
53
64
|
/**
|
|
54
65
|
* Name a patch target for diagnostics: the client's class name for instances
|
|
55
66
|
* and prototypes alike, when it has one.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SimAwsPrincipal } from "./sim-aws-caller.js";
|
|
2
|
+
import { type SimAwsRunAsOwner } from "./sim-aws-run-as-context.js";
|
|
3
|
+
/**
|
|
4
|
+
* Where a call that names no caller of its own looks for one first.
|
|
5
|
+
*
|
|
6
|
+
* A `SimAws.runAs` block is what sets an ambient caller today. Asking through
|
|
7
|
+
* this interface keeps the resolver clear of Node.js asynchronous context
|
|
8
|
+
* tracking, and leaves room for the other thing that will set one, a simulated
|
|
9
|
+
* Lambda invocation running under an execution role.
|
|
10
|
+
*/
|
|
11
|
+
export interface SimAwsAmbientCaller {
|
|
12
|
+
/**
|
|
13
|
+
* The caller ambient where the call is being made, if there is one.
|
|
14
|
+
*/
|
|
15
|
+
currentCaller(): SimAwsPrincipal | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The ambient caller of the `runAs` block one simulation is inside.
|
|
19
|
+
*
|
|
20
|
+
* Only that simulation's own runs count. Each SimAws instance is its own
|
|
21
|
+
* simulated universe, so a `runAs` on one never decides what another observes.
|
|
22
|
+
*/
|
|
23
|
+
export declare function simAwsRunAsAmbientCaller(owner: SimAwsRunAsOwner): SimAwsAmbientCaller;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { simAwsRunAsContext, } from "./sim-aws-run-as-context.js";
|
|
2
|
+
/**
|
|
3
|
+
* The ambient caller of the `runAs` block one simulation is inside.
|
|
4
|
+
*
|
|
5
|
+
* Only that simulation's own runs count. Each SimAws instance is its own
|
|
6
|
+
* simulated universe, so a `runAs` on one never decides what another observes.
|
|
7
|
+
*/
|
|
8
|
+
export function simAwsRunAsAmbientCaller(owner) {
|
|
9
|
+
return {
|
|
10
|
+
currentCaller: () => simAwsRunAsContext.currentCaller(owner),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SimAwsAmbientCaller } from "./sim-aws-ambient-caller.js";
|
|
2
|
+
import type { SimAwsCaller, SimAwsDefaultCaller, SimAwsPrincipal, SimCredentialCaller } from "./sim-aws-caller.js";
|
|
2
3
|
import type { SimIamCredentialIdentity } from "../../iam/credential/sim-aws-credentials.js";
|
|
3
4
|
export interface SimAwsCredentialIdentityResolver {
|
|
4
5
|
resolveCredentials(credentials: SimCredentialCaller["credentials"], now?: Date): SimIamCredentialIdentity;
|
|
@@ -17,19 +18,51 @@ export interface SimAwsResolvedCaller {
|
|
|
17
18
|
readonly accountId?: string | undefined;
|
|
18
19
|
readonly service?: string | undefined;
|
|
19
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* What resolving a caller needs beyond the caller itself.
|
|
23
|
+
*/
|
|
24
|
+
export interface SimAwsCallerResolverProperties {
|
|
25
|
+
/**
|
|
26
|
+
* Authenticates a caller that presents credentials.
|
|
27
|
+
*/
|
|
28
|
+
readonly credentialIdentityResolver?: SimAwsCredentialIdentityResolver | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The caller a request naming none of its own is attributed to.
|
|
31
|
+
*
|
|
32
|
+
* A simulation sets this to say who its unattributed calls come from. It is
|
|
33
|
+
* consulted ahead of the operation default. A simulation that names no
|
|
34
|
+
* default caller keeps the Account root fallback.
|
|
35
|
+
*/
|
|
36
|
+
readonly defaultCaller?: SimAwsDefaultCaller | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Where a request naming no caller looks before the default.
|
|
39
|
+
*
|
|
40
|
+
* A `runAs` block says who is making the calls inside it, which is more
|
|
41
|
+
* specific than what a simulation holds for its unattributed calls
|
|
42
|
+
* generally, so it is consulted first.
|
|
43
|
+
*/
|
|
44
|
+
readonly ambientCaller?: SimAwsAmbientCaller | undefined;
|
|
45
|
+
}
|
|
20
46
|
/**
|
|
21
47
|
* Resolves caller input at a simulated AWS operation boundary.
|
|
22
48
|
*
|
|
23
|
-
* An omitted caller resolves to the
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
49
|
+
* An omitted caller resolves to the ambient caller of the `runAs` block the
|
|
50
|
+
* call is inside, then to the simulation's default caller, and to the supplied
|
|
51
|
+
* operation default where there is neither. Explicit anonymity is preserved.
|
|
52
|
+
* Credential callers are authenticated before a resolved caller is returned,
|
|
53
|
+
* and a caller already resolved elsewhere is taken as it stands.
|
|
27
54
|
*/
|
|
28
55
|
export declare class SimAwsCallerResolver {
|
|
29
56
|
private readonly credentialIdentityResolver?;
|
|
30
|
-
|
|
57
|
+
private readonly defaultCaller?;
|
|
58
|
+
private readonly ambientCaller?;
|
|
59
|
+
constructor(properties?: SimAwsCallerResolverProperties);
|
|
31
60
|
/**
|
|
32
61
|
* Resolve and normalize a simulated AWS caller.
|
|
62
|
+
*
|
|
63
|
+
* The request's own caller is used where it has one. A request without one
|
|
64
|
+
* falls back to the ambient `runAs` caller, then to the simulation's default
|
|
65
|
+
* caller, and then to the operation default the call site supplies.
|
|
33
66
|
*/
|
|
34
67
|
resolve(caller: SimAwsCaller | undefined, defaultPrincipal: SimAwsPrincipal): SimAwsResolvedCaller;
|
|
35
68
|
private normalized;
|
|
@@ -2,54 +2,56 @@ import { assertDefined } from "../../../util/type-guard/defined.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Resolves caller input at a simulated AWS operation boundary.
|
|
4
4
|
*
|
|
5
|
-
* An omitted caller resolves to the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* An omitted caller resolves to the ambient caller of the `runAs` block the
|
|
6
|
+
* call is inside, then to the simulation's default caller, and to the supplied
|
|
7
|
+
* operation default where there is neither. Explicit anonymity is preserved.
|
|
8
|
+
* Credential callers are authenticated before a resolved caller is returned,
|
|
9
|
+
* and a caller already resolved elsewhere is taken as it stands.
|
|
9
10
|
*/
|
|
10
11
|
export class SimAwsCallerResolver {
|
|
11
12
|
credentialIdentityResolver;
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
defaultCaller;
|
|
14
|
+
ambientCaller;
|
|
15
|
+
constructor(properties = {}) {
|
|
16
|
+
this.credentialIdentityResolver = properties.credentialIdentityResolver;
|
|
17
|
+
this.defaultCaller = properties.defaultCaller;
|
|
18
|
+
this.ambientCaller = properties.ambientCaller;
|
|
14
19
|
}
|
|
15
20
|
/**
|
|
16
21
|
* Resolve and normalize a simulated AWS caller.
|
|
22
|
+
*
|
|
23
|
+
* The request's own caller is used where it has one. A request without one
|
|
24
|
+
* falls back to the ambient `runAs` caller, then to the simulation's default
|
|
25
|
+
* caller, and then to the operation default the call site supplies.
|
|
17
26
|
*/
|
|
18
27
|
resolve(caller, defaultPrincipal) {
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
const stated = caller ?? this.ambientCaller?.currentCaller() ?? this.defaultCaller;
|
|
29
|
+
if (stated?.kind === "resolved") {
|
|
30
|
+
return this.normalized(stated.principal, stated.identityPolicyPrincipal);
|
|
21
31
|
}
|
|
22
|
-
if (
|
|
32
|
+
if (stated?.kind === "credentials") {
|
|
23
33
|
assertDefined(this.credentialIdentityResolver, "Simulated credential callers require an IAM credential resolver");
|
|
24
|
-
const identity = this.credentialIdentityResolver.resolveCredentials(
|
|
34
|
+
const identity = this.credentialIdentityResolver.resolveCredentials(stated.credentials);
|
|
25
35
|
return this.normalized(identity.principal, identity.identityPolicyPrincipal);
|
|
26
36
|
}
|
|
27
|
-
const principal =
|
|
37
|
+
const principal = stated ?? defaultPrincipal;
|
|
28
38
|
return this.normalized(principal, principal);
|
|
29
39
|
}
|
|
30
40
|
normalized(principal, identityPolicyPrincipal) {
|
|
31
|
-
|
|
32
|
-
const identityPolicyArn = identityPolicyPrincipal.kind === "arn"
|
|
33
|
-
? identityPolicyPrincipal.arn
|
|
34
|
-
: undefined;
|
|
35
|
-
return {
|
|
36
|
-
principal,
|
|
37
|
-
identityPolicyPrincipal,
|
|
38
|
-
arn: principal.arn,
|
|
39
|
-
identityPolicyArn,
|
|
40
|
-
accountId: this.accountId(principal.arn),
|
|
41
|
-
};
|
|
42
|
-
}
|
|
41
|
+
const both = { principal, identityPolicyPrincipal };
|
|
43
42
|
if (principal.kind === "service") {
|
|
44
|
-
return {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
43
|
+
return { ...both, service: principal.service };
|
|
44
|
+
}
|
|
45
|
+
if (principal.kind !== "arn") {
|
|
46
|
+
return both;
|
|
49
47
|
}
|
|
50
48
|
return {
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
...both,
|
|
50
|
+
arn: principal.arn,
|
|
51
|
+
identityPolicyArn: identityPolicyPrincipal.kind === "arn"
|
|
52
|
+
? identityPolicyPrincipal.arn
|
|
53
|
+
: undefined,
|
|
54
|
+
accountId: this.accountId(principal.arn),
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
@@ -52,3 +52,12 @@ export interface SimResolvedCaller {
|
|
|
52
52
|
* Caller accepted by simulated AWS service operations.
|
|
53
53
|
*/
|
|
54
54
|
export type SimAwsCaller = SimAwsPrincipal | SimCredentialCaller | SimResolvedCaller;
|
|
55
|
+
/**
|
|
56
|
+
* Caller a simulation attributes a request that names none of its own to.
|
|
57
|
+
*
|
|
58
|
+
* A principal, or a caller something else has already resolved. Credentials
|
|
59
|
+
* are left out because the Account that issued a key is the only thing able to
|
|
60
|
+
* authenticate it, while a default is held for a whole simulation. A key from
|
|
61
|
+
* one Account would fail wherever another Account decided the request.
|
|
62
|
+
*/
|
|
63
|
+
export type SimAwsDefaultCaller = SimAwsPrincipal | SimResolvedCaller;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SimAwsPrincipal, SimResolvedCaller } from "./sim-aws-caller.js";
|
|
2
|
+
import { type SimAwsResolvedCaller } from "./sim-aws-caller-resolver.js";
|
|
3
|
+
/**
|
|
4
|
+
* State an already-resolved caller as the caller of another request.
|
|
5
|
+
*
|
|
6
|
+
* A resolver answers with a SimAwsResolvedCaller, and a service that goes on
|
|
7
|
+
* to ask IAM about the same caller has to pass one back in. Both principals
|
|
8
|
+
* travel together, so an assumed-role session keeps the Role its policies come
|
|
9
|
+
* from instead of arriving as a session ARN that owns none.
|
|
10
|
+
*/
|
|
11
|
+
export declare function simAwsCallerFor(caller: SimAwsResolvedCaller): SimResolvedCaller;
|
|
12
|
+
/**
|
|
13
|
+
* Resolve a principal that needs nothing authenticated.
|
|
14
|
+
*
|
|
15
|
+
* A service principal, or an ARN something else has already established, is
|
|
16
|
+
* its own answer. This is the short way to the SimAwsResolvedCaller that an
|
|
17
|
+
* authorization boundary asks for.
|
|
18
|
+
*/
|
|
19
|
+
export declare function simAwsResolvedCallerOf(principal: SimAwsPrincipal): SimAwsResolvedCaller;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SimAwsCallerResolver, } from "./sim-aws-caller-resolver.js";
|
|
2
|
+
/**
|
|
3
|
+
* State an already-resolved caller as the caller of another request.
|
|
4
|
+
*
|
|
5
|
+
* A resolver answers with a SimAwsResolvedCaller, and a service that goes on
|
|
6
|
+
* to ask IAM about the same caller has to pass one back in. Both principals
|
|
7
|
+
* travel together, so an assumed-role session keeps the Role its policies come
|
|
8
|
+
* from instead of arriving as a session ARN that owns none.
|
|
9
|
+
*/
|
|
10
|
+
export function simAwsCallerFor(caller) {
|
|
11
|
+
return {
|
|
12
|
+
kind: "resolved",
|
|
13
|
+
principal: caller.principal,
|
|
14
|
+
identityPolicyPrincipal: caller.identityPolicyPrincipal,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Resolve a principal that needs nothing authenticated.
|
|
19
|
+
*
|
|
20
|
+
* A service principal, or an ARN something else has already established, is
|
|
21
|
+
* its own answer. This is the short way to the SimAwsResolvedCaller that an
|
|
22
|
+
* authorization boundary asks for.
|
|
23
|
+
*/
|
|
24
|
+
export function simAwsResolvedCallerOf(principal) {
|
|
25
|
+
return new SimAwsCallerResolver().resolve(principal, principal);
|
|
26
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { BackgroundCompleter, BackgroundScheduler } from "../../../util/background/background.js";
|
|
2
2
|
import type { SimAwsAccountRegionContainer } from "../sim-aws-account-region-scope.js";
|
|
3
3
|
import type { SimAws } from "../sim-aws.js";
|
|
4
|
+
import type { SimAwsDefaultCaller } from "../caller/sim-aws-caller.js";
|
|
5
|
+
import type { SimAwsAmbientCaller } from "../caller/sim-aws-ambient-caller.js";
|
|
4
6
|
import { SimCloudFormation } from "../../cloudformation/index.js";
|
|
5
7
|
import { SimCloudWatch } from "../../cloudwatch/index.js";
|
|
6
8
|
import { SimCognitoIdentityProvider } from "../../cognito/index.js";
|
|
@@ -30,6 +32,14 @@ interface SimAwsAccountRegionServiceBuilderProperties {
|
|
|
30
32
|
readonly lambdaUrlRegistry: SimLambdaUrlRegistry;
|
|
31
33
|
readonly accountServices: SimAwsAccountServiceCache;
|
|
32
34
|
readonly messageLog: SimAwsMessageLog;
|
|
35
|
+
/**
|
|
36
|
+
* The caller this simulation attributes a request naming none to.
|
|
37
|
+
*/
|
|
38
|
+
readonly defaultCaller?: SimAwsDefaultCaller | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Where a request naming no caller looks before the default.
|
|
41
|
+
*/
|
|
42
|
+
readonly ambientCaller?: SimAwsAmbientCaller | undefined;
|
|
33
43
|
}
|
|
34
44
|
/**
|
|
35
45
|
* Builder for simulated AWS services scoped to one Account and Region.
|
|
@@ -61,6 +71,8 @@ export declare class SimAwsAccountRegionServiceBuilder {
|
|
|
61
71
|
private readonly lambdaUrlRegistry;
|
|
62
72
|
private readonly accountServices;
|
|
63
73
|
private readonly messageLog;
|
|
74
|
+
private readonly defaultCaller?;
|
|
75
|
+
private readonly ambientCaller?;
|
|
64
76
|
constructor(properties: SimAwsAccountRegionServiceBuilderProperties);
|
|
65
77
|
/** Create simulated ACM for an Account Region scope. */
|
|
66
78
|
/** Create simulated CloudFormation for an Account Region scope. */
|
|
@@ -55,6 +55,8 @@ export class SimAwsAccountRegionServiceBuilder {
|
|
|
55
55
|
lambdaUrlRegistry;
|
|
56
56
|
accountServices;
|
|
57
57
|
messageLog;
|
|
58
|
+
defaultCaller;
|
|
59
|
+
ambientCaller;
|
|
58
60
|
constructor(properties) {
|
|
59
61
|
this.simAws = properties.simAws;
|
|
60
62
|
this.background = properties.background;
|
|
@@ -63,6 +65,8 @@ export class SimAwsAccountRegionServiceBuilder {
|
|
|
63
65
|
this.lambdaUrlRegistry = properties.lambdaUrlRegistry;
|
|
64
66
|
this.accountServices = properties.accountServices;
|
|
65
67
|
this.messageLog = properties.messageLog;
|
|
68
|
+
this.defaultCaller = properties.defaultCaller;
|
|
69
|
+
this.ambientCaller = properties.ambientCaller;
|
|
66
70
|
}
|
|
67
71
|
/** Create simulated ACM for an Account Region scope. */
|
|
68
72
|
/** Create simulated CloudFormation for an Account Region scope. */
|
|
@@ -269,6 +273,8 @@ export class SimAwsAccountRegionServiceBuilder {
|
|
|
269
273
|
accountRegionScope: scope.accountRegionScope,
|
|
270
274
|
background: this.background,
|
|
271
275
|
iamResolver: this.iamRegistry,
|
|
276
|
+
defaultCaller: this.defaultCaller,
|
|
277
|
+
ambientCaller: this.ambientCaller,
|
|
272
278
|
});
|
|
273
279
|
}
|
|
274
280
|
/**
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { BackgroundCompleter, BackgroundScheduler } from "../../../util/background/background.js";
|
|
2
2
|
import type { SimAwsAccountRegionContainer } from "../sim-aws-account-region-scope.js";
|
|
3
3
|
import type { SimAws } from "../sim-aws.js";
|
|
4
|
+
import type { SimAwsDefaultCaller } from "../caller/sim-aws-caller.js";
|
|
5
|
+
import type { SimAwsAmbientCaller } from "../caller/sim-aws-ambient-caller.js";
|
|
4
6
|
import type { SimAcmRegistry } from "../../acm/registry/sim-acm-registry.js";
|
|
5
7
|
import type { SimCloudFrontRegistry } from "../../cloudfront/registry/sim-cloud-front-registry.js";
|
|
6
8
|
import { SimCloudFront } from "../../cloudfront/sim-cloudfront.js";
|
|
@@ -25,6 +27,14 @@ interface SimAwsAccountServiceCacheProperties {
|
|
|
25
27
|
readonly iamRegistry: SimIamRegistry;
|
|
26
28
|
readonly accessKeyRegistry: SimIamAccessKeyRegistry;
|
|
27
29
|
readonly scpResolver: SimIamServiceControlPolicyResolver;
|
|
30
|
+
/**
|
|
31
|
+
* The caller this simulation attributes a request naming none to.
|
|
32
|
+
*/
|
|
33
|
+
readonly defaultCaller?: SimAwsDefaultCaller | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Where a request naming no caller looks before the default.
|
|
36
|
+
*/
|
|
37
|
+
readonly ambientCaller?: SimAwsAmbientCaller | undefined;
|
|
28
38
|
}
|
|
29
39
|
/**
|
|
30
40
|
* Account-level cache for simulated AWS service instances.
|
|
@@ -55,6 +65,8 @@ export declare class SimAwsAccountServiceCache {
|
|
|
55
65
|
private readonly iamRegistry;
|
|
56
66
|
private readonly accessKeyRegistry;
|
|
57
67
|
private readonly scpResolver;
|
|
68
|
+
private readonly defaultCaller?;
|
|
69
|
+
private readonly ambientCaller?;
|
|
58
70
|
private readonly route53Registry;
|
|
59
71
|
private readonly kmsRegistry;
|
|
60
72
|
private readonly serviceHosts;
|
|
@@ -38,6 +38,8 @@ export class SimAwsAccountServiceCache {
|
|
|
38
38
|
iamRegistry;
|
|
39
39
|
accessKeyRegistry;
|
|
40
40
|
scpResolver;
|
|
41
|
+
defaultCaller;
|
|
42
|
+
ambientCaller;
|
|
41
43
|
route53Registry;
|
|
42
44
|
kmsRegistry;
|
|
43
45
|
serviceHosts;
|
|
@@ -57,6 +59,8 @@ export class SimAwsAccountServiceCache {
|
|
|
57
59
|
this.cloudFrontRegistry = properties.cloudFrontRegistry;
|
|
58
60
|
this.iamRegistry = properties.iamRegistry;
|
|
59
61
|
this.scpResolver = properties.scpResolver;
|
|
62
|
+
this.defaultCaller = properties.defaultCaller;
|
|
63
|
+
this.ambientCaller = properties.ambientCaller;
|
|
60
64
|
this.accessKeyRegistry = properties.accessKeyRegistry;
|
|
61
65
|
this.route53Registry = properties.route53Registry;
|
|
62
66
|
this.kmsRegistry = properties.kmsRegistry;
|
|
@@ -114,6 +118,11 @@ export class SimAwsAccountServiceCache {
|
|
|
114
118
|
// What the Account's organization allows it to do is decided outside
|
|
115
119
|
// the Account, so IAM asks simulated Organizations about it.
|
|
116
120
|
scpResolver: this.scpResolver,
|
|
121
|
+
// Who a request naming no caller comes from is decided for the
|
|
122
|
+
// whole simulation. Every Account in it applies the same default,
|
|
123
|
+
// and answers to the same run-as block ahead of it.
|
|
124
|
+
defaultCaller: this.defaultCaller,
|
|
125
|
+
ambientCaller: this.ambientCaller,
|
|
117
126
|
// Access keys are indexed simulation-wide as they are issued, so a
|
|
118
127
|
// signed request naming only a key id can be traced to this Account.
|
|
119
128
|
credentialRegistry: new SimIamCredentialRegistry({
|
|
@@ -82,8 +82,10 @@ export class SimAwsRegisteredServiceBuilder {
|
|
|
82
82
|
* nothing but that URI, and the function need not be in this scope.
|
|
83
83
|
*/
|
|
84
84
|
createEcr(scope) {
|
|
85
|
+
const { accountRegionScope, iam } = this.scoped(scope);
|
|
85
86
|
return new SimEcr({
|
|
86
|
-
accountRegionScope
|
|
87
|
+
accountRegionScope,
|
|
88
|
+
iam,
|
|
87
89
|
registry: this.registries.ecr,
|
|
88
90
|
});
|
|
89
91
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BackgroundCompleter, BackgroundScheduler } from "../../../util/background/background.js";
|
|
2
2
|
import type { SimAwsAccountRegionContainer } from "../sim-aws-account-region-scope.js";
|
|
3
3
|
import type { SimAws } from "../sim-aws.js";
|
|
4
|
+
import type { SimAwsDefaultCaller } from "../caller/sim-aws-caller.js";
|
|
4
5
|
import type { SimAcm } from "../../acm/sim-acm.js";
|
|
5
6
|
import type { SimApiGateway } from "../../apigateway/index.js";
|
|
6
7
|
import type { SimApiGatewayV2 } from "../../apigatewayv2/index.js";
|
|
@@ -45,6 +46,10 @@ import { SimAwsMessageLog } from "../message/sim-aws-message-log.js";
|
|
|
45
46
|
interface SimAwsServiceFactoryProperties {
|
|
46
47
|
readonly simAws: SimAws;
|
|
47
48
|
readonly background: BackgroundScheduler & BackgroundCompleter;
|
|
49
|
+
/**
|
|
50
|
+
* The caller this simulation attributes a call naming none to.
|
|
51
|
+
*/
|
|
52
|
+
readonly defaultCaller?: SimAwsDefaultCaller | undefined;
|
|
48
53
|
}
|
|
49
54
|
/**
|
|
50
55
|
* Factory for simulated AWS services used by one SimAws instance.
|