Skip to content

Commit

Permalink
Merge pull request #24 from thc202/regen-add-ons
Browse files Browse the repository at this point in the history
Regenerate add-ons' APIs
  • Loading branch information
psiinon authored Nov 29, 2017
2 parents 2609c3c + 190f1b9 commit c3645b9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/zapv2/ajaxSpider.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2016 the ZAP development team
# Copyright 2017 the ZAP development team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -131,6 +131,7 @@ def option_random_inputs(self):

def scan(self, url=None, inscope=None, contextname=None, subtreeonly=None, apikey=''):
"""
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').
This component is optional and therefore the API will only work if it is installed
"""
params = {'apikey': apikey}
Expand All @@ -146,6 +147,7 @@ def scan(self, url=None, inscope=None, contextname=None, subtreeonly=None, apike

def scan_as_user(self, contextname, username, url=None, subtreeonly=None, apikey=''):
"""
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').
This component is optional and therefore the API will only work if it is installed
"""
params = {'contextName': contextname, 'userName': username, 'apikey': apikey}
Expand Down
4 changes: 3 additions & 1 deletion src/zapv2/reveal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2016 the ZAP development team
# Copyright 2017 the ZAP development team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,12 +30,14 @@ def __init__(self, zap):
@property
def reveal(self):
"""
Tells if shows hidden fields and enables disabled fields
This component is optional and therefore the API will only work if it is installed
"""
return six.next(six.itervalues(self.zap._request(self.zap.base + 'reveal/view/reveal/')))

def set_reveal(self, reveal, apikey=''):
"""
Sets if shows hidden fields and enables disabled fields
This component is optional and therefore the API will only work if it is installed
"""
return six.next(six.itervalues(self.zap._request(self.zap.base + 'reveal/action/setReveal/', {'reveal': reveal, 'apikey': apikey})))
12 changes: 11 additions & 1 deletion src/zapv2/selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2016 the ZAP development team
# Copyright 2017 the ZAP development team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,64 +30,74 @@ def __init__(self, zap):
@property
def option_chrome_driver_path(self):
"""
Returns the current path to ChromeDriver
This component is optional and therefore the API will only work if it is installed
"""
return six.next(six.itervalues(self.zap._request(self.zap.base + 'selenium/view/optionChromeDriverPath/')))

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

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

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

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

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

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

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

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

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

0 comments on commit c3645b9

Please sign in to comment.