Expand description
§Edge Computing for Authorization
Lightweight authorization engine designed for edge deployment. Enables low-latency authorization checks at the edge by maintaining a synchronized subset of authorization data.
§Features
- Lightweight Engine: In-memory engine optimized for edge workers
- Tuple Synchronization: Automatic sync from central database
- CRDT Conflict Resolution: Handles concurrent updates across edge nodes
- Selective Sync: Only sync relevant namespaces/tenants
§Example
use oxify_authz::edge::{EdgeEngine, EdgeConfig, SyncConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = EdgeConfig {
central_db_url: "postgres://central-db/authz".to_string(),
sync_interval_secs: 30,
sync_config: SyncConfig::Namespaces(vec!["document".to_string()]),
};
let engine = EdgeEngine::new(config).await?;
engine.start_sync().await?;
// Perform fast authorization checks at the edge
let allowed = engine.check("document", "123", "viewer", "user:alice").await?;
Ok(())
}Structs§
- Crdt
Resolver - CRDT-based conflict resolver using Last-Write-Wins (LWW) strategy
- Crdt
Tuple - A tuple with CRDT metadata for conflict resolution
- Edge
Config - Configuration for edge engine
- Edge
Engine - Lightweight authorization engine for edge deployment
- Edge
Stats - Statistics for edge engine
Enums§
- Sync
Config - Defines what data to sync from central database