Skip to content

Commit 079b5d2

Browse files
authored
Merge pull request #101 from thc202/update-apis
Add/update APIs of add-ons and core
2 parents 16a48fa + 921569f commit 079b5d2

File tree

17 files changed

+1219
-127
lines changed

17 files changed

+1219
-127
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- Add the APIs of the following add-ons:
10+
- Import/Export version 0.3.0;
11+
- Network version 0.3.0;
12+
- Spider version 0.1.0.
13+
814
### Changed
15+
- Update core APIs for 2.12.
916
- Update the APIs of the following add-ons:
1017
- Automation Framework version 0.15.0;
1118
- Selenium version 15.8.0;
19+
- Replacer version 11.
20+
21+
### Deprecated
22+
- The following APIs were deprecated:
23+
- `ImportLogFiles`;
24+
- `Importurls`;
25+
- `LocalProxies`.
1226

1327
### Fixed
1428
- Add a graphql object to ClientApi.

subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/core/ClientApi.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@
5959
import org.zaproxy.clientapi.gen.Break;
6060
import org.zaproxy.clientapi.gen.Context;
6161
import org.zaproxy.clientapi.gen.Core;
62+
import org.zaproxy.clientapi.gen.Exim;
6263
import org.zaproxy.clientapi.gen.Exportreport;
6364
import org.zaproxy.clientapi.gen.ForcedUser;
6465
import org.zaproxy.clientapi.gen.Graphql;
6566
import org.zaproxy.clientapi.gen.HttpSessions;
66-
import org.zaproxy.clientapi.gen.ImportLogFiles;
67-
import org.zaproxy.clientapi.gen.Importurls;
68-
import org.zaproxy.clientapi.gen.LocalProxies;
67+
import org.zaproxy.clientapi.gen.Network;
6968
import org.zaproxy.clientapi.gen.Openapi;
7069
import org.zaproxy.clientapi.gen.Params;
7170
import org.zaproxy.clientapi.gen.Pnh;
@@ -119,13 +118,25 @@ public class ClientApi {
119118
public Break brk = new Break(this);
120119
public Context context = new Context(this);
121120
public Core core = new Core(this);
121+
public Exim exim = new Exim(this);
122122
public Exportreport exportreport = new Exportreport(this);
123123
public ForcedUser forcedUser = new ForcedUser(this);
124124
public Graphql graphql = new Graphql(this);
125125
public HttpSessions httpSessions = new HttpSessions(this);
126-
public ImportLogFiles logImportFiles = new ImportLogFiles(this);
127-
public Importurls importurls = new Importurls(this);
128-
public LocalProxies localProxies = new LocalProxies(this);
126+
127+
@SuppressWarnings("deprecation")
128+
public org.zaproxy.clientapi.gen.ImportLogFiles logImportFiles =
129+
new org.zaproxy.clientapi.gen.ImportLogFiles(this);
130+
131+
@SuppressWarnings("deprecation")
132+
public org.zaproxy.clientapi.gen.Importurls importurls =
133+
new org.zaproxy.clientapi.gen.Importurls(this);
134+
135+
@SuppressWarnings("deprecation")
136+
public org.zaproxy.clientapi.gen.LocalProxies localProxies =
137+
new org.zaproxy.clientapi.gen.LocalProxies(this);
138+
139+
public Network network = new Network(this);
129140
public Openapi openapi = new Openapi(this);
130141
public Params params = new Params(this);
131142
public Pnh pnh = new Pnh(this);

subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/gen/Ascan.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ public ApiResponse excludedFromScan() throws ClientApiException {
8585
return api.callApi("ascan", "view", "excludedFromScan", null);
8686
}
8787

88-
/**
89-
* Gets the scanners, optionally, of the given scan policy and/or scanner policy/category ID.
90-
*/
88+
/** Gets the scan rules, optionally, of the given scan policy or scanner policy/category ID. */
9189
public ApiResponse scanners(String scanpolicyname, String policyid) throws ClientApiException {
9290
Map<String, String> map = new HashMap<>();
9391
if (scanpolicyname != null) {
@@ -253,9 +251,9 @@ public ApiResponse scan(
253251
}
254252

255253
/**
256-
* Runs the active scanner against the given URL and/or Context. Optionally, the 'recurse'
257-
* parameter can be used to scan URLs under the given URL, the parameter 'inScopeOnly' can be
258-
* used to constrain the scan to URLs that are in scope (ignored if a Context is specified), the
254+
* Runs the active scanner against the given URL or Context. Optionally, the 'recurse' parameter
255+
* can be used to scan URLs under the given URL, the parameter 'inScopeOnly' can be used to
256+
* constrain the scan to URLs that are in scope (ignored if a Context is specified), the
259257
* parameter 'scanPolicyName' allows to specify the scan policy (if none is given it uses the
260258
* default scan policy), the parameters 'method' and 'postData' allow to select a given request
261259
* in conjunction with the given URL.
@@ -385,7 +383,7 @@ public ApiResponse excludeFromScan(String regex) throws ClientApiException {
385383
}
386384

387385
/**
388-
* Enables all scanners of the scan policy with the given name, or the default if none given.
386+
* Enables all scan rules of the scan policy with the given name, or the default if none given.
389387
*/
390388
public ApiResponse enableAllScanners(String scanpolicyname) throws ClientApiException {
391389
Map<String, String> map = new HashMap<>();
@@ -396,7 +394,7 @@ public ApiResponse enableAllScanners(String scanpolicyname) throws ClientApiExce
396394
}
397395

398396
/**
399-
* Disables all scanners of the scan policy with the given name, or the default if none given.
397+
* Disables all scan rules of the scan policy with the given name, or the default if none given.
400398
*/
401399
public ApiResponse disableAllScanners(String scanpolicyname) throws ClientApiException {
402400
Map<String, String> map = new HashMap<>();
@@ -407,8 +405,8 @@ public ApiResponse disableAllScanners(String scanpolicyname) throws ClientApiExc
407405
}
408406

409407
/**
410-
* Enables the scanners with the given IDs (comma separated list of IDs) of the scan policy with
411-
* the given name, or the default if none given.
408+
* Enables the scan rules with the given IDs (comma separated list of IDs) of the scan policy
409+
* with the given name, or the default if none given.
412410
*/
413411
public ApiResponse enableScanners(String ids, String scanpolicyname) throws ClientApiException {
414412
Map<String, String> map = new HashMap<>();
@@ -420,7 +418,7 @@ public ApiResponse enableScanners(String ids, String scanpolicyname) throws Clie
420418
}
421419

422420
/**
423-
* Disables the scanners with the given IDs (comma separated list of IDs) of the scan policy
421+
* Disables the scan rules with the given IDs (comma separated list of IDs) of the scan policy
424422
* with the given name, or the default if none given.
425423
*/
426424
public ApiResponse disableScanners(String ids, String scanpolicyname)
@@ -487,10 +485,6 @@ public ApiResponse setScannerAlertThreshold(
487485
return api.callApi("ascan", "action", "setScannerAlertThreshold", map);
488486
}
489487

490-
public ApiResponse addScanPolicy(String scanpolicyname) throws ClientApiException {
491-
return addScanPolicy(scanpolicyname, null, null);
492-
}
493-
494488
public ApiResponse addScanPolicy(
495489
String scanpolicyname, String alertthreshold, String attackstrength)
496490
throws ClientApiException {

0 commit comments

Comments
 (0)