use of java.net.SocketPermission in project wildfly by wildfly.
the class DefaultDataSourceRemovedTestCase method defaultDSWithNameAndCtx.
@Deployment(name = "with-default-ds-with-name-and-ctx")
public static WebArchive defaultDSWithNameAndCtx() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "with-default-ds-with-name-and-ctx.war");
war.addClasses(DefaultDSWithCtxListenerServlet.class);
war.addPackage(HttpRequest.class.getPackage());
war.addAsManifestResource(createPermissionsXmlAsset(new RuntimePermission("modifyThread"), new SocketPermission(TestSuiteEnvironment.getHttpAddress() + ":" + TestSuiteEnvironment.getHttpPort(), "connect,resolve")), "permissions.xml");
return war;
}
use of java.net.SocketPermission 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).addClasses(WhoAmIServlet.class, AuthenticationTestCase.class).addClasses(AbstractSecurityDomainSetup.class, EjbSecurityDomainSetup.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"), new ElytronPermission("getSecurityDomain"), new ElytronPermission("authenticate")), "permissions.xml");
war.addPackage(CommonCriteria.class.getPackage());
return war;
}
use of java.net.SocketPermission in project wildfly by wildfly.
the class ServiceRefTestCase method deployment.
@Deployment
public static JavaArchive deployment() {
String wsdl = FileUtils.readFile(ServiceRefTestCase.class, "TestService.wsdl");
final Properties properties = new Properties();
properties.putAll(System.getProperties());
final String node0 = NetworkUtils.formatPossibleIpv6Address((String) properties.get("node0"));
if (properties.containsKey("node0")) {
properties.put("node0", node0);
}
return ShrinkWrap.create(JavaArchive.class, "ws-serviceref-example.jar").addClasses(EJB3Bean.class, EndpointInterface.class, EndpointService.class, StatelessBean.class, StatelessRemote.class, CdiBean.class).addAsManifestResource(ServiceRefTestCase.class.getPackage(), "ejb-jar.xml", "ejb-jar.xml").addAsManifestResource(ServiceRefTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml").addAsManifestResource(new StringAsset(PropertiesValueResolver.replaceProperties(wsdl, properties)), "wsdl/TestService.wsdl").addAsManifestResource(new StringAsset("<beans bean-discovery-mode=\"all\"></beans>"), "beans.xml").addAsManifestResource(createPermissionsXmlAsset(new FilePermission("<<ALL FILES>>", "read"), new PropertyPermission("user.dir", "read"), new RuntimePermission("getClassLoader"), new RuntimePermission("org.apache.cxf.permission", "resolveUri"), new RuntimePermission("createClassLoader"), new RuntimePermission("accessDeclaredMembers"), new SocketPermission(node0 + ":8080", "connect,resolve")), "jboss-permissions.xml");
}
use of java.net.SocketPermission in project wildfly by wildfly.
the class ServiceRefEarTestCase method deployment.
@Deployment(testable = false)
public static Archive<?> deployment() {
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "ws-serviceref-example.jar").addClasses(EJB3Bean.class, EndpointInterface.class);
WebArchive war = ShrinkWrap.create(WebArchive.class, "ws-serviceref-example-servlet-client.war").addClasses(EndpointInterface.class, EndpointService.class, ServletClient.class).addAsWebInfResource(ServiceRefEarTestCase.class.getPackage(), "web.xml", "web.xml").addAsWebInfResource(ServiceRefEarTestCase.class.getPackage(), "jboss-web.xml", "jboss-web.xml");
String wsdl = FileUtils.readFile(ServiceRefEarTestCase.class, "TestService.wsdl");
final Properties properties = new Properties();
properties.putAll(System.getProperties());
final String node0 = NetworkUtils.formatPossibleIpv6Address((String) properties.get("node0"));
if (properties.containsKey("node0")) {
properties.put("node0", node0);
}
war.addAsWebInfResource(new StringAsset(PropertiesValueResolver.replaceProperties(wsdl, properties)), "wsdl/TestService.wsdl");
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "ws-serviceref-example.ear").addAsModule(jar).addAsModule(war);
// all the following permissions are needed because EndpointService directly extends javax.xml.ws.Service class
// and CXF guys are not willing to add more privileged blocks into their code, thus deployments need to have
// the following permissions (note that the wsdl.properties permission is needed by wsdl4j)
ear.addAsManifestResource(createPermissionsXmlAsset(new FilePermission("<<ALL FILES>>", "read"), new PropertyPermission("user.dir", "read"), new RuntimePermission("getClassLoader"), new RuntimePermission("org.apache.cxf.permission", "resolveUri"), new RuntimePermission("createClassLoader"), new RuntimePermission("accessDeclaredMembers"), new SocketPermission(node0 + ":8080", "connect,resolve")), "jboss-permissions.xml");
return ear;
}
use of java.net.SocketPermission in project wildfly by wildfly.
the class WebSuspendTestCase method deployment.
@Deployment
public static WebArchive deployment() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "web-suspend.war");
war.addPackage(WebSuspendTestCase.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 PropertyPermission("management.address", "read"), new PropertyPermission("jboss.http.port", "read"), new PropertyPermission("node0", "read"), // executorService.shutdown() needs the following permission
new RuntimePermission("modifyThread"), // ManagementClient needs the following permissions and a dependency on 'org.jboss.remoting3' module
new RemotingPermission("createEndpoint"), new RemotingPermission("connect"), // HttpClient needs the following permission
new SocketPermission(TestSuiteEnvironment.getServerAddress() + ":" + TestSuiteEnvironment.getHttpPort(), "connect,resolve"), new FilePermission(System.getProperty("jboss.inst") + "/standalone/tmp/auth/*", "read")), "permissions.xml");
return war;
}
Aggregations