Skip to content

API: '/orgs/:org/repos' should also return private repos, which the caller has read access to #5310

Closed
@inxonic

Description

@inxonic
  • Gitea version (or commit ref): d487a76
  • Operating system: Linux
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (example below)

Description

API /orgs/:org/repos only returns public repos of an org (if not called as admin). I'd expect it to also return private repos, which the caller has at least read access to.

This would be more consistent with the web interface and the Github API where type defaults to all. Further there's no other API call for that purpose.

Example

Only returns testcase01/public-repo:
curl -X GET "https://try.gitea.io/api/v1/orgs/testcase01/repos" -H "accept: application/json" -H "authorization: Basic dGVzdHVzZXIwMjp0ZXN0dXNlcjAy"

Should also return testcase01/private-repo as it is readable:
curl -X GET "https://try.gitea.io/api/v1/repos/testcase01/private-repo" -H "accept: application/json" -H "authorization: Basic dGVzdHVzZXIwMjp0ZXN0dXNlcjAy"

Web interface also returns both repos:
curl -X GET https://try.gitea.io/testcase01 -H "accept: application/json" -H "authorization: Basic dGVzdHVzZXIwMjp0ZXN0dXNlcjAy"

Metadata

Metadata

Assignees

No one assigned

    Labels

    modifies/apiThis PR adds API routes or modifies themtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions