tatara_github_watcher/lib.rs
1//! tatara-github-watcher — GitHub webhook receiver.
2//!
3//! Watches an entire GitHub organization (or several) by receiving
4//! org-level webhooks and translating PR + push + branch events into
5//! `EphemeralAllocation` CRs that the pool reconciler routes to a
6//! matching `EphemeralPool`.
7//!
8//! Modules:
9//! - `verify` — HMAC-SHA256 signature verification (GitHub's
10//! `X-Hub-Signature-256` header). Constant-time comparison.
11//! - `event` — typed GitHub event shapes (just the fields we read).
12//! - `allocation_factory` — typed translator: GitHub PR event →
13//! `EphemeralAllocation` spec. Pure function, fully unit-tested.
14//! - `handler` — axum HTTP handler that verifies signature, dispatches
15//! on event type, applies via kube-rs.
16//! - `config` — typed config struct loaded from env / CLI flags.
17
18#![warn(rust_2018_idioms)]
19
20pub mod allocation_factory;
21pub mod config;
22pub mod event;
23pub mod handler;
24pub mod verify;
25
26pub use allocation_factory::{allocation_name, build_allocation, FactoryError};
27pub use config::WatcherConfig;
28pub use event::{EventKind, PrAction, PullRequestEvent, PushEvent};
29pub use verify::{verify_signature, VerifyError};