Feature: Unauthenticated photo upload for registration flow #108
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api#108
Loading…
Add table
Add a link
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?
Type
Feature
Lineage
plan-wkq→ Phase 11 (Girls Tryout — March 24)Repo
forgejo_admin/basketball-apiUser Story
As a parent registering my player for tryouts
I want to upload a player photo during registration
So that the player profile is complete before tryout day
Context
The existing
POST /upload/photorequires Keycloak authentication, but during registration the user doesn't have an account yet. The SPA registration form has a photo upload UI but can't actually send photos to the API. We need an unauthenticated upload endpoint specifically for the registration flow. ThePOST /api/registerJSON endpoint (PR #107) already acceptsphoto_url— we just need the upload mechanism.File Targets
Files to modify:
src/basketball_api/routes/register.py— addPOST /api/register/upload-photoendpointtests/test_register_upload.py— new test file for upload testsFiles NOT to touch:
src/basketball_api/routes/upload.py— existing auth-required upload stays as-is (import constants from it)src/basketball_api/routes/admin.py— no admin changesAcceptance Criteria
POST /api/register/upload-photoaccepts multipart file upload without auth{"photo_url": "/uploads/photos/<uuid>.<ext>"}POST /api/registerwithphoto_urlfield saves toPlayer.photo_urlTest Expectations
pytest tests/ -x -vConstraints
ALLOWED_EXTENSIONS,MAX_FILE_SIZE,UPLOAD_DIRfromroutes/upload.py/data/uploads/photosin prod (PVC mount)Checklist
Related
westside-basketball— projectforgejo_admin/basketball-api #106— promo code endpoint (this builds on it)forgejo_admin/westside-app #47— SPA fix (will consume this endpoint)plan-wkqPhase 11 — Girls Tryout March 24