Skip to content

WIP: Add a management API for keyword policies

Hécate requested to merge (removed):keyword_policy/mgmt_api into develop

This MR is built on #612 (closed) and the subsequent discussions that happened.

Additions

It implemements three basic actions on keyword policies:

  1. POST /save
  2. GET /list
  3. DELETE /reset

Changes

  1. The format for replacement rules in config/config.exs changed from a list of tuples (aka: Keyword) to a Map.
    Documentation has been modified accordingly.
  2. In the NodeInfo controller, Keyword Policy aggregation and formatting has been moved to the Pleroma.Web.ActivityPub.MRF.KeywordPolicy module.

Notes

  1. During this MR, an attempt was made to formalize the shape of the data with Ecto, which led to #644 (closed).
    It was then decided (by myself) that any effort to implement the results of what was suggested in #644 (closed) would take place in another MR.

  2. Cachex will not be used (in this MR at least) to store keyword policies

TODO

  • Unit tests on the new functions
  • Deprecation warning

@rinpatch
@lambadalambda
@feld
@kaniini

Edited by Hécate

Merge request reports

Loading