1#![forbid(unsafe_code)]
2#![doc = include_str!("../README.md")]
3
4use ::reqwest_middleware::ClientWithMiddleware;
5use mauth_core::signer::Signer;
6use mauth_core::verifier::Verifier;
7use reqwest::Url;
8use std::collections::HashMap;
9use std::sync::{LazyLock, OnceLock, RwLock};
10use uuid::Uuid;
11
12#[derive(Clone)]
18pub struct MAuthInfo {
19 app_id: Uuid,
20 sign_with_v1_also: bool,
21 signer: Signer,
22 mauth_uri_base: Url,
23 allow_v1_auth: bool,
24}
25
26static CLIENT: OnceLock<ClientWithMiddleware> = OnceLock::new();
27
28static PUBKEY_CACHE: LazyLock<RwLock<HashMap<Uuid, Verifier>>> =
29 LazyLock::new(|| RwLock::new(HashMap::new()));
30
31#[cfg(feature = "axum-service")]
33pub mod axum_service;
34pub mod config;
36#[cfg(test)]
37mod protocol_test_suite;
38mod reqwest_middleware;
39pub mod sign_outgoing;
41#[cfg(feature = "axum-service")]
43pub mod validate_incoming;