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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static URLstatic final HBaseClassTestRuleprivate static final Stringprivate static Fileprivate static SingleProcessHBaseClusterprivate static final Stringprivate static org.apache.hadoop.minikdc.MiniKdcprivate static final org.slf4j.Loggerprivate static final Stringprivate static final HBaseRESTTestingUtilityprivate static Fileprivate static org.apache.hadoop.hbase.rest.RESTServerprivate static final Stringprivate static Fileprivate static final Stringprivate static final HBaseTestingUtilprivate static final Stringprivate static File -
Constructor Summary
Constructors -
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 voidprivate static voidsetHdfsSecuredConfiguration(org.apache.hadoop.conf.Configuration conf) static voidstatic voidvoidtestDoas()voidtestDoAs()voidvoidvoidvoidprivate static voidupdateKerberosConfiguration(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:
IOExceptionInterruptedException
-
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()
-