Skip to content

fix: Unify public-only token filtering in API queries and repo access checks (#37118)#37773

Merged
bircni merged 3 commits into
go-gitea:release/v1.26from
lunny:backport_37118
May 19, 2026
Merged

fix: Unify public-only token filtering in API queries and repo access checks (#37118)#37773
bircni merged 3 commits into
go-gitea:release/v1.26from
lunny:backport_37118

Conversation

@lunny
Copy link
Copy Markdown
Member

@lunny lunny commented May 19, 2026

backport #37118

This PR closes remaining public-only token gaps in the API by making the restriction apply consistently across repository, organization, activity, notification, and authenticated /api/v1/user/... routes.

Previously, public-only tokens were still able to:

  • receive private results from some list/search/self endpoints,
  • access repository data through ID-based lookups,
  • and reach several authenticated self routes that should remain unavailable for public-only access.

This change treats public-only as a cross-cutting visibility boundary:

  • list/search endpoints now filter private resources consistently,
  • repository lookups enforce the same restriction even when addressed indirectly,
  • and self routes that inherently expose or mutate private account state now reject public-only tokens.

Generated by a coding agent with Codex 5.2

… checks (go-gitea#37118)

This PR closes remaining `public-only` token gaps in the API by making
the restriction apply consistently across repository, organization,
activity, notification, and authenticated `/api/v1/user/...` routes.

Previously, `public-only` tokens were still able to:
- receive private results from some list/search/self endpoints,
- access repository data through ID-based lookups,
- and reach several authenticated self routes that should remain
unavailable for public-only access.

This change treats `public-only` as a cross-cutting visibility boundary:
- list/search endpoints now filter private resources consistently,
- repository lookups enforce the same restriction even when addressed
indirectly,
- and self routes that inherently expose or mutate private account state
now reject `public-only` tokens.

---
Generated by a coding agent with Codex 5.2

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
@lunny lunny added type/bug topic/security Something leaks user information or is otherwise vulnerable. Should be fixed! labels May 19, 2026
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 19, 2026
@GiteaBot GiteaBot added this to the 1.26.2 milestone May 19, 2026
@lunny lunny requested review from bircni and silverwind May 19, 2026 04:40
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 19, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 19, 2026
@bircni bircni added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 19, 2026
@bircni bircni enabled auto-merge (squash) May 19, 2026 15:05
@bircni bircni merged commit a34eac5 into go-gitea:release/v1.26 May 19, 2026
27 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 19, 2026
@lunny lunny deleted the backport_37118 branch May 19, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/security Something leaks user information or is otherwise vulnerable. Should be fixed! type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants