Skip to content

Commit 95a7a9c

Browse files
authored
Merge pull request #126 from psiinon/master
Update for ZAP 2.16.0
2 parents 352e6cc + 5ccf8db commit 95a7a9c

38 files changed

+276
-47
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
55

6-
## [Unreleased]
6+
## [0.4.0] - 2025-01-20
7+
### Changed
8+
- Update APIs for 2.16.
79

810
## [0.3.2] - 2024-06-04
911
### Fixed
@@ -181,7 +183,7 @@ ensure it's automatically sent in all API requests.
181183
### Changed
182184
- Moved from the main `zaproxy` repository.
183185

184-
[Unreleased]: https://github.com/zaproxy/zap-api-python/compare/0.3.2...HEAD
186+
[0.4.0]: https://github.com/zaproxy/zap-api-python/compare/0.3.2...0.4.0
185187
[0.3.2]: https://github.com/zaproxy/zap-api-python/compare/0.3.1...0.3.2
186188
[0.3.1]: https://github.com/zaproxy/zap-api-python/compare/0.3.0...0.3.1
187189
[0.3.0]: https://github.com/zaproxy/zap-api-python/compare/0.2.0...0.3.0

src/zapv2/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
from .httpSessions import httpSessions
4646
from .localProxies import localProxies
4747
from .network import network
48+
from .oast import oast
4849
from .openapi import openapi
4950
from .params import params
5051
from .pnh import pnh
@@ -111,6 +112,7 @@ def __init__(self, proxies=None, apikey=None, validate_status_code=False):
111112
self.httpsessions = httpSessions(self)
112113
self.localProxies = localProxies(self)
113114
self.network = network(self)
115+
self.oast = oast(self)
114116
self.openapi = openapi(self)
115117
self.params = params(self)
116118
self.pnh = pnh(self)

src/zapv2/accessControl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/acsrf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/ajaxSpider.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.
@@ -150,6 +150,13 @@ def option_click_elems_once(self):
150150
"""
151151
return six.next(six.itervalues(self.zap._request(self.zap.base + 'ajaxSpider/view/optionClickElemsOnce/')))
152152

153+
@property
154+
def option_enable_extensions(self):
155+
"""
156+
This component is optional and therefore the API will only work if it is installed
157+
"""
158+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'ajaxSpider/view/optionEnableExtensions/')))
159+
153160
@property
154161
def option_random_inputs(self):
155162
"""
@@ -283,6 +290,12 @@ def set_option_click_elems_once(self, boolean, apikey=''):
283290
"""
284291
return six.next(six.itervalues(self.zap._request(self.zap.base + 'ajaxSpider/action/setOptionClickElemsOnce/', {'Boolean': boolean})))
285292

293+
def set_option_enable_extensions(self, boolean, apikey=''):
294+
"""
295+
This component is optional and therefore the API will only work if it is installed
296+
"""
297+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'ajaxSpider/action/setOptionEnableExtensions/', {'Boolean': boolean})))
298+
286299
def set_option_event_wait(self, integer, apikey=''):
287300
"""
288301
Sets the time to wait after an event (in milliseconds). For example: the wait delay after the cursor hovers over an element, in order for a menu to display, etc.

src/zapv2/alert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/alertFilter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/ascan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/authorization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/automation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/autoupdate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/brk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/custompayloads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2024 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/exim.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.
@@ -55,6 +55,20 @@ def import_modsec_2_logs(self, filepath, apikey=''):
5555
"""
5656
return six.next(six.itervalues(self.zap._request(self.zap.base + 'exim/action/importModsec2Logs/', {'filePath': filepath})))
5757

58+
def export_sites_tree(self, filepath, apikey=''):
59+
"""
60+
Exports the Sites Tree in the Sites Tree YAML format.
61+
This component is optional and therefore the API will only work if it is installed
62+
"""
63+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'exim/action/exportSitesTree/', {'filePath': filepath})))
64+
65+
def prune_sites_tree(self, filepath, apikey=''):
66+
"""
67+
Prunes the Sites Tree based on a file in the Sites Tree YAML format.
68+
This component is optional and therefore the API will only work if it is installed
69+
"""
70+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'exim/action/pruneSitesTree/', {'filePath': filepath})))
71+
5872
def export_har(self, baseurl=None, start=None, count=None, apikey=''):
5973
"""
6074
Gets the HTTP messages sent through/by ZAP, in HAR format, optionally filtered by URL and paginated with 'start' position and 'count' of messages

src/zapv2/forcedUser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/httpSessions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/oast.py

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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+
This file was automatically generated.
20+
"""
21+
22+
import six
23+
24+
25+
class oast(object):
26+
27+
def __init__(self, zap):
28+
self.zap = zap
29+
30+
@property
31+
def get_active_scan_service(self):
32+
"""
33+
Gets the service used with the active scanner, if any.
34+
This component is optional and therefore the API will only work if it is installed
35+
"""
36+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'oast/view/getActiveScanService/')))
37+
38+
@property
39+
def get_services(self):
40+
"""
41+
Gets all of the services.
42+
This component is optional and therefore the API will only work if it is installed
43+
"""
44+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'oast/view/getServices/')))
45+
46+
@property
47+
def get_boast_options(self):
48+
"""
49+
Gets the BOAST options.
50+
This component is optional and therefore the API will only work if it is installed
51+
"""
52+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'oast/view/getBoastOptions/')))
53+
54+
@property
55+
def get_callback_options(self):
56+
"""
57+
Gets the Callback options.
58+
This component is optional and therefore the API will only work if it is installed
59+
"""
60+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'oast/view/getCallbackOptions/')))
61+
62+
@property
63+
def get_interactsh_options(self):
64+
"""
65+
Gets the Interactsh options.
66+
This component is optional and therefore the API will only work if it is installed
67+
"""
68+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'oast/view/getInteractshOptions/')))
69+
70+
@property
71+
def get_days_to_keep_records(self):
72+
"""
73+
Gets the number of days the OAST records will be kept for.
74+
This component is optional and therefore the API will only work if it is installed
75+
"""
76+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'oast/view/getDaysToKeepRecords/')))
77+
78+
def set_active_scan_service(self, name, apikey=''):
79+
"""
80+
Sets the service used with the active scanner.
81+
This component is optional and therefore the API will only work if it is installed
82+
"""
83+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'oast/action/setActiveScanService/', {'name': name})))
84+
85+
def set_boast_options(self, server, pollinsecs, apikey=''):
86+
"""
87+
Sets the BOAST options.
88+
This component is optional and therefore the API will only work if it is installed
89+
"""
90+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'oast/action/setBoastOptions/', {'server': server, 'pollInSecs': pollinsecs})))
91+
92+
def set_callback_options(self, localaddress, remoteaddress, port, apikey=''):
93+
"""
94+
Sets the Callback options.
95+
This component is optional and therefore the API will only work if it is installed
96+
"""
97+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'oast/action/setCallbackOptions/', {'localAddress': localaddress, 'remoteAddress': remoteaddress, 'port': port})))
98+
99+
def set_interactsh_options(self, server, pollinsecs, authtoken, apikey=''):
100+
"""
101+
Sets the Interactsh options.
102+
This component is optional and therefore the API will only work if it is installed
103+
"""
104+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'oast/action/setInteractshOptions/', {'server': server, 'pollInSecs': pollinsecs, 'authToken': authtoken})))
105+
106+
def set_days_to_keep_records(self, days, apikey=''):
107+
"""
108+
Sets the number of days the OAST records will be kept for.
109+
This component is optional and therefore the API will only work if it is installed
110+
"""
111+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'oast/action/setDaysToKeepRecords/', {'days': days})))

src/zapv2/params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

src/zapv2/pnh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
44
#
5-
# Copyright 2022 the ZAP development team
5+
# Copyright 2025 the ZAP development team
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)