Skip to content

Commit a42eebf

Browse files
reeceyangConvex, Inc.
authored andcommitted
mark hmacSecret as required (#43418)
GitOrigin-RevId: dcf1290a299e73e984bc8e2ecbb956cf2e2c989a
1 parent e50aa0a commit a42eebf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/local_backend/src/log_sinks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub async fn regenerate_webhook_secret(
106106
let config = WebhookConfig {
107107
url: existing_webhook_sink.url,
108108
format: existing_webhook_sink.format,
109-
hmac_secret: Some(hmac_secret),
109+
hmac_secret,
110110
};
111111
st.application
112112
.add_log_sink(SinkConfig::Webhook(config))
@@ -136,7 +136,7 @@ pub async fn add_webhook_sink(
136136

137137
let hmac_secret = match existing_webhook_sink {
138138
Some(SinkConfig::Webhook(WebhookConfig {
139-
hmac_secret: Some(existing_secret),
139+
hmac_secret: existing_secret,
140140
..
141141
})) => existing_secret,
142142
_ => generate_webhook_hmac_secret(st.application.runtime()),
@@ -152,7 +152,7 @@ pub async fn add_webhook_sink(
152152
let config = WebhookConfig {
153153
url,
154154
format: args.format,
155-
hmac_secret: Some(hmac_secret),
155+
hmac_secret,
156156
};
157157
st.application
158158
.add_log_sink(SinkConfig::Webhook(config))

crates/model/src/log_sinks/types/webhook.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct WebhookConfig {
1515
)]
1616
pub url: reqwest::Url,
1717
pub format: WebhookFormat,
18-
pub hmac_secret: Option<String>,
18+
pub hmac_secret: String,
1919
}
2020

2121
#[cfg_attr(any(test, feature = "testing"), derive(proptest_derive::Arbitrary))]
@@ -31,7 +31,7 @@ pub enum WebhookFormat {
3131
pub struct SerializedWebhookConfig {
3232
pub url: String,
3333
pub format: WebhookFormat,
34-
pub hmac_secret: Option<String>,
34+
pub hmac_secret: String,
3535
}
3636

3737
impl From<WebhookConfig> for SerializedWebhookConfig {

0 commit comments

Comments
 (0)