|
| 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 Oast (clientApi) { |
| 26 | + this.api = clientApi |
| 27 | +} |
| 28 | + |
| 29 | +/** |
| 30 | + * Gets the service used with the active scanner, if any. |
| 31 | + * This component is optional and therefore the API will only work if it is installed |
| 32 | + **/ |
| 33 | +Oast.prototype.getActiveScanService = function () { |
| 34 | + return this.api.request('/oast/view/getActiveScanService/') |
| 35 | +} |
| 36 | + |
| 37 | +/** |
| 38 | + * Gets all of the services. |
| 39 | + * This component is optional and therefore the API will only work if it is installed |
| 40 | + **/ |
| 41 | +Oast.prototype.getServices = function () { |
| 42 | + return this.api.request('/oast/view/getServices/') |
| 43 | +} |
| 44 | + |
| 45 | +/** |
| 46 | + * Gets the BOAST options. |
| 47 | + * This component is optional and therefore the API will only work if it is installed |
| 48 | + **/ |
| 49 | +Oast.prototype.getBoastOptions = function () { |
| 50 | + return this.api.request('/oast/view/getBoastOptions/') |
| 51 | +} |
| 52 | + |
| 53 | +/** |
| 54 | + * Gets the Callback options. |
| 55 | + * This component is optional and therefore the API will only work if it is installed |
| 56 | + **/ |
| 57 | +Oast.prototype.getCallbackOptions = function () { |
| 58 | + return this.api.request('/oast/view/getCallbackOptions/') |
| 59 | +} |
| 60 | + |
| 61 | +/** |
| 62 | + * Gets the Interactsh options. |
| 63 | + * This component is optional and therefore the API will only work if it is installed |
| 64 | + **/ |
| 65 | +Oast.prototype.getInteractshOptions = function () { |
| 66 | + return this.api.request('/oast/view/getInteractshOptions/') |
| 67 | +} |
| 68 | + |
| 69 | +/** |
| 70 | + * Gets the number of days the OAST records will be kept for. |
| 71 | + * This component is optional and therefore the API will only work if it is installed |
| 72 | + **/ |
| 73 | +Oast.prototype.getDaysToKeepRecords = function () { |
| 74 | + return this.api.request('/oast/view/getDaysToKeepRecords/') |
| 75 | +} |
| 76 | + |
| 77 | +/** |
| 78 | + * Sets the service used with the active scanner. |
| 79 | + * This component is optional and therefore the API will only work if it is installed |
| 80 | + * @param {string} name - The name of the service. |
| 81 | + **/ |
| 82 | +Oast.prototype.setActiveScanService = function (args) { |
| 83 | + return this.api.request('/oast/action/setActiveScanService/', { name: args.name }) |
| 84 | +} |
| 85 | + |
| 86 | +/** |
| 87 | + * Sets the BOAST options. |
| 88 | + * This component is optional and therefore the API will only work if it is installed |
| 89 | + * @param {string} server - The server URL. |
| 90 | + * @param {string} pollinsecs - The polling frequency. |
| 91 | + **/ |
| 92 | +Oast.prototype.setBoastOptions = function (args) { |
| 93 | + return this.api.request('/oast/action/setBoastOptions/', { server: args.server, pollInSecs: args.pollinsecs }) |
| 94 | +} |
| 95 | + |
| 96 | +/** |
| 97 | + * Sets the Callback options. |
| 98 | + * This component is optional and therefore the API will only work if it is installed |
| 99 | + * @param {string} localaddress - The local address |
| 100 | + * @param {string} remoteaddress - The remote address. |
| 101 | + * @param {string} port - The port to listen on. |
| 102 | + **/ |
| 103 | +Oast.prototype.setCallbackOptions = function (args) { |
| 104 | + return this.api.request('/oast/action/setCallbackOptions/', { localAddress: args.localaddress, remoteAddress: args.remoteaddress, port: args.port }) |
| 105 | +} |
| 106 | + |
| 107 | +/** |
| 108 | + * Sets the Interactsh options. |
| 109 | + * This component is optional and therefore the API will only work if it is installed |
| 110 | + * @param {string} server - The server URL. |
| 111 | + * @param {string} pollinsecs - The polling frequency. |
| 112 | + * @param {string} authtoken - The Interactsh authentication token. |
| 113 | + **/ |
| 114 | +Oast.prototype.setInteractshOptions = function (args) { |
| 115 | + return this.api.request('/oast/action/setInteractshOptions/', { server: args.server, pollInSecs: args.pollinsecs, authToken: args.authtoken }) |
| 116 | +} |
| 117 | + |
| 118 | +/** |
| 119 | + * Sets the number of days the OAST records will be kept for. |
| 120 | + * This component is optional and therefore the API will only work if it is installed |
| 121 | + * @param {string} days - The number of days. |
| 122 | + **/ |
| 123 | +Oast.prototype.setDaysToKeepRecords = function (args) { |
| 124 | + return this.api.request('/oast/action/setDaysToKeepRecords/', { days: args.days }) |
| 125 | +} |
| 126 | + |
| 127 | +module.exports = Oast |
0 commit comments