use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class AuthorizationHandlerTest method testAuthenticationDisabled.
@Test
public void testAuthenticationDisabled() throws Exception {
CConfiguration cConf = CConfiguration.create();
cConf.setBoolean(Constants.Security.ENABLED, false);
cConf.setBoolean(Constants.Security.Authorization.ENABLED, true);
testDisabled(cConf, FeatureDisabledException.Feature.AUTHENTICATION, Constants.Security.ENABLED);
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class DefaultSecureStoreServiceTest method createCConf.
private static CConfiguration createCConf() throws Exception {
CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMPORARY_FOLDER.newFolder().getAbsolutePath());
cConf.setBoolean(Constants.Security.ENABLED, true);
cConf.setBoolean(Constants.Security.Authorization.ENABLED, true);
// we only want to test authorization, but we don't specify principal/keytab, so disable kerberos
cConf.setBoolean(Constants.Security.KERBEROS_ENABLED, false);
cConf.setInt(Constants.Security.Authorization.CACHE_MAX_ENTRIES, 0);
LocationFactory locationFactory = new LocalLocationFactory(TEMPORARY_FOLDER.newFolder());
Location authorizerJar = AppJarHelper.createDeploymentJar(locationFactory, InMemoryAuthorizer.class);
cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH, authorizerJar.toURI().getPath());
// set secure store provider
cConf.set(Constants.Security.Store.PROVIDER, "file");
return cConf;
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class ProgramLifecycleServiceAuthorizationTest method createCConf.
private static CConfiguration createCConf() throws IOException {
CConfiguration cConf = CConfiguration.create();
cConf.setBoolean(Constants.Security.ENABLED, true);
cConf.setBoolean(Constants.Security.Authorization.ENABLED, true);
// we only want to test authorization, but we don't specify principal/keytab, so disable kerberos
cConf.setBoolean(Constants.Security.KERBEROS_ENABLED, false);
cConf.setInt(Constants.Security.Authorization.CACHE_MAX_ENTRIES, 0);
LocationFactory locationFactory = new LocalLocationFactory(new File(TEMPORARY_FOLDER.newFolder().toURI()));
Location authorizerJar = AppJarHelper.createDeploymentJar(locationFactory, InMemoryAuthorizer.class);
cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH, authorizerJar.toURI().getPath());
return cConf;
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class AppFabricTestBase method createBasicCConf.
protected static CConfiguration createBasicCConf() throws IOException {
CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.Service.MASTER_SERVICES_BIND_ADDRESS, hostname);
cConf.set(Constants.CFG_LOCAL_DATA_DIR, tmpFolder.newFolder("data").getAbsolutePath());
cConf.set(Constants.AppFabric.OUTPUT_DIR, System.getProperty("java.io.tmpdir"));
cConf.set(Constants.AppFabric.TEMP_DIR, System.getProperty("java.io.tmpdir"));
cConf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET, true);
String updateSchedules = System.getProperty(Constants.AppFabric.APP_UPDATE_SCHEDULES);
if (updateSchedules != null) {
cConf.set(Constants.AppFabric.APP_UPDATE_SCHEDULES, updateSchedules);
}
return cConf;
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class AuthorizationBootstrapperTest method setup.
@BeforeClass
public static void setup() throws Exception {
CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TMP_FOLDER.newFolder().getAbsolutePath());
cConf.setBoolean(Constants.Security.ENABLED, true);
cConf.setBoolean(Constants.Security.KERBEROS_ENABLED, false);
cConf.setBoolean(Constants.Security.Authorization.ENABLED, true);
Location deploymentJar = AppJarHelper.createDeploymentJar(new LocalLocationFactory(TMP_FOLDER.newFolder()), InMemoryAuthorizer.class);
cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH, deploymentJar.toURI().getPath());
// make Alice an admin user, so she can create namespaces
cConf.set(Constants.Security.Authorization.ADMIN_USERS, ADMIN_USER.getName());
instanceId = new InstanceId(cConf.get(Constants.INSTANCE_NAME));
// setup a system artifact
File systemArtifactsDir = TMP_FOLDER.newFolder();
cConf.set(Constants.AppFabric.SYSTEM_ARTIFACTS_DIR, systemArtifactsDir.getAbsolutePath());
createSystemArtifact(systemArtifactsDir);
Injector injector = Guice.createInjector(new AppFabricTestModule(cConf));
namespaceQueryAdmin = injector.getInstance(NamespaceQueryAdmin.class);
namespaceAdmin = injector.getInstance(NamespaceAdmin.class);
defaultNamespaceEnsurer = new DefaultNamespaceEnsurer(namespaceAdmin);
discoveryServiceClient = injector.getInstance(DiscoveryServiceClient.class);
txManager = injector.getInstance(TransactionManager.class);
datasetService = injector.getInstance(DatasetService.class);
systemArtifactLoader = injector.getInstance(SystemArtifactLoader.class);
authorizationBootstrapper = injector.getInstance(AuthorizationBootstrapper.class);
artifactRepository = injector.getInstance(ArtifactRepository.class);
dsFramework = injector.getInstance(DatasetFramework.class);
authorizationEnforcer = injector.getInstance(AuthorizationEnforcer.class);
}
Aggregations