k2rbac-api-client 0.1.0

HTTP client for the standalone k2rbac/auth Rust service
Documentation

k2rbac-api-client

Typed Rust client for the k2rbac HTTP API.

What it provides

  • Reqwest-based client methods for auth flows, user operations, account operations, role operations, and API key management.
  • Configurable default authorization and header injection.
  • Structured problem-details style error handling.

Install

[dependencies]
k2rbac-api-client = "0.1.0"

Minimal example

use k2rbac_api_client::{RbacApiClient, RbacApiClientOptions, RequestOptions};

let client = RbacApiClient::new(RbacApiClientOptions {
    base_url: "http://127.0.0.1:4100".to_owned(),
    authorization: Some("Bearer your-token".to_owned()),
    headers: Vec::new(),
})?;

let me = client.whoami(&RequestOptions::default()).await?;
println!("{}", me.user_id);
# Ok::<(), Box<dyn std::error::Error>>(())

License: GPL-3.0-or-later

Repository: https://github.com/frogfishio/k2db