Skip to content

Fix authentication for /api/v1/orgs/<org>/teams/* #15909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

noerw
Copy link
Member

@noerw noerw commented May 17, 2021

These routes would throw 500 errors when called without a authenticated user.
fixes #16192

@noerw noerw added backport/v1.14 modifies/api This PR adds API routes or modifies them type/bug labels May 17, 2021
@noerw noerw added this to the 1.15.0 milestone May 17, 2021
@noerw
Copy link
Member Author

noerw commented May 17, 2021

TestAPITeamSearch fails, because it uses session auth without a CSRF token.
I guess the route works now as expected, but the test is wrong, right?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 17, 2021
@noerw noerw requested a review from 6543 May 19, 2021 08:21
@6543
Copy link
Member

6543 commented May 19, 2021

It was introduced in #8108

Yes ajust the tests ...

@noerw noerw added the pr/wip This PR is not ready for review label May 20, 2021
@noerw noerw force-pushed the fix-api-teams-permission branch from 869d38c to bec759f Compare June 18, 2021 13:04
@@ -992,7 +992,7 @@ func Routes() *web.Route {
m.Combo("", reqToken()).Get(org.ListTeams).
Copy link
Member

@a1012112796 a1012112796 Jun 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
m.Combo("", reqToken()).Get(org.ListTeams).
m.Combo("").Get(org.ListTeams).

They are in same Group ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check ...

@a1012112796
Copy link
Member

looks the list api is too similar with search, maybe can combine them ...

@noerw
Copy link
Member Author

noerw commented Jun 21, 2021

closing in favor of #16198

@noerw noerw closed this Jun 21, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/api This PR adds API routes or modifies them pr/wip This PR is not ready for review type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal Server Error on endpoint ​/orgs​/{org}​/teams - List an organization's teams
4 participants