Skip to content

Use 'Authorization' header in requests #24

@lukecarr

Description

@lukecarr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions