Hi,
i have some questions about the pltraining-rbac module: I am trying to manage user passwords and have the following behaviour:
• If I create a new user, I am able to set a password
• If I have an existing user, the password will not be updated/set.
I had a look at the provider, and found this piece of code:
https://github.com/puppetlabs/pltraining-rbac/blob/master/lib/puppet/provider/rbac_user/ruby.rb#L86
This seems to indicate, the module is not able to manage the password at all. But on the other hand it seems this password method is never used. Is it safe to remove it?
The set_password method seems to be the place where all the logic happens:
https://github.com/puppetlabs/pltraining-rbac/blob/master/lib/puppet/provider/rbac_user/ruby.rb#L134
I understood the method does the following:
It takes the user ID and the desired password as arguments and checks if the ID is a string and confirms if the user exists, otherwise it throws an error.
Afterwards the provider calls the API to receive a password reset token and creates the payload for the Password reset request and performs the API call to reset the password.
• for me it looks like, the password reset is performed always as long as the user provides a password parameter. Is that correct?
• Why is a password not updated for an existing user?
It should be possible to check a users password using the
POST /command/validate-password
endpoint, and to update the password only in case the password provided is not matching the existing.
I also need to generate tokens, is this a valuable addition to the module?