kragniz / kragniz/python-etcd3
Authentication with username and password doesn't work?
- Lingua principale
- Python
- Stelle
- 450
- Fork
- 194
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
@kragniz , after installed etcd3 version 0.7.0, I can't access data in `etcd` when user authentication is enabled. The following is the traceback,
```
In [30]: Etcd3Client(user='root', password='xxxxxx')
Out[30]:
In [31]: Out[30].get('foo')
---------------------------------------------------------------------------
_Rendezvous Traceback (most recent call last)
in ()
----> 1 Out[30].get('foo')
/Users/justdoit/workspace/works/laiye/venv/v3.6/lib/python3.6/site-packages/etcd3/client.py in handler(*args, **kwargs)
46 return f(*args, **kwargs)
47 except grpc.RpcError as exc:
---> 48 _translate_exception(exc)
49
50 return functools.wraps(f)(handler)
/Users/justdoit/workspace/works/laiye/venv/v3.6/lib/python3.6/site-packages/etcd3/client.py in handler(*args, **kwargs)
44 def handler(*args, **kwargs):
45 try:
---> 46 return f(*args, **kwargs)
47 except grpc.RpcError as exc:
48 _translate_exception(exc)
/Users/justdoit/workspace/works/laiye/venv/v3.6/lib/python3.6/site-packages/etcd3/client.py in get(self, key)
247 range_request,
248 self.timeout,
--> 249 credentials=self.call_credentials,
250 )
251
/Users/justdoit/workspace/works/laiye/venv/v3.6/lib/python3.6/site-packages/grpc/_channel.py in __call__(self, request, timeout, metadata, credentials)
490 state, call, deadline = self._blocking(request, timeout, metadata,
491 credentials)
--> 492 return _end_unary_response_blocking(state, call, False, deadline)
493
494 def with_call(self, request, timeout=None, metadata=None, credentials=None):
/Users/justdoit/workspace/works/laiye/venv/v3.6/lib/python3.6/site-packages/grpc/_channel.py in _end_unary_response_blocking(state, call, with_call, deadline)
438 return state.response
439 else:
--> 440 raise _Rendezvous(state, None, None, deadline)
441
442
_Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.INVALID_ARGUMENT, etcdserver: user name is empty)>
```
This was tested on my Mac, with python version 3.6, and detailed as the followed,
```
Python 3.6.0 (default, Mar 24 2017, 18:00:20)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
```
The Mac version is `Darwin yusenbindeMacBook-Pro.local 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64`.
However, I could access with `etcdctl` command line tool,
```
yusenbindeMacBook-Pro:etcd justdoit$ export ETCDCTL_API=3
yusenbindeMacBook-Pro:etcd justdoit$ etcdctl --user=root get foo
Password:
foo
bar_1
```
The authentication process had already succeeded, and the message was logged.
>2017-11-13 17:06:16.295082 D | auth: authorized root, token is dAhzbXDmVRQsFJYA.72`
It's the same as what `etcdctl` has did. Hence it seems that the gRPC's call credential check has failed.
So, guys, how does this occurred?
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia in etcd3/client.py, intorno a Etcd3Client, get() e call_credentials, quindi confronta la richiesta autenticata del client Python con il comando funzionante etcdctl --user=root. Riproduci l’errore INVALID_ARGUMENT segnalato e verifica che un get('foo') autenticato abbia successo senza il messaggio relativo all’utente vuoto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- grpc, python
- Ambito
- api, authentication, backend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100