It would be really handy if this plugin could populate the Authorization header with Bearer $token in the HTTP requests that are sent to a configured webhook.
In my scenario, I'm hosting the webhooks as Lambda functions behind AWS API Gateway, and API Gateway's custom authorizers don't support reading from the request's POST body. If this plugin sent the token in the request's Authorization header, I'd be able to create a custom authorizer that could validate the provided function, and decouple my authentication logic from each individual function that sits behind API Gateway.
I'm not too familiar with PHP or Moodle plugin development, but if it's as simple as modifying lib.php's local_webhooks_send_request() function to set the header, I'm happy to open a PR.
It would be really handy if this plugin could populate the
Authorizationheader withBearer $tokenin the HTTP requests that are sent to a configured webhook.In my scenario, I'm hosting the webhooks as Lambda functions behind AWS API Gateway, and API Gateway's custom authorizers don't support reading from the request's POST body. If this plugin sent the token in the request's
Authorizationheader, I'd be able to create a custom authorizer that could validate the provided function, and decouple my authentication logic from each individual function that sits behind API Gateway.I'm not too familiar with PHP or Moodle plugin development, but if it's as simple as modifying
lib.php'slocal_webhooks_send_request()function to set the header, I'm happy to open a PR.