Skip to content

Commit 10536fb

Browse files
committed
docs: update README
1 parent 38bb05f commit 10536fb

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

README.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
<p>Ergonomic, type-safe access to InferaDB's authorization and management APIs</p>
1010
</div>
1111

12+
- Centralized, fine‑grained authorization so Rust services avoid scattered, hand‑rolled permission logic.
13+
- Low‑latency, Google Zanzibar‑inspired engine that replaces ad‑hoc DB lookups and caches for authorization checks at scale.
14+
- Rust‑native API surface (types, async, errors, testing) so teams don’t need to build or adapt a generic policy engine.
15+
- Strong typing and policy‑as‑code to catch permission model mistakes in tests and at compile time instead of in production.
16+
- Standards‑based authorization (AuthZen) with built‑in multi‑tenant isolation and auditability.
17+
1218
## Quick Start
1319

1420
```toml
@@ -37,7 +43,7 @@ async fn main() -> Result<(), Error> {
3743
// Check permission - returns Ok(false) for denial, never errors on deny
3844
let allowed = vault.check("user:alice", "view", "document:readme").await?;
3945

40-
// Or use require() for guard clauses - returns Err(AccessDenied) on denial
46+
// Guard-style API – converts denial into an AccessDenied error.
4147
vault.check("user:alice", "edit", "document:readme")
4248
.require()
4349
.await?;
@@ -70,7 +76,7 @@ inferadb = { version = "0.1", default-features = false, features = ["rest", "rus
7076

7177
### Minimum Supported Rust Version
7278

73-
The MSRV is **1.88.0**. We target two releases behind stable where possible. MSRV increases are noted in the [CHANGELOG](CHANGELOG.md). Builds on earlier compiler versions are not guaranteed.
79+
The MSRV is **1.88.0**. The crate targets approximately two releases behind stable; MSRV bumps are documented in the [CHANGELOG](CHANGELOG.md). Earlier compilers are not guaranteed to work.
7480

7581
## Design Guarantees
7682

@@ -79,8 +85,8 @@ The MSRV is **1.88.0**. We target two releases behind stable where possible. MSR
7985
| **Denial is not an error** | `check()` returns `Ok(false)` for denied access; only `require()` converts denial to error |
8086
| **Fail-closed by default** | Errors default to denying access; fail-open must be explicit |
8187
| **Results preserve order** | Batch operations return results in the same order as inputs |
82-
| **Writes are acknowledged** | Write operations return only after server confirmation |
83-
| **Errors include request IDs** | All server errors include a `request_id()` for debugging |
88+
| **Writes are acknowledged** | Write operations complete only after server confirmation. |
89+
| **Errors include request IDs** | All server errors expose a request_id() for debugging and support. |
8490

8591
## Core API
8692

@@ -111,13 +117,19 @@ let results: Vec<bool> = vault
111117
### Relationship Management
112118

113119
```rust
114-
// Write relationships
115-
vault.relationships()
116-
.write(Relationship::new("document:readme", "viewer", "user:alice"))
120+
// Write a single relationship
121+
vault
122+
.relationships()
123+
.write(Relationship::new(
124+
"document:readme",
125+
"viewer",
126+
"user:alice",
127+
))
117128
.await?;
118129

119130
// Batch write
120-
vault.relationships()
131+
vault
132+
.relationships()
121133
.write_batch([
122134
Relationship::new("folder:docs", "viewer", "group:engineering#member"),
123135
Relationship::new("document:readme", "parent", "folder:docs"),
@@ -149,7 +161,7 @@ let users = vault.subjects()
149161
```rust
150162
let client = Client::builder()
151163
.url("http://localhost:8080")
152-
.insecure() // Disables TLS verification, allows HTTP
164+
.insecure() // Disables TLS verification for local development
153165
.credentials(BearerCredentialsConfig {
154166
token: "dev-token".into(),
155167
})
@@ -174,7 +186,7 @@ services:
174186
Use `MockClient` for unit tests:
175187

176188
```rust
177-
use inferadb::testing::{MockClient, AuthorizationClient};
189+
use inferadb::testing::{AuthorizationClient, MockClient};
178190
179191
#[tokio::test]
180192
async fn test_authorization() {
@@ -183,7 +195,10 @@ async fn test_authorization() {
183195
.check("user:bob", "delete", "document:readme", false)
184196
.build();
185197
186-
assert!(mock.check("user:alice", "view", "document:readme").await.unwrap());
198+
assert!(mock
199+
.check("user:alice", "view", "document:readme")
200+
.await
201+
.unwrap());
187202
}
188203
```
189204

@@ -200,7 +215,7 @@ See the [Testing Guide](docs/guides/testing.md) for `InMemoryClient` (full polic
200215
| [Authentication](docs/guides/authentication.md) | Client credentials, bearer tokens, key management |
201216
| [Integration Patterns](docs/guides/integration-patterns.md) | Axum, Actix-web, GraphQL, gRPC middleware |
202217
| [Error Handling](docs/guides/errors.md) | Error types, retries, graceful degradation |
203-
| [Testing](docs/guides/testing.md) | MockClient, InMemoryClient, TestVault |
218+
| [Testing](docs/guides/testing.md) | `MockClient`, `InMemoryClient`, `TestVault` |
204219
| [Schema Design](docs/guides/schema-design.md) | ReBAC patterns, role hierarchy, anti-patterns |
205220
| [Production Checklist](docs/guides/production-checklist.md) | Deployment readiness |
206221
| [Troubleshooting](docs/troubleshooting.md) | Common issues and solutions |

0 commit comments

Comments
 (0)