# 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
```toml
[dependencies]
k2rbac-api-client = "0.1.0"
```
## Minimal example
```rust
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