-
Notifications
You must be signed in to change notification settings - Fork 473
add extern uid field for create #182
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
Conversation
@lamdav
Also, to make the create and update more fluent, it would be good to have withXyz() methods added to User, this has been done in Project and a few other classes as I have added fields to them. Here's an example withXyz() method to add to User.java:
Only the 20 properties that are needed for creation/update should have with methods added. If you don't wish to do this, not a problem, I'll take care of it next time I make a mod to the project. |
@lamdav |
@gmessner One last note is that gitlab has also updated the api with
One last thing, I also modified |
I should have made it clearer concerning avatar, password and reset_password, don't want any of these added to the user object, these are used on create or update only and are not returned in the user resource. My plan was to add a create and update method that takes avatar, password, and reset_password as parameters, I believe avatar will need to do a file upload, which is currently only partially supported in GitLab4J so it will not be supported for now. You've pretty much done this except for reset_password. You should change this to have resetPassword as a parameter to the methods instead of being part of the User object. Additionally, the implementation of userToForm() will not allow you to specify reset_password on create, with what you have right now, userToForm() will throw an exception if password is not set on creation. What you need to do is make both of these optional in the form and add this verification before the form is created:
|
@gmessner Let me know if I misunderstood anything. |
Everything is spot on. Only one small issue is with the createUser() methods, since either password or reset_password must be set, it makes no sense to have a createUser(User user, boolean resetPassword) method. If resetPassword is false this method will throw an exception, as either a password must be provided or reset_password must be true. can we just combine these into one method:
You'll also notice that CharSequence is used instead of String, this is for security reasons, you can actually pass BTW, thank you for all your contributions and working with me on these things. |
@gmessner In addition, after thinking about it more, perhaps we should throw the specific Let me know what you think and I'll make the change accordingly. |
I updated any uses of I decided to use I also went ahead and made the createUser update as mentioned previously as it was a quick fix. I am open to changing it all to one |
@lamdav I would rather not split createUser() out into two methods, you have the same problem you called silly with the new Thanks again for all your diligent work and responses. |
@gmessner
as suggested. |
@gmessner |
@lamdav |
@lamdav |
Closes #181
Let me know if you have another way in mind to support this.