Skip to content

Commit

Permalink
Merge pull request #118 from thc202/release/1.14.0
Browse files Browse the repository at this point in the history
Update APIs of core and release 1.14.0
  • Loading branch information
psiinon authored May 13, 2024
2 parents 4d0cc0d + 564d560 commit 448d03f
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 6 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ subprojects {

group = "org.zaproxy"

version = "1.14.0-SNAPSHOT"
version = "1.14.0"
extra["versionBC"] = "1.13.0"

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>This component is optional and therefore the API will only work if it is installed
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<String, String> map = new HashMap<>();
map.put("Boolean", Boolean.toString(bool));
return api.callApi("ascan", "action", "setOptionEncodeCookieValues", map);
}

public ApiResponse setOptionHandleAntiCSRFTokens(boolean bool) throws ClientApiException {
Map<String, String> map = new HashMap<>();
map.put("Boolean", Boolean.toString(bool));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> 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).
Expand Down Expand Up @@ -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<String, String> 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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> 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.
Expand Down Expand Up @@ -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<String, String> 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.
Expand Down Expand Up @@ -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<String, String> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>This component is optional and therefore the API will only work if it is installed
*/
Expand Down

0 comments on commit 448d03f

Please sign in to comment.