Skip to main content

webhook_auth_middleware

Function webhook_auth_middleware 

Source
pub async fn webhook_auth_middleware<L: BridgeLookup>(
    __arg0: State<Arc<L>>,
    req: Request<Body>,
    next: Next,
) -> impl IntoResponse
Expand description

Axum middleware that validates webhook signatures from external platforms.

Extracts the X-SCP-Signature and X-SCP-Platform-Key-Id headers and verifies the Ed25519 signature over the raw request body.

On success, the request proceeds to the next handler. On failure, returns 401 with error code BRIDGE_NOT_AUTHORIZED.

See spec section 12.10.2.