This PR adds a new API endpoint /api/v1/legalhold/run, which allows the Legal Hold job to be run on demand via HTTP request, as opposed to only running on a timer.
The plugin ensures the provided token belongs to an admin user before proceeding, as it does for all endpoints that the plugin exposes. You can use a personal access token with admin privileges, or take the MMAUTHTOKEN cookie value from your browser's request headers, and use it as a Bearer token as shown below:
curl -X POST 'http://localhost:8065/plugins/com.mattermost.plugin-legal-hold/api/v1/legalhold/run' \
-H 'Authorization: Bearer adu7m6bydudfimzof6nuey237re'
Summary
This PR adds a new API endpoint
/api/v1/legalhold/run
, which allows the Legal Hold job to be run on demand via HTTP request, as opposed to only running on a timer.The plugin ensures the provided token belongs to an admin user before proceeding, as it does for all endpoints that the plugin exposes. You can use a personal access token with admin privileges, or take the
MMAUTHTOKEN
cookie value from your browser's request headers, and use it as aBearer
token as shown below:Ticket Link
Fixes https://github.com/mattermost/mattermost-plugin-legal-hold/issues/41