1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Typed async Rust client for Treetop policy authorization servers.
//!
//! Treetop is a Cedar-based policy evaluation service. This crate provides a strongly typed,
//! async client for evaluating authorization requests, managing policies, and querying
//! server status over the Treetop REST API.
//!
//! # Quick start
//!
//! ```rust,no_run
//! use treetop_client::{Action, Client, Request, Resource, User};
//!
//! # async fn example() -> treetop_client::Result<()> {
//! let client = Client::builder("https://treetop.example.com").build()?;
//!
//! let allowed = client
//! .is_allowed(Request::new(
//! User::new("alice"),
//! Action::new("view"),
//! Resource::new("Document", "doc-42"),
//! ))
//! .await?;
//! # Ok(())
//! # }
//! ```
//!
//! # Connection pooling
//!
//! The [`Client`] reuses connections via reqwest's built-in connection pool. Create one
//! `Client` and share it across your application. Cloning a `Client` (e.g. via
//! [`Client::with_correlation_id`]) shares the same underlying pool at zero cost.
//!
//! # Security
//!
//! Upload tokens are stored using [`secrecy::SecretString`], which zeroizes memory on drop
//! and is redacted in `Debug` output. TLS uses rustls by default (pure Rust, no OpenSSL).
//! Request-domain fields are private and validated before transport, redirects are disabled on
//! the default HTTP client, and successful response bodies have a configurable size limit.
pub use ;
pub use ;
pub use UploadToken;
pub use ;