bug: /projects and /boards endpoints don't filter by is_public for unauthenticated requests #184
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/pal-e-api#184
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?
Lineage
plan-pal-e-docs→ Phase F14 (phase-pal-e-docs-f14-public-readiness)Repo
forgejo_admin/pal-e-docsUser Story
As a public visitor browsing pal-e-docs without authentication
I want to only see public projects and boards
So that private projects (like "Private" and "Remember") and their boards are not exposed to me
Context
Phase F6 (PR #179) added
is_publicfiltering to all note endpoints usingget_is_authenticated()inauth.py. The/projectsand/boardsendpoints were not updated with the same filtering. Currently:GET /projectsreturns ALL projects including ones withis_public=falseGET /boardsreturns ALL boards including boards belonging to private projectsGET /boards/{slug}returns board details even for private project boardsThe portfolio site needs pal-e-docs to be safe for public traffic before it can link to it.
File Targets
Files the agent should modify:
src/pal_e_docs/routes/projects.py— addis_publicfiltering usingget_is_authenticated()dependencysrc/pal_e_docs/routes/boards.py— add project-levelis_publicfiltering for list and get endpointstests/test_projects.py(or equivalent) — new tests for auth filteringtests/test_boards.py(or equivalent) — new tests for auth filteringFiles the agent should reference (do not modify):
src/pal_e_docs/auth.py— existingget_is_authenticated()implementation to followsrc/pal_e_docs/routes/notes.py— reference implementation ofis_publicfilteringAcceptance Criteria
curl /projectswithoutX-PaleDocs-Token, then projects withis_public=falseare NOT in the responsecurl /projectsWITH valid token, then ALL projects are returnedcurl /boardswithout token, then boards belonging tois_public=falseprojects are NOT in the responsecurl /boards/{slug}without token for a board on a private project, then I get 404curl /boards/{slug}WITH token for a board on a private project, then I get the boardTest Expectations
/projectsfilteris_public=falseprojects/boardsfilter boards on private projectspytest tests/ -k "project" -vandpytest tests/ -k "board" -vConstraints
get_is_authenticated()fromauth.py— do not create a new auth mechanismroutes/notes.pyforis_publicfilteringis_publicfield — use it directlyis_publicfieldChecklist
Related
project-pal-e-docs— project this affectsphase-pal-e-docs-private-notes— Phase F6, the foundation this extends