diff --git a/CHANGELOG.md b/CHANGELOG.md index 02c06eb..56a7b43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.14.0] - 2024-05-13 +### Changed +- Update core APIs for 2.15. ## [1.13.0] - 2023-11-21 ### Added @@ -195,7 +197,7 @@ of the alert (zaproxy/zaproxy#1341), older methods were deprecated. - First version as "stand alone library", it was migrated from the [zaproxy repository](https://github.com/zaproxy/zaproxy) and released to Maven Central. -[Unreleased]: https://github.com/zaproxy/zap-api-java/compare/v1.13.0...HEAD +[1.14.0]: https://github.com/zaproxy/zap-api-java/compare/v1.13.0...v1.14.0 [1.13.0]: https://github.com/zaproxy/zap-api-java/compare/v1.12.0...v1.13.0 [1.12.0]: https://github.com/zaproxy/zap-api-java/compare/v1.11.0...v1.12.0 [1.11.0]: https://github.com/zaproxy/zap-api-java/compare/v1.10.0...v1.11.0 diff --git a/README.md b/README.md index 1fdd7e1..b459581 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ can be obtained from [Maven Central](https://search.maven.org/) with following c * GroupId: `org.zaproxy` * ArtifactId: `zap-clientapi` - * Version: `1.13.0` + * Version: `1.14.0` Previous releases are also available, more details can be found in [Maven Central](https://search.maven.org/search?q=g:org.zaproxy%20AND%20a:zap-clientapi&core=gav). diff --git a/build.gradle.kts b/build.gradle.kts index bde81fd..f90144e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ subprojects { group = "org.zaproxy" - version = "1.14.0-SNAPSHOT" + version = "1.14.0" extra["versionBC"] = "1.13.0" java { diff --git a/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/AjaxSpider.java b/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/AjaxSpider.java index 5e511ba..61f4d64 100644 --- a/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/AjaxSpider.java +++ b/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/AjaxSpider.java @@ -389,7 +389,7 @@ public ApiResponse setOptionBrowserId(String string) throws ClientApiException { } /** - * Sets whether or not the the AJAX Spider will only click on the default HTML elements. + * Sets whether or not the AJAX Spider will only click on the default HTML elements. * *

This component is optional and therefore the API will only work if it is installed */ diff --git a/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Ascan.java b/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Ascan.java index 2e2c341..2954fae 100644 --- a/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Ascan.java +++ b/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Ascan.java @@ -211,6 +211,11 @@ public ApiResponse optionAllowAttackOnStart() throws ClientApiException { return api.callApi("ascan", "view", "optionAllowAttackOnStart", null); } + /** Tells whether or not the active scanner should encode cookie values. */ + public ApiResponse optionEncodeCookieValues() throws ClientApiException { + return api.callApi("ascan", "view", "optionEncodeCookieValues", null); + } + /** * Tells whether or not the active scanner should inject the HTTP request header X-ZAP-Scan-ID, * with the ID of the scan rule that's sending the requests. @@ -631,6 +636,13 @@ public ApiResponse setOptionDelayInMs(int i) throws ClientApiException { return api.callApi("ascan", "action", "setOptionDelayInMs", map); } + /** Sets whether or not the active scanner should encode cookie values. */ + public ApiResponse setOptionEncodeCookieValues(boolean bool) throws ClientApiException { + Map map = new HashMap<>(); + map.put("Boolean", Boolean.toString(bool)); + return api.callApi("ascan", "action", "setOptionEncodeCookieValues", map); + } + public ApiResponse setOptionHandleAntiCSRFTokens(boolean bool) throws ClientApiException { Map map = new HashMap<>(); map.put("Boolean", Boolean.toString(bool)); diff --git a/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Core.java b/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Core.java index 194a8f8..179958a 100644 --- a/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Core.java +++ b/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Core.java @@ -267,6 +267,15 @@ public ApiResponse numberOfAlerts(String baseurl, String riskid) throws ClientAp return api.callApi("core", "view", "numberOfAlerts", map); } + /** The detailed logging config, optionally filtered based on a name (ex: starts with). */ + public ApiResponse getLogLevel(String name) throws ClientApiException { + Map map = new HashMap<>(); + if (name != null) { + map.put("name", name); + } + return api.callApi("core", "view", "getLogLevel", map); + } + /** * Gets the user agent that ZAP should use when creating HTTP messages (for example, spider * messages or CONNECT requests to outgoing proxy). @@ -701,6 +710,14 @@ public ApiResponse deleteAlert(String id) throws ClientApiException { return api.callApi("core", "action", "deleteAlert", map); } + /** Sets the logging level for a given logger name. */ + public ApiResponse setLogLevel(String name, String loglevel) throws ClientApiException { + Map map = new HashMap<>(); + map.put("name", name); + map.put("logLevel", loglevel); + return api.callApi("core", "action", "setLogLevel", map); + } + /** * Sets the user agent that ZAP should use when creating HTTP messages (for example, spider * messages or CONNECT requests to outgoing proxy). diff --git a/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Search.java b/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Search.java index b4a4b97..d7c0caa 100644 --- a/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Search.java +++ b/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Search.java @@ -56,6 +56,27 @@ public ApiResponse urlsByUrlRegex(String regex, String baseurl, String start, St return api.callApi("search", "view", "urlsByUrlRegex", map); } + /** + * Returns the URLs of the HTTP messages that match the given regular expression in their + * history Tags optionally filtered by URL and paginated with 'start' position and 'count' of + * messages. + */ + public ApiResponse urlsByTagRegex(String regex, String baseurl, String start, String count) + throws ClientApiException { + Map map = new HashMap<>(); + map.put("regex", regex); + if (baseurl != null) { + map.put("baseurl", baseurl); + } + if (start != null) { + map.put("start", start); + } + if (count != null) { + map.put("count", count); + } + return api.callApi("search", "view", "urlsByTagRegex", map); + } + /** * Returns the URLs of the HTTP messages that match the given regular expression in the request * optionally filtered by URL and paginated with 'start' position and 'count' of messages. @@ -137,6 +158,26 @@ public ApiResponse messagesByUrlRegex(String regex, String baseurl, String start return api.callApi("search", "view", "messagesByUrlRegex", map); } + /** + * Returns the HTTP messages that match the given regular expression in their history Tags + * optionally filtered by URL and paginated with 'start' position and 'count' of messages. + */ + public ApiResponse messagesByTagRegex(String regex, String baseurl, String start, String count) + throws ClientApiException { + Map map = new HashMap<>(); + map.put("regex", regex); + if (baseurl != null) { + map.put("baseurl", baseurl); + } + if (start != null) { + map.put("start", start); + } + if (count != null) { + map.put("count", count); + } + return api.callApi("search", "view", "messagesByTagRegex", map); + } + /** * Returns the HTTP messages that match the given regular expression in the request optionally * filtered by URL and paginated with 'start' position and 'count' of messages. @@ -217,6 +258,27 @@ public byte[] harByUrlRegex(String regex, String baseurl, String start, String c return api.callApiOther("search", "other", "harByUrlRegex", map); } + /** + * Returns the HTTP messages, in HAR format, that match the given regular expression in their + * history Tags optionally filtered by URL and paginated with 'start' position and 'count' of + * messages. + */ + public byte[] harByTagRegex(String regex, String baseurl, String start, String count) + throws ClientApiException { + Map map = new HashMap<>(); + map.put("regex", regex); + if (baseurl != null) { + map.put("baseurl", baseurl); + } + if (start != null) { + map.put("start", start); + } + if (count != null) { + map.put("count", count); + } + return api.callApiOther("search", "other", "harByTagRegex", map); + } + /** * Returns the HTTP messages, in HAR format, that match the given regular expression in the * request optionally filtered by URL and paginated with 'start' position and 'count' of diff --git a/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Wappalyzer.java b/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Wappalyzer.java index 1a655fe..465de02 100644 --- a/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Wappalyzer.java +++ b/subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Wappalyzer.java @@ -36,7 +36,7 @@ public Wappalyzer(ClientApi api) { } /** - * Lists all the sites recognized by the wappalyzer addon. + * Lists all the sites recognized by the Technology Detection add-on. * *

This component is optional and therefore the API will only work if it is installed */