Expand description
Keycloak SDK for Rust — async OIDC auth + Admin REST.
Re-exports§
pub use admin::AdminClient;pub use auth::AuthClient;pub use client::KeycloakClient;pub use config::KeycloakConfig;pub use error::AdminError;pub use error::KeycloakError;pub use jwt::JwtValidator;pub use oidc::OidcEndpoints;pub use token_provider::ClientCredentialsTokenProvider;pub use token_provider::TokenProvider;pub use tokens::AuthorizationRequest;pub use tokens::IntrospectionResult;pub use tokens::TokenSet;pub use tokens::ValidatedToken;pub use admin::SdkTokenSupplier;pub use reqwest;
Modules§
- admin
- AdminClient — the admin REST facade. The SDK sends the requests itself and borrows only the representation types
from the
keycloakcrate. - auth
- AuthClient — wraps openidconnect (auth flows) + introspect/logout by hand. Coverage omit (network boundary).
- client
- Unified entry point — injects one shared reqwest client (SSRF, timeouts, TLS) into auth, jwks and admin.
- config
- Immutable configuration. client_secret is masked by a manual Debug impl (a derive would expose it).
- error
- SDK error hierarchy — errors from the underlying crates are converted into this enum at the boundary.
- jwks
- DoS-safe JWKS: kid cache (key-set lifetime 300 seconds), within which only an unresolved kid triggers a refetch, rate-limit + single-flight.
- jwt
- Self-hardened JWT validation: RS256 pin (header alg not trusted) · none structurally rejected · exact iss · aud containment · exp required · nbf · skew · DoS-safe JWKS.
- oidc
- OIDC endpoint assembly (no network).
- token_
provider - TokenProvider — the §4-isomorphic async abstraction. admin receives tokens only through this trait.
- tokens
- Value types — secret fields are masked by a manual Debug impl.
- types
- The representation types that the admin facade exposes, unchanged, as its data model (a mirror of
keycloak::types). These are all five that appear in admin.rs’s public signatures.