Search in sources :

Example 11 with ElytronPermission

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

the class AggregateRealmWithTransformerTestCase method deploymentAttributeAggregation.

@Deployment(name = AGGREGATE_REALM_ATTRIBUTES_NAME)
public static WebArchive deploymentAttributeAggregation() {
    final WebArchive war = ShrinkWrap.create(WebArchive.class, AGGREGATE_REALM_ATTRIBUTES_NAME + ".war");
    war.addClasses(AttributePrintingServlet.class, RolePrintingServlet.class);
    war.addClasses(RoleServlets.class, RoleServlets.Role1Servlet.class, RoleServlets.Role2Servlet.class, RoleServlets.Role3Servlet.class, RoleServlets.Role4Servlet.class, RoleServlets.Role5Servlet.class, RoleServlets.Role6Servlet.class);
    war.addAsWebInfResource(AggregateRealmWithTransformerTestCase.class.getPackage(), "aggregate-realm-with-transformer-web.xml", "web.xml");
    war.addAsWebInfResource(Utils.getJBossWebXmlAsset(AGGREGATE_REALM_ATTRIBUTES_NAME), "jboss-web.xml");
    war.addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain")), "permissions.xml");
    return war;
}
Also used : 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 12 with ElytronPermission

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

the class JdbcRealmTestCase method deployment.

@Deployment(name = DEPLOYMENT)
public static WebArchive deployment() {
    final WebArchive war = ShrinkWrap.create(WebArchive.class, DEPLOYMENT + ".war");
    war.addClasses(JdbcTestServlet.class);
    war.addAsWebInfResource(JdbcRealmTestCase.class.getPackage(), "jdbc-realm-web.xml", "web.xml");
    war.addAsWebInfResource(Utils.getJBossWebXmlAsset(DEPLOYMENT), "jboss-web.xml").addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain")), "permissions.xml");
    return war;
}
Also used : 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 13 with ElytronPermission

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

the class UsernameTokenElytronTestCase method createDeployment.

@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebArchive archive = ShrinkWrap.create(WebArchive.class, UsernameTokenElytronTestCase.class.getSimpleName() + ".war");
    archive.setManifest(new StringAsset("Manifest-Version: 1.0\n" + "Dependencies: org.apache.cxf\n")).addClasses(ServiceIface.class, ElytronUsernameTokenImpl.class).addAsWebInfResource(UsernameTokenElytronTestCase.class.getPackage(), "jboss-ejb3-elytron-properties.xml", "jboss-ejb3.xml").addAsWebInfResource(ServiceIface.class.getPackage(), "wsdl/UsernameToken.wsdl", "wsdl/UsernameToken.wsdl").addAsWebInfResource(ServiceIface.class.getPackage(), "wsdl/UsernameToken_schema1.xsd", "wsdl/UsernameToken_schema1.xsd").addAsManifestResource(PermissionUtils.createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain")), "permissions.xml");
    return archive;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) ServiceIface(org.jboss.as.test.integration.ws.wsse.ServiceIface) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ElytronPermission(org.wildfly.security.permission.ElytronPermission) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 14 with ElytronPermission

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

the class SecuredBeanClientInterceptorTestCase method deployment1.

@Deployment(name = "client")
@TargetsContainer("multinode-client")
public static Archive<?> deployment1() {
    final Package currentPackage = SecuredBeanClientInterceptorTestCase.class.getPackage();
    WebArchive war = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME_CLIENT + ".war");
    war.addClasses(Util.class, ClientInterceptorUtil.class);
    war.addClasses(AbstractSecurityDomainSetup.class, EjbSecurityDomainSetup.class);
    war.addClasses(SecuredBeanClientInterceptorTestCase.class, SampleSecureInterceptor.class, Secured.class, SecuredBean.class);
    war.addPackage(AbstractClientInterceptorsSetupTask.class.getPackage());
    war.addAsManifestResource("META-INF/jboss-ejb-client-receivers.xml", "jboss-ejb-client.xml");
    war.addAsWebInfResource(currentPackage, "jboss-web.xml", "jboss-web.xml");
    war.addAsManifestResource(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.controller-client,org.jboss.dmr\n"), "MANIFEST.MF");
    war.addAsManifestResource(createPermissionsXmlAsset(new SecurityPermission("putProviderProperty.WildFlyElytron"), new ElytronPermission("getSecurityDomain"), new ElytronPermission("authenticate"), new RuntimePermission("getProtectionDomain"), new AuthPermission("modifyPrincipals"), new FilePermission(System.getProperty("jboss.home") + File.separatorChar + "standalone" + File.separatorChar + "tmp" + File.separatorChar + "auth" + File.separatorChar + "-", "read")), "permissions.xml");
    return war;
}
Also used : AbstractClientInterceptorsSetupTask(org.jboss.as.test.shared.integration.interceptor.clientside.AbstractClientInterceptorsSetupTask) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) AuthPermission(javax.security.auth.AuthPermission) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ElytronPermission(org.wildfly.security.permission.ElytronPermission) FilePermission(java.io.FilePermission) SecurityPermission(java.security.SecurityPermission) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment) TargetsContainer(org.jboss.arquillian.container.test.api.TargetsContainer)

Example 15 with ElytronPermission

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

the class BasicIIOPInvocationTestCase method clientDeployment.

@Deployment(name = "client", testable = true)
@TargetsContainer("iiop-client")
public static Archive<?> clientDeployment() {
    /*
         * The @EJB annotation doesn't allow to specify the address dynamically. So, istead of
         *       @EJB(lookup = "corbaname:iiop:localhost:3628#IIOPTransactionalStatelessBean")
         *       private IIOPTransactionalHome home;
         * we need to do this trick to get the ${node0} sys prop into ejb-jar.xml
         * and have it injected that way.
         */
    String ejbJar = FileUtils.readFile(BasicIIOPInvocationTestCase.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, IIOPBasicHome.class, IIOPBasicRemote.class, BasicIIOPInvocationTestCase.class, IIOPBasicStatefulHome.class, IIOPBasicStatefulRemote.class, HandleWrapper.class).addAsManifestResource(BasicIIOPInvocationTestCase.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