Starting impl Sentry and tracing #3

Merged
qpismont merged 6 commits from tracing into main 2026-06-10 20:27:26 +02:00
Showing only changes of commit 6599c20c30 - Show all commits
+6 -6
View File
1
@@ -79,6 +79,12 @@ where
let type_header = extract_header(GITEA_EVENT_TYPE_HEADER_NAME, headers)?; let type_header = extract_header(GITEA_EVENT_TYPE_HEADER_NAME, headers)?;
let body_bytes = read_body(req.into_body()).await?; let body_bytes = read_body(req.into_body()).await?;
verify_signature(
app_state.config.webhook_secret.as_bytes(),
&sig_header,
&body_bytes,
)?;
let body_str = String::from_utf8_lossy(&body_bytes).into_owned(); let body_str = String::from_utf8_lossy(&body_bytes).into_owned();
sentry::configure_scope(|scope| { sentry::configure_scope(|scope| {
scope.add_event_processor(move |mut event| { scope.add_event_processor(move |mut event| {
@@ -89,12 +95,6 @@ where
}); });
}); });
verify_signature(
app_state.config.webhook_secret.as_bytes(),
&sig_header,
&body_bytes,
)?;
let webhook = parse_webhook(&type_header, &app_state.config.bot_name, &body_bytes)?; let webhook = parse_webhook(&type_header, &app_state.config.bot_name, &body_bytes)?;
Ok(WebhookExtract(webhook)) Ok(WebhookExtract(webhook))
} }