botkube
botkube copied to clipboard
How to add Authorization header for Outgoing Webhook ?
I have a secure Webhook endpoint to which i like to have botkube send the events. How should i add the Authorization header for Webhook?
Would love to see that feature as well
Well, authorization webhooks headers are going to have API key and value, how we manage to add them?
@mszostok Can I work on this?
Hi @ronit-nandwani
Yes, it's available to pick 🙂 If you will have any questions, let us know on our Botkube Slack Workspace 👍
Awesome! Yes, will reach out for help on Slack. Can you please assign this issue to me.
we can make a webhook request chain system, respectively in the request chain has three operation: 1. build request 2. Call a hook to modify the request 3. Dorequest. As drawn in the image below:
Hey everyone Has there been any progress regarding the issue? We actually want to start using botKube and our webhook is secure
Thanks!
Hey @ronit-nandwani, could you please give us a status update regarding your pull request? Thanks!
Hello @pkosiec, I have not yet started on this issue. I'm sorry for not getting back to you on this thread earlier. I won't be able to work on it any time soon. I have some other commitments that need my attention. You can assign this to someone else.
Hi @pkosiec , I'll take this one. Can you assign it to me?
Also new to this project. Can you provide some resources or information on how to get started on this issue, what exactly needs to be done? How to navigate to the project codebase? And what expected PR contains?
Thanks :)
Hey @Omkar0114, Sure! 🚀
Outgoing webhook integration basically sends all notifications to a dedicated server user configures. You can start with going through the instruction: https://docs.botkube.io/installation/webhook/self-hosted If you don't have any server to get the requests, you can folow this: https://docs.botkube.io/community/contribute/webhook-develop
The idea is to modify this part: https://github.com/kubeshop/botkube/blob/main/helm/botkube/values.yaml#L825-L834 and add headers property, where I can add:
headers:
Authorization: Bearer my-token
My-Header: Foo
...
and all these headers will be always passed to the remote server.
On Go side, all headers should be passed in the PostWebhook method: https://github.com/kubeshop/botkube/blob/main/pkg/sink/webhook.go#L70
See also our contribution guide: https://github.com/kubeshop/botkube/blob/main/CONTRIBUTING.md Hope that helps!
Thanks a lot for such brief info @pkosiec I am starting to work on this. I'll discuss this here or on Slack with my approach :)