use of com.predic8.membrane.core.interceptor.acl.AccessControlInterceptor in project service-proxy by membrane.
the class AccessControlParserTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
resources = new AccessControlInterceptor().parse(FILE_NAME, new HttpRouter()).getResources();
}
use of com.predic8.membrane.core.interceptor.acl.AccessControlInterceptor in project service-proxy by membrane.
the class AccessControlInterceptorIntegrationTest method setInterceptor.
/*
* This test can only by run on a specific machine.
*/
/*@Test
public void testLocalhost() throws Exception {
setInterceptor(FILE_CLIENTS_FROM_LOCALHOST);
HttpClient client = new HttpClient();
HostConfiguration config = new HostConfiguration();
config.setLocalAddress(InetAddress.getByName("localhost"));
client.setHostConfiguration(config);
assertEquals(200, client.executeMethod(getBLZRequestMethod()));
}*/
/*
* This test can only by run on a specific machine.
*/
/*@Test
public void test192_168_2_Star() throws Exception {
setInterceptor(FILE_CLIENTS_FROM_192_168_2_STAR);
assertEquals(200, getClient(FIXED_IP).executeMethod(getBLZRequestMethod()));
}*/
private void setInterceptor(String fileName) throws Exception {
AccessControlInterceptor interceptor = new AccessControlInterceptor();
interceptor.setFile(fileName);
router.addUserFeatureInterceptor(interceptor);
router.init();
}
use of com.predic8.membrane.core.interceptor.acl.AccessControlInterceptor in project service-proxy by membrane.
the class ProxyRuleTest method getInterceptors.
private List<Interceptor> getInterceptors() {
List<Interceptor> interceptors = new ArrayList<Interceptor>();
Interceptor balancer = new LoadBalancingInterceptor();
balancer.setId("roundRobinBalancer");
interceptors.add(balancer);
Interceptor acl = new AccessControlInterceptor();
acl.setId("accessControlInterceptor");
interceptors.add(acl);
return interceptors;
}
use of com.predic8.membrane.core.interceptor.acl.AccessControlInterceptor in project service-proxy by membrane.
the class AccessControlInterceptorTest method setUp.
@Before
public void setUp() throws Exception {
router = new HttpRouter();
interceptor = new AccessControlInterceptor();
interceptor.setFile("classpath:/acl/acl.xml");
Rule rule4000 = new ServiceProxy(new ServiceProxyKey("localhost", "*", ".*", 4000), "oio.de", 80);
router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(rule4000);
router.addUserFeatureInterceptor(interceptor);
router.init();
}
Aggregations