Expand description
§grow-casdoor
Rust SDK for Casdoor by Grow Codes.
use grow_casdoor::{CasdoorClient, CasdoorConfig};
let client = CasdoorClient::new(CasdoorConfig::from_env()?)?;
let health = client.health().await?;
println!("healthy: {}", health.healthy);
client.close().await;Features: blocking (a blocking client), testing (in-memory fakes and the conformance
runner)
.
Re-exports§
pub use crate::core::Error;pub use crate::core::ErrorCode;pub use crate::core::HealthStatus;pub use crate::core::Result;pub use crate::core::RetryPolicy;pub use crate::core::Secret;pub use crate::casdoor::pkce_challenge;pub use crate::casdoor::random_state;pub use crate::casdoor::Pkce;pub use crate::casdoor::TokenSet;
Modules§
- blocking
blocking - Blocking wrapper (feature
blocking). Each client owns a tokio runtime with one worker thread, so background work (log batching, exports, watchers, retries’ timers) keeps running between blocking calls. - casdoor
- Casdoor helpers:
{"status":"error"}/ OAuth error normalization, PKCE, tokens. - core
- Shared core: errors, configuration, secrets in config, redaction, retries and transport.
- testing
testing - Test support (feature
testing): in-memory fakes and the conformance runner (SPEC §6).
Structs§
- Casdoor
Client - Async client for Casdoor. Cheap to clone (clones share one connection pool).
- Casdoor
Config - Immutable client configuration; build it with
CasdoorConfig::builderorCasdoorConfig::from_env.Debugoutput redacts every credential. - Casdoor
Config Builder - Builder for
CasdoorConfig. Values set here win over the environment. - Sign
InInput - Input of
CasdoorClient::sign_in.
Constants§
- DEFAULT_
SCOPE - Default OAuth scope.
- DEFAULT_
URL - Endpoint used when neither the builder nor the environment sets one.
Type Aliases§
- Casdoor
Error - Service-prefixed alias of
Error.