use of org.apache.jackrabbit.oak.spi.security.SecurityProvider in project jackrabbit-oak by apache.
the class AbstractLoginModuleTest method testGetSecurityProvider.
@Test
public void testGetSecurityProvider() {
AbstractLoginModule loginModule = initLoginModule(TestCredentials.class, new TestCallbackHandler(null, new OpenSecurityProvider(), null));
SecurityProvider securityProvider = loginModule.getSecurityProvider();
assertNotNull(securityProvider);
// securityProvider is stored as field -> second access returns the same object
assertSame(securityProvider, loginModule.getSecurityProvider());
}
use of org.apache.jackrabbit.oak.spi.security.SecurityProvider in project jackrabbit-oak by apache.
the class SecurityProviderCallbackTest method testCallback.
@Test
public void testCallback() {
SecurityProviderCallback cb = new SecurityProviderCallback();
SecurityProvider sp = new OpenSecurityProvider();
cb.setSecurityProvider(sp);
assertSame(sp, cb.getSecurityProvider());
}
use of org.apache.jackrabbit.oak.spi.security.SecurityProvider in project jackrabbit-oak by apache.
the class ImportIgnoreTest method before.
@Before
public void before() throws Exception {
String importBehavior = getImportBehavior();
SecurityProvider securityProvider;
if (importBehavior != null) {
Map<String, String> params = new HashMap<String, String>();
params.put(ProtectedItemImporter.PARAM_IMPORT_BEHAVIOR, getImportBehavior());
ConfigurationParameters config = ConfigurationParameters.of(AuthorizationConfiguration.NAME, ConfigurationParameters.of(params));
securityProvider = new SecurityProviderImpl(config);
} else {
securityProvider = new SecurityProviderImpl();
}
QueryEngineSettings queryEngineSettings = new QueryEngineSettings();
queryEngineSettings.setFailTraversal(true);
Jcr jcr = new Jcr();
jcr.with(securityProvider);
jcr.with(queryEngineSettings);
repo = jcr.createRepository();
adminSession = repo.login(new SimpleCredentials(UserConstants.DEFAULT_ADMIN_ID, UserConstants.DEFAULT_ADMIN_ID.toCharArray()));
target = adminSession.getRootNode().addNode("nodeName1");
target.addMixin("rep:AccessControllable");
adminSession.save();
}
Aggregations