Search in sources :

Example 1 with ServerPermission

use of org.jboss.as.server.security.ServerPermission in project wildfly by wildfly.

the class SingletonServiceTestCase method createDeployment.

private static Archive<?> createDeployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "singleton.war");
    war.addPackage(NodeService.class.getPackage());
    war.setManifest(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.server\n"));
    war.addAsManifestResource(createPermissionsXmlAsset(// See org.jboss.as.server.deployment.service.ServiceActivatorProcessor#deploy()
    new RuntimePermission("getClassLoader"), // See org.jboss.as.server.deployment.service.SecuredServiceRegistry
    new ServerPermission("useServiceRegistry"), new ServerPermission("getCurrentServiceContainer")), "permissions.xml");
    war.addAsServiceProvider(org.jboss.msc.service.ServiceActivator.class, NodeServiceActivator.class);
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) NodeService(org.jboss.as.test.clustering.cluster.singleton.service.NodeService) ServerPermission(org.jboss.as.server.security.ServerPermission)

Example 2 with ServerPermission

use of org.jboss.as.server.security.ServerPermission in project wildfly by wildfly.

the class SingletonServiceTestCase method deployment.

@Deployment
public static Archive<?> deployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "singleton.war");
    war.addPackage(NodeService.class.getPackage());
    war.setManifest(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.server\n"));
    war.addAsManifestResource(createPermissionsXmlAsset(// See org.jboss.as.server.deployment.service.ServiceActivatorProcessor#deploy()
    new RuntimePermission("getClassLoader"), // See org.jboss.as.server.deployment.service.SecuredServiceRegistry
    new ServerPermission("useServiceRegistry"), new ServerPermission("getCurrentServiceContainer")), "permissions.xml");
    war.addAsServiceProvider(org.jboss.msc.service.ServiceActivator.class, NodeServiceActivator.class);
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) NodeService(org.jboss.as.test.clustering.cluster.singleton.service.NodeService) ServerPermission(org.jboss.as.server.security.ServerPermission) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 3 with ServerPermission

use of org.jboss.as.server.security.ServerPermission in project wildfly by wildfly.

the class SingletonBackupServiceTestCase method createDeployment.

private static Archive<?> createDeployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "singleton.war");
    war.addPackage(ValueServiceServlet.class.getPackage());
    war.setManifest(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.server\n"));
    war.addAsServiceProvider(org.jboss.msc.service.ServiceActivator.class, ValueServiceActivator.class);
    war.addAsManifestResource(createPermissionsXmlAsset(// See org.jboss.as.server.deployment.service.ServiceActivatorProcessor#deploy()
    new RuntimePermission("getClassLoader"), // See org.jboss.as.server.deployment.service.SecuredServiceRegistry
    new ServerPermission("useServiceRegistry"), new ServerPermission("getCurrentServiceContainer")), "permissions.xml");
    return war;
}
Also used : ValueServiceServlet(org.jboss.as.test.clustering.cluster.singleton.service.ValueServiceServlet) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ServerPermission(org.jboss.as.server.security.ServerPermission)

Example 4 with ServerPermission

use of org.jboss.as.server.security.ServerPermission in project wildfly by wildfly.

the class SingletonPolicyServiceTestCase method createDeployment.

private static Archive<?> createDeployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "singleton.war");
    war.addPackage(NodeService.class.getPackage());
    war.setManifest(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.server\n"));
    war.addAsServiceProvider(org.jboss.msc.service.ServiceActivator.class, NodeServicePolicyActivator.class);
    war.addAsManifestResource(createPermissionsXmlAsset(// See org.jboss.as.server.deployment.service.ServiceActivatorProcessor#deploy()
    new RuntimePermission("getClassLoader"), // See org.jboss.as.server.deployment.service.SecuredServiceRegistry
    new ServerPermission("useServiceRegistry"), new ServerPermission("getCurrentServiceContainer")), "permissions.xml");
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) NodeService(org.jboss.as.test.clustering.cluster.singleton.service.NodeService) ServerPermission(org.jboss.as.server.security.ServerPermission)

Example 5 with ServerPermission

use of org.jboss.as.server.security.ServerPermission in project wildfly by wildfly.

the class ClusterTestUtil method addTopologyListenerDependencies.

/**
     * <em>Note that should you need to manually add an extra set of permissions, the following permission is required for this utility to work within
     * security manager:</em>
     *
     * <pre>{@code
     * war.addAsManifestResource(PermissionUtils.createPermissionsXmlAsset(new ServerPermission("getCurrentServiceContainer")), "permissions.xml");
     * }</pre>
     */
public static <A extends Archive<A> & ClassContainer<A> & ManifestContainer<A>> A addTopologyListenerDependencies(A archive) {
    archive.addClasses(TopologyChangeListener.class, TopologyChangeListenerBean.class, TopologyChangeListenerServlet.class);
    archive.setManifest(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.clustering.common, org.jboss.as.controller, org.jboss.as.server, org.infinispan, org.wildfly.clustering.infinispan.spi\n"));
    archive.addAsManifestResource(PermissionUtils.createPermissionsXmlAsset(new ServerPermission("getCurrentServiceContainer")), "permissions.xml");
    return archive;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) ServerPermission(org.jboss.as.server.security.ServerPermission)

Aggregations

ServerPermission (org.jboss.as.server.security.ServerPermission)5 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)5 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)4 NodeService (org.jboss.as.test.clustering.cluster.singleton.service.NodeService)3 Deployment (org.jboss.arquillian.container.test.api.Deployment)1 ValueServiceServlet (org.jboss.as.test.clustering.cluster.singleton.service.ValueServiceServlet)1