Public teams endpoint — GET /public/teams #176
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#176
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
Enables dynamic teams page on westside-app public site.
Repo
forgejo_admin/basketball-apiUser Story
As a visitor on the public website, I want to see team rosters so that I can learn about the program and its players without needing to log in.
story:WS-S26
Context
All existing team/roster endpoints require auth (
require_adminorrequire_role). The public site needs an unauthenticated endpoint that returns only publicly-safe player data.The westside-playground teams.html
@svelte-notesdefine the data contract:Security — Field Allowlist
CRITICAL: Do NOT reuse existing admin response schemas. Create dedicated public schemas.
Public response MUST include ONLY:
MUST NOT expose: parent_id, parent_name, parent_email, parent_phone, date_of_birth, payment_status, stripe_customer_id, stripe_subscription_id, contract_status, contract_token, monthly_fee, jersey_size, jersey_option, address, hometown, target_schools, photo_url, tryout_number.
File Targets
src/basketball_api/routes/public.py— public endpoints (no auth)src/basketball_api/main.py— register public routerAcceptance Criteria
GET /public/teamsreturns teams with nested players, no auth requiredPublicTeamsResponse— allowlisted fields onlyTest Expectations
Constraints
Depends(require_role)orDepends(require_admin)Checklist
Related
@svelte-notes— data contractconvention-sveltekit-spa— frontend consuming this endpointScope Addition
Add
is_publicboolean column toplayerstable (defaultfalse). TheGET /public/teamsendpoint should only return players whereis_public = true. This gives coaches/admin control over which player profiles appear on the public website.Migration needed:
ALTER TABLE players ADD COLUMN is_public BOOLEAN NOT NULL DEFAULT false;Admin will need a way to toggle this — but that's a separate ticket. For now, the column + filter is enough.
Scope Review: READY
Review note:
review-429-2026-03-26Scope is solid — all 12 template sections present, traceability triangle complete, all file targets verified against codebase, security allowlist is thorough with explicit deny list. Acceptance criteria are fully testable by an agent. No blockers found; sibling ticket #177 (public coaches) shares
public.pybut no conflict. Downstream consumer (westside-app SvelteKit) correctly declaresdepends:bb-176+bb-177.forgejo_admin referenced this issue2026-03-27 03:43:33 +00:00