Reject third-party remote reports
This commit is contained in:
parent
960c730706
commit
0cf865f025
3 changed files with 25 additions and 0 deletions
|
|
@ -86,6 +86,23 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
|||
assert activity.data["cc"] == [user.ap_id]
|
||||
end
|
||||
|
||||
test "it rejects Flag activities when both reporter and reported account are remote" do
|
||||
reporter = insert(:user, local: false, domain: "mastodon.cat")
|
||||
reported = insert(:user, local: false, domain: "nicecrew.digital")
|
||||
|
||||
message = %{
|
||||
"@context" => "https://www.w3.org/ns/activitystreams",
|
||||
"actor" => reporter.ap_id,
|
||||
"content" => "blocked AND reported!!!",
|
||||
"object" => [reported.ap_id, "https://nicecrew.digital/objects/report-status"],
|
||||
"type" => "Flag"
|
||||
}
|
||||
|
||||
assert {:reject, reason} = Transmogrifier.handle_incoming(message)
|
||||
assert reason =~ "third-party report"
|
||||
refute "Flag" |> Pleroma.Activity.Queries.by_type() |> Pleroma.Repo.one()
|
||||
end
|
||||
|
||||
test "it accepts Move activities" do
|
||||
old_user = insert(:user)
|
||||
new_user = insert(:user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue