#![doc = include_str!("../README.md")]

pub mod error;
#[cfg(feature = "well-known-fetch")]
pub mod keyset;
#[cfg(feature = "oauth")]
pub mod oauth;
#[cfg(feature = "oauth")]
pub mod pkce;
#[cfg(feature = "oauth")]
pub mod session_version;
#[cfg(feature = "session-liveness")]
pub mod session_liveness;
#[cfg(feature = "token")]
pub mod token;
pub mod types;
pub mod well_known;

#[cfg(feature = "axum")]
pub mod middleware;

// Re-exports for convenient access
pub use error::{Error, TokenError};
#[cfg(feature = "well-known-fetch")]
pub use keyset::KeySet;
#[cfg(feature = "oauth")]
pub use oauth::{AuthClient, AuthorizationRequest, OAuthConfig, TokenResponse, UserInfo};
#[cfg(feature = "oauth")]
pub use pkce::{generate_code_challenge, generate_code_verifier, generate_state};
#[cfg(feature = "oauth")]
pub use session_version::{
    MemorySessionVersionCache, SessionVersionCache, SV_CACHE_KEY_PREFIX, SV_CACHE_TTL,
};
#[cfg(feature = "session-liveness")]
pub use session_liveness::{
    CipherError, EncryptedRefreshToken, LivenessFailure, LivenessOutcome, RevokeCause,
    TokenCipher, TransientCause, attempt_liveness_refresh, classify_refresh_error,
};
#[cfg(feature = "token")]
pub use token::{
    PublicKey, VerifiedClaims, extract_unverified_kid, parse_public_key_hex,
    verify_v4_public_access_token, verify_v4_with_keyset,
};
pub use types::{KeyId, Ppnum, PpnumId, SessionId, UserId};
#[cfg(feature = "oauth")]
pub use url::Url;
pub use well_known::{WellKnownKeyStatus, WellKnownPasetoDocument, WellKnownPasetoKey};
