feat(server): REST-API für Ressourcen (CRUD + Download) #120
Labels
No labels
block-planning
bug
documentation
duplicate
enhancement
feature
good first issue
help wanted
infrastructure
invalid
planning
priority:high
priority:low
question
refactoring
status:backlog
status:done
status:in-progress
status:todo
tech-decision
test
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: bollwerkadmin/bollwerk#120
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feature: Server – REST-API für Ressourcen
Part of: #117
Depends on: #119
Ziel
Der Server stellt vollständige CRUD- und Download-Endpoints für Ressourcen bereit; authentifizierte Nutzer können den Katalog abrufen und Dateien herunterladen, Admins können Ressourcen verwalten.
Scope
ResourceRoutes.ktmit folgenden Endpoints:GET /api/resources– Katalog als JSON-Array (authenticated)GET /api/resources/{guid}/download– Datei-Stream (authenticated, korrekte Content-Type-Header)POST /api/admin/resources– Multipart-Upload: Metadaten-JSON + Datei-Part (Admin-only)PUT /api/admin/resources/{guid}– Metadaten aktualisieren ohne Datei-Upload (Admin-only)DELETE /api/admin/resources/{guid}– Ressource aus DB + Datei löschen (Admin-only)ResourceRepository.kt(Server) für alle DB-ZugriffeRouting.ktTechnische Hinweise
call.principal<UserPrincipal>()?.userId+isAdmin-Check (403 für Nicht-Admins)call.receiveMultipart()– Part "metadata" (JSON) + Part "file" (Bytes)call.respondFile(File("/opt/bollwerk/resources/${guid}.${ext}"))mitContentType.parse(mimeType)Akzeptanzkriterien
GET /api/resourcesliefert JSON-Array aller Ressourcen (authenticated)Content-TypePOSTspeichert Datei als{guid}.{ext}im Volume