Class DheAuthenticationHandler
java.lang.Object
io.deephaven.enterprise.dnd.authentication.DheAuthenticationHandler
- All Implemented Interfaces:
AuthenticationRequestHandler
The authentication hook for enterprise clients to DnD workers.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.auth.AuthenticationRequestHandler
AuthenticationRequestHandler.HandshakeResponseListener, AuthenticationRequestHandler.MetadataResponseListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable DheAuthContext
Fetch an EnterpriseDheAuthContext
from the currentExecutionContext
.static UserContext
void
initialize
(@NotNull String targetUrl) static boolean
isAdmin
(@NotNull UserContext userContext) Check if the specified user is an administrator of this worker.static boolean
isViewer
(@NotNull UserContext userContext) Check if the specified user is a viewer of this worker.login
(long protocolVersionUnused, ByteBuffer payload, AuthenticationRequestHandler.HandshakeResponseListener listenerUnused) login
(String payload, AuthenticationRequestHandler.MetadataResponseListener listener) static void
setAdminGroups
(@NotNull Set<String> adminGroups) static void
setAuthClient
(AuthenticationClient authClient) static void
setGroupProvider
(@NotNull GroupProvider groupProvider) static void
setOwnerCredentials
(@NotNull UserContext userContext) static void
setProcessInfoId
(@NotNull String processInfoId) static void
setViewerGroups
(@NotNull Set<String> viewerGroups) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.auth.AuthenticationRequestHandler
urls
-
Constructor Details
-
DheAuthenticationHandler
public DheAuthenticationHandler()Create a new auth handler.
-
-
Method Details
-
setOwnerCredentials
-
getOwnerCredentials
-
setAdminGroups
-
setViewerGroups
-
setGroupProvider
-
setProcessInfoId
-
isAdmin
Check if the specified user is an administrator of this worker.- Parameters:
userContext
- the user- Returns:
- true if the user is an administrator.
-
isViewer
Check if the specified user is a viewer of this worker.- Parameters:
userContext
- the user- Returns:
- true if the user is a viewer
-
fetchDheAuthContext
Fetch an EnterpriseDheAuthContext
from the currentExecutionContext
. If one is not provided, or of the wrong type, returnnull
.- Returns:
- the current
DheAuthContext
or null of one was not present.
-
setAuthClient
-
getAuthType
- Specified by:
getAuthType
in interfaceAuthenticationRequestHandler
-
login
public Optional<AuthContext> login(long protocolVersionUnused, ByteBuffer payload, AuthenticationRequestHandler.HandshakeResponseListener listenerUnused) throws AuthenticationException - Specified by:
login
in interfaceAuthenticationRequestHandler
- Throws:
AuthenticationException
-
login
public Optional<AuthContext> login(String payload, AuthenticationRequestHandler.MetadataResponseListener listener) throws AuthenticationException - Specified by:
login
in interfaceAuthenticationRequestHandler
- Throws:
AuthenticationException
-
initialize
- Specified by:
initialize
in interfaceAuthenticationRequestHandler
-