Class PskAuthenticationHandler

java.lang.Object
io.deephaven.authentication.psk.PskAuthenticationHandler
All Implemented Interfaces:
io.deephaven.auth.AuthenticationRequestHandler

public class PskAuthenticationHandler extends Object implements io.deephaven.auth.AuthenticationRequestHandler
On startup, check if a PSK was set by config, otherwise generate a new one and log it. Any user with the pre-shared key will be identified as a superuser.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.deephaven.auth.AuthenticationRequestHandler

    io.deephaven.auth.AuthenticationRequestHandler.HandshakeResponseListener, io.deephaven.auth.AuthenticationRequestHandler.MetadataResponseListener
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    initialize(String targetUrl)
     
    Optional<io.deephaven.auth.AuthContext>
    login(long protocolVersion, ByteBuffer payload, io.deephaven.auth.AuthenticationRequestHandler.HandshakeResponseListener listener)
     
    Optional<io.deephaven.auth.AuthContext>
    login(String payload, io.deephaven.auth.AuthenticationRequestHandler.MetadataResponseListener listener)
     
    urls(String targetUrl)
    Provide a list of URLs that the user can visit to authenticate.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PskAuthenticationHandler

      public PskAuthenticationHandler()
  • Method Details

    • getAuthType

      public String getAuthType()
      Specified by:
      getAuthType in interface io.deephaven.auth.AuthenticationRequestHandler
    • login

      public Optional<io.deephaven.auth.AuthContext> login(long protocolVersion, ByteBuffer payload, io.deephaven.auth.AuthenticationRequestHandler.HandshakeResponseListener listener) throws io.deephaven.auth.AuthenticationException
      Specified by:
      login in interface io.deephaven.auth.AuthenticationRequestHandler
      Throws:
      io.deephaven.auth.AuthenticationException
    • login

      public Optional<io.deephaven.auth.AuthContext> login(String payload, io.deephaven.auth.AuthenticationRequestHandler.MetadataResponseListener listener) throws io.deephaven.auth.AuthenticationException
      Specified by:
      login in interface io.deephaven.auth.AuthenticationRequestHandler
      Throws:
      io.deephaven.auth.AuthenticationException
    • initialize

      public void initialize(String targetUrl)
      Specified by:
      initialize in interface io.deephaven.auth.AuthenticationRequestHandler
    • urls

      public List<String> urls(String targetUrl)
      Provide a list of URLs that the user can visit to authenticate. Adds the `psk` query parameter to the target URL.
      Specified by:
      urls in interface io.deephaven.auth.AuthenticationRequestHandler
      Parameters:
      targetUrl - the base url of the hosted UI
      Returns:
      The targetUrl with the PSK query parameter appended