Skip to content
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

Change users password via cli #95

Open
verhyppo opened this issue Feb 7, 2020 · 5 comments
Open

Change users password via cli #95

verhyppo opened this issue Feb 7, 2020 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@verhyppo
Copy link
Contributor

verhyppo commented Feb 7, 2020

It could be a good idea to allow the users for nexus-cli to change the password for existing users.

@thiagofigueiro
Copy link
Owner

For local users, yeah. Nice. This is the sort of thing I think should go into the configure sub-command I mentioned in your other issue.

@thiagofigueiro thiagofigueiro added the enhancement New feature or request label Feb 8, 2020
@thiagofigueiro thiagofigueiro added this to the 3.1.0 milestone Feb 18, 2020
@verhyppo
Copy link
Contributor Author

Hi,
What do you think should be the best approach to login again the user once it's password has been changed?
Simply logout the user from the cli and then ask the user to do the login back?
or reconnect him directly using the username and pwd just changed if the username match with the current user?

@thiagofigueiro
Copy link
Owner

I understood the original suggestion as:

  1. The CLI user recorded in ~/.nexus3cli is an administrator
  2. The CLI user can issue a command to change any other user's password (including herself)

Your question leads me to think that 1 is not always true (which is sensible) and that 2 is only herself.

Either way, your question is valid as if an admin CLI user changes their own password, they would need to manually re-login with nexus3 login.

My opinion is:

  1. The CLI doesn't check for an existing ~/.nexus3cli. It would be good if it did and adjusted the default answers to match the existing configuration.
  2. If the password changed is for the user in ~/.nexus3cli, the CLI should automatically update the settings.

How does this sound?

@verhyppo
Copy link
Contributor Author

verhyppo commented Mar 24, 2020

just for clarification: by administrator do you mean that has role nx-admin?

EDIT: in nx domain, a user to change it's own password must have nx-userschangepw priviledge granted, while needs nx-admin to change other user passwords.
In this case it makes sense to allow simple users to change their own password via cli.
This means that your opinions are correct and I think makes the ux enough for a simple user.

I think there could be some problems integration testing those scenarios since we don't have the creation of a new user already, maybe it's something that can be planned.

@thiagofigueiro
Copy link
Owner

by administrator do you mean that has role nx-admin?

Yes - I should have been specific, thanks!

From a testing point of view it would be easier if user creation/management came before password changing. We could always hack the test setup externally (curl? I remember seeing user management in the REST API recently).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants