use of org.apache.hadoop.minikdc.MiniKdc in project hbase by apache.
the class CustomSaslAuthenticationProviderTestBase method startCluster.
protected static void startCluster(String rpcServerImpl) throws Exception {
KEYTAB_FILE = new File(UTIL.getDataTestDir("keytab").toUri().getPath());
final MiniKdc kdc = UTIL.setupMiniKdc(KEYTAB_FILE);
// Adds our test impls instead of creating service loader entries which
// might inadvertently get them loaded on a real cluster.
CONF.setStrings(SaslClientAuthenticationProviders.EXTRA_PROVIDERS_KEY, InMemoryClientProvider.class.getName());
CONF.setStrings(SaslServerAuthenticationProviders.EXTRA_PROVIDERS_KEY, InMemoryServerProvider.class.getName());
CONF.set(SaslClientAuthenticationProviders.SELECTOR_KEY, InMemoryProviderSelector.class.getName());
createBaseCluster(UTIL, KEYTAB_FILE, kdc);
CONF.set(RpcServerFactory.CUSTOM_RPC_SERVER_IMPL_CONF_KEY, rpcServerImpl);
CLUSTER = new LocalHBaseCluster(CONF, 1);
CLUSTER.startup();
}
use of org.apache.hadoop.minikdc.MiniKdc in project incubator-atlas by apache.
the class BaseSecurityTest method startKDC.
protected File startKDC() throws Exception {
File target = Files.createTempDirectory("sectest").toFile();
File kdcWorkDir = new File(target, "kdc");
Properties kdcConf = MiniKdc.createConf();
kdcConf.setProperty(MiniKdc.DEBUG, "true");
kdc = new MiniKdc(kdcConf, kdcWorkDir);
kdc.start();
Assert.assertNotNull(kdc.getRealm());
return kdcWorkDir;
}
use of org.apache.hadoop.minikdc.MiniKdc in project hadoop by apache.
the class TestRMWebappAuthentication method setUp.
@BeforeClass
public static void setUp() {
try {
testMiniKDC = new MiniKdc(MiniKdc.createConf(), testRootDir);
setupKDC();
} catch (Exception e) {
assertTrue("Couldn't create MiniKDC", false);
}
}
use of org.apache.hadoop.minikdc.MiniKdc in project hadoop by apache.
the class TestHttpServerWithSpengo method setUp.
@BeforeClass
public static void setUp() throws Exception {
try {
testMiniKDC = new MiniKdc(MiniKdc.createConf(), testRootDir);
testMiniKDC.start();
testMiniKDC.createPrincipal(httpSpnegoKeytabFile, HTTP_USER + "/localhost");
} catch (Exception e) {
assertTrue("Couldn't setup MiniKDC", false);
}
Writer w = new FileWriter(secretFile);
w.write("secret");
w.close();
}
use of org.apache.hadoop.minikdc.MiniKdc in project hadoop by apache.
the class TestKMS method setUpMiniKdc.
private static void setUpMiniKdc(Properties kdcConf) throws Exception {
File kdcDir = getTestDir();
kdc = new MiniKdc(kdcConf, kdcDir);
kdc.start();
keytab = new File(kdcDir, "keytab");
List<String> principals = new ArrayList<String>();
principals.add("HTTP/localhost");
principals.add("client");
principals.add("hdfs");
principals.add("otheradmin");
principals.add("client/host");
principals.add("client1");
for (KMSACLs.Type type : KMSACLs.Type.values()) {
principals.add(type.toString());
}
principals.add("CREATE_MATERIAL");
principals.add("ROLLOVER_MATERIAL");
kdc.createPrincipal(keytab, principals.toArray(new String[principals.size()]));
}
Aggregations