mattermost / mattermost-plugin-legal-hold

Plugin to create and manage legal holds in Mattermost
Other
5 stars 2 forks source link

Add API endpoint to run legal hold job on demand #43

Closed mickmister closed 2 months ago

mickmister commented 2 months ago

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 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'

Ticket Link

Fixes https://github.com/mattermost/mattermost-plugin-legal-hold/issues/41

mickmister commented 1 month ago

@jlandells This is now implemented and available on the master branch of this repo. See the PR description for more details