From 5c8956535b18f94f7b340e0d14184259651366ee Mon Sep 17 00:00:00 2001 From: Bretton Date: Fri, 24 Oct 2025 15:58:05 -0700 Subject: [PATCH] docs(communities): add blob upload proxy system design Adds design documentation for blob upload proxy system to enable image/video posts in communities from external PDS users. Problem: Users on external PDSs cannot directly upload blobs to community-owned PDS repositories because they lack authentication credentials for the community's PDS. Solution: Coves AppView acts as an authenticated proxy for blob uploads via social.coves.blob.uploadForCommunity endpoint. Flow: 1. User uploads blob to AppView 2. AppView validates user can post to community 3. AppView uses community's PDS credentials to upload blob 4. AppView returns CID to user 5. User creates post record referencing the CID 6. Post and blob both live in community's PDS Status: Design documented, implementation TODO Priority: CRITICAL for Beta - Required for rich media posts Implementation checklist includes: - Handler endpoint - User authorization validation - Community credential management - Upload proxy logic - Security measures (size limits, content-type validation, rate limiting) --- docs/PRD_COMMUNITIES.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/docs/PRD_COMMUNITIES.md b/docs/PRD_COMMUNITIES.md index f76d198..ab20000 100644 --- a/docs/PRD_COMMUNITIES.md +++ b/docs/PRD_COMMUNITIES.md @@ -201,6 +201,44 @@ Communities can define content posting restrictions via the `contentRules` objec --- +### Blob Upload Proxy System +**Status:** Design documented, implementation TODO +**Priority:** CRITICAL for Beta - Required for image/video posts in communities + +**Problem:** Users on external PDSs cannot directly upload blobs to community-owned PDS repositories because they lack authentication credentials for the community's PDS. + +**Solution:** Coves AppView acts as an authenticated proxy for blob uploads: + +**Flow:** +1. User uploads blob to Coves AppView via `social.coves.blob.uploadForCommunity` +2. AppView validates user can post to community (not banned, community accessible) +3. AppView uses community's PDS credentials to upload blob via `com.atproto.repo.uploadBlob` +4. AppView returns CID to user +5. User creates post record referencing the CID +6. Post and blob both live in community's PDS + +**Implementation Checklist:** +- [ ] Handler: `social.coves.blob.uploadForCommunity` endpoint +- [ ] Validation: Check user authorization to post in community +- [ ] Credential Management: Reuse community token refresh logic +- [ ] Upload Proxy: Forward blob to community's PDS with community credentials +- [ ] Security: Size limits, content-type validation, rate limiting +- [ ] Testing: E2E test with federated user uploading to community + +**Why This Approach:** +- ✅ Works with federated users (any PDS) +- ✅ Reuses existing community credential infrastructure +- ✅ Matches V2 architecture (AppView orchestrates, communities own data) +- ✅ Blobs stored on correct PDS (community's repository) +- ❌ AppView becomes upload intermediary (bandwidth cost) + +**Alternative Considered:** Direct user uploads to community PDS +- Rejected: Would require creating temporary user accounts on every community PDS (complex, insecure) + +**See:** Design discussion in context of ATProto blob architecture + +--- + ### Posts in Communities **Status:** Lexicon designed, implementation TODO **Priority:** HIGHEST for Beta 1 @@ -215,6 +253,8 @@ Communities can define content posting restrictions via the `contentRules` objec **Without posts, communities exist but can't be used!** +**Depends on:** Blob Upload Proxy System (for image/video posts) + --- ## 📍 Beta Features (Lower Priority) -- 2.51.2