Add support for webhooks on POSTs
Background
To integrate with external systems, it is desirable to add possibility for webhooks.
Implementation
Wrap select POST/PUT requests with a @webhook
decorator, where, on success, the payload is forwarded to any matching hooks defined in the application config.
The application config can be updated like this:
webhooks:
- endpoint: "/api/v1/workflows/action/\d+/actions/finalize"
hook: "http://my-server/api/notify-workflow-finalize"
methods:
- "POST"
The implementation should satisfy:
- The endpoints should be defined with regex patterns
- Failure in webhook requests should be logged, but not prevent a successful request in ELLA
- No sensitive information should be sent, such as passwords (hence only select POST/PUT requests, not e.g. /api/v1/login)
- The payload should be posted "as-is", with the following additions:
- user information
- endpoint called
Edited by Øyvind Evju