Search in sources :

Example 1 with ChangeRoleMapperPermission

use of org.wildfly.security.auth.permission.ChangeRoleMapperPermission 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 2 with ChangeRoleMapperPermission

use of org.wildfly.security.auth.permission.ChangeRoleMapperPermission 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 3 with ChangeRoleMapperPermission

use of org.wildfly.security.auth.permission.ChangeRoleMapperPermission in project wildfly by wildfly.

the class RunAsPrincipalTestCase method runAsDeployment.

@Deployment
public static Archive<?> runAsDeployment() {
    // using JavaArchive doesn't work, because of a bug in Arquillian, it only deploys wars properly
    final WebArchive war = ShrinkWrap.create(WebArchive.class, DEPLOYMENT + ".war").addPackage(WhoAmI.class.getPackage()).addClass(SimpleSingletonBean.class).addClass(StatelessSingletonUseBean.class).addClass(Util.class).addClass(Entry.class).addClass(RunAsPrincipalTestCase.class).addClass(TestLogHandlerSetupTask.class).addClass(LoggingUtil.class).addClasses(AbstractSecurityDomainSetup.class, EjbSecurityDomainSetup.class).addAsWebInfResource(RunAsPrincipalTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml").addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client,org.jboss.dmr\n"), "MANIFEST.MF").addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain"), new PropertyPermission("jboss.server.log.dir", "read"), PermissionUtils.createFilePermission("read", "standalone", "log", TEST_LOG_FILE_NAME), new ElytronPermission("authenticate"), new ElytronPermission("getIdentity"), new ElytronPermission("createAdHocIdentity"), new ChangeRoleMapperPermission("ejb"), new ElytronPermission("setRunAsPrincipal")), "permissions.xml");
    war.addPackage(CommonCriteria.class.getPackage());
    return war;
}
Also used : TestLogHandlerSetupTask(org.jboss.as.test.shared.TestLogHandlerSetupTask) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) CommonCriteria(org.jboss.as.test.categories.CommonCriteria) StatelessSingletonUseBean(org.jboss.as.test.integration.ejb.security.runasprincipal.transitive.StatelessSingletonUseBean) ElytronPermission(org.wildfly.security.permission.ElytronPermission) ChangeRoleMapperPermission(org.wildfly.security.auth.permission.ChangeRoleMapperPermission) 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 4 with ChangeRoleMapperPermission

use of org.wildfly.security.auth.permission.ChangeRoleMapperPermission in project wildfly by wildfly.

the class RunAsEjbMdbTestCase method runAsEJB3.

@Deployment(testable = false, managed = true, name = "ejb3", order = 2)
public static Archive<?> runAsEJB3() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "runasmdbejb-ejb3.jar").addClasses(HelloBean.class, Hello.class, HolaBean.class, Hola.class, Howdy.class, HowdyBean.class, HelloMDB.class, TimeoutUtil.class);
    // TODO WFLY-15289 Should these permissions be required?
    jar.addAsResource(createPermissionsXmlAsset(new PropertyPermission("ts.timeout.factor", "read"), new ElytronPermission("setRunAsPrincipal"), new ElytronPermission("handleSecurityEvent"), new ChangeRoleMapperPermission("ejb")), "META-INF/jboss-permissions.xml");
    jar.addAsManifestResource(new StringAsset("Dependencies: deployment.runasmdbejb-ejb2.jar  \n"), "MANIFEST.MF");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) ElytronPermission(org.wildfly.security.permission.ElytronPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) ChangeRoleMapperPermission(org.wildfly.security.auth.permission.ChangeRoleMapperPermission) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 5 with ChangeRoleMapperPermission

use of org.wildfly.security.auth.permission.ChangeRoleMapperPermission in project wildfly by wildfly.

the class RunAsMDBUnitTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "runas-mdb.jar").addPackage(RunAsMDBUnitTestCase.class.getPackage()).addPackage(JMSOperations.class.getPackage()).addClass(JmsQueueSetup.class);
    jar.addAsManifestResource(RunAsMDBUnitTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");
    jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client,org.jboss.dmr \n"), "MANIFEST.MF");
    jar.addPackage(CommonCriteria.class.getPackage());
    // TODO WFLY-15289 Should these permissions be required?
    jar.addAsResource(createPermissionsXmlAsset(new ElytronPermission("setRunAsPrincipal"), new ElytronPermission("handleSecurityEvent"), new ChangeRoleMapperPermission("ejb")), "META-INF/jboss-permissions.xml");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) 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) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

Deployment (org.jboss.arquillian.container.test.api.Deployment)6 ChangeRoleMapperPermission (org.wildfly.security.auth.permission.ChangeRoleMapperPermission)6 ElytronPermission (org.wildfly.security.permission.ElytronPermission)6 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)5 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)4 PropertyPermission (java.util.PropertyPermission)3 CommonCriteria (org.jboss.as.test.categories.CommonCriteria)3 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)2 AbstractSecurityDomainSetup (org.jboss.as.test.integration.security.common.AbstractSecurityDomainSetup)2 AuthPermission (javax.security.auth.AuthPermission)1 MDBRole (org.jboss.as.test.integration.ejb.security.authorization.MDBRole)1 SimpleSLSB (org.jboss.as.test.integration.ejb.security.authorization.SimpleSLSB)1 StatelessSingletonUseBean (org.jboss.as.test.integration.ejb.security.runasprincipal.transitive.StatelessSingletonUseBean)1 TestLogHandlerSetupTask (org.jboss.as.test.shared.TestLogHandlerSetupTask)1 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)1