diff options
author | Mark Felder <feld@feld.me> | 2021-02-12 13:05:12 -0600 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2021-02-12 13:05:12 -0600 |
commit | 3554a65f45d0e513e5e23e987f6f8fb1da5e8525 (patch) | |
tree | eb4bda9435864c0102af118caebf48eb6226acff | |
parent | 9b61df1fb64c49a4ad6277862d1405a27ad1c0da (diff) | |
download | pleroma-3554a65f45d0e513e5e23e987f6f8fb1da5e8525.tar.gz |
Inject fake application metadata and validate it is stripped by transmogrifier
-rw-r--r-- | lib/pleroma/constants.ex | 3 | ||||
-rw-r--r-- | test/pleroma/web/activity_pub/transmogrifier_test.exs | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/pleroma/constants.ex b/lib/pleroma/constants.ex index a40741ba6..9ee836d5d 100644 --- a/lib/pleroma/constants.ex +++ b/lib/pleroma/constants.ex @@ -18,7 +18,8 @@ defmodule Pleroma.Constants do "emoji", "context_id", "deleted_activity_id", - "pleroma_internal" + "pleroma_internal", + "application" ] ) diff --git a/test/pleroma/web/activity_pub/transmogrifier_test.exs b/test/pleroma/web/activity_pub/transmogrifier_test.exs index 7c97fa8f8..2c99875ff 100644 --- a/test/pleroma/web/activity_pub/transmogrifier_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier_test.exs @@ -202,7 +202,11 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do test "it strips internal fields" do user = insert(:user) - {:ok, activity} = CommonAPI.post(user, %{status: "#2hu :firefox:"}) + {:ok, activity} = + CommonAPI.post(user, %{ + status: "#2hu :firefox:", + application: %{name: "TestClient", website: "https://pleroma.social"} + }) {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data) @@ -213,6 +217,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do assert is_nil(modified["object"]["announcements"]) assert is_nil(modified["object"]["announcement_count"]) assert is_nil(modified["object"]["context_id"]) + assert is_nil(modified["object"]["application"]) end test "it strips internal fields of article" do |