Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,9 @@ test-unit:
# invocation hits. Enumerated explicitly because nothing in CI runs
# `cargo test --workspace` — membership buys clippy/check, not tests.
cargo nextest run -p buzz-sdk --lib
# buzz-workflow parser, cron, condition and denial-logging unit tests
# (infra-free). Its ignored Postgres cases run in the PostgreSQL lane.
cargo nextest run -p buzz-workflow --lib
# buzz-acp owns the relay-to-agent trust boundary. Run its tests here so
# forged relay events cannot regain a path into agent routing unnoticed.
cargo nextest run -p buzz-acp
Expand Down
15 changes: 11 additions & 4 deletions crates/buzz-relay/src/api/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ use super::{api_error, db_read_error, internal_error, not_found, parse_query_or_
mod thread_roots;
mod thread_window;

#[cfg(test)]
#[path = "bridge/workflow_webhook_postgres_tests.rs"]
mod workflow_webhook_postgres_tests;

/// Authenticate a relay-owned JSON `POST` endpoint for a community member.
///
/// Binds the community from the request host, runs NIP-FI admission over a
Expand Down Expand Up @@ -2642,7 +2646,9 @@ pub struct WebhookQuery {
/// Webhook trigger endpoint. No user auth — the webhook secret authenticates the caller.
///
/// Prefers `X-Webhook-Secret` header over `?secret=` query param (headers aren't logged
/// by most proxies). Returns 202 Accepted; execution is async.
/// by most proxies). Returns 202 Accepted; execution is async. Immediately
/// before the `workflow_runs` insert, the owner authority gate also rejects an
/// owner banned from the host-bound community.
pub async fn workflow_webhook(
State(state): State<Arc<AppState>>,
Path(id_str): Path<String>,
Expand Down Expand Up @@ -2736,9 +2742,10 @@ pub async fn workflow_webhook(
// executes with the workflow **owner's** standing authority — so the
// secret alone is insufficient. Immediately before run creation, reject
// disabled/inactive workflows and recheck the owner's current channel
// membership (and role, for exfiltration-capable definitions). Fail
// closed with the same generic 404 as the lookups above so a
// revoked-owner workflow is indistinguishable from a nonexistent one.
// membership (and role, for exfiltration-capable definitions) and that
// the owner is not banned. Fail closed with the same generic 404 as the
// lookups above so a revoked-owner workflow is indistinguishable from a
// nonexistent one.
if !workflow.enabled || workflow.status != buzz_db::workflow::WorkflowStatus::Active {
return Err(not_found("workflow not found"));
}
Expand Down
Loading
Loading