use of org.wildfly.naming.java.permission.JndiPermission in project wildfly by wildfly.
the class NamingContextTestCase method testLookupContextLink.
@Test
public void testLookupContextLink() throws Exception {
final Name name = new CompositeName("test/value");
namingStore.bind(name, "testValue");
final Name linkName = new CompositeName("link");
namingStore.bind(linkName, new LinkRef("./test"));
Object result = namingContext.lookup("link/value");
assertEquals("testValue", result);
//the same with security permissions
result = testActionPermission(JndiPermission.ACTION_LOOKUP, Arrays.asList(new JndiPermission("test", "lookup"), new JndiPermission("test/value", "lookup")), namingContext, "link/value");
assertEquals("testValue", result);
}
use of org.wildfly.naming.java.permission.JndiPermission in project wildfly by wildfly.
the class NamingContextTestCase method testLookupWithContinuation.
@Test
public void testLookupWithContinuation() throws Exception {
namingStore.bind(new CompositeName("comp/nested"), "test");
final Reference reference = new Reference(String.class.getName(), new StringRefAddr("nns", "comp"), TestObjectFactoryWithNameResolution.class.getName(), null);
namingStore.bind(new CompositeName("test"), reference);
Object result = namingContext.lookup(new CompositeName("test/nested"));
assertEquals("test", result);
//the same with security permissions
result = testActionPermission(JndiPermission.ACTION_LOOKUP, Arrays.asList(new JndiPermission("comp/nested", "lookup")), namingContext, "test/nested");
assertEquals("test", result);
}
use of org.wildfly.naming.java.permission.JndiPermission in project wildfly by wildfly.
the class DeploymentWithBindTestCase method deploy.
@Deployment
public static Archive<?> deploy() {
final WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
war.addClasses(HttpRequest.class, BeanWithBind.class, ServletWithBind.class);
war.addAsManifestResource(createPermissionsXmlAsset(new JndiPermission("global", "listBindings"), new JndiPermission("jboss", "listBindings"), new JndiPermission("jboss/exported", "listBindings"), new JndiPermission("/test", "bind"), new JndiPermission("jboss/test", "bind")), "permissions.xml");
return war;
}
use of org.wildfly.naming.java.permission.JndiPermission in project wildfly by wildfly.
the class RemoteNamingEjbTestCase method deploy.
@Deployment
public static Archive<?> deploy() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, ARCHIVE_NAME + ".jar");
jar.addClasses(Remote.class, BinderRemote.class, Bean.class, Singleton.class, StatefulBean.class);
jar.addAsResource(createPermissionsXmlAsset(new JndiPermission("java:jboss/exported/-", "all")), "META-INF/jboss-permissions.xml");
return jar;
}
use of org.wildfly.naming.java.permission.JndiPermission in project wildfly by wildfly.
the class LinkRefResourceInjectionTestCase method deployBinder.
@Deployment
public static Archive<?> deployBinder() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, BINDER_JAR_NAME + ".jar");
jar.addClasses(BinderBean.class, Binder.class, Injected.class);
jar.addAsManifestResource(createPermissionsXmlAsset(new JndiPermission("global/a", "bind"), new JndiPermission("global/b", "bind"), new JndiPermission("global/z", "bind")), "jboss-permissions.xml");
return jar;
}
Aggregations