Mercurial > stress-tester
changeset 1011:1f46460b2580
HTTP filters type prefixed by "http."
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpBasicAuthLoginFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpBasicAuthLoginFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -33,7 +33,7 @@ private static final Logger LOGGER = LogManager.getLogger(HttpBasicAuthLoginFilter.class); - public static final String TYPE = "basicLogin"; + public static final String TYPE = "http.basicLogin"; private static final Charset ASCII = Charset.forName("US-ASCII"); private static final ByteString BASIC = ByteString.create("Basic ");
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpCsrfFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpCsrfFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -199,7 +199,7 @@ } } - public static final String TYPE = "csrf"; + public static final String TYPE = "http.csrf"; public static final String SESSION_KEY = "_csrfTokens";
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpCsrfFormFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpCsrfFormFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -35,7 +35,7 @@ "text/html", "application/xhtml+xml" )); - public static final String TYPE = "csrfForm"; + public static final String TYPE = "http.csrfForm"; public static final String SESSION_KEY = "_csrfFormTokens";
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpDateFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpDateFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -15,7 +15,7 @@ @Plugin(name = HttpDateFilter.TYPE, category = PluginConstants.CATEGORY_FLOW_FILTER) public class HttpDateFilter extends HttpFilter { - public static final String TYPE = "date"; + public static final String TYPE = "http.date"; private TimeGenerator generator = TimeGenerator.getDefaultGenerator();
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpDigestAuthLoginFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpDigestAuthLoginFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -37,7 +37,7 @@ private static final Logger LOGGER = LogManager.getLogger(HttpDigestAuthLoginFilter.class); - public static final String TYPE = "digestLogin"; + public static final String TYPE = "http.digestLogin"; public static final ByteString ALGO_MD5 = ByteString.create("MD5"); public static final ByteString ALGO_MD5_SESS = ByteString.create("MD5-sess");
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpDumper.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpDumper.java Tue Mar 24 12:11:15 2020 +0100 @@ -21,7 +21,7 @@ @Plugin(name = HttpDumper.TYPE, category = PluginConstants.CATEGORY_FLOW_FILTER) public class HttpDumper extends HttpFilter { - public static final String TYPE = "dumper"; + public static final String TYPE = "http.dumper"; private static final int MSG_REQ_ORIG = 0; private static final int MSG_REQ_PROC = 1;
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFormLoginFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFormLoginFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -31,7 +31,7 @@ private static final Logger LOGGER = LogManager.getLogger(HttpFormLoginFilter.class); - public static final String TYPE = "formLogin"; + public static final String TYPE = "http.formLogin"; private final HttpMessageHelper helper = new HttpMessageHelper(false); // used in outbound only, instance per filter is OK private CharSequence userField;
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpHostRewriterFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpHostRewriterFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -29,7 +29,7 @@ @Plugin(name = HttpHostRewriterFilter.TYPE, category = PluginConstants.CATEGORY_FLOW_FILTER) public class HttpHostRewriterFilter extends HttpFilter { - public static final String TYPE = "host"; + public static final String TYPE = "http.host"; private static final Logger LOGGER = LogManager.getLogger(HttpHostRewriterFilter.class);
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpLogoutFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpLogoutFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -25,7 +25,7 @@ @Plugin(name = HttpLogoutFilter.TYPE, category = PluginConstants.CATEGORY_FLOW_FILTER) public class HttpLogoutFilter extends HttpFilter { - public static final String TYPE = "logout"; + public static final String TYPE = "http.logout"; private boolean invalidateSession = true;
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMarkFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMarkFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -41,7 +41,7 @@ @Plugin(name = HttpMarkFilter.TYPE, category = PluginConstants.CATEGORY_FLOW_FILTER) public class HttpMarkFilter extends HttpFilter { - public static final String TYPE = "marker"; + public static final String TYPE = "http.marker"; private static final int DEFAULT_MARKERS_CAPACITY = 2;
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -34,7 +34,7 @@ private static final Logger LOGGER = LogManager.getLogger(HttpMessageModificationFilter.class); - public static final String TYPE = "modifyMessage"; + public static final String TYPE = "http.modifyMessage"; private final List<Operation> operations = new ArrayList<>();
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMvelFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMvelFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -80,7 +80,7 @@ @Override public void configure(Configuration config, ConfigurationContext context) { - direction = (HttpFilterDirection) config.get("dir", HttpFilterDirection.OUT); + direction = config.get("dir", HttpFilterDirection.OUT); statement = (ExecutableStatement) config.get("script"); }
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpRequestCacheHeadersCleanerFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpRequestCacheHeadersCleanerFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -12,7 +12,7 @@ @Plugin(name = HttpRequestCacheHeadersCleanerFilter.TYPE, category = PluginConstants.CATEGORY_FLOW_FILTER) public class HttpRequestCacheHeadersCleanerFilter extends HttpAbstractCleanerFilter { - public static final String TYPE = "requestCacheHeadersCleaner"; + public static final String TYPE = "http.requestCacheHeadersCleaner"; public static final ByteString[] CACHE_HEADERS = { IF_MODIFIED_SINCE, IF_NONE_MATCH
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpRequestProxyHeadersCleanerFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpRequestProxyHeadersCleanerFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -12,7 +12,7 @@ @Plugin(name = HttpRequestProxyHeadersCleanerFilter.TYPE, category = PluginConstants.CATEGORY_FLOW_FILTER) public class HttpRequestProxyHeadersCleanerFilter extends HttpAbstractCleanerFilter { - public static final String TYPE = "requestProxyHeadersCleaner"; + public static final String TYPE = "http.requestProxyHeadersCleaner"; public static final ByteString[] PROXY_HEADERS = { FORWARDED, PROXY_AUTHORIZATION, PROXY_CONNECTION,
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpScopeModificationFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpScopeModificationFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -31,7 +31,7 @@ @Plugin(name = HttpScopeModificationFilter.TYPE, category = PluginConstants.CATEGORY_FLOW_FILTER) public class HttpScopeModificationFilter extends HttpFilter { - public static final String TYPE = "modifyScope"; + public static final String TYPE = "http.modifyScope"; public static abstract class Operation {
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSessionBlockerFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSessionBlockerFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -21,7 +21,7 @@ @Plugin(name = HttpSessionBlockerFilter.TYPE, category = PluginConstants.CATEGORY_FLOW_FILTER) public class HttpSessionBlockerFilter extends HttpFilter { - public static final String TYPE = "sessionBlocker"; + public static final String TYPE = "http.sessionBlocker"; public static final int DEFAULT_MAX_REQUESTS_COUNT = 10;
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSessionCookieFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSessionCookieFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -30,7 +30,7 @@ @Plugin(name = HttpSessionCookieFilter.TYPE, category = PluginConstants.CATEGORY_FLOW_FILTER) public final class HttpSessionCookieFilter extends HttpFilter { - public static final String TYPE = "session"; + public static final String TYPE = "http.session"; private static final Logger LOGGER = LogManager.getLogger(HttpSessionCookieFilter.class);
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpZoneFilter.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpZoneFilter.java Tue Mar 24 12:11:15 2020 +0100 @@ -33,7 +33,7 @@ @Plugin(name = HttpZoneFilter.TYPE, category = PluginConstants.CATEGORY_FLOW_FILTER) public class HttpZoneFilter extends HttpFilter { - public static final String TYPE = "zone"; + public static final String TYPE = "http.zone"; public static class Rule {
--- a/stress-tester/src/main/java/com/passus/st/emitter/StaticMACAddressResolver.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/main/java/com/passus/st/emitter/StaticMACAddressResolver.java Tue Mar 24 12:11:15 2020 +0100 @@ -54,7 +54,7 @@ try { ip = IpAddress.parse(ipStr); } catch (Exception e) { - throw new ParseException(e.getMessage(), pos); + throw new ParseException("Invalid MAC-IP pair. " + e.getMessage(), 0); } pos += separator.length(); @@ -62,7 +62,7 @@ try { mac = new MACAddress(macStr.trim()); } catch (Exception e) { - throw new ParseException(e.getMessage(), pos); + throw new ParseException("Invalid MAC-IP pair." + e.getMessage(), 0); } return new Pair<>(ip, mac);
--- a/stress-tester/src/test/java/com/passus/st/client/FlowExecutorTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/FlowExecutorTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -39,7 +39,6 @@ @Test public void testHandle_HTTP() throws Exception { - Log4jConfigurationFactory.enableFactory("debug"); Map<String, Object> props = new HashMap<>(); props.put("allowPartialSession", true); props.put("ports", 4214);
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpBasicAuthLoginFilterTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpBasicAuthLoginFilterTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -124,7 +124,7 @@ @Test public void testConfigureAndFilterOutbound() throws Exception { String filterConfig = "filters:\n" - + " - type: basicLogin\n" + + " - type: http.basicLogin\n" + " applyIf:\n" + " \"@req.uri\": {$contains: \"index2\"}\n" + " provider:\n"
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpCsrfFilterTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpCsrfFilterTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -138,7 +138,7 @@ @Test public void testConfigure() throws Exception { String filterConfig = "filters:\n" - + " - type: csrf\n" + + " - type: http.csrf\n" + " extract:\n" + " header: \"csrf-header\"\n" + " cookie: \"csrf-cookie\"\n"
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpCsrfFormFilterTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpCsrfFormFilterTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -70,7 +70,7 @@ @Test public void testConfigure() throws IOException, NodeException { String filterConfig = "filters:\n" - + " - type: csrfForm\n" + + " - type: http.csrfForm\n" + " inputName: '_token'\n" + " contentTypesToScan: ['text/html', 'application/xhtml+xml', 'application/xml']\n";
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpHostRewriterFilterTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpHostRewriterFilterTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -85,7 +85,7 @@ @Test public void testConfigure() throws Exception { String filterConfig = "filters:\n" - + " - type: host\n" + + " - type: http.host\n" + " hostMap:\n" + " \"example.com\": \"example.org:8088\"\n" + " \"example.com:8080\": \"example.org\"\n";
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpLogoutFilterTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpLogoutFilterTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -82,7 +82,7 @@ @Test public void testConfigure() throws Exception { String filterConfig = "filters:\n" - + " - type: logout\n" + + " - type: http.logout\n" + " invalidateSession: false\n" + " applyIf: {\"@req.uri\": \"/logout\"}\n";
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpMarkFilterTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpMarkFilterTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -52,7 +52,7 @@ @Test public void testConfigure() throws Exception { String filterConfig = "filters:\n" - + " - type: marker\n" + + " - type: http.marker\n" + " rules:\n" + " - category: category1\n" + " message: message1\n"
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpMessageModificationFilterTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpMessageModificationFilterTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -174,7 +174,7 @@ @Test(enabled = true) public void testConfigureAndFilterOutbound() throws Exception { String filterConfig = "filters:\n" - + " - type: modifyMessage\n" + + " - type: http.modifyMessage\n" + " operations:\n" + " removeHeader: Header1\n" + " addHeader: \n" @@ -227,12 +227,12 @@ public void testConfigureAndFilterOutbound_firstLineOps() throws Exception { String filterConfig = "filters:\n" - + " - type: modifyMessage\n" + + " - type: http.modifyMessage\n" + " operations:\n" + " setMethod: HEAD\n" + " setVersion: 'HTTP/1.1'\n" + " setUri: '/aaa/bbb/ccc?q1x=v1x'\n" - + " - type: modifyMessage\n" + + " - type: http.modifyMessage\n" + " operations:\n" + " setUrlQuery: 'qqq=vvv'\n" + " setUrlRef: anchor\n" @@ -273,7 +273,7 @@ ); String filterConfig = "filters:\n" - + " - type: modifyMessage\n" + + " - type: http.modifyMessage\n" + " operations:\n" + " setHeader: \n" + " Header1: '@req.url.path'\n" @@ -304,7 +304,7 @@ @Test(enabled = true) public void testComplexExpression() throws Exception { String filterConfig = "filters:\n" - + " - type: modifyMessage\n" + + " - type: http.modifyMessage\n" + " operations:\n" + " setQueryParam: \n" + " v1: {$expr: \"sessionParams.get('testParam2') or 'aaa'\"}\n" @@ -334,7 +334,7 @@ .build(); String filterConfig = "filters:\n" - + " - type: modifyMessage\n" + + " - type: http.modifyMessage\n" + " applyIf:\n" + " \"@req.uri\": /path/test\n" + " operations:\n"
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpScopeModificationFilterTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpScopeModificationFilterTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -207,7 +207,7 @@ @Test public void testSetGlobalParamOperation_Extractors() throws Exception { String filterConfig = "filters:\n" - + " - type: modifyScope\n" + + " - type: http.modifyScope\n" + " operations:\n" + " setGlobalParam: \n" + " NewGlobalParam1: '@req.uri'\n" @@ -272,7 +272,7 @@ @Test public void testConfiguration() throws Exception { String filterConfig = "filters:\n" - + " - type: modifyScope\n" + + " - type: http.modifyScope\n" + " dir: both\n" + " operations:\n" + " removeSession: ~\n" @@ -297,7 +297,7 @@ @Test public void testConfiguration_expressions() throws Exception { String filterConfig = "filters:\n" - + " - type: modifyScope\n" + + " - type: http.modifyScope\n" + " dir: both\n" + " operations:\n" + " removeSession: ~\n"
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpSessionCookieFilterTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpSessionCookieFilterTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -258,7 +258,7 @@ @Test public void testConfigure() throws Exception { String filterConfig = "filters:\n" - + " - type: session\n" + + " - type: http.session\n" + " sessionCookieNames: [aaa, bbb]\n" + " removeInvalidSessionId: true\n";
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpZoneFilterTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpZoneFilterTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -54,7 +54,7 @@ @Test public void testConfigure() throws Exception { String filterConfig = "filters:\n" - + " - type: zone\n" + + " - type: http.zone\n" + " zones:\n" + " \"zone1\": {req.url: {$contains: \"test\"}}\n";
--- a/stress-tester/src/test/java/com/passus/st/config/ClientConfiguratorTest.java Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/java/com/passus/st/config/ClientConfiguratorTest.java Tue Mar 24 12:11:15 2020 +0100 @@ -41,7 +41,7 @@ + "collectMetrics: true\n" + "workers: 4\n" + "filters:\n" - + " - type: formLogin\n" + + " - type: http.formLogin\n" + " active: true\n" + " loginCheckUrl: /login\n" + " userField: username\n"
--- a/stress-tester/src/test/resources/com/passus/st/client/http/filter/http_message_modify_filter.yml Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/resources/com/passus/st/client/http/filter/http_message_modify_filter.yml Tue Mar 24 12:11:15 2020 +0100 @@ -1,5 +1,5 @@ filters: - - type: modifyMessage + - type: http.modifyMessage operations: removeHeader: Test addHeader: @@ -12,9 +12,9 @@ setCookie: CookieName: CookieValue - - type: requestProxyHeadersCleaner + - type: http.requestProxyHeadersCleaner - - type: basicLogin + - type: http.basicLogin applyIf: "@req.url": {$contains: "test"} provider:
--- a/stress-tester/src/test/resources/com/passus/st/config/test_job_config.yml Tue Mar 24 10:03:56 2020 +0100 +++ b/stress-tester/src/test/resources/com/passus/st/config/test_job_config.yml Tue Mar 24 12:11:15 2020 +0100 @@ -36,7 +36,7 @@ workers: 4 filters: - - type: requestCacheHeadersCleaner + - type: http.requestCacheHeadersCleaner lookups: - type: csvFile