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

feature request: change an OmniDB user's password via command line #1290

Open
hahnn opened this issue Sep 29, 2021 · 0 comments
Open

feature request: change an OmniDB user's password via command line #1290

hahnn opened this issue Sep 29, 2021 · 0 comments

Comments

@hahnn
Copy link

hahnn commented Sep 29, 2021

Hello,

OmniDB offers a few command line commands to manage creation of users in particular, like -u or -s.

There is no command line available to generate a new password for an existing user (when they forget it), and that would be needed when using Ansible automation (which is our case) to manage OmniDB users and associated DB connections.

This kind of command line feature would be really appreciated :-)

I would see something like that: maybe add this piece of code in omnidb-server.py:

group.add_option("-up", "--userpwd", dest="userpwd",
                  nargs=2,metavar="username password",
                  help="update user password: -up username password")
group.add_option("-sp", "--superuserpwd", dest="superuserpwd",
                  nargs=2,metavar="username password",
                  help="update super user password: -sp username password")

Then code the needed functions to handle those two new command line options, for example:

def user_pwd(p_user,p_pwd,p_superuser):
    User.objects.get(username=p_user).set_password(p_pwd)

if options.userpwd:
    maintenance_action = True
    user_pwd(options.userpwd[0], options.userpwd[1], False)

if options.superuserpwd:
    maintenance_action = True
    user_pwd(options.superuserpwd[0], options.superuserpwd[1], True)

Well in fact I don't really know because I'm not a Python developer :-(

Best regards.

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

No branches or pull requests

1 participant