This crate bundles shared code — models, services, and helpers — reused across the server, webhook, and client. It keeps the data contracts and cross-cutting concerns in one place so each binary doesn’t redefine them.
Data models (models/)
Module
Purpose
claims.rs
Parsed OIDC JWT claims (sub, name, iss, exp, preferred_username, realm roles). Helpers: get_name() (prefers name, falls back to preferred_username) and is_admin() (checks the wazuh_admin role).
document.rs
OIDC DiscoveryDocument (issuer, authorization/token endpoints, jwks_uri); unknown fields are captured for forward compatibility.
ledger_entry.rs
One row of the issuance ledger: subject, serial_hex, issued_at_unix, revoked, optional revoked_at_unix/reason/issuer/realm, and wazuh_agent_name.