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

special characters break password value and result in (401): Invalid username/password #15

Closed
xo4n opened this issue Dec 16, 2014 · 2 comments

Comments

@xo4n
Copy link

xo4n commented Dec 16, 2014

Hi a minor issue here: if the password includes a special character like '#' influx-cli will truncate the password and result in error
influx> list series
Server returned (401): Invalid username/password
influx>

for instance for this config in .influxrc
user = "root1"
pass = "root#root"

will result in this request

GET /db/metrics/series?u=root1&p=root HTTP/1.1
User-Agent: Go 1.1 package http
Accept-Encoding: identity

when escaping the character it will return

influx-cli
Near line 4, key 'pass': Near line 4: Invalid escape character '#'. Only the following escape characters are allowed: \b, \t, \n, \f, \r, ", /, , and \uXXXX.

@xo4n
Copy link
Author

xo4n commented Dec 30, 2014

hi, just missed that the especial character in the config should be percent encoded (as in http://en.wikipedia.org/wiki/Percent-encoding), so for # it should be %23
Then it works

@xo4n xo4n closed this as completed Dec 30, 2014
@Dieterbe Dieterbe reopened this Dec 30, 2014
@Dieterbe
Copy link
Owner

it shouldn't be up to the user to do url encoding in the config.
you should be able to put your pass in the config the way it is, and influx-cli should do the url encoding when issuing the request.
would you be interested in patching this and filing a PR?

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

2 participants