[PR #2125] [MERGED] Fix GET /users/:username/repos endpoint #16244

Closed
opened 2025-11-02 12:05:47 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2125
Author: @ethantkoenig
Created: 7/7/2017
Status: Merged
Merged: 7/10/2017
Merged by: @lafriks

Base: masterHead: fix/api


📝 Commits (1)

  • c45d7e0 Fix GET /users/:username/repos endpoint

📊 Changes

2 files changed (+63 additions, -34 deletions)

View changed files

📝 integrations/api_repo_test.go (+33 -4)
📝 routers/api/v1/user/repo.go (+30 -30)

📄 Description

Fixes the following bugs in the GET /users/:username/repos endpoint:

  • Used to get 500 if user was unauthenticated
  • Used to indicate that requester has owner-level access of repos owned by :username, regardless of whether this was actually true
  • Used to display the repositories that the authenticated user (not the searched user) had access to. Ideally, it should display neither, but like Github only display repos that the searched user owns.

Also improve existing integration tests to check that responses are expected.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2125 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 7/7/2017 **Status:** ✅ Merged **Merged:** 7/10/2017 **Merged by:** [@lafriks](https://github.com/lafriks) **Base:** `master` ← **Head:** `fix/api` --- ### 📝 Commits (1) - [`c45d7e0`](https://github.com/go-gitea/gitea/commit/c45d7e0c56f5e3d3d87bd63bf551e2f87afd5aec) Fix GET /users/:username/repos endpoint ### 📊 Changes **2 files changed** (+63 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `integrations/api_repo_test.go` (+33 -4) 📝 `routers/api/v1/user/repo.go` (+30 -30) </details> ### 📄 Description Fixes the following bugs in the `GET /users/:username/repos` endpoint: - Used to get 500 if user was unauthenticated - Used to indicate that requester has owner-level access of repos owned by `:username`, regardless of whether this was actually true - Used to display the repositories that the _authenticated_ user (not the searched user) had access to. Ideally, it should display neither, but like Github only display repos that the searched user owns. Also improve existing integration tests to check that responses are expected. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:05:47 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16244