Skip to content

Commit 448d03f

Browse files
authored
Merge pull request #118 from thc202/release/1.14.0
Update APIs of core and release 1.14.0
2 parents 4d0cc0d + 564d560 commit 448d03f

File tree

8 files changed

+99
-6
lines changed

8 files changed

+99
-6
lines changed

CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased]
7+
## [1.14.0] - 2024-05-13
8+
### Changed
9+
- Update core APIs for 2.15.
810

911
## [1.13.0] - 2023-11-21
1012
### Added
@@ -195,7 +197,7 @@ of the alert (zaproxy/zaproxy#1341), older methods were deprecated.
195197
- First version as "stand alone library", it was migrated from the [zaproxy repository](https://github.com/zaproxy/zaproxy)
196198
and released to Maven Central.
197199

198-
[Unreleased]: https://github.com/zaproxy/zap-api-java/compare/v1.13.0...HEAD
200+
[1.14.0]: https://github.com/zaproxy/zap-api-java/compare/v1.13.0...v1.14.0
199201
[1.13.0]: https://github.com/zaproxy/zap-api-java/compare/v1.12.0...v1.13.0
200202
[1.12.0]: https://github.com/zaproxy/zap-api-java/compare/v1.11.0...v1.12.0
201203
[1.11.0]: https://github.com/zaproxy/zap-api-java/compare/v1.10.0...v1.11.0

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ can be obtained from [Maven Central](https://search.maven.org/) with following c
1818

1919
* GroupId: `org.zaproxy`
2020
* ArtifactId: `zap-clientapi`
21-
* Version: `1.13.0`
21+
* Version: `1.14.0`
2222

2323
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).
2424

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ subprojects {
1414

1515
group = "org.zaproxy"
1616

17-
version = "1.14.0-SNAPSHOT"
17+
version = "1.14.0"
1818
extra["versionBC"] = "1.13.0"
1919

2020
java {

subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/AjaxSpider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public ApiResponse setOptionBrowserId(String string) throws ClientApiException {
389389
}
390390

391391
/**
392-
* Sets whether or not the the AJAX Spider will only click on the default HTML elements.
392+
* Sets whether or not the AJAX Spider will only click on the default HTML elements.
393393
*
394394
* <p>This component is optional and therefore the API will only work if it is installed
395395
*/

subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Ascan.java

+12
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ public ApiResponse optionAllowAttackOnStart() throws ClientApiException {
211211
return api.callApi("ascan", "view", "optionAllowAttackOnStart", null);
212212
}
213213

214+
/** Tells whether or not the active scanner should encode cookie values. */
215+
public ApiResponse optionEncodeCookieValues() throws ClientApiException {
216+
return api.callApi("ascan", "view", "optionEncodeCookieValues", null);
217+
}
218+
214219
/**
215220
* Tells whether or not the active scanner should inject the HTTP request header X-ZAP-Scan-ID,
216221
* with the ID of the scan rule that's sending the requests.
@@ -631,6 +636,13 @@ public ApiResponse setOptionDelayInMs(int i) throws ClientApiException {
631636
return api.callApi("ascan", "action", "setOptionDelayInMs", map);
632637
}
633638

639+
/** Sets whether or not the active scanner should encode cookie values. */
640+
public ApiResponse setOptionEncodeCookieValues(boolean bool) throws ClientApiException {
641+
Map<String, String> map = new HashMap<>();
642+
map.put("Boolean", Boolean.toString(bool));
643+
return api.callApi("ascan", "action", "setOptionEncodeCookieValues", map);
644+
}
645+
634646
public ApiResponse setOptionHandleAntiCSRFTokens(boolean bool) throws ClientApiException {
635647
Map<String, String> map = new HashMap<>();
636648
map.put("Boolean", Boolean.toString(bool));

subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Core.java

+17
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,15 @@ public ApiResponse numberOfAlerts(String baseurl, String riskid) throws ClientAp
267267
return api.callApi("core", "view", "numberOfAlerts", map);
268268
}
269269

270+
/** The detailed logging config, optionally filtered based on a name (ex: starts with). */
271+
public ApiResponse getLogLevel(String name) throws ClientApiException {
272+
Map<String, String> map = new HashMap<>();
273+
if (name != null) {
274+
map.put("name", name);
275+
}
276+
return api.callApi("core", "view", "getLogLevel", map);
277+
}
278+
270279
/**
271280
* Gets the user agent that ZAP should use when creating HTTP messages (for example, spider
272281
* messages or CONNECT requests to outgoing proxy).
@@ -701,6 +710,14 @@ public ApiResponse deleteAlert(String id) throws ClientApiException {
701710
return api.callApi("core", "action", "deleteAlert", map);
702711
}
703712

713+
/** Sets the logging level for a given logger name. */
714+
public ApiResponse setLogLevel(String name, String loglevel) throws ClientApiException {
715+
Map<String, String> map = new HashMap<>();
716+
map.put("name", name);
717+
map.put("logLevel", loglevel);
718+
return api.callApi("core", "action", "setLogLevel", map);
719+
}
720+
704721
/**
705722
* Sets the user agent that ZAP should use when creating HTTP messages (for example, spider
706723
* messages or CONNECT requests to outgoing proxy).

subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Search.java

+62
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,27 @@ public ApiResponse urlsByUrlRegex(String regex, String baseurl, String start, St
5656
return api.callApi("search", "view", "urlsByUrlRegex", map);
5757
}
5858

59+
/**
60+
* Returns the URLs of the HTTP messages that match the given regular expression in their
61+
* history Tags optionally filtered by URL and paginated with 'start' position and 'count' of
62+
* messages.
63+
*/
64+
public ApiResponse urlsByTagRegex(String regex, String baseurl, String start, String count)
65+
throws ClientApiException {
66+
Map<String, String> map = new HashMap<>();
67+
map.put("regex", regex);
68+
if (baseurl != null) {
69+
map.put("baseurl", baseurl);
70+
}
71+
if (start != null) {
72+
map.put("start", start);
73+
}
74+
if (count != null) {
75+
map.put("count", count);
76+
}
77+
return api.callApi("search", "view", "urlsByTagRegex", map);
78+
}
79+
5980
/**
6081
* Returns the URLs of the HTTP messages that match the given regular expression in the request
6182
* 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
137158
return api.callApi("search", "view", "messagesByUrlRegex", map);
138159
}
139160

161+
/**
162+
* Returns the HTTP messages that match the given regular expression in their history Tags
163+
* optionally filtered by URL and paginated with 'start' position and 'count' of messages.
164+
*/
165+
public ApiResponse messagesByTagRegex(String regex, String baseurl, String start, String count)
166+
throws ClientApiException {
167+
Map<String, String> map = new HashMap<>();
168+
map.put("regex", regex);
169+
if (baseurl != null) {
170+
map.put("baseurl", baseurl);
171+
}
172+
if (start != null) {
173+
map.put("start", start);
174+
}
175+
if (count != null) {
176+
map.put("count", count);
177+
}
178+
return api.callApi("search", "view", "messagesByTagRegex", map);
179+
}
180+
140181
/**
141182
* Returns the HTTP messages that match the given regular expression in the request optionally
142183
* 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
217258
return api.callApiOther("search", "other", "harByUrlRegex", map);
218259
}
219260

261+
/**
262+
* Returns the HTTP messages, in HAR format, that match the given regular expression in their
263+
* history Tags optionally filtered by URL and paginated with 'start' position and 'count' of
264+
* messages.
265+
*/
266+
public byte[] harByTagRegex(String regex, String baseurl, String start, String count)
267+
throws ClientApiException {
268+
Map<String, String> map = new HashMap<>();
269+
map.put("regex", regex);
270+
if (baseurl != null) {
271+
map.put("baseurl", baseurl);
272+
}
273+
if (start != null) {
274+
map.put("start", start);
275+
}
276+
if (count != null) {
277+
map.put("count", count);
278+
}
279+
return api.callApiOther("search", "other", "harByTagRegex", map);
280+
}
281+
220282
/**
221283
* Returns the HTTP messages, in HAR format, that match the given regular expression in the
222284
* request optionally filtered by URL and paginated with 'start' position and 'count' of

subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Wappalyzer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public Wappalyzer(ClientApi api) {
3636
}
3737

3838
/**
39-
* Lists all the sites recognized by the wappalyzer addon.
39+
* Lists all the sites recognized by the Technology Detection add-on.
4040
*
4141
* <p>This component is optional and therefore the API will only work if it is installed
4242
*/

0 commit comments

Comments
 (0)