logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 5049b4272e6d1d306a5ffcf05d8d190dacc58478
parent 5f5dc24027ee5cfadd226c5db2e2a2bdb0ababe0
Author: Ilja <ilja@ilja.space>
Date:   Sat, 14 Aug 2021 13:42:32 +0200

Selecting MRF policies didn't work as intended any more

* Policies were put under a new module (Pleroma.Web.ActivityPub.MRF.Policy instead of Pleroma.Web.ActivityPub.MRF), but this wasn't changed in the Pleroma.Web.ActivityPub.MRF @mrf_config_descriptions
* I don't have a unit test to prevent similar problems in the future because I don't find a proper way to do it
    * The descriptions in the unit tests are defined in the unit tests, so if someone changes module names in the code, the tests wont see it
    * The list is generated in Pleroma.Docs.Generator.list_behaviour_implementations, but I can't do a check in the when clause of the function to see if the provided module is a behaviour or not.

Diffstat:

Mlib/pleroma/web/activity_pub/mrf.ex2+-
Mtest/pleroma/docs/generator_test.exs2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/pleroma/web/activity_pub/mrf.ex b/lib/pleroma/web/activity_pub/mrf.ex @@ -21,7 +21,7 @@ defmodule Pleroma.Web.ActivityPub.MRF do type: [:module, {:list, :module}], description: "A list of MRF policies enabled. Module names are shortened (removed leading `Pleroma.Web.ActivityPub.MRF.` part), but on adding custom module you need to use full name.", - suggestions: {:list_behaviour_implementations, Pleroma.Web.ActivityPub.MRF} + suggestions: {:list_behaviour_implementations, Pleroma.Web.ActivityPub.MRF.Policy} }, %{ key: :transparency, diff --git a/test/pleroma/docs/generator_test.exs b/test/pleroma/docs/generator_test.exs @@ -23,7 +23,7 @@ defmodule Pleroma.Docs.GeneratorTest do key: :filters, type: {:list, :module}, description: "", - suggestions: {:list_behaviour_implementations, Pleroma.Web.ActivityPub.MRF} + suggestions: {:list_behaviour_implementations, Pleroma.Web.ActivityPub.MRF.Policy} }, %{ key: Pleroma.Upload,