Skip to content
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

Fixes #6881 - API users search fix #6882

Merged
merged 2 commits into from
May 8, 2019

Conversation

richmahn
Copy link
Contributor

@richmahn richmahn commented May 8, 2019

Fixes #6881

Fixes the user search if not using auth. No login/user should be needed for user search. Adds integration tests to make sure logged in, logged in as admin, and not logged in all work, where the former shows emails unless queried user has made their email private, the 2nd shows all emails, latter shows no emails.

Also set in admin API.

Test using the swagger page.

@techknowlogick techknowlogick added backport/v1.8 modifies/api This PR adds API routes or modifies them type/bug labels May 8, 2019
@techknowlogick techknowlogick added this to the 1.9.0 milestone May 8, 2019
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label May 8, 2019
@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 8, 2019
@lafriks
Copy link
Member

lafriks commented May 8, 2019

Great, thanks for adding tests! 🎉

@codecov-io
Copy link

Codecov Report

Merging #6882 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6882      +/-   ##
==========================================
+ Coverage   41.33%   41.41%   +0.08%     
==========================================
  Files         432      432              
  Lines       59552    59552              
==========================================
+ Hits        24613    24666      +53     
+ Misses      31701    31646      -55     
- Partials     3238     3240       +2
Impacted Files Coverage Δ
routers/api/v1/user/user.go 62.99% <100%> (+37.79%) ⬆️
routers/api/v1/admin/user.go 29.24% <100%> (ø) ⬆️
modules/log/event.go 65.98% <0%> (+1.52%) ⬆️
models/unit.go 67.56% <0%> (+5.4%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8b2ed6...452d490. Read the comment docs.

@lafriks lafriks merged commit 6db3dc7 into go-gitea:master May 8, 2019
@lafriks
Copy link
Member

lafriks commented May 8, 2019

Please send backport

richmahn added a commit to richmahn/gitea that referenced this pull request May 9, 2019
@techknowlogick techknowlogick added the backport/done All backports for this PR have been created label May 9, 2019
lunny pushed a commit that referenced this pull request May 9, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API User search now fails if not using token
5 participants