SimplePolicyTest: Add test for leaking DMs.
This commit is contained in:
parent
702f0fb822
commit
e2e66e50d3
1 changed files with 13 additions and 0 deletions
|
@ -290,6 +290,15 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicyTest do
|
||||||
"cc" => [actor.follower_address, "http://foo.bar/qux"]
|
"cc" => [actor.follower_address, "http://foo.bar/qux"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dm_activity = %{
|
||||||
|
"actor" => actor.ap_id,
|
||||||
|
"to" => [
|
||||||
|
following_user.ap_id,
|
||||||
|
non_following_user.ap_id
|
||||||
|
],
|
||||||
|
"cc" => []
|
||||||
|
}
|
||||||
|
|
||||||
actor_domain =
|
actor_domain =
|
||||||
activity
|
activity
|
||||||
|> Map.fetch!("actor")
|
|> Map.fetch!("actor")
|
||||||
|
@ -305,6 +314,10 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicyTest do
|
||||||
refute "https://www.w3.org/ns/activitystreams#Public" in new_activity["cc"]
|
refute "https://www.w3.org/ns/activitystreams#Public" in new_activity["cc"]
|
||||||
refute non_following_user.ap_id in new_activity["to"]
|
refute non_following_user.ap_id in new_activity["to"]
|
||||||
refute non_following_user.ap_id in new_activity["cc"]
|
refute non_following_user.ap_id in new_activity["cc"]
|
||||||
|
|
||||||
|
assert {:ok, new_dm_activity} = SimplePolicy.filter(dm_activity)
|
||||||
|
assert new_dm_activity["to"] == [following_user.ap_id]
|
||||||
|
assert new_dm_activity["cc"] == []
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue