-
Notifications
You must be signed in to change notification settings - Fork 5.8k
user creation api extension: Added temp password feature from admin ui into users api call #4805
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
|
Can you please include tests for the new functionality? If you can transform if/else statements to object calls that would be great too. |
Conflicts: lib/api/users.rb Maintained changes for useradd api
Added a test for the new features introduced to the user api in ba10a34
Parameter reference in error string was typo'd.
Several tests for the /user api call were succeeding for the wrong reason. The tests were all missing required parameters, so the api would return an error because of that and not because of the specific condition intended to be tested. Also fixed a small typo.
|
I've updated my PR with a test and some bugfixes. I've also changed the other tests for the POST /users API to work as intended; this leads to one of them failing. I don't know which of the if-statements I should change. Do you mean using validators in the user model instead of testing for correct parameters in the API call handler? |
lib/api/users.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
semi-required => required unless force_random is set
replaced "semi-required" description for password field to proper description.
Removed parentheses in if-statements
Added documentation for the extended api.
|
I integrated the last suggestions from @dosire. Thanks for helping me mature this PR! |
|
@duk3luk3 You're welcome, thank you for your efforts. I've asked Dmitriy to take a look at this. |
…racker PivotalTracker Source Commits Endpoint
Update app version in init script
…labhq into 6-1-stable
|
Pulled in 6-1-stable and added a fix for a syntax error I had introduced. Will pull in 6-2-stable and then master as soon as I get to it. |
|
@dosire What do you think about this PR? |
|
@duk3luk3 We want to start sending users an activation link instead of a temporary password when they create an account. Therefore it doesn't seem wise to add the temporary password to the API anymore. Also something I should have mentioned earlier, please try to keep PR's as small as possible. If you want to update the documentation do that in one PR. |
This pull request
To properly handle the more complex logic needed to make this change backwards-compatible and robust, some code had to be added. Comments were inserted where expedient.
I believe it is self-evident that adding the "generate temp password" feature that is already in the admin ui to the api call is useful. It enables for example batch-adding users with random passwords.