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

Add support for SET PASSWORD FOR user = 'PASSWORD' #2158

Merged
merged 1 commit into from
Apr 8, 2015

Conversation

dgolja
Copy link
Contributor

@dgolja dgolja commented Apr 3, 2015

Added support for the set password for user, so we can update user password via the new server administration commands.

Example:

curl -s -G http://localhost:8086//query?db=&q=set+password+for+dejan+%3D+%golja%27

@otoolep
Copy link
Contributor

otoolep commented Apr 3, 2015

Thanks @n1tr0g -- have you signed the CLA? Also, does the tests suite for you? Please be sure to run it before opening a PR.

@otoolep
Copy link
Contributor

otoolep commented Apr 3, 2015

This is a good idea, and we need it. I'm not sure this is quite the syntax we want however. We may want ALTER USER, like we have ALTER RETENTION.

@dgnorton
Copy link
Contributor

dgnorton commented Apr 3, 2015

@n1tr0g that's awesome. I agree with @otoolep, ALTER USER is more consistent with existing syntax. Also allows other user fields to be updated in the same statement. Can you change it to ALTER USER and update INFLUXQL.md? Thanks for contributing!

@dgolja
Copy link
Contributor Author

dgolja commented Apr 4, 2015

Sure I can change that to alter user, however I followed the MySQL syntax when doing that ... https://dev.mysql.com/doc/refman/5.0/en/set-password.html

In the SQL world you use alter user to modify user preferences, not the password itself. For example you would use ALTER USER test1 admin false (https://dev.mysql.com/doc/refman/5.6/en/alter-user.html), but you can't change the password with that.

Anyway if you still would like to go with ALTER USER what would be the correct syntax ?

ALTER USER user1 PASSWORD=something ?

About the CI failing could you guys have a look ? I am not the first one getting this error. Looks like something is missing in the repo, so the tests fail.

Last but not least where would be the best place to start a conversation about some changes I would like to implement/suggest for the administration commands ? I would like to manage users/databases via my puppet module (http://github.com/n1tr0g/golja-influxdb - https://forge.puppetlabs.com/golja/influxdb), but I miss some functionality to do it properly.

In general I think if we improve the admin commands, other configuration management tools like chef, ansible, salt could benefit.

p.s. - yes I signed the CLA

@otoolep
Copy link
Contributor

otoolep commented Apr 4, 2015

@dgnorton -- would you mind offering suggestions for the ALTER USER syntax?

As for the CI failure, you've somehow changed the output of SHOW USER since the password hashes are now coming back:

    server_integration_test.go:1268: Test #115: "show users, 1 existing user" failed
          exp: {"results":[{"series":[{"columns":["user","admin"],"values":[["jdoe",false]]}]}]}
          got: {"results":[{"series":[{"columns":["user","admin"],"values":[["jdoe",false,"$2a$10$2M1xSL0kynjovZCHEwN8Q.2.5hlSQjip/JkItoCZPzrsExF/Wk/dW"]]}]}]}
    server_integration_test.go:1239: Running test 116: GRANT ALL PRIVILEGES TO jdoe
    server_integration_test.go:1239: Running test 117: show users, existing user as admin
    server_integration_test.go:1268: Test #117: "show users, existing user as admin" failed
          exp: {"results":[{"series":[{"columns":["user","admin"],"values":[["jdoe",true]]}]}]}
          got: {"results":[{"series":[{"columns":["user","admin"],"values":[["jdoe",true,"$2a$10$2M1xSL0kynjovZCHEwN8Q.2.5hlSQjip/JkItoCZPzrsExF/Wk/dW"]]}]}]}

Please run go test and make sure the test does not fail locally.

As for general discussions about changes, the mailing list is a good place to start.

@dgolja
Copy link
Contributor Author

dgolja commented Apr 4, 2015

@otoolep tnx ...

Hmm I did modify the output of 'SHOW USERS' when testing, but looks like I forgot to undo it before committing the PR. I will fix it now.

Added support for the set password for user, so we can update user
password via the new server administration commands
@dgnorton
Copy link
Contributor

dgnorton commented Apr 4, 2015

@benbjohnson @pauldix what do you guys think about ALTER USER vs SET PASSWORD? See @n1tr0g's comments above.

@pauldix
Copy link
Member

pauldix commented Apr 4, 2015

I'm cool with using SET PASSWORD or whatever. I don't have strong opinions on all the stuff related to administration. Just that everything should be possible so that people can script whatever they need through puppet, chef, ansible, etc.

@benbjohnson
Copy link
Contributor

I like SET PASSWORD since it's such a common use case and other databases support it (e.g. MySQL). I always forget the syntax of ALTER USER.

@dgolja
Copy link
Contributor Author

dgolja commented Apr 8, 2015

Any final decision on that ?

@pauldix
Copy link
Member

pauldix commented Apr 8, 2015

LGTM, thanks @n1tr0g!

pauldix added a commit that referenced this pull request Apr 8, 2015
Add support for SET PASSWORD FOR user = 'PASSWORD'
@pauldix pauldix merged commit 5ed6958 into influxdata:master Apr 8, 2015
mark-rushakoff pushed a commit that referenced this pull request Jan 11, 2019
Document/Use secret service in API
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

Successfully merging this pull request may close these issues.

5 participants