Spaces:
Runtime error
Runtime error
Commit History
-
feat(ta-01): backend-proxy photo URLs so they stop expiring
Greg +1: Claude Opus 4.7 (1M context)Frontend now receives stable /api/v1/photos/{account_id}/{user_id}/{filename} URLs for face photos, regardless of which storage backend is active. The serve_photo endpoint authenticates against our own JWT and streams the bytes from disk (local) or Supabase (S3 via boto3.get_object). Browser caches the response privately for 5 minutes so re-renders don't hit the backend. This eliminates the 10-min signed-URL expiry pain — the URL never changes and never goes stale. Same behavior on the local-disk dev backend and on Supabase in prod. - PhotoStorage Protocol gains fetch_bytes(path) -> (bytes, content_type). - Implemented on all three adapters (Local, InMemory, Supabase). - serve_photo routes through the protocol; per-backend logic moves there. - users.py response mapping and the upload endpoint return the proxied URL instead of storage.get_url() so legacy signed URLs are gone. Tests: 22 passed (storage + photo upload), no regressions. Co-Authored-By: Claude Opus 4.7 (1M context) <n…8ca1e92 -
diag(ta-01): log resolved photo backend + admin /photos/_debug endpoint
Gregccc4fb4 -
fix(ta-01): treat blank PHOTO_STORAGE_BACKEND as unset (default to local)
Grega1c2d97 -
refactor(ta-01): swap supabase-py for boto3 S3 adapter
Greg +1: Claude Opus 4.7 (1M context)The supabase-py SDK was ~70MB with sub-deps and only used for storage. Switch to boto3 against Supabase's S3-compatible endpoint. Same class name (SupabaseStorage) for adapter-pattern continuity; the constructor now takes access_key/secret_key/endpoint/region and uses presigned URLs via generate_presigned_url for private buckets. Env vars (HF Space Secrets): SUPABASE_ACCESS_KEY_ID (from Dashboard → Project Settings → Storage → S3) SUPABASE_ACCESS_KEY_SECRET SUPABASE_ENDPOINT (e.g. https://<ref>.storage.supabase.co/storage/v1/s3) SUPABASE_REGION (default us-west-2) SUPABASE_PHOTO_BUCKET (default user-photos) Side benefit: vendor-agnostic. The same adapter works against AWS S3, R2, MinIO by changing endpoint and region. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>959bccd -
feat(ta-01): implement SupabaseStorage adapter with signed URLs
Greg +1: Claude Opus 4.7 (1M context)- SupabaseStorage uploads to {account_id}/{user_id}/{uuid}.{ext} inside the configured bucket via supabase-py. get_url() returns a short-lived signed URL (default 10 min TTL) so private buckets stay private. - _strip_url_prefix normalizes inputs so delete() works whether given a relative path or a full Supabase URL (with or without query token). - supabase>=2.0 added to requirements; SDK is lazily imported so the local backend (PHOTO_STORAGE_BACKEND=local) doesn't pay the cost. - AuthImage now passes http(s):// URLs through directly (Supabase signed URLs are already authenticated via the token query param). - Tests updated to cover credential check, prefix stripping for relative paths and signed URLs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>ea91fea
-
feat(ta-01): add PhotoStorage abstraction with Local/InMemory/Supabase adapters
Greg +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>9e5f651