Expand description
Multi-Tenancy Support for Authorization
Provides tenant isolation, cross-tenant sharing, and per-tenant quotas.
§Features
- Tenant Isolation: Logical partitioning by tenant_id
- Cross-Tenant Sharing: Explicit permission grants across tenants
- Per-Tenant Quotas: Resource limits and rate limiting
- Audit Logging: Track all cross-tenant access
§Example
use oxify_authz::multitenancy::{TenantContext, MultiTenantEngine, TenantQuota};
let tenant_ctx = TenantContext::new("tenant-123");
let engine = MultiTenantEngine::new();
// Set tenant quota
let quota = TenantQuota::new("tenant-123").with_max_tuples(1000);
engine.set_quota(quota).await?;
// Check quota before operations
let can_create = engine.check_tuple_quota("tenant-123").await?;
assert!(can_create);
// Increment usage
engine.increment_tuple_count("tenant-123").await?;Structs§
- Cross
Tenant Access - Cross-tenant access record for auditing
- Multi
Tenant Engine - Multi-tenant authorization engine
- Resource
- Resource identifier
- Tenant
Context - Tenant context for multi-tenancy
- Tenant
Quota - Tenant quotas and limits
- Tenant
Relation Tuple - Tenant-specific relation tuple
- Tenant
Resource - Tenant-aware resource