mirror of
https://github.com/block/buzz.git
synced 2026-10-27 12:40:30 +00:00
Expect generic 404 for wrong webhook secret in ban regression
Main now answers a missing or invalid webhook secret with the same non-disclosing 404 as an unknown workflow. The merged Postgres regression still expected 401, so it stopped at its first assertion before exercising the ban, tenant-scope, unban and lookup-failure arms. Co-authored-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Luke Tornquist <tornquist@squareup.com>
This commit is contained in:
@@ -252,12 +252,13 @@ async fn webhook_admission_enforces_owner_ban_tenant_scope_and_lookup_failure()
|
||||
|
||||
let (state, audit_shutdown) = app_state(db.clone(), &pool).await;
|
||||
|
||||
let (status, _) = post_webhook(&state, workflow_id, &host_a, "wrong-secret").await;
|
||||
let (status, body) = post_webhook(&state, workflow_id, &host_a, "wrong-secret").await;
|
||||
assert_eq!(
|
||||
status,
|
||||
StatusCode::UNAUTHORIZED,
|
||||
"the secret remains required"
|
||||
StatusCode::NOT_FOUND,
|
||||
"the secret remains required and is denied generically"
|
||||
);
|
||||
assert_eq!(body["error"], "workflow not found");
|
||||
assert_eq!(workflow_run_count(&pool, community_a, workflow_id).await, 0);
|
||||
|
||||
let (status, _) = post_webhook(&state, workflow_id, &host_a, &secret).await;
|
||||
|
||||
Reference in New Issue
Block a user