Fetcher: Only check SimplePolicy rules when policy is enabled #1044
No reviewers
Labels
No labels
approved, awaiting change
broken setup
bug
cannot reproduce
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs change/feedback
needs docs
needs tests
not a bug
not our bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AkkomaGang/akkoma!1044
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "mkljczk/akkoma:fetcher-simple-policy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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)},nit: just
:mrf_checkand(maybe_)restrict_uri_mrfis 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@ -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")This test does not do what it title claims, but is just a duplicate of
"does not fetch anything from a rejected instance"e5bdc31735cf109080b5@ -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}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 futureRepushed with this fixed
cf109080b5dee0e01af9Fixed 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 formatandmix test || mix test --failedpass locally