federated-auth-realm-sdk-rust

Crates.iofederated-auth-realm-sdk-rust
lib.rsfederated-auth-realm-sdk-rust
version0.4.12
created_at2026-01-09 05:56:10.036097+00
updated_at2026-01-24 15:32:49.836851+00
descriptionFederated Auth Realm Rust SDK for authentication and token management.
homepage
repositoryhttps://github.com/savant-realms/federated-auth-realm-sdk-rust
max_upload_size
id2031644
size46,130
Andi Ferhati (formidablae)

documentation

README

Federated Auth Realm Rust SDK

A comprehensive Rust SDK for Federated Auth Realm, providing authentication, token management, and basic API calls.

Features

  • Authenticate with username/password
  • Token management (access/refresh)
  • Async API calls with reqwest
  • Extensible for SRWP discovery

Project layout

├── Cargo.toml                # Package manifest
├── src
│   ├── lib.rs                # Library entry point
│   └── client.rs             # Auth client implementation
├── tests
│   └── client_tests.rs       # Unit tests
├── example
│   └── main.rs               # Usage example

Getting started

  1. Build the library
cargo build
  1. Run tests
cargo test
  1. Format and lint
cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings

Usage

use federated_auth_realm_sdk::AuthClient;

#[tokio::main]
async fn main() {
 let client = AuthClient::new("https://api.example.com");
 match client.login("user", "pass").await {
  Ok(token) => println!("Access token: {}", token.access_token),
  Err(e) => eprintln!("Login failed: {}", e),
 }
}

 ## Publishing to crates.io

 To publish the package, ensure you have a valid `.env` file with your `CARGO_REGISTRY_TOKEN`.

 Run:

Contributing

If you want to publish with a dirty working directory (not recommended), use:

./scripts/deploy.sh --allow-dirty

This will pass the --allow-dirty flag to cargo publish.

  • Format: cargo fmt --all
  • Lint: cargo clippy --all-targets --all-features -- -D warnings
  • Tests: cargo test

License

MIT

Commit count: 0

cargo fmt