Skip to content

[nexus] add x-oxide-timestamp header to webhooks #8205

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

Merged
merged 2 commits into from
May 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nexus/src/app/webhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ impl<'a> ReceiverClient<'a> {
HeaderName::from_static("x-oxide-alert-class");
const HDR_SIG: HeaderName =
HeaderName::from_static("x-oxide-signature");
const HDR_TIMESTAMP: HeaderName =
HeaderName::from_static("x-oxide-timestamp");

#[derive(serde::Serialize, Debug)]
struct Payload<'a> {
Expand Down Expand Up @@ -459,6 +461,7 @@ impl<'a> ReceiverClient<'a> {
.header(HDR_DELIVERY_ID, delivery.id.to_string())
.header(HDR_ALERT_ID, delivery.alert_id.to_string())
.header(HDR_ALERT_CLASS, alert_class.to_string())
.header(HDR_TIMESTAMP, &sent_at)
.header(http::header::CONTENT_TYPE, "application/json");

// For each secret assigned to this webhook, calculate the HMAC and add a signature header.
Expand Down
Loading