From: Lunar Date: Fri, 30 Jun 2023 09:06:40 +0000 (+0200) Subject: Switch to Mailman 3 REST API for “ag” subscriptions X-Git-Url: https://www.nos-oignons.net/gitweb/gestion-adh.git/commitdiff_plain/56d63dc536c09e07e7de107a76500ecc92cf7cb7?hp=56d63dc536c09e07e7de107a76500ecc92cf7cb7 Switch to Mailman 3 REST API for “ag” subscriptions We used to control subscriptions to the “ag“ mailing list using Mailman 2 command line interface. Now that we use Mailman 3, we need to switch to its REST API to do the same. Most of what is useful to us is documented at: https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/membership.html The `rest-client` gem has been added to ease with implementing REST requests. A key difference from the old interface is that a subscription creates a `member_id`, specific to the list and different from the `user_id` or email address. Unsubscribing a user requires to this `member_id`. It is not a big issue as our process to update the list subscriptions always start by listing all current subscriptions. We retrieve both the `member_id` and email address at this stage. After comparing to the list of known members, we can use the `member_id` to remove outdated subscriptions. The relevant Gherkin scenarios have been updated to be easier to test with these new process but are functionally equivalent. We also take the opportunity to move from crontab(5) to systemd.timer(5) and systemd.service(5) to use systemd service credentials to protect the password to Mailman REST API. ---