-
-
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
chore(api): support ignore password if login source type is LDAP for creating user API #28491
Conversation
Maybe we need to check whether the user is a plain type or other type? |
We only support login type as LDAP so we need to ignore the password field for checking the request body. |
@lunny Add checking in Plain type. |
- Modify the `Password` field in `CreateUserOption` struct to remove the `Required` tag - Update the `v1_json.tmpl` template to include the `email` field and remove the `password` field Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add validation for password requirement in CreateUser function Signed-off-by: appleboy <appleboy.tw@gmail.com>
…r function - Modify the condition for `u.LoginType` and `form.Password` in `CreateUser` function - Add an empty line in `CreateUser` function Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@lunny Can we backport the PR to the 1.21.3 version? |
Could you elaborate the reason why it needs to "create a user without password"? If you are using LDAP, I think you could just "sync" the LDAP users into Gitea, then no need to call the "create user API"? |
Our company is currently in the process of migrating from Bitbucket to Gitea service. Since Bitbucket is integrated with LDAP authentication, there are 20,000 users in LDAP. However, we only want to migrate the users who are currently using Bitbucket to Gitea, rather than transferring all users. I have developed a migration tool that, during the project conversion, adds users based on project permissions. Therefore, it requires the use of the "add user" API. The login source will be filled with LDAP, and when using LDAP, there is no need to provide a password. https://github.com/appleboy/BitbucketServer2Gitea |
BTW: any chance to merge the logic into Gitea? So we can have a new migrate from bitbucket like others. |
…creating user API (go-gitea#28491) - Modify the `Password` field in `CreateUserOption` struct to remove the `Required` tag - Update the `v1_json.tmpl` template to include the `email` field and remove the `password` field --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
…creating user API (#28491) (#28525) Backport #28491 by @appleboy - Modify the `Password` field in `CreateUserOption` struct to remove the `Required` tag - Update the `v1_json.tmpl` template to include the `email` field and remove the `password` field Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* giteaofficial/main: Fix duplicate ID when deleting repo (go-gitea#28520) chore(api): support ignore password if login source type is LDAP for creating user API (go-gitea#28491) Update go dependencies (go-gitea#28518) Bump google/go-github to v57 (go-gitea#28514) Only check online runner when detecting matching runners in workflows (go-gitea#28286) Add orphaned topic consistency check (go-gitea#28507) Improve the prompt for "ssh-keygen sign" (go-gitea#28509)
…creating user API (go-gitea#28491) - Modify the `Password` field in `CreateUserOption` struct to remove the `Required` tag - Update the `v1_json.tmpl` template to include the `email` field and remove the `password` field --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
…creating user API (go-gitea#28491) - Modify the `Password` field in `CreateUserOption` struct to remove the `Required` tag - Update the `v1_json.tmpl` template to include the `email` field and remove the `password` field --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Password
field inCreateUserOption
struct to remove theRequired
tagv1_json.tmpl
template to include theemail
field and remove thepassword
field