8000 oas validation for sqs backdoor · localstack/localstack@12ea791 · GitHub
[go: up one dir, main page]

Skip to content

Commit 12ea791

Browse files
committed
oas validation for sqs backdoor
1 parent 8085e41 commit 12ea791

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

localstack-core/localstack/aws/handlers/validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def __call__(self, chain: HandlerChain, context: RequestContext, response: Respo
134134
WerkzeugOpenAPIResponse(response),
135135
)
136136
except ResponseValidationError as exc:
137-
LOG.error("Response validation failed for %s: $s", path, exc)
137+
LOG.error("Response validation failed for %s: %s", path, exc)
138138
response.status_code = 500
139139
response.set_json({"error": exc.__class__.__name__, "message": str(exc)})
140140
chain.stop()

localstack-core/localstack/testing/pytest/fixtures.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,3 +2285,9 @@ def _delete_log_group():
22852285
call_safe(_delete_log_group)
22862286

22872287
yield _clean_up
2288+
2289+
2290+
@pytest.fixture
2291+
def openapi_validate(monkeypatch):
2292+
monkeypatch.setattr(config, "OPENAPI_VALIDATE_RESPONSE", "true")
2293+
monkeypatch.setattr(config, "OPENAPI_VALIDATE_REQUEST", "true")

tests/aws/services/sqs/test_sqs_backdoor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def _parse_attribute_map(json_message: dict) -> dict[str, str]:
2626
return {attr["Name"]: attr["Value"] for attr in json_message["Attribute"]}
2727

2828

29+
@pytest.mark.usefixtures("openapi_validate")
2930
class TestSqsDeveloperEndpoints:
3031
@markers.aws.only_localstack
3132
@pytest.mark.parametrize("strategy", ["standard", "domain", "path"])

0 commit comments

Comments
 (0)
0