Athena Webhooks Crate
What belongs in crates/athena-webhooks and what stays wired through athena_rs adapters.
crates/athena-webhooks is the reusable webhook-domain seam for Athena. It
owns the durable store, route-key catalog, and generic dispatch engine so the
main server can keep compatibility wrappers while the core webhook logic lives
in a publishable crate.
What Lives Here Today
- Gateway webhook definition and delivery-log persistence.
- Route-key constants for gateway, REST compatibility, and schema webhook events.
- Human-readable webhook event catalog data for admin and Studio surfaces.
- The generic outbound dispatch engine:
- trigger construction from
HttpRequest - template rendering
- idempotency and state-cap resolution
- outbound HTTP execution
- runtime hooks for auth-pool lookup, client-pool lookup, and shared HTTP transport
- trigger construction from
What Still Stays In athena_rs
- The
AppStateadapter that implements the runtime trait for the real server. - Management-schema payload mapping from
TableEditOperationto webhook events. - Actix admin routes, gateway routes, and worker orchestration that call into the crate.
Current Extraction Rule
Use athena-webhooks when code is about webhook persistence, route catalogs,
or delivery behavior that can run behind a small runtime trait.
Keep code in athena_rs when it needs:
- direct
AppStateaccess - management DDL operation types
- route registration and
HttpResponseconstruction - worker/bootstrap wiring outside the webhook domain itself
Near-Term Direction
The next webhook-related extractions should keep the same shape:
- Move reusable delivery logic and store contracts into
athena-webhooks. - Leave thin compatibility shims in
src/webhooks.rsandsrc/data/webhooks.rs. - Keep broader runtime concerns in their dedicated crates:
athena-actixathena-driverathena-query