python-pachyderm icon indicating copy to clipboard operation
python-pachyderm copied to clipboard

Authentication behaviour is not trivial from docs/broken?

Open RaananHadar opened this issue 4 years ago • 1 comments

Assumming I get an otp via pachctl, I run the following in python:

client.authenticate_one_time_password('<valid otp>')

this returns a string. It is unclear where and how this string is used from the docs. The obvious behavior for the user would now be to run something like client.list_repo() thinking that they authenticated successfully. However it which will fail with:

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.UNKNOWN
	details = "error getting access level for "test": no authentication token (try logging in)"
	debug_error_string = "{"created":"@1615240761.537080145","description":"Error received from peer ipv6:[::1]:30650","file":"src/core/lib/surface/call.cc","file_line":1067,"grpc_message":"error getting access level for "test": no authentication token (try logging in)","grpc_status":2}"

I've managed to successfully login by doing: client.auth_token = client.authenticate_one_time_password('<valid otp>')

This is not trivial from the docs, and i'm not sure that its the proper pythonic way to implement this...

RaananHadar avatar Mar 08 '21 22:03 RaananHadar

Thanks for this feedback @RaananHadar This is something we'll consider when updating the python-pachyderm client in the future. Auth is going through some upcoming changes with Pachyderm 2.0, so we'll probably address this after 2.0 lands.

echohack avatar Mar 08 '21 23:03 echohack