You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2026. It is now read-only.
Full-online R2-only news portal mode requires news image uploads to go to Cloudflare R2 without writing files to the application server filesystem. The application should create controlled upload sessions, generate server-owned object keys, and verify uploaded objects before attaching them to content.
Objective
Add a secure direct-to-R2 presigned upload flow for news images.
Scope
Add API routes such as:
POST /api/v1/media/news-images/upload-sessions
POST /api/v1/media/news-images/upload-sessions/{id}/finalize
POST /api/v1/media/news-images/upload-sessions/{id}/cancel
Upload session flow:
Authenticated admin requests an upload session.
Server validates tenant context, ABAC, file metadata, MIME, extension, size, and target resource.
Server creates a pending_upload media object metadata row.
Server generates an R2 presigned PUT URL or equivalent upload credential.
Browser uploads directly to R2.
Browser calls finalize.
Server verifies object existence and metadata via R2 HEAD/metadata.
Depends on: #631, #632, #633
Context
Full-online R2-only news portal mode requires news image uploads to go to Cloudflare R2 without writing files to the application server filesystem. The application should create controlled upload sessions, generate server-owned object keys, and verify uploaded objects before attaching them to content.
Objective
Add a secure direct-to-R2 presigned upload flow for news images.
Scope
Add API routes such as:
POST /api/v1/media/news-images/upload-sessions POST /api/v1/media/news-images/upload-sessions/{id}/finalize POST /api/v1/media/news-images/upload-sessions/{id}/cancelUpload session flow:
pending_uploadmedia object metadata row.PUTURL or equivalent upload credential.HEAD/metadata.verified.Suggested permissions:
Required validations
Out of scope
Acceptance criteria
failedororphaned.bun run api:spec:checkpasses.bun run testpasses.bun run checkpasses.Security notes
public_urlfrom the browser./tmp,/public,/uploads, Docker volumes, or app filesystem.