Expose the header matches in the REST API
This branch exposes a mailing list's header matches in the REST API.
It is composed of 3 commits that are best understood in sequence:
- commit 3e69044a turns the former
HeaderMatchSet
into aHeaderMatchList
because the order in which the header matches are processed by the rule is significant. For this reason, the HeaderMatch model classes have gained anindex
attribute that allows sorting and re-ordering.HeaderMatchList
does not entirely behave like a list because we want a better API forappend
andinsert
. - commit 432b07c5 changes the newly introduced
index
attribute into a property where the setter takes care of re-ordering the list of header matches. - commit 703fc135 renames the
HeaderMatch.chain
attribute toaction
and coerces it to anAction
enum. This is what this field is intended for, and allows validation of what the admin can set through the REST API. - commit e1950ac8 adds the REST API endpoints and documentation.
Fixes: #192 (closed)