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
55
56
57
58
59
60
61
62
63
64
//! Vault client for authorization operations.
//!
//! [`VaultClient`] provides the primary API for authorization checks:
//!
//! - [`check()`](VaultClient::check): Check if a subject has permission on a resource
//! - [`explain_permission()`](VaultClient::explain_permission): Explain why access is allowed/denied
//! - [`simulate()`](VaultClient::simulate): Test hypothetical changes
//! - [`watch()`](VaultClient::watch): Subscribe to relationship changes
//! - [`relationships()`](VaultClient::relationships): Manage relationships
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! // Get a vault client
//! let vault = client.organization("org_123").vault("vlt_456");
//!
//! // Check permission
//! let allowed = vault.check("user:alice", "view", "doc:readme").await?;
//!
//! // Use require() to get an error on denial
//! vault.check("user:alice", "edit", "doc:readme")
//! .require()
//! .await?;
//!
//! // Explain why access is allowed or denied
//! let explanation = vault
//! .explain_permission()
//! .subject("user:alice")
//! .permission("edit")
//! .resource("doc:readme")
//! .await?;
//!
//! // Simulate hypothetical changes
//! let result = vault
//! .simulate()
//! .add_relationship(Relationship::new("doc:readme", "editor", "user:alice"))
//! .check("user:alice", "edit", "doc:readme")
//! .await?;
//!
//! // Watch for real-time changes
//! use futures::StreamExt;
//! let mut stream = vault.watch().run().await?;
//! while let Some(event) = stream.next().await {
//! println!("Change: {}", event?);
//! }
//! ```
pub use VaultClient;
pub use ;
pub use ;
pub use ;