Skip to content

Commit b3d35a2

Browse files
committed
Update APIs of add-ons and core
Update core APIs for 2.17.0. Add the APIs of the following add-ons: - Client Side Integration version 0.20.0; - Postman Support version 0.7.0. Update the APIs of the following add-ons: - Automation Framework version 0.58.0; - Passive Scanner version 0.6.0; - Selenium version 15.43.0; - Spider version 0.18.0. Signed-off-by: thc202 <[email protected]>
1 parent c98e526 commit b3d35a2

File tree

12 files changed

+399
-58
lines changed

12 files changed

+399
-58
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
55

66
## [Unreleased]
7+
### Added
8+
- Add the APIs of the following add-ons:
9+
- Client Side Integration version 0.20.0;
10+
- Postman Support version 0.7.0.
11+
12+
### Changed
13+
- Update dependencies.
14+
- Update core APIs for 2.17.
15+
- Update the APIs of the following add-ons:
16+
- Automation Framework version 0.58.0;
17+
- OpenAPI Support version 48;
18+
- Passive Scanner version 0.6.0;
19+
- Selenium version 15.43.0;
20+
- Spider version 0.18.0.
721

822
## [2.0.0-rc.6] - 2025-01-20
923
### Added

src/alert.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Alert.prototype.alert = function (args) {
4141
* @param {string} count
4242
* @param {string} riskid
4343
* @param {string} contextname - Optionally, the Context name which the Alerts' URLs are associated with.
44+
* @param {string} falsepositive - Optionally, a boolean indicating whether the results should include False Positive alerts.
4445
**/
4546
Alert.prototype.alerts = function (args) {
4647
const params = { }
@@ -59,6 +60,9 @@ Alert.prototype.alerts = function (args) {
5960
if (args.contextname && args.contextname !== null) {
6061
params.contextName = args.contextname
6162
}
63+
if (args.falsepositive && args.falsepositive !== null) {
64+
params.falsePositive = args.falsepositive
65+
}
6266
return this.api.request('/alert/view/alerts/', params)
6367
}
6468

src/alertFilter.js

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function AlertFilter (clientApi) {
2929
/**
3030
* Lists the alert filters of the context with the given ID.
3131
* This component is optional and therefore the API will only work if it is installed
32-
* @param {string} contextid
32+
* @param {string} contextid - The numeric ID of the context for which the filters should be listed.
3333
**/
3434
AlertFilter.prototype.alertFilterList = function (args) {
3535
return this.api.request('/alertFilter/view/alertFilterList/', { contextId: args.contextid })
@@ -46,19 +46,19 @@ AlertFilter.prototype.globalAlertFilterList = function () {
4646
/**
4747
* Adds a new alert filter for the context with the given ID.
4848
* This component is optional and therefore the API will only work if it is installed
49-
* @param {string} contextid
50-
* @param {string} ruleid
51-
* @param {string} newlevel
52-
* @param {string} url
53-
* @param {string} urlisregex
54-
* @param {string} parameter
55-
* @param {string} enabled
56-
* @param {string} parameterisregex
57-
* @param {string} attack
58-
* @param {string} attackisregex
59-
* @param {string} evidence
60-
* @param {string} evidenceisregex
61-
* @param {string} methods
49+
* @param {string} contextid - The numeric ID of the context for which the filter should be added.
50+
* @param {string} ruleid - The numeric ID of the rule for which the filter should apply.
51+
* @param {string} newlevel - The numeric risk representation ('0 - Informational' through '3 - High') ['-1 - False Positive'].
52+
* @param {string} url - The URL for which the filter should apply (can be regex).
53+
* @param {string} urlisregex - A boolean indicating whether or not the URL is a regex.
54+
* @param {string} parameter - The parameter name for which the filter should apply (can be regex).
55+
* @param {string} enabled - A boolean indicating whether or not the filter should be enabled.
56+
* @param {string} parameterisregex - A boolean indicating whether or not the parameter name is a regex.
57+
* @param {string} attack - The attack value for which the filter should apply (can be regex).
58+
* @param {string} attackisregex - A boolean indicating whether or not the attack value is a regex.
59+
* @param {string} evidence - The evidence value for which the filter should apply (can be regex).
60+
* @param {string} evidenceisregex - A boolean indicating whether or not the evidence value is a regex.
61+
* @param {string} methods - The HTTP methods (comma separated) for which the filter should apply.
6262
**/
6363
AlertFilter.prototype.addAlertFilter = function (args) {
6464
const params = { contextId: args.contextid, ruleId: args.ruleid, newLevel: args.newlevel }
@@ -98,19 +98,19 @@ AlertFilter.prototype.addAlertFilter = function (args) {
9898
/**
9999
* Removes an alert filter from the context with the given ID.
100100
* This component is optional and therefore the API will only work if it is installed
101-
* @param {string} contextid
102-
* @param {string} ruleid
103-
* @param {string} newlevel
104-
* @param {string} url
105-
* @param {string} urlisregex
106-
* @param {string} parameter
107-
* @param {string} enabled
108-
* @param {string} parameterisregex
109-
* @param {string} attack
110-
* @param {string} attackisregex
111-
* @param {string} evidence
112-
* @param {string} evidenceisregex
113-
* @param {string} methods
101+
* @param {string} contextid - The numeric ID of the context for which the filter should be removed.
102+
* @param {string} ruleid - The numeric ID of the rule for which the filter applies.
103+
* @param {string} newlevel - The numeric risk representation ('0 - Informational' through '3 - High') ['-1 - False Positive'].
104+
* @param {string} url - The URL for which the filter applies (can be regex).
105+
* @param {string} urlisregex - A boolean indicating whether or not the URL is a regex.
106+
* @param {string} parameter - The parameter name for which the filter applies (can be regex).
107+
* @param {string} enabled - A boolean indicating whether or not the filter should be enabled.
108+
* @param {string} parameterisregex - A boolean indicating whether or not the parameter name is a regex.
109+
* @param {string} attack - The attack value for which the filter applies (can be regex).
110+
* @param {string} attackisregex - A boolean indicating whether or not the attack value is a regex.
111+
* @param {string} evidence - The evidence value for which the filter applies (can be regex).
112+
* @param {string} evidenceisregex - A boolean indicating whether or not the evidence value is a regex.
113+
* @param {string} methods - The HTTP methods (comma separated) for which the filter applies.
114114
**/
115115
AlertFilter.prototype.removeAlertFilter = function (args) {
116116
const params = { contextId: args.contextid, ruleId: args.ruleid, newLevel: args.newlevel }
@@ -150,18 +150,18 @@ AlertFilter.prototype.removeAlertFilter = function (args) {
150150
/**
151151
* Adds a new global alert filter.
152152
* This component is optional and therefore the API will only work if it is installed
153-
* @param {string} ruleid
154-
* @param {string} newlevel
155-
* @param {string} url
156-
* @param {string} urlisregex
157-
* @param {string} parameter
158-
* @param {string} enabled
159-
* @param {string} parameterisregex
160-
* @param {string} attack
161-
* @param {string} attackisregex
162-
* @param {string} evidence
163-
* @param {string} evidenceisregex
164-
* @param {string} methods
153+
* @param {string} ruleid - The numeric ID of the rule for which the filter should apply.
154+
* @param {string} newlevel - The numeric risk representation ('0 - Informational' through '3 - High') ['-1 - False Positive'].
155+
* @param {string} url - The URL for which the filter should apply (can be regex).
156+
* @param {string} urlisregex - A boolean indicating whether or not the URL is a regex.
157+
* @param {string} parameter - The parameter name for which the filter should apply (can be regex).
158+
* @param {string} enabled - A boolean indicating whether or not the filter should be enabled.
159+
* @param {string} parameterisregex - A boolean indicating whether or not the parameter name is a regex.
160+
* @param {string} attack - The attack value for which the filter should apply (can be regex).
161+
* @param {string} attackisregex - A boolean indicating whether or not the attack value is a regex.
162+
* @param {string} evidence - The evidence value for which the filter should apply (can be regex).
163+
* @param {string} evidenceisregex - A boolean indicating whether or not the evidence value is a regex.
164+
* @param {string} methods - The HTTP methods (comma separated) for which the filter should apply.
165165
**/
166166
AlertFilter.prototype.addGlobalAlertFilter = function (args) {
167167
const params = { ruleId: args.ruleid, newLevel: args.newlevel }
@@ -201,18 +201,18 @@ AlertFilter.prototype.addGlobalAlertFilter = function (args) {
201201
/**
202202
* Removes a global alert filter.
203203
* This component is optional and therefore the API will only work if it is installed
204-
* @param {string} ruleid
205-
* @param {string} newlevel
206-
* @param {string} url
207-
* @param {string} urlisregex
208-
* @param {string} parameter
209-
* @param {string} enabled
210-
* @param {string} parameterisregex
211-
* @param {string} attack
212-
* @param {string} attackisregex
213-
* @param {string} evidence
214-
* @param {string} evidenceisregex
215-
* @param {string} methods
204+
* @param {string} ruleid - The numeric ID of the rule for which the filter applies.
205+
* @param {string} newlevel - The numeric risk representation ('0 - Informational' through '3 - High') ['-1 - False Positive'].
206+
* @param {string} url - The URL for which the filter applies (can be regex).
207+
* @param {string} urlisregex - A boolean indicating whether or not the URL is a regex.
208+
* @param {string} parameter - The parameter name for which the filter applies (can be regex).
209+
* @param {string} enabled - A boolean indicating whether or not the filter should be enabled.
210+
* @param {string} parameterisregex - A boolean indicating whether or not the parameter name is a regex.
211+
* @param {string} attack - The attack value for which the filter applies (can be regex).
212+
* @param {string} attackisregex - A boolean indicating whether or not the attack value is a regex.
213+
* @param {string} evidence - The evidence value for which the filter applies (can be regex).
214+
* @param {string} evidenceisregex - A boolean indicating whether or not the evidence value is a regex.
215+
* @param {string} methods - The HTTP methods (comma separated) for which the filter applies.
216216
**/
217217
AlertFilter.prototype.removeGlobalAlertFilter = function (args) {
218218
const params = { ruleId: args.ruleid, newLevel: args.newlevel }

src/ascan.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,27 @@ Ascan.prototype.optionEncodeCookieValues = function () {
266266
return this.api.request('/ascan/view/optionEncodeCookieValues/')
267267
}
268268

269+
/**
270+
* Tells whether or not the active scanner should exclude anti-csrf tokens from the scan.
271+
**/
272+
Ascan.prototype.optionExcludeAntiCsrfTokens = function () {
273+
return this.api.request('/ascan/view/optionExcludeAntiCsrfTokens/')
274+
}
275+
269276
/**
270277
* 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.
271278
**/
272279
Ascan.prototype.optionInjectPluginIdInHeader = function () {
273280
return this.api.request('/ascan/view/optionInjectPluginIdInHeader/')
274281
}
275282

283+
/**
284+
* Tells whether or not the temporary HTTP messages sent while active scanning should be persisted.
285+
**/
286+
Ascan.prototype.optionPersistTemporaryMessages = function () {
287+
return this.api.request('/ascan/view/optionPersistTemporaryMessages/')
288+
}
289+
276290
/**
277291
*
278292
**/
@@ -734,6 +748,14 @@ Ascan.prototype.setOptionEncodeCookieValues = function (args) {
734748
return this.api.request('/ascan/action/setOptionEncodeCookieValues/', { Boolean: args.bool })
735749
}
736750

751+
/**
752+
* Sets whether or not the active scanner should exclude anti-csrf tokens from the scan.
753+
* @param {string} bool - true if anti-csrf tokens should be excluded, false otherwise.
754+
**/
755+
Ascan.prototype.setOptionExcludeAntiCsrfTokens = function (args) {
756+
return this.api.request('/ascan/action/setOptionExcludeAntiCsrfTokens/', { Boolean: args.bool })
757+
}
758+
737759
/**
738760
*
739761
* @param {string} bool
@@ -806,6 +828,14 @@ Ascan.prototype.setOptionMaxScansInUI = function (args) {
806828
return this.api.request('/ascan/action/setOptionMaxScansInUI/', { Integer: args.integer })
807829
}
808830

831+
/**
832+
* Sets whether or not the temporary HTTP messages sent while active scanning should be persisted.
833+
* @param {string} bool - true if the temporary HTTP messages should be persisted, false otherwise.
834+
**/
835+
Ascan.prototype.setOptionPersistTemporaryMessages = function (args) {
836+
return this.api.request('/ascan/action/setOptionPersistTemporaryMessages/', { Boolean: args.bool })
837+
}
838+
809839
/**
810840
*
811841
* @param {string} bool

src/automation.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,34 @@ function Automation (clientApi) {
2727
}
2828

2929
/**
30+
* Returns the progress details for the specified planId
3031
* This component is optional and therefore the API will only work if it is installed
32+
* @param {string} planid
3133
**/
3234
Automation.prototype.planProgress = function (args) {
3335
return this.api.request('/automation/view/planProgress/', { planId: args.planid })
3436
}
3537

3638
/**
39+
* Loads and asynchronously runs the plan in the specified file, returning a planId
3740
* This component is optional and therefore the API will only work if it is installed
41+
* @param {string} filepath
3842
**/
3943
Automation.prototype.runPlan = function (args) {
4044
return this.api.request('/automation/action/runPlan/', { filePath: args.filepath })
4145
}
4246

4347
/**
48+
* Stops the running plan identified by the planId
49+
* This component is optional and therefore the API will only work if it is installed
50+
* @param {string} planid
51+
**/
52+
Automation.prototype.stopPlan = function (args) {
53+
return this.api.request('/automation/action/stopPlan/', { planId: args.planid })
54+
}
55+
56+
/**
57+
* Ends the currently running delay job, if any
4458
* This component is optional and therefore the API will only work if it is installed
4559
**/
4660
Automation.prototype.endDelayJob = function () {

src/client.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/* Zed Attack Proxy (ZAP) and its related class files.
2+
*
3+
* ZAP is an HTTP/HTTPS proxy for assessing web application security.
4+
*
5+
* Copyright 2025 the ZAP development team
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
'use strict'
21+
22+
/**
23+
* This file was automatically generated.
24+
*/
25+
function Client (clientApi) {
26+
this.api = clientApi
27+
}
28+
29+
/**
30+
* This component is optional and therefore the API will only work if it is installed
31+
**/
32+
Client.prototype.reportObject = function (args) {
33+
return this.api.request('/client/action/reportObject/', { objectJson: args.objectjson })
34+
}
35+
36+
/**
37+
* This component is optional and therefore the API will only work if it is installed
38+
**/
39+
Client.prototype.reportEvent = function (args) {
40+
return this.api.request('/client/action/reportEvent/', { eventJson: args.eventjson })
41+
}
42+
43+
/**
44+
* This component is optional and therefore the API will only work if it is installed
45+
**/
46+
Client.prototype.reportZestStatement = function (args) {
47+
return this.api.request('/client/action/reportZestStatement/', { statementJson: args.statementjson })
48+
}
49+
50+
/**
51+
* This component is optional and therefore the API will only work if it is installed
52+
**/
53+
Client.prototype.reportZestScript = function (args) {
54+
return this.api.request('/client/action/reportZestScript/', { scriptJson: args.scriptjson })
55+
}
56+
57+
/**
58+
* Exports the Client Map to a file.
59+
* This component is optional and therefore the API will only work if it is installed
60+
* @param {string} pathyaml - The file system path to the file.
61+
**/
62+
Client.prototype.exportClientMap = function (args) {
63+
return this.api.request('/client/action/exportClientMap/', { pathYaml: args.pathyaml })
64+
}
65+
66+
module.exports = Client

0 commit comments

Comments
 (0)