|
| 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 clientSpider(object): |
| 26 | + |
| 27 | + def __init__(self, zap): |
| 28 | + self.zap = zap |
| 29 | + |
| 30 | + def status(self, scanid): |
| 31 | + """ |
| 32 | + Gets the status of a client spider scan. |
| 33 | + This component is optional and therefore the API will only work if it is installed |
| 34 | + """ |
| 35 | + return six.next(six.itervalues(self.zap._request(self.zap.base + 'clientSpider/view/status/', {'scanId': scanid}))) |
| 36 | + |
| 37 | + def scan(self, browser=None, url=None, contextname=None, username=None, subtreeonly=None, maxcrawldepth=None, pageloadtime=None, numberofbrowsers=None, scopecheck=None, apikey=''): |
| 38 | + """ |
| 39 | + Starts a client spider scan. |
| 40 | + This component is optional and therefore the API will only work if it is installed |
| 41 | + """ |
| 42 | + params = {} |
| 43 | + if browser is not None: |
| 44 | + params['browser'] = browser |
| 45 | + if url is not None: |
| 46 | + params['url'] = url |
| 47 | + if contextname is not None: |
| 48 | + params['contextName'] = contextname |
| 49 | + if username is not None: |
| 50 | + params['userName'] = username |
| 51 | + if subtreeonly is not None: |
| 52 | + params['subtreeOnly'] = subtreeonly |
| 53 | + if maxcrawldepth is not None: |
| 54 | + params['maxCrawlDepth'] = maxcrawldepth |
| 55 | + if pageloadtime is not None: |
| 56 | + params['pageLoadTime'] = pageloadtime |
| 57 | + if numberofbrowsers is not None: |
| 58 | + params['numberOfBrowsers'] = numberofbrowsers |
| 59 | + if scopecheck is not None: |
| 60 | + params['scopeCheck'] = scopecheck |
| 61 | + return six.next(six.itervalues(self.zap._request(self.zap.base + 'clientSpider/action/scan/', params))) |
| 62 | + |
| 63 | + def stop(self, scanid, apikey=''): |
| 64 | + """ |
| 65 | + Stops a client spider scan. |
| 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 + 'clientSpider/action/stop/', {'scanId': scanid}))) |
0 commit comments