aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/pleroma/web/activity_pub/mrf.ex16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/mrf.ex b/lib/pleroma/web/activity_pub/mrf.ex
index caa2a3231..d43a8760b 100644
--- a/lib/pleroma/web/activity_pub/mrf.ex
+++ b/lib/pleroma/web/activity_pub/mrf.ex
@@ -35,4 +35,20 @@ defmodule Pleroma.Web.ActivityPub.MRF do
def subdomain_match?(domains, host) do
Enum.any?(domains, fn domain -> Regex.match?(domain, host) end)
end
+
+ @callback describe() :: {:ok | :error, Map.t()}
+
+ def describe(policies) do
+ policies
+ |> Enum.reduce({:ok, %{}}, fn
+ policy, {:ok, data} ->
+ {:ok, policy_data} = policy.describe()
+ {:ok, Map.merge(data, policy_data)}
+
+ _, error ->
+ error
+ end)
+ end
+
+ def describe(), do: get_policies() |> describe()
end