Bug: repos query on browse frontend ignores project is_public #58

Closed
opened 2026-03-01 22:26:10 +00:00 by forgejo_admin · 0 comments

Plan

plan-2026-02-28-knowledge-system-consolidation — Phase 4 (Privacy Audit)

Repo

pal-e-docs — the repo where the code change happens

User Story

As an unauthenticated visitor browsing pal-e-docs
I need repos belonging to private projects to be hidden
So that internal infrastructure repos are not leaked on the public browse frontend

Acceptance Criteria

When I visit /browse/ or /browse/repos without logging in
Then I only see repos whose parent project has is_public = true

When I visit /browse/ or /browse/repos while logged in
Then I see all repos regardless of project visibility

Additional Information

src/pal_e_docs/routes/frontend.py:

  • Line 79 (landing page): repos = db.query(Repo)... — no public filter applied
  • Lines 226-227 (/browse/repos): same unfiltered db.query(Repo), plus db.query(Project) also unfiltered

The pattern already exists: _apply_project_public_filter (line 29) filters projects. Repos need an equivalent filter that joins through Repo.project and checks Project.is_public. The /browse/repos route also passes an unfiltered project list to the template.

Discovered during the Phase 4 privacy audit. 13 infra-sensitive notes were already made private. This is the remaining code fix to fully close Phase 4.

Checklist

  • PR opened with related notes
  • Tests cover the acceptance criteria
  • Docs updated if needed
  • project-pal-e-docs — parent project
  • plan-2026-02-28-knowledge-system-consolidation — Phase 4
  • issue-pal-e-docs-repos-public-filter — pal-e-docs issue note
### Plan `plan-2026-02-28-knowledge-system-consolidation` — Phase 4 (Privacy Audit) ### Repo `pal-e-docs` — the repo where the code change happens ### User Story As an unauthenticated visitor browsing pal-e-docs I need repos belonging to private projects to be hidden So that internal infrastructure repos are not leaked on the public browse frontend ### Acceptance Criteria When I visit `/browse/` or `/browse/repos` without logging in Then I only see repos whose parent project has `is_public = true` When I visit `/browse/` or `/browse/repos` while logged in Then I see all repos regardless of project visibility ### Additional Information `src/pal_e_docs/routes/frontend.py`: - **Line 79** (landing page): `repos = db.query(Repo)...` — no public filter applied - **Lines 226-227** (`/browse/repos`): same unfiltered `db.query(Repo)`, plus `db.query(Project)` also unfiltered The pattern already exists: `_apply_project_public_filter` (line 29) filters projects. Repos need an equivalent filter that joins through `Repo.project` and checks `Project.is_public`. The `/browse/repos` route also passes an unfiltered project list to the template. Discovered during the Phase 4 privacy audit. 13 infra-sensitive notes were already made private. This is the remaining code fix to fully close Phase 4. ### Checklist - [ ] PR opened with related notes - [ ] Tests cover the acceptance criteria - [ ] Docs updated if needed ### Related - `project-pal-e-docs` — parent project - `plan-2026-02-28-knowledge-system-consolidation` — Phase 4 - `issue-pal-e-docs-repos-public-filter` — pal-e-docs issue note
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/pal-e-api#58
No description provided.