Search in sources :

Example 36 with PropertyPermission

use of java.util.PropertyPermission in project wildfly by wildfly.

the class RemoteEJBClientStatefulBeanFailoverTestCase method createDeployment.

private static Archive<?> createDeployment() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
    jar.addPackage(CounterRemote.class.getPackage());
    jar.addClass(CounterBean.class);
    jar.addClass(NodeNameGetter.class);
    jar.addAsManifestResource(new StringAsset("Manifest-Version: 1.0\nDependencies: deployment." + MODULE_NAME_SINGLE + ".jar\n"), "MANIFEST.MF");
    jar.addAsResource(createPermissionsXmlAsset(new PropertyPermission("jboss.node.name", "read")), "META-INF/jboss-permissions.xml");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) CounterRemote(org.jboss.as.test.clustering.cluster.ejb2.stateful.failover.bean.shared.CounterRemote) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 37 with PropertyPermission

use of java.util.PropertyPermission in project wildfly by wildfly.

the class GlobalDirectoryTestCase method createDeployment3.

@Deployment(name = DEPLOYMENT3, managed = false, testable = false)
@TargetsContainer(CONTAINER)
public static WebArchive createDeployment3() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, DEPLOYMENT3 + ".war");
    war.addClass(GlobalDirectoryDeployment3.class);
    war.addAsWebInfResource(new StringAsset("<?xml version=\"1.0\" encoding=\"UTF-8\"?><web-app><servlet-mapping>\n" + "        <servlet-name>javax.ws.rs.core.Application</servlet-name>\n" + "        <url-pattern>/*</url-pattern>\n" + "    </servlet-mapping></web-app>"), "web.xml");
    war.addAsManifestResource(createPermissionsXmlAsset(new RuntimePermission("getProtectionDomain"), new PropertyPermission("user.dir", "read")), "permissions.xml");
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment) GlobalDirectoryDeployment(org.jboss.as.test.manualmode.ee.globaldirectory.deployments.GlobalDirectoryDeployment) TargetsContainer(org.jboss.arquillian.container.test.api.TargetsContainer)

Example 38 with PropertyPermission

use of java.util.PropertyPermission in project wildfly by wildfly.

the class EEConcurrencySuspendTestCase method deployment.

@Deployment
public static WebArchive deployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "ee-suspend.war");
    war.addPackage(EEConcurrencySuspendTestCase.class.getPackage());
    war.addPackage(HttpRequest.class.getPackage());
    war.addClass(TestSuiteEnvironment.class);
    war.addAsResource(new StringAsset("Dependencies: org.jboss.dmr, org.jboss.as.controller, org.jboss.remoting \n"), "META-INF/MANIFEST.MF");
    war.addAsManifestResource(createPermissionsXmlAsset(new RuntimePermission("modifyThread"), new PropertyPermission("management.address", "read"), new PropertyPermission("node0", "read"), new PropertyPermission("jboss.http.port", "read"), new RemotingPermission("createEndpoint"), new RemotingPermission("connect"), new FilePermission(System.getProperty("jboss.inst") + "/standalone/tmp/auth/*", "read"), new SocketPermission(TestSuiteEnvironment.getServerAddress() + ":" + TestSuiteEnvironment.getHttpPort(), "connect,resolve")), "permissions.xml");
    return war;
}
Also used : HttpRequest(org.jboss.as.test.integration.common.HttpRequest) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) SocketPermission(java.net.SocketPermission) RemotingPermission(org.jboss.remoting3.security.RemotingPermission) FilePermission(java.io.FilePermission) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 39 with PropertyPermission

use of java.util.PropertyPermission in project wildfly by wildfly.

the class MDBRoleTestCase method deployment.

@Deployment
public static Archive<?> deployment() {
    final JavaArchive deployment = ShrinkWrap.create(JavaArchive.class, "ejb3mdb.jar").addClass(MDBRole.class).addClass(CreateQueueSetupTask.class).addClasses(AbstractSecurityDomainSetup.class, EjbSecurityDomainSetup.class).addClass(Simple.class).addClass(SimpleSLSB.class).addClass(TimeoutUtil.class);
    deployment.addAsManifestResource(MDBRoleTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");
    deployment.addPackage(CommonCriteria.class.getPackage());
    // grant necessary permissions
    // TODO WFLY-15289 The Elytron permissions need to be checked, should a deployment really need these?
    deployment.addAsResource(createPermissionsXmlAsset(new PropertyPermission("ts.timeout.factor", "read"), new ElytronPermission("setRunAsPrincipal"), new ElytronPermission("handleSecurityEvent"), new ChangeRoleMapperPermission("ejb")), "META-INF/jboss-permissions.xml");
    return deployment;
}
Also used : MDBRole(org.jboss.as.test.integration.ejb.security.authorization.MDBRole) PropertyPermission(java.util.PropertyPermission) SimpleSLSB(org.jboss.as.test.integration.ejb.security.authorization.SimpleSLSB) CommonCriteria(org.jboss.as.test.categories.CommonCriteria) ElytronPermission(org.wildfly.security.permission.ElytronPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) ChangeRoleMapperPermission(org.wildfly.security.auth.permission.ChangeRoleMapperPermission) AbstractSecurityDomainSetup(org.jboss.as.test.integration.security.common.AbstractSecurityDomainSetup) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 40 with PropertyPermission

use of java.util.PropertyPermission in project wildfly by wildfly.

the class MDBTestCase method getDeployment.

@Deployment
public static Archive getDeployment() {
    final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, "mdb.jar").addPackage(MDBWithDeliveryActiveAnnotation.class.getPackage()).addPackage(JMSOperations.class.getPackage()).addClass(TimeoutUtil.class).addAsManifestResource(MDBWithDeliveryActiveAnnotation.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml").addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client, org.jboss.dmr, org.jboss.remoting\n"), "MANIFEST.MF");
    // grant necessary permissions
    ejbJar.addAsManifestResource(createPermissionsXmlAsset(new PropertyPermission("ts.timeout.factor", "read"), new RemotingPermission("createEndpoint"), new RemotingPermission("connect"), new FilePermission(System.getProperty("jboss.inst") + "/standalone/tmp/auth/*", "read")), "permissions.xml");
    return ejbJar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) RemotingPermission(org.jboss.remoting3.security.RemotingPermission) FilePermission(java.io.FilePermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

PropertyPermission (java.util.PropertyPermission)98 Deployment (org.jboss.arquillian.container.test.api.Deployment)49 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)46 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)35 FilePermission (java.io.FilePermission)23 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)18 SocketPermission (java.net.SocketPermission)13 JMSOperations (org.jboss.as.test.integration.common.jms.JMSOperations)13 Permission (java.security.Permission)10 AccessControlException (java.security.AccessControlException)8 RemotingPermission (org.jboss.remoting3.security.RemotingPermission)8 PermissionCollection (java.security.PermissionCollection)7 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)7 ReflectPermission (java.lang.reflect.ReflectPermission)6 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)6 Permissions (java.security.Permissions)5 SecurityPermission (java.security.SecurityPermission)5 AccessControlContext (java.security.AccessControlContext)4 TimeoutUtil (org.jboss.as.test.shared.TimeoutUtil)4 Method (java.lang.reflect.Method)3