Skip to content

Commit c3645b9

Browse files
authored
Merge pull request #24 from thc202/regen-add-ons
Regenerate add-ons' APIs
2 parents 2609c3c + 190f1b9 commit c3645b9

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/zapv2/ajaxSpider.py

Lines changed: 3 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 2016 the ZAP development team
5+
# Copyright 2017 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.
@@ -131,6 +131,7 @@ def option_random_inputs(self):
131131

132132
def scan(self, url=None, inscope=None, contextname=None, subtreeonly=None, apikey=''):
133133
"""
134+
Runs the spider against the given URL and/or context, optionally, spidering everything in scope. The parameter 'contextName' can be used to constrain the scan to a Context, the option 'in scope' is ignored if a context was also specified. The parameter 'subtreeOnly' allows to restrict the spider under a site's subtree (using the specified 'url').
134135
This component is optional and therefore the API will only work if it is installed
135136
"""
136137
params = {'apikey': apikey}
@@ -146,6 +147,7 @@ def scan(self, url=None, inscope=None, contextname=None, subtreeonly=None, apike
146147

147148
def scan_as_user(self, contextname, username, url=None, subtreeonly=None, apikey=''):
148149
"""
150+
Runs the spider from the perspective of a User, obtained using the given context name and user name. The parameter 'url' allows to specify the starting point for the spider, otherwise it's used an existing URL from the context (if any). The parameter 'subtreeOnly' allows to restrict the spider under a site's subtree (using the specified 'url').
149151
This component is optional and therefore the API will only work if it is installed
150152
"""
151153
params = {'contextName': contextname, 'userName': username, 'apikey': apikey}

src/zapv2/reveal.py

Lines changed: 3 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 2016 the ZAP development team
5+
# Copyright 2017 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.
@@ -30,12 +30,14 @@ def __init__(self, zap):
3030
@property
3131
def reveal(self):
3232
"""
33+
Tells if shows hidden fields and enables disabled fields
3334
This component is optional and therefore the API will only work if it is installed
3435
"""
3536
return six.next(six.itervalues(self.zap._request(self.zap.base + 'reveal/view/reveal/')))
3637

3738
def set_reveal(self, reveal, apikey=''):
3839
"""
40+
Sets if shows hidden fields and enables disabled fields
3941
This component is optional and therefore the API will only work if it is installed
4042
"""
4143
return six.next(six.itervalues(self.zap._request(self.zap.base + 'reveal/action/setReveal/', {'reveal': reveal, 'apikey': apikey})))

src/zapv2/selenium.py

Lines changed: 11 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 2016 the ZAP development team
5+
# Copyright 2017 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.
@@ -30,64 +30,74 @@ def __init__(self, zap):
3030
@property
3131
def option_chrome_driver_path(self):
3232
"""
33+
Returns the current path to ChromeDriver
3334
This component is optional and therefore the API will only work if it is installed
3435
"""
3536
return six.next(six.itervalues(self.zap._request(self.zap.base + 'selenium/view/optionChromeDriverPath/')))
3637

3738
@property
3839
def option_firefox_binary_path(self):
3940
"""
41+
Returns the current path to Firefox binary
4042
This component is optional and therefore the API will only work if it is installed
4143
"""
4244
return six.next(six.itervalues(self.zap._request(self.zap.base + 'selenium/view/optionFirefoxBinaryPath/')))
4345

4446
@property
4547
def option_firefox_driver_path(self):
4648
"""
49+
Returns the current path to Firefox driver (geckodriver)
4750
This component is optional and therefore the API will only work if it is installed
4851
"""
4952
return six.next(six.itervalues(self.zap._request(self.zap.base + 'selenium/view/optionFirefoxDriverPath/')))
5053

5154
@property
5255
def option_ie_driver_path(self):
5356
"""
57+
Returns the current path to IEDriverServer
5458
This component is optional and therefore the API will only work if it is installed
5559
"""
5660
return six.next(six.itervalues(self.zap._request(self.zap.base + 'selenium/view/optionIeDriverPath/')))
5761

5862
@property
5963
def option_phantom_js_binary_path(self):
6064
"""
65+
Returns the current path to PhantomJS binary
6166
This component is optional and therefore the API will only work if it is installed
6267
"""
6368
return six.next(six.itervalues(self.zap._request(self.zap.base + 'selenium/view/optionPhantomJsBinaryPath/')))
6469

6570
def set_option_chrome_driver_path(self, string, apikey=''):
6671
"""
72+
Sets the current path to ChromeDriver
6773
This component is optional and therefore the API will only work if it is installed
6874
"""
6975
return six.next(six.itervalues(self.zap._request(self.zap.base + 'selenium/action/setOptionChromeDriverPath/', {'String': string, 'apikey': apikey})))
7076

7177
def set_option_firefox_binary_path(self, string, apikey=''):
7278
"""
79+
Sets the current path to Firefox binary
7380
This component is optional and therefore the API will only work if it is installed
7481
"""
7582
return six.next(six.itervalues(self.zap._request(self.zap.base + 'selenium/action/setOptionFirefoxBinaryPath/', {'String': string, 'apikey': apikey})))
7683

7784
def set_option_firefox_driver_path(self, string, apikey=''):
7885
"""
86+
Sets the current path to Firefox driver (geckodriver)
7987
This component is optional and therefore the API will only work if it is installed
8088
"""
8189
return six.next(six.itervalues(self.zap._request(self.zap.base + 'selenium/action/setOptionFirefoxDriverPath/', {'String': string, 'apikey': apikey})))
8290

8391
def set_option_ie_driver_path(self, string, apikey=''):
8492
"""
93+
Sets the current path to IEDriverServer
8594
This component is optional and therefore the API will only work if it is installed
8695
"""
8796
return six.next(six.itervalues(self.zap._request(self.zap.base + 'selenium/action/setOptionIeDriverPath/', {'String': string, 'apikey': apikey})))
8897

8998
def set_option_phantom_js_binary_path(self, string, apikey=''):
9099
"""
100+
Sets the current path to PhantomJS binary
91101
This component is optional and therefore the API will only work if it is installed
92102
"""
93103
return six.next(six.itervalues(self.zap._request(self.zap.base + 'selenium/action/setOptionPhantomJsBinaryPath/', {'String': string, 'apikey': apikey})))

0 commit comments

Comments
 (0)