Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'Authorization' header in requests #24

Open
lukecarr opened this issue Mar 15, 2021 · 0 comments
Open

Use 'Authorization' header in requests #24

lukecarr opened this issue Mar 15, 2021 · 0 comments

Comments

@lukecarr
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant