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

Username/password authentication not working ? #41

Closed
jsfrerot opened this issue Dec 19, 2018 · 2 comments
Closed

Username/password authentication not working ? #41

jsfrerot opened this issue Dec 19, 2018 · 2 comments

Comments

@jsfrerot
Copy link

  • etcd3-py version: 0.1.5
  • Python version:3.6.7
  • Operating System: Ubuntu 18.10

Description

Authentication seems to be not working

What I Did

>>> from etcd3 import Client
>>> client = Client(host='my_etcd_host',protocol='https', verify='/etc/ssl/certs/ca-certificates.crt', username='myuser', password='mypassword')
>>> client.version()
EtcdVersion(etcdserver='3.3.10', etcdcluster='3.3.0')
>>> client.put('foo', 'bar')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jsfrerot/code/python_envs/etcd_client/lib/python3.6/site-packages/etcd3/apis/kv.py", line 106, in put
    return self.call_rpc(method, data=data)
  File "/home/jsfrerot/code/python_envs/etcd_client/lib/python3.6/site-packages/etcd3/client.py", line 199, in call_rpc
    self._raise_for_status(resp)
  File "/home/jsfrerot/code/python_envs/etcd_client/lib/python3.6/site-packages/etcd3/client.py", line 148, in _raise_for_status
    raise get_client_error(error, code, status, resp)
etcd3.errors.go_etcd_rpctypes_error.ErrUserEmpty: <ErrUserEmpty error:'etcdserver: user name is empty', code:3>


@Revolution1
Copy link
Owner

thank you for your report, I'm working on it

@Revolution1
Copy link
Owner

Revolution1 commented Dec 24, 2018

@jsfrerot turns out you just need to call client.auth() before you call other apis.

etcd3-py won't detect if the auth is enabled for you, you have to call the auth function by your self.

I will try to make this more human friendly.

@Revolution1 Revolution1 pinned this issue Sep 6, 2019
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