From c44238fbe10df95607b9d5f106703b7067c53dc6 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Thu, 22 May 2025 15:57:10 -0700 Subject: [PATCH 1/2] [nexus] add `x-oxide-timestamp` header to webhooks I forgor --- nexus/src/app/webhook.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nexus/src/app/webhook.rs b/nexus/src/app/webhook.rs index db6cee8b58..185c92431d 100644 --- a/nexus/src/app/webhook.rs +++ b/nexus/src/app/webhook.rs @@ -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> { @@ -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. From 0733273613e25d879c23a4170565122e1d4ef631 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Thu, 22 May 2025 16:18:19 -0700 Subject: [PATCH 2/2] agh --- nexus/src/app/webhook.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexus/src/app/webhook.rs b/nexus/src/app/webhook.rs index 185c92431d..33aa5aac48 100644 --- a/nexus/src/app/webhook.rs +++ b/nexus/src/app/webhook.rs @@ -461,7 +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(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.