public class ClientApi
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
Acsrf |
acsrf |
AjaxSpider |
ajaxSpider |
Ascan |
ascan |
Authentication |
authentication |
Authorization |
authorization |
Autoupdate |
autoupdate |
Break |
brk |
Context |
context |
Core |
core |
ForcedUser |
forcedUser |
HttpSessions |
httpSessions |
ImportLogFiles |
logImportFiles |
Params |
params |
Pnh |
pnh |
Pscan |
pscan |
Reveal |
reveal |
Script |
script |
Search |
search |
Selenium |
selenium |
SessionManagement |
sessionManagement |
Spider |
spider |
Stats |
stats |
Users |
users |
Constructor and Description |
---|
ClientApi(java.lang.String zapAddress,
int zapPort) |
ClientApi(java.lang.String zapAddress,
int zapPort,
boolean debug) |
Modifier and Type | Method and Description |
---|---|
void |
accessUrl(java.lang.String url) |
void |
activeScanSiteInScope(java.lang.String apikey,
java.lang.String url) |
void |
addExcludeFromContext(java.lang.String apikey,
java.lang.String contextName,
java.lang.String regex) |
void |
addIncludeInContext(java.lang.String apikey,
java.lang.String contextName,
java.lang.String regex) |
ApiResponse |
callApi(java.lang.String component,
java.lang.String type,
java.lang.String method,
java.util.Map<java.lang.String,java.lang.String> params) |
byte[] |
callApiOther(java.lang.String component,
java.lang.String type,
java.lang.String method,
java.util.Map<java.lang.String,java.lang.String> params) |
void |
checkAlerts(java.util.List<Alert> ignoreAlerts,
java.util.List<Alert> requireAlerts) |
void |
checkAlerts(java.util.List<Alert> ignoreAlerts,
java.util.List<Alert> requireAlerts,
java.io.File outputFile) |
java.util.List<Alert> |
getAlerts(java.lang.String baseUrl,
int start,
int count) |
void |
includeOneMatchingNodeInContext(java.lang.String apikey,
java.lang.String contextName,
java.lang.String regex) |
void |
setDebugStream(java.io.PrintStream debugStream) |
void |
waitForSuccessfulConnectionToZap(int timeoutInSeconds)
Convenience method to wait for ZAP to be ready to receive API calls, when started programmatically.
|
void |
waitForSuccessfulConnectionToZap(int timeoutInSeconds,
int pollingIntervalInMs)
Convenience method to wait for ZAP to be ready to receive API calls, when started programmatically.
|
public Acsrf acsrf
public AjaxSpider ajaxSpider
public Ascan ascan
public Authentication authentication
public Authorization authorization
public Autoupdate autoupdate
public Break brk
public Context context
public Core core
public ForcedUser forcedUser
public HttpSessions httpSessions
public ImportLogFiles logImportFiles
public Params params
public Pnh pnh
public Pscan pscan
public Reveal reveal
public Search search
public Script script
public Selenium selenium
public SessionManagement sessionManagement
public Spider spider
public Stats stats
public Users users
public ClientApi(java.lang.String zapAddress, int zapPort)
public ClientApi(java.lang.String zapAddress, int zapPort, boolean debug)
public void setDebugStream(java.io.PrintStream debugStream)
public void accessUrl(java.lang.String url) throws ClientApiException
ClientApiException
public void checkAlerts(java.util.List<Alert> ignoreAlerts, java.util.List<Alert> requireAlerts) throws ClientApiException
ClientApiException
public void checkAlerts(java.util.List<Alert> ignoreAlerts, java.util.List<Alert> requireAlerts, java.io.File outputFile) throws ClientApiException
ClientApiException
public java.util.List<Alert> getAlerts(java.lang.String baseUrl, int start, int count) throws ClientApiException
ClientApiException
public ApiResponse callApi(java.lang.String component, java.lang.String type, java.lang.String method, java.util.Map<java.lang.String,java.lang.String> params) throws ClientApiException
ClientApiException
public byte[] callApiOther(java.lang.String component, java.lang.String type, java.lang.String method, java.util.Map<java.lang.String,java.lang.String> params) throws ClientApiException
ClientApiException
public void addExcludeFromContext(java.lang.String apikey, java.lang.String contextName, java.lang.String regex) throws java.lang.Exception
java.lang.Exception
public void addIncludeInContext(java.lang.String apikey, java.lang.String contextName, java.lang.String regex) throws java.lang.Exception
java.lang.Exception
public void includeOneMatchingNodeInContext(java.lang.String apikey, java.lang.String contextName, java.lang.String regex) throws java.lang.Exception
java.lang.Exception
public void activeScanSiteInScope(java.lang.String apikey, java.lang.String url) throws java.lang.Exception
java.lang.Exception
public void waitForSuccessfulConnectionToZap(int timeoutInSeconds) throws ClientApiException
It attempts to establish a connection to ZAP's proxy, in the given time, throwing an exception if the connection is not successful. The connection attempts might be polled in one second interval.
timeoutInSeconds
- the (maximum) number of seconds to wait for ZAP to startClientApiException
- if the timeout was reached or if the thread was interrupted while waitingwaitForSuccessfulConnectionToZap(int, int)
public void waitForSuccessfulConnectionToZap(int timeoutInSeconds, int pollingIntervalInMs) throws ClientApiException
It attempts to establish a connection to ZAP's proxy, in the given time, throwing an exception if the connection is not successful. The connection attempts are done with the given polling interval.
timeoutInSeconds
- the (maximum) number of seconds to wait for ZAP to startpollingIntervalInMs
- the interval, in milliseconds, for connection pollingClientApiException
- if the timeout was reached or if the thread was interrupted while waiting.java.lang.IllegalArgumentException
- if the interval for connection polling is negative.waitForSuccessfulConnectionToZap(int)