Phase 2a: FastAPI Service + SDK Routes
Goal: Create a FastAPI service that wraps all MinIO SDK operations as JSON REST endpoints — no auth yet, just the routes and SDK integration.
Owner: Dev agent
Repo:
forgejo_admin/minio-api (to be created)Depends on:
phase-pal-e-platform-24-minio-sdk (completed), minio-sdk #3 (XML escaping fix — must merge first)Scope
- FastAPI app with 15 REST endpoints wrapping all MinioClient methods
- JSON request/response — SDK handles XML internally
- Pydantic models for request/response schemas
- MinIO credentials from env vars (
MINIO_ACCESS_KEY,MINIO_SECRET_KEY,MINIO_ENDPOINT) - Presigned URL generation endpoints (GET and PUT)
- OpenAPI docs at
/docs(Swagger UI) and/openapi.json - Integration tests using httpx test client against live MinIO
pyproject.tomlwith minio-sdk as dependency (from Forgejo PyPI)
API Routes
No Auth in This Subphase
Auth is Phase 2b. This subphase ships a working API with no authentication — usable on tailnet only. This lets us validate the SDK integration and API design independently from the auth layer.
Deliverables
- PR #2 merged (squash) — 2026-03-22
- 15 REST endpoints: buckets (4), objects (5), presign (2), multipart (3), batch delete (1)
- Pydantic v2 request/response schemas
- Swagger UI at
/docs, OpenAPI spec at/openapi.json - 27 integration tests (buckets 7, objects 10, presign 3, multipart 7) — all passing against live MinIO
- 100 MiB upload size cap with 413 response + chunked reading
- minio-sdk imported from Forgejo PyPI (not vendored)
- Routing shadow fix: multipart router mounted before objects catch-all
Related
phase-minio-mobile-2-api-auth— parent phaseplan-minio-mobile— parent planphase-minio-mobile-2b-keycloak-auth— next subphase (adds auth)