Class LdapServerTestBase

java.lang.Object
org.apache.hadoop.hbase.http.HttpServerFunctionalTest
org.apache.hadoop.hbase.http.LdapServerTestBase
Direct Known Subclasses:
TestLdapAdminACL, TestLdapHttpServer

Base class for setting up and testing an HTTP server with LDAP authentication.
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • ldapRule

      public static org.apache.directory.server.core.integ.CreateLdapServerRule ldapRule
    • server

      protected static org.apache.hadoop.hbase.http.HttpServer server
    • baseUrl

      protected static URL baseUrl
    • AUTH_TYPE

      private static final String AUTH_TYPE
      See Also:
  • Constructor Details

  • Method Details

    • setupServer

      public static void setupServer() throws Exception
      Sets up the HTTP server with LDAP authentication before any tests are run.
      Throws:
      Exception - if an error occurs during server setup
    • stopServer

      public static void stopServer() throws Exception
      Stops the HTTP server after all tests are completed.
      Throws:
      Exception - if an error occurs during server shutdown
    • setLdapConfigurations

      protected static void setLdapConfigurations(org.apache.hadoop.conf.Configuration conf)
      Configures the provided Configuration object for LDAP authentication.
      Parameters:
      conf - the Configuration object to set LDAP properties on
    • getBasicAuthHeader

      private String getBasicAuthHeader(String credentials)
      Generates a Basic Authentication header from the provided credentials.
      Parameters:
      credentials - the credentials to encode
      Returns:
      the Basic Authentication header
    • openConnection

      protected HttpURLConnection openConnection(String endpoint, String credentials) throws IOException
      Opens an HTTP connection to the specified endpoint with optional Basic Authentication.
      Parameters:
      endpoint - the endpoint to connect to
      credentials - the credentials for Basic Authentication (optional)
      Returns:
      the opened HttpURLConnection
      Throws:
      IOException - if an error occurs while opening the connection