-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Rest API invalid output compared to UI #27694
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
The auth source is LDAP. Users are created automatically by cron sync with ldap |
This comment was marked as outdated.
This comment was marked as outdated.
I can't seem to find any
I suspect the root cause may be that LDAP downgraded the user's permission to 0 (Can LDAP do that?), or the admin manually changed the user's permission to unread. ( @sgabenov, could you confirm this please?) . This might be causing the frontend to fail to retrieve all the users. I'm not certain if this issue should be labeled as a bug. According to GitLab documentation about deactivated user
However, it might be better for the backend API to find the whitelist users with a readAccess condition as well. This would unify the logic for both the backend and frontend. Happy to provide a pr for that. |
Thank you for the contribution. |
…0291) Add some logic in `convert.ToBranchProtection` to return only the names associated with readAccess instead of returning all names. This will ensure consistency in behavior between the frontend and backend. Fixes: #27694 --------- Co-authored-by: techknowlogick <[email protected]> Co-authored-by: wenzhuo.zhang <[email protected]> Co-authored-by: Giteabot <[email protected]>
…-gitea#30291) Add some logic in `convert.ToBranchProtection` to return only the names associated with readAccess instead of returning all names. This will ensure consistency in behavior between the frontend and backend. Fixes: go-gitea#27694 --------- Co-authored-by: techknowlogick <[email protected]> Co-authored-by: wenzhuo.zhang <[email protected]> Co-authored-by: Giteabot <[email protected]>
…0291) (#30544) Backport #30291 by @edwardzhanged Add some logic in `convert.ToBranchProtection` to return only the names associated with readAccess instead of returning all names. This will ensure consistency in behavior between the frontend and backend. Fixes: #27694 Co-authored-by: Edward Zhang <[email protected]> Co-authored-by: techknowlogick <[email protected]> Co-authored-by: wenzhuo.zhang <[email protected]>
…-gitea#30291) (go-gitea#30544) Backport go-gitea#30291 by @edwardzhanged Add some logic in `convert.ToBranchProtection` to return only the names associated with readAccess instead of returning all names. This will ensure consistency in behavior between the frontend and backend. Fixes: go-gitea#27694 Co-authored-by: Edward Zhang <[email protected]> Co-authored-by: techknowlogick <[email protected]> Co-authored-by: wenzhuo.zhang <[email protected]> (cherry picked from commit d88958b)
Description
Hi all,
The Gitea REST API {{baseUrl}}/repos/:owner/:repo/branch_protections/:name returns invalid output compared to the data that is shown in UI.
For instance, we have a repo with protected branch "master". Initially we have added several users for "merge_whitelist_usernames" with user "vasiliy.chipizhin" included into this list. Then this user was retired and we have deleted his account from "merge_whitelist_usernames". It was done several month ago and we have already restarted gitea instance since that time. In Gitea UI i do not see this user account in the whitelist section. But when i use REST API to get list of users, i do see this user account "vasiliy.chipizhin" in API respoce
Postman responce:
"vasiliy.chipizhin" account is presented
Gitea UI:
"vasiliy.chipizhin" account is absent
Gitea Version
1.20.0
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
docker
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: