Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix SQS JSON protocol support in ASF #8268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions localstack/aws/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from botocore.waiter import Waiter

from localstack import config as localstack_config
from localstack.aws.spec import LOCALSTACK_BUILTIN_DATA_PATH
from localstack.constants import (
AWS_REGION_US_EAST_1,
INTERNAL_AWS_ACCESS_KEY_ID,
Expand Down Expand Up @@ -240,6 +241,11 @@ def __init__(
self._verify = verify
self._config: Config = config or Config(max_pool_connections=MAX_POOL_CONNECTIONS)
self._session: Session = session or Session()

# make sure we consider our custom data paths for legacy specs (like SQS query protocol)
if LOCALSTACK_BUILTIN_DATA_PATH not in self._session._loader.search_paths:
self._session._loader.search_paths.append(LOCALSTACK_BUILTIN_DATA_PATH)

self._create_client_lock = threading.RLock()

def __call__(
Expand Down
8 changes: 8 additions & 0 deletions localstack/aws/data/sqs-query/2012-11-05/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This spec preserves the SQS query protocol spec, which was part of botocore until the protocol was switched to json with `botocore==1.31.81`.
This switch removed a lot of spec data which is necessary for the proper parsing and serialization, which is why we have to preserve them on our own.

- The spec content was preserved from this state: https://github.com/boto/botocore/blob/4ff08259b6325b9b8d25127672b88d7c963e6f71/botocore/data/sqs/2012-11-05/service-2.json
- This was the last commit before the protocol switched to json (with https://github.com/boto/botocore/commit/143e3925dac58976b5e83864a3ed9a2dea1db91b).
- The file is licensed with Apache License 2.0.
- Modifications:
- Removal of documentation strings with the following regex: `(,)?\n\s+"documentation":".*"`
Loading