Package org.apache.hadoop.hbase.http
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
protected static URL
static org.apache.directory.server.core.integ.CreateLdapServerRule
private static final org.slf4j.Logger
protected static org.apache.hadoop.hbase.http.HttpServer
Fields inherited from class org.apache.hadoop.hbase.http.HttpServerFunctionalTest
TEST_BUILD_WEBAPPS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
getBasicAuthHeader
(String credentials) Generates a Basic Authentication header from the provided credentials.protected HttpURLConnection
openConnection
(String endpoint, String credentials) Opens an HTTP connection to the specified endpoint with optional Basic Authentication.protected static void
setLdapConfigurations
(org.apache.hadoop.conf.Configuration conf) Configures the provided Configuration object for LDAP authentication.static void
Sets up the HTTP server with LDAP authentication before any tests are run.static void
Stops the HTTP server after all tests are completed.Methods inherited from class org.apache.hadoop.hbase.http.HttpServerFunctionalTest
access, createAndStartTestServer, createServer, createServer, createServer, createServer, createServer, createTestServer, createTestServer, createTestServer, createTestServer, createTestServerWithSecurity, createTestServerWithSecurityAndAcl, deleteRecursively, getFreePort, getServerURL, prepareTestWebapp, readOutput, stop
-
Field Details
-
LOG
-
ldapRule
-
server
-
baseUrl
-
AUTH_TYPE
- See Also:
-
-
Constructor Details
-
LdapServerTestBase
public LdapServerTestBase()
-
-
Method Details
-
setupServer
Sets up the HTTP server with LDAP authentication before any tests are run.- Throws:
Exception
- if an error occurs during server setup
-
stopServer
Stops the HTTP server after all tests are completed.- Throws:
Exception
- if an error occurs during server shutdown
-
setLdapConfigurations
Configures the provided Configuration object for LDAP authentication.- Parameters:
conf
- the Configuration object to set LDAP properties on
-
getBasicAuthHeader
Generates a Basic Authentication header from the provided credentials.- Parameters:
credentials
- the credentials to encode- Returns:
- the Basic Authentication header
-
openConnection
Opens an HTTP connection to the specified endpoint with optional Basic Authentication.- Parameters:
endpoint
- the endpoint to connect tocredentials
- the credentials for Basic Authentication (optional)- Returns:
- the opened HttpURLConnection
- Throws:
IOException
- if an error occurs while opening the connection
-