Fetcher: Only check SimplePolicy rules when policy is enabled #1044

Merged
Oneric merged 2 commits from mkljczk/akkoma:fetcher-simple-policy into develop 2026-02-18 13:37:29 +00:00
Contributor
No description provided.
Fetcher: Only check SimplePolicy rules when policy is enabled
Some checks are pending
ci/woodpecker/pr/test/1 Pipeline is pending approval
ci/woodpecker/pr/test/2 Pipeline is pending approval
fbe1957b9b
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
Oneric left a comment
Owner

Thanks, this makes sense, but a few minor issues

Thanks, this makes sense, but a few minor issues
@ -142,3 +141,1 @@
{:mrf_reject_check, Pleroma.Web.ActivityPub.MRF.SimplePolicy.check_reject(uri)},
{:mrf_accept_check, {:ok, _}} <-
{:mrf_accept_check, Pleroma.Web.ActivityPub.MRF.SimplePolicy.check_accept(uri)},
{_, {_, nil}} <- {:mrf_reject_accept_check, maybe_check_reject_accept(uri)},
Owner

nit: just :mrf_check and (maybe_)restrict_uri_mrf is enough. It doesn’t need to be this long and specific, if we add any more MRF rules here in the future it would be added to the newly split out function anyway

nit: just `:mrf_check` and `(maybe_)restrict_uri_mrf` is enough. It doesn’t need to be this long and specific, if we add any more MRF rules here in the future it would be added to the newly split out function anyway
Oneric marked this conversation as resolved
@ -355,3 +363,4 @@
clear_config([:mrf, :policies], [Pleroma.Web.ActivityPub.MRF.SimplePolicy])
assert {:reject, _} =
Fetcher.fetch_object_from_id("http://evil.example.org/@admin/99541947525187367")
Owner

This test does not do what it title claims, but is just a duplicate of "does not fetch anything from a rejected instance"

This test does not do what it title claims, but is just a duplicate of `"does not fetch anything from a rejected instance"`
Oneric marked this conversation as resolved
apply suggestions
Some checks failed
ci/woodpecker/pr/test/2 Pipeline failed
ci/woodpecker/pr/test/1 Pipeline failed
e5bdc31735
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
Oneric force-pushed fetcher-simple-policy from e5bdc31735
Some checks failed
ci/woodpecker/pr/test/2 Pipeline failed
ci/woodpecker/pr/test/1 Pipeline failed
to cf109080b5
Some checks failed
ci/woodpecker/pr/test/2 Pipeline failed
ci/woodpecker/pr/test/1 Pipeline failed
2026-01-30 20:20:18 +00:00
Compare
@ -216,0 +210,4 @@
with {:enabled, true} <- {:enabled, MRF.SimplePolicy in MRF.get_policies()},
{:ok, _} <- MRF.SimplePolicy.check_reject(uri, nil),
{:ok, _} <- MRF.SimplePolicy.check_accept(uri, nil) do
{:ok, nil}
Owner

This was missing an import and check_(reject|accept) does not take a second argument, which both lead to compiler warnings and many test failures. Please compile and test in the future

Repushed with this fixed

This was missing an import and `check_(reject|accept)` does not take a second argument, which both lead to compiler warnings and many test failures. Please compile and test in the future Repushed with this fixed
Oneric marked this conversation as resolved
Oneric force-pushed fetcher-simple-policy from cf109080b5
Some checks failed
ci/woodpecker/pr/test/2 Pipeline failed
ci/woodpecker/pr/test/1 Pipeline failed
to dee0e01af9
Some checks are pending
ci/woodpecker/pr/test/1 Pipeline is pending approval
ci/woodpecker/pr/test/2 Pipeline is pending approval
2026-01-30 20:44:01 +00:00
Compare
Owner

Fixed yet another missing change, but now the previously broken test fails due to a missing mock and there’s no readily available fixture gor this AP id. Please make sure mix format and mix test || mix test --failed pass locally

Fixed yet another missing change, but now the previously broken test fails due to a missing mock and there’s no readily available fixture gor this AP id. Please make sure `mix format` and `mix test || mix test --failed` pass locally
fix test
All checks were successful
ci/woodpecker/pr/test/2 Pipeline was successful
ci/woodpecker/pr/test/1 Pipeline was successful
00fcffe5b9
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
Oneric approved these changes 2026-02-18 13:36:37 +00:00
Oneric merged commit 7c0deab8c5 into develop 2026-02-18 13:37:29 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AkkomaGang/akkoma!1044
No description provided.