diff options
| author | Dennis Fink | 2026-10-30 20:41:25 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-10-30 20:41:25 +0100 |
| commit | 53370723df05193938ce3c2d55a8e12f2a87b17b (patch) | |
| tree | e67ec12d3635d141bdc670fbfc5fa6bfb87cd69c /tests/tasks/test_receiver.py | |
| parent | 13a9d9ddce09230017699bc34ac3bf08ed2f84ed (diff) | |
| download | webmentions-ssg-53370723df05193938ce3c2d55a8e12f2a87b17b.tar.gz webmentions-ssg-53370723df05193938ce3c2d55a8e12f2a87b17b.zip | |
fix(core): replace Huey pickle serialization with JSON
Prevent broker-controlled task and result payloads from deserializing
arbitrary Python objects by using a restricted JSON serializer with an
explicit type allowlist.
Fail closed on serializer overrides and document broker isolation and
migration requirements for existing pickle-backed deployments.
Diffstat (limited to 'tests/tasks/test_receiver.py')
| -rw-r--r-- | tests/tasks/test_receiver.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/tasks/test_receiver.py b/tests/tasks/test_receiver.py index 102410d..c795115 100644 --- a/tests/tasks/test_receiver.py +++ b/tests/tasks/test_receiver.py @@ -688,8 +688,9 @@ def test_fetch_source_rejects_unsafe_destination( client = httpx_client.return_value.__enter__.return_value client.stream.side_effect = UnsafeAddressError("Local address") - with app.app_context(), pytest.raises( - receiver.VerificationError, match="non-public address" + with ( + app.app_context(), + pytest.raises(receiver.VerificationError, match="non-public address"), ): receiver.fetch_source(SOURCE_URL) @@ -700,8 +701,9 @@ def test_fetch_source_treats_dns_failure_as_temporary( ) -> None: client = httpx_client.return_value.__enter__.return_value client.stream.side_effect = AddressResolutionError("DNS timeout") - with app.app_context(), pytest.raises( - receiver.TemporaryFetchError, match="could not be resolved" + with ( + app.app_context(), + pytest.raises(receiver.TemporaryFetchError, match="could not be resolved"), ): receiver.fetch_source(SOURCE_URL) |
