pleroma/test/support
Lain Soykaf 20354e0aee
fix(fetcher): require fetched documents to have the fetched id
The fetcher accepted any document whose id was on the same host as the
fetch URL. Anyone who can place a JSON file on a host, for example
through an upload, could pass it off as another object or actor from
that host.

The id of a fetched document must now be the URL it came from (after
redirects), ignoring a trailing slash, the fragment, the host case and
differences that our URL encoding removes.
If it differs, as for Mastodon's /@user/123 display URLs, we refetch
once from that id, which must be on the same host. The refetch must
not redirect and must match exactly.

Test mocks that served a document under a different URL now serve it
from its own id.

Based on Akkoma 8684964c5 and 940792f8b.
2026-10-27 21:58:41 +04:00
..
builders
captcha
api_spec_helpers.ex
cachex_proxy.ex
channel_case.ex
cluster.ex
conn_case.ex fix tests 2026-05-12 16:50:35 +02:00
data_case.ex
factory.ex Tests AP Factory: fix featured collection factories 2025-12-25 20:40:12 +01:00
helpers.ex
http_request_mock.ex fix(fetcher): require fetched documents to have the fetched id 2026-10-27 21:58:41 +04:00
http_signatures_proxy.ex
mocks.ex Add ParadeDB external search backend 2026-03-03 12:17:34 +04:00
mrf_module_mock.ex
null_cache.ex
oban_helpers.ex
translation_mock.ex
websocket_client.ex