Search in sources :

Example 1 with ElytronPermission

use of org.wildfly.security.permission.ElytronPermission in project wildfly by wildfly.

the class GetCallerPrincipalTestCase method deployment.

@Deployment(managed = true, testable = true, name = "test", order = 3)
public static Archive<?> deployment() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "callerprincipal-test.jar").addClass(GetCallerPrincipalTestCase.class).addClass(SLSBWithoutSecurityDomain.class).addClass(ISLSBWithoutSecurityDomain.class).addClass(PollingUtils.class).addClass(Util.class).addClasses(JmsQueueSetup.class, EjbSecurityDomainSetup.class, AbstractSecurityDomainSetup.class, AbstractMgmtTestBase.class).addPackage(AbstractMgmtTestBase.class.getPackage()).addClasses(MgmtOperationException.class, XMLElementReader.class, XMLElementWriter.class).addAsResource(GetCallerPrincipalTestCase.class.getPackage(), "users.properties", "users.properties").addAsResource(GetCallerPrincipalTestCase.class.getPackage(), "roles.properties", "roles.properties").addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml").addAsManifestResource(GetCallerPrincipalTestCase.class.getPackage(), "MANIFEST.MF-test", "MANIFEST.MF").addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain"), new ElytronPermission("authenticate")), "permissions.xml");
    jar.addPackage(CommonCriteria.class.getPackage());
    return jar;
}
Also used : XMLElementWriter(org.jboss.staxmapper.XMLElementWriter) EjbSecurityDomainSetup(org.jboss.as.test.integration.ejb.security.EjbSecurityDomainSetup) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) XMLElementReader(org.jboss.staxmapper.XMLElementReader) AbstractMgmtTestBase(org.jboss.as.test.integration.management.base.AbstractMgmtTestBase) CommonCriteria(org.jboss.as.test.categories.CommonCriteria) ElytronPermission(org.wildfly.security.permission.ElytronPermission) MgmtOperationException(org.jboss.as.test.integration.management.util.MgmtOperationException) AbstractSecurityDomainSetup(org.jboss.as.test.integration.security.common.AbstractSecurityDomainSetup) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 2 with ElytronPermission

use of org.wildfly.security.permission.ElytronPermission in project wildfly by wildfly.

the class WildFlyActivationRaWithWMElytronSecurityDomainWorkManagerElytronEnabledTestCase method ejbDeployment.

@Deployment(name = "ejb", order = 2)
public static Archive<?> ejbDeployment() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "wf-ra-wm-security-domain-ejb.jar").addClass(WildFlyActivationRaWithWMElytronSecurityDomainWorkManagerElytronEnabledTestCase.class).addClass(AbstractElytronSetupTask.class).addClass(AbstractJcaSetup.class).addClass(AbstractRaSetup.class);
    jar.addClasses(AbstractLoginModuleSecurityDomainTestCaseSetup.class, AbstractSecurityDomainSetup.class, TestBean.class);
    jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.ironjacamar.api,deployment.wf-ra-wm-security-domain-rar.rar\n"), "MANIFEST.MF");
    jar.addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("createAdHocIdentity"), new ChangeRoleMapperPermission("ejb"), new AuthPermission("modifyPrincipals")), "permissions.xml");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) AuthPermission(javax.security.auth.AuthPermission) ElytronPermission(org.wildfly.security.permission.ElytronPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) ChangeRoleMapperPermission(org.wildfly.security.auth.permission.ChangeRoleMapperPermission) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 3 with ElytronPermission

use of org.wildfly.security.permission.ElytronPermission in project wildfly by wildfly.

the class ServletUnitTestCase method deployEar.

@Deployment(name = "ear", order = 4)
public static Archive<?> deployEar() {
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "ejb3-ear-servlet.ear");
    ear.addAsModule(getClient("ejb3-ear-servlet-client.jar"));
    ear.addAsModule(getEjbs("ejb3-ear-servlet-ejbs.jar"));
    WebArchive war = getServlet("ejb3-ear-servlet.war");
    war.addAsWebInfResource(ServletUnitTestCase.class.getPackage(), "jboss-web-ear.xml", "jboss-web.xml");
    war.addAsWebInfResource(ServletUnitTestCase.class.getPackage(), "web-ear.xml", "web.xml");
    war.addClass(EJBServletEar.class);
    war.addClass(Util.class);
    ear.addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain"), new ElytronPermission("authenticate")), "permissions.xml");
    ear.addAsModule(war);
    ear.addAsManifestResource(ServletUnitTestCase.class.getPackage(), "application.xml", "application.xml");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ElytronPermission(org.wildfly.security.permission.ElytronPermission) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 4 with ElytronPermission

use of org.wildfly.security.permission.ElytronPermission in project wildfly by wildfly.

the class ServletUnitTestCase method deployServlet.

@Deployment(name = "servlet", order = 3)
public static Archive<?> deployServlet() {
    WebArchive war = getServlet("ejb3-servlet.war");
    war.addClass(EJBServlet.class);
    war.addClass(Util.class);
    war.addAsWebInfResource(ServletUnitTestCase.class.getPackage(), "jboss-web.xml", "jboss-web.xml");
    war.addAsWebInfResource(ServletUnitTestCase.class.getPackage(), "web.xml", "web.xml");
    war.addAsManifestResource(new StringAsset("Dependencies: deployment.ejb3-servlet-ejbs.jar \n"), "MANIFEST.MF");
    war.addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain"), new ElytronPermission("authenticate")), "permissions.xml");
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ElytronPermission(org.wildfly.security.permission.ElytronPermission) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 5 with ElytronPermission

use of org.wildfly.security.permission.ElytronPermission in project wildfly by wildfly.

the class TransactionIIOPInvocationTestCase method clientDeployment.

@Deployment(name = "client", testable = true)
@TargetsContainer("iiop-client")
public static Archive<?> clientDeployment() {
    String ejbJar = FileUtils.readFile(TransactionIIOPInvocationTestCase.class, "ejb-jar.xml");
    final Properties properties = new Properties();
    properties.putAll(System.getProperties());
    if (properties.containsKey("node1")) {
        properties.put("node1", NetworkUtils.formatPossibleIpv6Address((String) properties.get("node1")));
    }
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "client.jar");
    jar.addClasses(ClientEjb.class, IIOPTransactionalHome.class, IIOPTransactionalRemote.class, TransactionIIOPInvocationTestCase.class, IIOPTransactionalStatefulHome.class, IIOPTransactionalStatefulRemote.class).addAsManifestResource(TransactionIIOPInvocationTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml").addAsManifestResource(new StringAsset(PropertiesValueResolver.replaceProperties(ejbJar, properties)), "ejb-jar.xml").addAsManifestResource(PermissionUtils.createPermissionsXmlAsset(new ElytronPermission("getPrivateCredentials")), "permissions.xml");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Properties(java.util.Properties) ElytronPermission(org.wildfly.security.permission.ElytronPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment) TargetsContainer(org.jboss.arquillian.container.test.api.TargetsContainer)

Aggregations

Deployment (org.jboss.arquillian.container.test.api.Deployment)27 ElytronPermission (org.wildfly.security.permission.ElytronPermission)27 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)17 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)15 CommonCriteria (org.jboss.as.test.categories.CommonCriteria)13 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)13 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)12 AbstractSecurityDomainSetup (org.jboss.as.test.integration.security.common.AbstractSecurityDomainSetup)6 ChangeRoleMapperPermission (org.wildfly.security.auth.permission.ChangeRoleMapperPermission)6 AuthPermission (javax.security.auth.AuthPermission)5 TargetsContainer (org.jboss.arquillian.container.test.api.TargetsContainer)4 Properties (java.util.Properties)3 PropertyPermission (java.util.PropertyPermission)3 Util (org.jboss.as.test.shared.integration.ejb.security.Util)3 SocketPermission (java.net.SocketPermission)2 EjbElytronDomainSetup (org.wildfly.test.security.common.elytron.EjbElytronDomainSetup)2 ElytronDomainSetup (org.wildfly.test.security.common.elytron.ElytronDomainSetup)2 ServletElytronDomainSetup (org.wildfly.test.security.common.elytron.ServletElytronDomainSetup)2 FilePermission (java.io.FilePermission)1 SecurityPermission (java.security.SecurityPermission)1