Skip to content

Commit 8e6a223

Browse files
committed
fix: HMAC verification logic in webhook handler
1 parent 1bb0f27 commit 8e6a223

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resolver = "2"
88
[package]
99
name = "backend"
1010
description = "Backend API and services for StackClass"
11-
version = "0.41.2"
11+
version = "0.41.3"
1212
edition = "2024"
1313

1414
default-run = "stackclass-server"

openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": {
77
"name": ""
88
},
9-
"version": "0.41.2"
9+
"version": "0.41.3"
1010
},
1111
"paths": {
1212
"/v1/courses": {

src/handler/webhook.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub async fn handle_tekton_webhook(
6161
let auth_secret = &ctx.config.auth_secret;
6262
let payload = format!("{}{}{}", repo, course, stage);
6363

64-
if crypto::hmac_sha256_verify(&payload, auth_secret, secret)? {
64+
if !crypto::hmac_sha256_verify(&payload, auth_secret, secret)? {
6565
error!("Received pipeline event with invalid signature");
6666
return Err(ApiError::Unauthorized("Invalid signature".into()));
6767
}

0 commit comments

Comments
 (0)