Skip to content

Commit f4be50a

Browse files
committed
docs: update documentation
1 parent f3ed555 commit f4be50a

File tree

4 files changed

+88
-36
lines changed

4 files changed

+88
-36
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ path = "src/lib.rs"
2020

2121
[dependencies]
2222
# Async runtime
23-
tokio = { version = "1", features = ["rt-multi-thread", "sync", "time"] }
23+
tokio = { version = "1", features = ["rt-multi-thread", "sync", "time", "macros"] }
2424
async-trait = "0.1"
2525
futures = "0.3"
2626

README.md

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

12+
<br />
1213

1314
[InferaDB](https://inferadb.com/) is a distributed, [Google Zanzibar](https://research.google/pubs/zanzibar-googles-consistent-global-authorization-system/)‑inspired authorization engine that replaces ad‑hoc database lookups and scattered logic with a unified, millisecond‑latency source of truth. With this SDK, you define permissions as policy‑as‑code and wire up a type‑safe client in just a few lines.
1415

@@ -21,7 +22,6 @@
2122
```toml
2223
[dependencies]
2324
inferadb = "0.1"
24-
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
2525
```
2626

2727
```rust
@@ -34,51 +34,19 @@ async fn main() -> Result<(), Error> {
3434
.credentials(ClientCredentialsConfig {
3535
client_id: "my_service".into(),
3636
private_key: Ed25519PrivateKey::from_pem_file("private-key.pem")?,
37-
certificate_id: None,
3837
})
3938
.build()
4039
.await?;
4140

4241
let vault = client.organization("org_...").vault("vlt_...");
4342

44-
// Check permission - returns Ok(false) for denial, never errors on deny
4543
let allowed = vault.check("user:alice", "view", "document:readme").await?;
46-
47-
// Guard-style API – converts denial into an AccessDenied error.
48-
vault.check("user:alice", "edit", "document:readme")
49-
.require()
50-
.await?;
44+
println!("Allowed: {allowed}");
5145

5246
Ok(())
5347
}
5448
```
5549

56-
## Installation
57-
58-
### Feature Flags
59-
60-
| Feature | Default | Description |
61-
| ------------ | ------- | -------------------------------------- |
62-
| `grpc` | Yes | gRPC transport (faster, streaming) |
63-
| `rest` | Yes | REST transport (broader compatibility) |
64-
| `rustls` | Yes | Pure-Rust TLS |
65-
| `native-tls` | No | System TLS (OpenSSL/Schannel) |
66-
| `tracing` | No | OpenTelemetry integration |
67-
| `blocking` | No | Sync/blocking API wrapper |
68-
| `derive` | No | Proc macros for type-safe schemas |
69-
| `wasm` | No | Browser/WASM support (REST only) |
70-
71-
### Minimal Build (REST Only)
72-
73-
```toml
74-
[dependencies]
75-
inferadb = { version = "0.1", default-features = false, features = ["rest", "rustls"] }
76-
```
77-
78-
### Minimum Supported Rust Version
79-
80-
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.
81-
8250
## Design Guarantees
8351

8452
| Guarantee | Description |
@@ -213,10 +181,11 @@ See the [Testing Guide](docs/guides/testing.md) for `InMemoryClient` (full polic
213181

214182
| Topic | Description |
215183
| ----------------------------------------------------------- | ------------------------------------------------- |
184+
| [Installation](docs/guides/installation.md) | Feature flags, optimized builds, TLS, MSRV |
216185
| [Authentication](docs/guides/authentication.md) | Client credentials, bearer tokens, key management |
217186
| [Integration Patterns](docs/guides/integration-patterns.md) | Axum, Actix-web, GraphQL, gRPC middleware |
218187
| [Error Handling](docs/guides/errors.md) | Error types, retries, graceful degradation |
219-
| [Testing](docs/guides/testing.md) | `MockClient`, `InMemoryClient`, `TestVault` |
188+
| [Testing](docs/guides/testing.md) | MockClient, InMemoryClient, TestVault |
220189
| [Schema Design](docs/guides/schema-design.md) | ReBAC patterns, role hierarchy, anti-patterns |
221190
| [Production Checklist](docs/guides/production-checklist.md) | Deployment readiness |
222191
| [Troubleshooting](docs/troubleshooting.md) | Common issues and solutions |

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Supplementary documentation for the InferaDB Rust SDK. For the main README and q
66

77
| Guide | Description |
88
| ------------------------------------------------------ | ------------------------------------------------------ |
9+
| [Installation](guides/installation.md) | Feature flags, optimized builds, TLS options, MSRV |
910
| [Authentication](guides/authentication.md) | Client credentials, bearer tokens, key management |
1011
| [Integration Patterns](guides/integration-patterns.md) | Framework integration (Axum, Actix-web, GraphQL, gRPC) |
1112
| [Error Handling](guides/errors.md) | Error types, retries, graceful degradation |

docs/guides/installation.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Installation & Configuration
2+
3+
## Basic Installation
4+
5+
Add inferadb to your `Cargo.toml`:
6+
7+
```toml
8+
[dependencies]
9+
inferadb = "0.1"
10+
```
11+
12+
This includes both gRPC and REST transports with pure-Rust TLS.
13+
14+
## Feature Flags
15+
16+
| Feature | Default | Description |
17+
| ------------ | ------- | -------------------------------------- |
18+
| `grpc` | Yes | gRPC transport (faster, streaming) |
19+
| `rest` | Yes | REST transport (broader compatibility) |
20+
| `rustls` | Yes | Pure-Rust TLS |
21+
| `native-tls` | No | System TLS (OpenSSL/Schannel) |
22+
| `tracing` | No | OpenTelemetry integration |
23+
| `blocking` | No | Sync/blocking API wrapper |
24+
| `derive` | No | Proc macros for type-safe schemas |
25+
| `wasm` | No | Browser/WASM support (REST only) |
26+
27+
## Optimized Builds
28+
29+
### REST Only (Smaller Binary)
30+
31+
```toml
32+
[dependencies]
33+
inferadb = { version = "0.1", default-features = false, features = ["rest", "rustls"] }
34+
```
35+
36+
### gRPC Only (Lower Latency)
37+
38+
```toml
39+
[dependencies]
40+
inferadb = { version = "0.1", default-features = false, features = ["grpc", "rustls"] }
41+
```
42+
43+
### With Tracing
44+
45+
```toml
46+
[dependencies]
47+
inferadb = { version = "0.1", features = ["tracing"] }
48+
```
49+
50+
## TLS Options
51+
52+
### Pure-Rust TLS (Default)
53+
54+
Uses `rustls` with Mozilla's root certificates. No system dependencies.
55+
56+
### Native TLS
57+
58+
Uses the system TLS library (OpenSSL on Linux, Secure Transport on macOS, Schannel on Windows):
59+
60+
```toml
61+
[dependencies]
62+
inferadb = { version = "0.1", default-features = false, features = ["grpc", "rest", "native-tls"] }
63+
```
64+
65+
## Minimum Supported Rust Version
66+
67+
The MSRV is **1.88.0**. We target approximately two releases behind stable.
68+
69+
- MSRV increases are documented in the [CHANGELOG](../../CHANGELOG.md)
70+
- The `rust-version` field in `Cargo.toml` enforces this at build time
71+
- Earlier compiler versions are not guaranteed to work
72+
73+
## WASM / Browser Support
74+
75+
For browser environments, use REST-only with the `wasm` feature:
76+
77+
```toml
78+
[dependencies]
79+
inferadb = { version = "0.1", default-features = false, features = ["rest", "wasm"] }
80+
```
81+
82+
Note: gRPC is not supported in WASM environments.

0 commit comments

Comments
 (0)