Skip to content

Commit e668c90

Browse files
authored
Merge pull request #76 from thc202/update-apis
Update APIs of add-ons
2 parents a95fbda + 4ead48a commit e668c90

File tree

4 files changed

+45
-17
lines changed

4 files changed

+45
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
### Changed
1212
- Core APIs updated for ZAP version 2.8.0.
1313
- Update Replacer API, per release of version 7.
14-
- Add description to Importurls API endpoint.
14+
- Update Websocket API, per release of version 19.
15+
- Update Selenium API, per release of version 15.0.0.
16+
- Add description to Importurls and AlertFilter API endpoints.
1517

1618
### Fixed
1719
- Disable XXE processing when parsing ZAP API responses.

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,22 @@ public AlertFilter(ClientApi api) {
3535
this.api = api;
3636
}
3737

38-
/** This component is optional and therefore the API will only work if it is installed */
38+
/**
39+
* Lists the alert filters of the context with the given ID.
40+
*
41+
* <p>This component is optional and therefore the API will only work if it is installed
42+
*/
3943
public ApiResponse alertFilterList(String contextid) throws ClientApiException {
4044
Map<String, String> map = new HashMap<>();
41-
if (contextid != null) {
42-
map.put("contextId", contextid);
43-
}
45+
map.put("contextId", contextid);
4446
return api.callApi("alertFilter", "view", "alertFilterList", map);
4547
}
4648

47-
/** This component is optional and therefore the API will only work if it is installed */
49+
/**
50+
* Adds a new alert filter for the context with the given ID.
51+
*
52+
* <p>This component is optional and therefore the API will only work if it is installed
53+
*/
4854
public ApiResponse addAlertFilter(
4955
String contextid,
5056
String ruleid,
@@ -73,7 +79,11 @@ public ApiResponse addAlertFilter(
7379
return api.callApi("alertFilter", "action", "addAlertFilter", map);
7480
}
7581

76-
/** This component is optional and therefore the API will only work if it is installed */
82+
/**
83+
* Removes an alert filter from the context with the given ID.
84+
*
85+
* <p>This component is optional and therefore the API will only work if it is installed
86+
*/
7787
public ApiResponse removeAlertFilter(
7888
String contextid,
7989
String ruleid,

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,8 @@ public ApiResponse optionFirefoxDriverPath() throws ClientApiException {
6363
return api.callApi("selenium", "view", "optionFirefoxDriverPath", null);
6464
}
6565

66-
/**
67-
* Returns the current path to IEDriverServer
68-
*
69-
* <p>This component is optional and therefore the API will only work if it is installed
70-
*/
66+
/** This component is optional and therefore the API will only work if it is installed */
67+
@Deprecated
7168
public ApiResponse optionIeDriverPath() throws ClientApiException {
7269
return api.callApi("selenium", "view", "optionIeDriverPath", null);
7370
}
@@ -114,11 +111,8 @@ public ApiResponse setOptionFirefoxDriverPath(String string) throws ClientApiExc
114111
return api.callApi("selenium", "action", "setOptionFirefoxDriverPath", map);
115112
}
116113

117-
/**
118-
* Sets the current path to IEDriverServer
119-
*
120-
* <p>This component is optional and therefore the API will only work if it is installed
121-
*/
114+
/** This component is optional and therefore the API will only work if it is installed */
115+
@Deprecated
122116
public ApiResponse setOptionIeDriverPath(String string) throws ClientApiException {
123117
Map<String, String> map = new HashMap<>();
124118
map.put("String", string);

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ public ApiResponse messages(
8383
return api.callApi("websocket", "view", "messages", map);
8484
}
8585

86+
/**
87+
* Returns a text representation of an intercepted websockets message
88+
*
89+
* <p>This component is optional and therefore the API will only work if it is installed
90+
*/
91+
public ApiResponse breakTextMessage() throws ClientApiException {
92+
return api.callApi("websocket", "view", "breakTextMessage", null);
93+
}
94+
8695
/**
8796
* Sends the specified message on the channel specified by channelId, if outgoing is 'True' then
8897
* the message will be sent to the server and if it is 'False' then it will be sent to the
@@ -98,4 +107,17 @@ public ApiResponse sendTextMessage(String channelid, String outgoing, String mes
98107
map.put("message", message);
99108
return api.callApi("websocket", "action", "sendTextMessage", map);
100109
}
110+
111+
/**
112+
* Sets the text message for an intercepted websockets message
113+
*
114+
* <p>This component is optional and therefore the API will only work if it is installed
115+
*/
116+
public ApiResponse setBreakTextMessage(String message, String outgoing)
117+
throws ClientApiException {
118+
Map<String, String> map = new HashMap<>();
119+
map.put("message", message);
120+
map.put("outgoing", outgoing);
121+
return api.callApi("websocket", "action", "setBreakTextMessage", map);
122+
}
101123
}

0 commit comments

Comments
 (0)