use of org.wildfly.security.permission.ElytronPermission in project wildfly by wildfly.
the class MixedSecurityAnnotationAuthorizationTestCase method runAsDeployment.
@Deployment
public static Archive<?> runAsDeployment() {
final Package currentPackage = AnnotationAuthorizationTestCase.class.getPackage();
final WebArchive war = ShrinkWrap.create(WebArchive.class, "ejb3security.war").addClasses(RolesAllowedOverrideBean.class, RolesAllowedOverrideBeanBase.class, PermitAllOverrideBean.class, DenyAllOverrideBean.class).addClass(Util.class).addClasses(MixedSecurityAnnotationAuthorizationTestCase.class).addClasses(AbstractSecurityDomainSetup.class, EjbSecurityDomainSetup.class, ElytronDomainSetup.class, EjbElytronDomainSetup.class, ServletElytronDomainSetup.class).addAsWebInfResource(currentPackage, "jboss-web.xml", "jboss-web.xml");
war.addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain"), new ElytronPermission("authenticate")), "permissions.xml");
war.addPackage(CommonCriteria.class.getPackage());
return war;
}
use of org.wildfly.security.permission.ElytronPermission 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;
}
use of org.wildfly.security.permission.ElytronPermission in project wildfly by wildfly.
the class RunAsPrincipalTestCase method runAsStartupTransitiveDeployment.
@Deployment(name = STARTUP_SINGLETON_DEPLOYMENT, managed = false, testable = false)
public static Archive<?> runAsStartupTransitiveDeployment() {
// using JavaArchive doesn't work, because of a bug in Arquillian, it only deploys wars properly
final WebArchive war = ShrinkWrap.create(WebArchive.class, STARTUP_SINGLETON_DEPLOYMENT + ".war").addClass(WhoAmI.class).addClass(StatelessBBean.class).addClass(SingletonStartupBean.class).addPackage(Assert.class.getPackage()).addClass(Util.class).addClass(Entry.class).addClass(RunAsPrincipalTestCase.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 ElytronPermission("authenticate")), "permissions.xml");
war.addPackage(CommonCriteria.class.getPackage());
return war;
}
use of org.wildfly.security.permission.ElytronPermission in project wildfly by wildfly.
the class AuthenticationTestCase method deployment.
@Deployment
public static Archive<?> deployment() {
final String SERVER_HOST_PORT = TestSuiteEnvironment.getHttpAddress() + ":" + TestSuiteEnvironment.getHttpPort();
final Package currentPackage = AuthenticationTestCase.class.getPackage();
// using JavaArchive doesn't work, because of a bug in Arquillian, it only deploys wars properly
final WebArchive war = ShrinkWrap.create(WebArchive.class, "ejb3security.war").addPackage(WhoAmIBean.class.getPackage()).addPackage(EntryBean.class.getPackage()).addClass(WhoAmI.class).addClass(Util.class).addClass(Entry.class).addClass(HttpUtil.class).addClasses(WhoAmIServlet.class, AuthenticationTestCase.class).addClasses(ElytronDomainSetup.class, EjbElytronDomainSetup.class, ServletElytronDomainSetup.class).addAsResource(currentPackage, "users.properties", "users.properties").addAsResource(currentPackage, "roles.properties", "roles.properties").addAsWebInfResource(currentPackage, "web.xml", "web.xml").addAsWebInfResource(currentPackage, "jboss-web.xml", "jboss-web.xml").addAsWebInfResource(currentPackage, "jboss-ejb3.xml", "jboss-ejb3.xml").addAsManifestResource(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.controller-client,org.jboss.dmr\n"), "MANIFEST.MF").addAsManifestResource(createPermissionsXmlAsset(// login module needs to modify principal to commit logging in
new AuthPermission("modifyPrincipals"), // AuthenticationTestCase#execute calls ExecutorService#shutdownNow
new RuntimePermission("modifyThread"), // AuthenticationTestCase#execute calls sun.net.www.http.HttpClient#openServer under the hood
new SocketPermission(SERVER_HOST_PORT, "connect,resolve"), // TestSuiteEnvironment reads system properties
new ElytronPermission("getSecurityDomain"), new ElytronPermission("authenticate")), "permissions.xml");
war.addPackage(CommonCriteria.class.getPackage());
return war;
}
use of org.wildfly.security.permission.ElytronPermission in project wildfly by wildfly.
the class AggregateRealmTestCase method deploymentAttributeAggregation.
@Deployment(name = AGGREGATE_ATTRIBUTES_NAME)
public static WebArchive deploymentAttributeAggregation() {
final WebArchive war = ShrinkWrap.create(WebArchive.class, AGGREGATE_ATTRIBUTES_NAME + ".war");
war.addClasses(AttributePrintingServlet.class);
war.addAsWebInfResource(AggregateRealmTestCase.class.getPackage(), "aggregate-realm-web.xml", "web.xml");
war.addAsWebInfResource(Utils.getJBossWebXmlAsset(AGGREGATE_ATTRIBUTES_NAME), "jboss-web.xml");
war.addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain")), "permissions.xml");
return war;
}
Aggregations