Package org.apache.hadoop.hbase.rest
Class TestSecureRESTServer
java.lang.Object
org.apache.hadoop.hbase.rest.TestSecureRESTServer
Test class for SPNEGO authentication on the HttpServer. Uses Kerby's MiniKDC and Apache
HttpComponents to verify that a simple Servlet is reachable via SPNEGO and unreachable w/o.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static URL
static final HBaseClassTestRule
private static final String
private static File
private static MiniHBaseCluster
private static final String
private static org.apache.hadoop.minikdc.MiniKdc
private static final org.slf4j.Logger
private static final String
private static final HBaseRESTTestingUtility
private static File
private static org.apache.hadoop.hbase.rest.RESTServer
private static final String
private static File
private static final String
private static final HBaseTestingUtility
private static final String
private static File
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.util.Pair<org.apache.http.impl.client.CloseableHttpClient,
org.apache.http.client.protocol.HttpClientContext> private static void
private static void
setHdfsSecuredConfiguration
(org.apache.hadoop.conf.Configuration conf) static void
static void
void
testDoas()
void
testDoAs()
void
void
void
void
private static void
updateKerberosConfiguration
(org.apache.hadoop.conf.Configuration conf, String serverPrincipal, String spnegoPrincipal, File serverKeytab)
-
Field Details
-
CLASS_RULE
-
LOG
-
TEST_UTIL
-
REST_TEST
-
CLUSTER
-
HOSTNAME
- See Also:
-
CLIENT_PRINCIPAL
- See Also:
-
WHEEL_PRINCIPAL
- See Also:
-
SPNEGO_SERVICE_PRINCIPAL
- See Also:
-
REST_SERVER_PRINCIPAL
- See Also:
-
SERVICE_PRINCIPAL
- See Also:
-
baseUrl
-
KDC
-
server
-
restServerKeytab
-
clientKeytab
-
wheelKeytab
-
serviceKeytab
-
-
Constructor Details
-
TestSecureRESTServer
public TestSecureRESTServer()
-
-
Method Details
-
setupServer
- Throws:
Exception
-
stopServer
- Throws:
Exception
-
setHdfsSecuredConfiguration
private static void setHdfsSecuredConfiguration(org.apache.hadoop.conf.Configuration conf) throws Exception - Throws:
Exception
-
updateKerberosConfiguration
private static void updateKerberosConfiguration(org.apache.hadoop.conf.Configuration conf, String serverPrincipal, String spnegoPrincipal, File serverKeytab) -
instertData
- Throws:
IOException
InterruptedException
-
testProxy
public void testProxy(String extraArgs, String PRINCIPAL, File keytab, int responseCode) throws Exception - Throws:
Exception
-
testPositiveAuthorization
- Throws:
Exception
-
testDoAs
- Throws:
Exception
-
testDoas
- Throws:
Exception
-
testWithoutDoAs
- Throws:
Exception
-
testNegativeAuthorization
- Throws:
Exception
-
getClient
private org.apache.hadoop.hbase.util.Pair<org.apache.http.impl.client.CloseableHttpClient,org.apache.http.client.protocol.HttpClientContext> getClient()
-