deephaven_enterprise.client.auth#
- class AuthClient(host=None, port=None, rpc_timeout_seconds=120, channel=None)[source]#
Bases:
object
AuthClient authenticates to a Deephaven authentication server and produces tokens for use with other Deephaven services.
Presently, password and private key authentication are provided.
Create an AuthClient and connect to the server.
You may either specify the host and port to connect to, or provide your own grpc channel. The simplest case is to simply provide the host and port, but if you need advanced channel configuration or want to share the channel for several clients, then you can create it and pass it in.
- Parameters:
host (
Optional
[str
]) – the host to connect to, requires portport (
Optional
[int
]) – the port to connect to, requires hostrpc_timeout_seconds (
int
) – the rpc timeout period to use, defaults to 120 seconds if not providedchannel (
Optional
[Channel
]) – a pre-created channel to use for the gRPC messages
- close()[source]#
Logout from the authentication server. No further tokens may be requested by this client.
- Return type:
- get_token(service)[source]#
Get an authentication token to present to another Deephaven service. This token may only be used one time, as it is consumed by the authentication server during the verification process.
- password(user, password, effective_user=None)[source]#
Authenticates to the server using a username and password.
- ping()[source]#
Pings the server, refreshing our cookie. :returns: True if a ping was sent, False if there is no active cookie.
- exception AuthenticationFailedException[source]#
Bases:
Exception
This Exception is raised when the server responds to our authentication request with a failure (e.g. bad password or bad key). Other errors, like the server not responding at all are not covered by this Exception.
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.