mirror of
https://github.com/hanzoai/base.git
synced 2026-10-21 03:41:50 +00:00
TenantStorage manages isolated S3 prefixes on Hanzo S3 (s3.hanzo.space):
tenants/{orgSlug}/org/ ← org-level shared storage
tenants/{orgSlug}/users/{userId}/ ← per-user isolated storage
Each level gets a unique SSE-C encryption key:
org key = HMAC-SHA256(master, "s3:org:" + orgSlug)
user key = HMAC-SHA256(master, "s3:user:" + orgSlug + ":" + userId)
IAM bucket policies enforce path isolation:
- Org admins: access tenants/{orgSlug}/*
- Users: access only tenants/{orgSlug}/users/{userId}/*
- Zero cross-org or cross-user access
PlatformConfig additions:
TenantStorageEndpoint — S3 endpoint (s3.hanzo.space)
TenantStorageBucket — root bucket name