feat: add GET /public/coaches endpoint with allowlisted fields #180
No reviewers
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!180
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "177-public-coaches-endpoint"
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?
Summary
Adds unauthenticated
GET /public/coachesendpoint returning only allowlisted fields (id, name, role, slug). Enables the dynamic staff page on westside-app without requiring authentication.Changes
src/basketball_api/routes/public.py— AddedPublicCoachResponseandPublicCoachesResponseschemas with strict field allowlist. Added/coachesendpoint to existing public router. Queries coaches filtered by tenant_id=1, returns role as raw enum string, derives slug at runtime vianame.lower().replace(" ", "-").tests/test_public.py— Added 8 tests across 4 test classes: unauthenticated access (200 without auth, empty response), field allowlist verification, sensitive field exclusion (email, phone, stripe, onboarding, etc.), slug kebab-case derivation, and role enum value correctness.Test Plan
GET /public/coachesreturns 200 without Bearer tokenRelated
58e69221f6d147f0eff8feat: add public coaches endpoint (GET /public/coaches)to feat: add GET /public/coaches endpoint with allowlisted fields