localstack-core 4.10.1.dev42__py3-none-any.whl → 4.11.2.dev14__py3-none-any.whl
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.
- localstack/aws/api/apigateway/__init__.py +42 -0
- localstack/aws/api/cloudformation/__init__.py +161 -0
- localstack/aws/api/ec2/__init__.py +1165 -12
- localstack/aws/api/iam/__init__.py +227 -0
- localstack/aws/api/kms/__init__.py +1 -0
- localstack/aws/api/lambda_/__init__.py +418 -66
- localstack/aws/api/logs/__init__.py +312 -0
- localstack/aws/api/opensearch/__init__.py +89 -0
- localstack/aws/api/redshift/__init__.py +69 -0
- localstack/aws/api/resourcegroupstaggingapi/__init__.py +36 -0
- localstack/aws/api/route53/__init__.py +42 -0
- localstack/aws/api/route53resolver/__init__.py +1 -0
- localstack/aws/api/s3/__init__.py +62 -0
- localstack/aws/api/secretsmanager/__init__.py +28 -23
- localstack/aws/api/stepfunctions/__init__.py +52 -10
- localstack/aws/api/sts/__init__.py +52 -0
- localstack/aws/handlers/logging.py +8 -4
- localstack/aws/handlers/service.py +11 -2
- localstack/aws/protocol/serializer.py +1 -1
- localstack/deprecations.py +0 -6
- localstack/services/acm/provider.py +4 -0
- localstack/services/apigateway/legacy/provider.py +28 -15
- localstack/services/cloudformation/engine/template_preparer.py +6 -2
- localstack/services/cloudformation/engine/v2/change_set_model_preproc.py +12 -0
- localstack/services/cloudwatch/provider.py +10 -3
- localstack/services/cloudwatch/provider_v2.py +6 -3
- localstack/services/configservice/provider.py +5 -1
- localstack/services/dynamodb/provider.py +1 -0
- localstack/services/dynamodb/v2/provider.py +1 -0
- localstack/services/dynamodbstreams/provider.py +6 -0
- localstack/services/dynamodbstreams/v2/provider.py +6 -0
- localstack/services/ec2/provider.py +6 -0
- localstack/services/es/provider.py +6 -0
- localstack/services/events/provider.py +4 -0
- localstack/services/events/v1/provider.py +9 -0
- localstack/services/firehose/provider.py +5 -0
- localstack/services/iam/provider.py +4 -0
- localstack/services/kms/models.py +10 -20
- localstack/services/kms/provider.py +4 -0
- localstack/services/lambda_/api_utils.py +37 -20
- localstack/services/lambda_/event_source_mapping/pollers/stream_poller.py +1 -1
- localstack/services/lambda_/invocation/assignment.py +4 -1
- localstack/services/lambda_/invocation/execution_environment.py +21 -2
- localstack/services/lambda_/invocation/lambda_models.py +27 -2
- localstack/services/lambda_/invocation/lambda_service.py +51 -3
- localstack/services/lambda_/invocation/models.py +9 -1
- localstack/services/lambda_/invocation/version_manager.py +18 -3
- localstack/services/lambda_/provider.py +239 -95
- localstack/services/lambda_/resource_providers/aws_lambda_function.py +33 -1
- localstack/services/lambda_/runtimes.py +3 -1
- localstack/services/logs/provider.py +9 -0
- localstack/services/opensearch/provider.py +53 -3
- localstack/services/resource_groups/provider.py +5 -1
- localstack/services/resourcegroupstaggingapi/provider.py +6 -1
- localstack/services/s3/provider.py +28 -15
- localstack/services/s3/utils.py +35 -14
- localstack/services/s3control/provider.py +101 -2
- localstack/services/s3control/validation.py +50 -0
- localstack/services/sns/constants.py +3 -1
- localstack/services/sns/publisher.py +15 -6
- localstack/services/sns/v2/models.py +6 -0
- localstack/services/sns/v2/provider.py +650 -19
- localstack/services/sns/v2/utils.py +12 -0
- localstack/services/stepfunctions/asl/component/common/path/result_path.py +1 -1
- localstack/services/stepfunctions/asl/component/state/state_execution/execute_state.py +0 -1
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/state_map.py +0 -1
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/lambda_eval_utils.py +8 -8
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/{mock_eval_utils.py → local_mock_eval_utils.py} +13 -9
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service.py +6 -6
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_callback.py +1 -1
- localstack/services/stepfunctions/asl/component/state/state_fail/state_fail.py +4 -0
- localstack/services/stepfunctions/asl/component/test_state/state/base_mock.py +118 -0
- localstack/services/stepfunctions/asl/component/test_state/state/common.py +82 -0
- localstack/services/stepfunctions/asl/component/test_state/state/execution.py +139 -0
- localstack/services/stepfunctions/asl/component/test_state/state/map.py +77 -0
- localstack/services/stepfunctions/asl/component/test_state/state/task.py +44 -0
- localstack/services/stepfunctions/asl/eval/environment.py +30 -22
- localstack/services/stepfunctions/asl/eval/states.py +1 -1
- localstack/services/stepfunctions/asl/eval/test_state/environment.py +49 -9
- localstack/services/stepfunctions/asl/eval/test_state/program_state.py +22 -0
- localstack/services/stepfunctions/asl/jsonata/jsonata.py +5 -1
- localstack/services/stepfunctions/asl/parse/preprocessor.py +67 -24
- localstack/services/stepfunctions/asl/parse/test_state/asl_parser.py +5 -4
- localstack/services/stepfunctions/asl/parse/test_state/preprocessor.py +222 -31
- localstack/services/stepfunctions/asl/static_analyser/test_state/test_state_analyser.py +170 -22
- localstack/services/stepfunctions/backend/execution.py +6 -6
- localstack/services/stepfunctions/backend/execution_worker.py +5 -5
- localstack/services/stepfunctions/backend/test_state/execution.py +36 -0
- localstack/services/stepfunctions/backend/test_state/execution_worker.py +33 -1
- localstack/services/stepfunctions/backend/test_state/test_state_mock.py +127 -0
- localstack/services/stepfunctions/local_mocking/__init__.py +9 -0
- localstack/services/stepfunctions/{mocking → local_mocking}/mock_config.py +24 -17
- localstack/services/stepfunctions/provider.py +78 -27
- localstack/services/stepfunctions/test_state/mock_config.py +47 -0
- localstack/testing/pytest/fixtures.py +28 -0
- localstack/testing/snapshots/transformer_utility.py +5 -0
- localstack/utils/analytics/publisher.py +37 -155
- localstack/utils/analytics/service_request_aggregator.py +6 -4
- localstack/utils/aws/arns.py +7 -0
- localstack/utils/batching.py +258 -0
- localstack/utils/collections.py +23 -11
- localstack/version.py +2 -2
- {localstack_core-4.10.1.dev42.dist-info → localstack_core-4.11.2.dev14.dist-info}/METADATA +5 -5
- {localstack_core-4.10.1.dev42.dist-info → localstack_core-4.11.2.dev14.dist-info}/RECORD +113 -105
- localstack_core-4.11.2.dev14.dist-info/plux.json +1 -0
- localstack/services/stepfunctions/mocking/__init__.py +0 -0
- localstack/utils/batch_policy.py +0 -124
- localstack_core-4.10.1.dev42.dist-info/plux.json +0 -1
- /localstack/services/stepfunctions/{mocking → local_mocking}/mock_config_file.py +0 -0
- {localstack_core-4.10.1.dev42.data → localstack_core-4.11.2.dev14.data}/scripts/localstack +0 -0
- {localstack_core-4.10.1.dev42.data → localstack_core-4.11.2.dev14.data}/scripts/localstack-supervisor +0 -0
- {localstack_core-4.10.1.dev42.data → localstack_core-4.11.2.dev14.data}/scripts/localstack.bat +0 -0
- {localstack_core-4.10.1.dev42.dist-info → localstack_core-4.11.2.dev14.dist-info}/WHEEL +0 -0
- {localstack_core-4.10.1.dev42.dist-info → localstack_core-4.11.2.dev14.dist-info}/entry_points.txt +0 -0
- {localstack_core-4.10.1.dev42.dist-info → localstack_core-4.11.2.dev14.dist-info}/licenses/LICENSE.txt +0 -0
- {localstack_core-4.10.1.dev42.dist-info → localstack_core-4.11.2.dev14.dist-info}/top_level.txt +0 -0
|
@@ -28,6 +28,7 @@ VALID_SUBSCRIPTION_ATTR_NAME: list[str] = [
|
|
|
28
28
|
MSG_ATTR_NAME_REGEX = re.compile(r"^(?!\.)(?!.*\.$)(?!.*\.\.)[a-zA-Z0-9_\-.]+$")
|
|
29
29
|
ATTR_TYPE_REGEX = re.compile(r"^(String|Number|Binary)\..+$")
|
|
30
30
|
VALID_MSG_ATTR_NAME_CHARS = set(ascii_letters + digits + "." + "-" + "_")
|
|
31
|
+
E164_REGEX = re.compile(r"^\+?[1-9]\d{1,14}$")
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
GCM_URL = "https://fcm.googleapis.com/fcm/send"
|
|
@@ -42,6 +43,7 @@ SUBSCRIPTION_TOKENS_ENDPOINT = "/_aws/sns/subscription-tokens"
|
|
|
42
43
|
SNS_CERT_ENDPOINT = "/_aws/sns/SimpleNotificationService-6c6f63616c737461636b69736e696365.pem"
|
|
43
44
|
|
|
44
45
|
DUMMY_SUBSCRIPTION_PRINCIPAL = "arn:{partition}:iam::{account_id}:user/DummySNSPrincipal"
|
|
45
|
-
E164_REGEX = re.compile(r"^\+?[1-9]\d{1,14}$")
|
|
46
46
|
|
|
47
47
|
VALID_APPLICATION_PLATFORMS = list(get_args(SnsApplicationPlatforms))
|
|
48
|
+
|
|
49
|
+
MAXIMUM_MESSAGE_LENGTH = 262144
|
|
@@ -30,6 +30,7 @@ from localstack.services.sns.models import (
|
|
|
30
30
|
SnsStore,
|
|
31
31
|
SnsSubscription,
|
|
32
32
|
)
|
|
33
|
+
from localstack.services.sns.v2.utils import get_topic_subscriptions
|
|
33
34
|
from localstack.utils.aws.arns import (
|
|
34
35
|
PARTITION_NAMES,
|
|
35
36
|
extract_account_id_from_arn,
|
|
@@ -254,9 +255,11 @@ class LambdaTopicPublisher(TopicPublisher):
|
|
|
254
255
|
"UnsubscribeUrl": unsubscribe_url,
|
|
255
256
|
"MessageAttributes": message_attributes,
|
|
256
257
|
}
|
|
257
|
-
|
|
258
|
+
# TODO: remove v1 "signature_version" access once v1 is retired
|
|
258
259
|
signature_version = (
|
|
259
|
-
topic_attributes.get("signature_version", "
|
|
260
|
+
topic_attributes.get("signature_version", topic_attributes.get("SignatureVersion", "1"))
|
|
261
|
+
if topic_attributes
|
|
262
|
+
else "1"
|
|
260
263
|
)
|
|
261
264
|
canonical_string = compute_canonical_string(event_payload, message_context.type)
|
|
262
265
|
signature = get_message_signature(canonical_string, signature_version=signature_version)
|
|
@@ -558,7 +561,10 @@ class HttpTopicPublisher(TopicPublisher):
|
|
|
558
561
|
):
|
|
559
562
|
return sub_content_type
|
|
560
563
|
|
|
561
|
-
|
|
564
|
+
# TODO: remove lower case access once legacy v1 provider is removed
|
|
565
|
+
if json_topic_delivery_policy := topic_attributes.get(
|
|
566
|
+
"delivery_policy", topic_attributes.get("DeliveryPolicy")
|
|
567
|
+
):
|
|
562
568
|
topic_delivery_policy = json.loads(json_topic_delivery_policy)
|
|
563
569
|
if not (
|
|
564
570
|
topic_content_type := topic_delivery_policy.get(subscriber["Protocol"].lower())
|
|
@@ -1009,7 +1015,10 @@ def create_sns_message_body(
|
|
|
1009
1015
|
# FIFO topics do not add the signature in the message
|
|
1010
1016
|
if not subscriber.get("TopicArn", "").endswith(".fifo"):
|
|
1011
1017
|
signature_version = (
|
|
1012
|
-
|
|
1018
|
+
# we allow for both casings, depending on v1 or v2 provider
|
|
1019
|
+
topic_attributes.get("signature_version", topic_attributes.get("SignatureVersion", "1"))
|
|
1020
|
+
if topic_attributes
|
|
1021
|
+
else "1"
|
|
1013
1022
|
)
|
|
1014
1023
|
canonical_string = compute_canonical_string(data, message_type)
|
|
1015
1024
|
signature = get_message_signature(canonical_string, signature_version=signature_version)
|
|
@@ -1234,7 +1243,7 @@ class PublishDispatcher:
|
|
|
1234
1243
|
)
|
|
1235
1244
|
|
|
1236
1245
|
def publish_to_topic(self, ctx: SnsPublishContext, topic_arn: str) -> None:
|
|
1237
|
-
subscriptions = ctx.store
|
|
1246
|
+
subscriptions = get_topic_subscriptions(ctx.store, topic_arn)
|
|
1238
1247
|
for subscriber in subscriptions:
|
|
1239
1248
|
if self._should_publish(ctx.store.subscription_filter_policy, ctx.message, subscriber):
|
|
1240
1249
|
notifier = self.topic_notifiers[subscriber["Protocol"]]
|
|
@@ -1249,7 +1258,7 @@ class PublishDispatcher:
|
|
|
1249
1258
|
self._submit_notification(notifier, ctx, subscriber)
|
|
1250
1259
|
|
|
1251
1260
|
def publish_batch_to_topic(self, ctx: SnsBatchPublishContext, topic_arn: str) -> None:
|
|
1252
|
-
subscriptions = ctx.store
|
|
1261
|
+
subscriptions = get_topic_subscriptions(ctx.store, topic_arn)
|
|
1253
1262
|
for subscriber in subscriptions:
|
|
1254
1263
|
protocol = subscriber["Protocol"]
|
|
1255
1264
|
notifier = self.batch_topic_notifiers.get(protocol)
|
|
@@ -181,9 +181,15 @@ class SnsStore(BaseStore):
|
|
|
181
181
|
# maps endpoint arns to platform endpoints
|
|
182
182
|
platform_endpoints: dict[str, PlatformEndpoint] = LocalAttribute(default=dict)
|
|
183
183
|
|
|
184
|
+
# cache of topic ARN to platform endpoint messages (used primarily for testing)
|
|
185
|
+
platform_endpoint_messages: dict[str, list[dict]] = LocalAttribute(default=dict)
|
|
186
|
+
|
|
184
187
|
# topic/subscription independent default values for sending sms messages
|
|
185
188
|
sms_attributes: dict[str, str] = LocalAttribute(default=dict)
|
|
186
189
|
|
|
190
|
+
# list of sent SMS messages
|
|
191
|
+
sms_messages: list[dict] = LocalAttribute(default=list)
|
|
192
|
+
|
|
187
193
|
TAGS: TaggingService = CrossRegionAttribute(default=TaggingService)
|
|
188
194
|
|
|
189
195
|
|