diff options
author | Alex Gleason <alex@alexgleason.me> | 2020-04-12 20:26:35 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2020-04-12 20:26:35 -0500 |
commit | 9a3c74b244bce6097a8c6da99692bfc9973e1ec8 (patch) | |
tree | 0ec2d6770054d4e318877ad26976b1abb78daa60 /test | |
parent | 7ee35eb9a6a55ef610eb02a04a33f67e5921cff3 (diff) | |
download | pleroma-9a3c74b244bce6097a8c6da99692bfc9973e1ec8.tar.gz |
Always accept deletions through SimplePolicy
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/mrf/simple_policy_test.exs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/web/activity_pub/mrf/simple_policy_test.exs b/test/web/activity_pub/mrf/simple_policy_test.exs index 91c24c2d9..eaa595706 100644 --- a/test/web/activity_pub/mrf/simple_policy_test.exs +++ b/test/web/activity_pub/mrf/simple_policy_test.exs @@ -258,6 +258,14 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicyTest do assert SimplePolicy.filter(remote_user) == {:reject, nil} end + + test "always accept deletions" do + Config.put([:mrf_simple, :reject], ["remote.instance"]) + + deletion_message = build_remote_deletion_message() + + assert SimplePolicy.filter(deletion_message) == {:ok, deletion_message} + end end describe "when :accept" do @@ -308,6 +316,14 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicyTest do assert SimplePolicy.filter(remote_user) == {:ok, remote_user} end + + test "always accept deletions" do + Config.put([:mrf_simple, :accept], ["non.matching.remote"]) + + deletion_message = build_remote_deletion_message() + + assert SimplePolicy.filter(deletion_message) == {:ok, deletion_message} + end end describe "when :avatar_removal" do @@ -408,4 +424,11 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicyTest do "type" => "Person" } end + + defp build_remote_deletion_message do + %{ + "type" => "Delete", + "actor" => "https://remote.instance/users/bob" + } + end end |