Rust SDK
The OhAuthCat server SDK for Rust: async client on tokio and rustls, SSO helpers and webhook verification.
Rust 1.88 or later. An async (tokio) client on reqwest with rustls.
Install
Section titled “Install”cargo add ohauthcatcargo add tokio --features macros,rt-multi-threadConfigure
Section titled “Configure”Client: creates the client (use ohauthcat::Client;). The client keeps no global state; timeouts are configurable on the builder.
First call
Section titled “First call”Typed resources cover the core objects: client., client. (an auto-paginating stream: while let Some(), and client.. Every other pinned operation is under client.operations(), for example client..
SSO: client. returns the URL and a code_verifier to keep on your server; on the callback, client. exchanges the code once.
Errors
Section titled “Errors”Every call returns Result<T, ohauthcat:. Error::Api carries an ApiError with the stable code, status, message, doc_url and request_id (error.code() reads it); see the error codes. Error::RestartSignIn means the code exchange cannot be retried: start a fresh sign-in.
Webhooks
Section titled “Webhooks”ohauthcat: checks the OhAuthCat-Signature header against the exact raw body bytes and returns the event (event.event_type). Pass both secrets during a rotation. A refusal is a WebhookError.
Reference
Section titled “Reference”Every method maps to an operation in the API reference; webhook payloads are in webhook events.