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 io.deephaven.enterprise.auth.UserContext
void
initialize
(@NotNull String targetUrl) static boolean
isAdmin
(@NotNull io.deephaven.enterprise.auth.UserContext userContext) Check if the specified user is an administrator of this worker.static boolean
isViewer
(@NotNull io.deephaven.enterprise.auth.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
setGroupProvider
(@NotNull GroupProvider groupProvider) static void
setOwnerCredentials
(@NotNull io.deephaven.enterprise.auth.UserContext userContext) static void
setViewerGroups
(@NotNull Set<String> viewerGroups)
-
Constructor Details
-
DheAuthenticationHandler
public DheAuthenticationHandler()Create a new auth handler.
-
-
Method Details
-
setOwnerCredentials
public static void setOwnerCredentials(@NotNull @NotNull io.deephaven.enterprise.auth.UserContext userContext) -
getOwnerCredentials
public static io.deephaven.enterprise.auth.UserContext getOwnerCredentials() -
setAdminGroups
-
setViewerGroups
-
setGroupProvider
-
isAdmin
public static boolean isAdmin(@NotNull @NotNull io.deephaven.enterprise.auth.UserContext userContext) Check if the specified user is an administrator of this worker.- Parameters:
userContext
- the user- Returns:
- true if the user is an administrator.
-
isViewer
public static boolean isViewer(@NotNull @NotNull io.deephaven.enterprise.auth.UserContext userContext) 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.
-
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
-