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

Support HMAC SHA256 request signing in the http client #285

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alexander-akhmetov
Copy link
Contributor

@alexander-akhmetov alexander-akhmetov commented Feb 18, 2025

Adds optional HMAC SHA256 signing to the HTTP client.

A new HMACRoundTripper (in http/hmac.go) computes and adds a signature for outgoing webhooks. The signature is computed from the request body.

Optionally, a timestamp header name can be specified, and if it's set, the signature is computed from {timestamp}:{body}, and the timestamp is added to the headers for the client to verify.

Other implementation examples:

Draft PR to Grafana: grafana/grafana#100960 if you want to test it locally.

Part of https://github.com/grafana/alerting-squad/issues/1040

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

Successfully merging this pull request may close these issues.

1 participant