Class QualysCSClient
java.lang.Object
com.qualys.plugins.wasPlugin.QualysClient.QualysCSClient
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionQualysCSClient(QualysAuth auth) QualysCSClient(QualysAuth auth, PrintStream stream) -
Method Summary
Modifier and TypeMethodDescriptiongetAbsoluteUrl(String path) protected Stringprotected Stringprotected org.apache.http.impl.client.CloseableHttpClientgetScanDetails(String scanId) getScanResult(String scanId) getScanStatus(String scanId) getWebAppDetails(String webappId) launchWASScan(com.google.gson.JsonObject requestData) listAuthRecords(String xml) listOptionProfiles(String xml) listWebApps(String xml) protected StringsendGetRequest(org.apache.http.impl.client.CloseableHttpClient httpClient, String url, Map<String, String> headers) Executes a GET request using Apache HttpClient.protected StringsendPostRequest(org.apache.http.impl.client.CloseableHttpClient httpClient, String url, Map<String, String> headers, String body) Executes a POST request using Apache HttpClient.voidsetTimeout(int timeout) This method use to set connection timeout for http client.void
-
Field Details
-
apiMap
-
stream
-
timeout
protected int timeout
-
-
Constructor Details
-
QualysCSClient
-
QualysCSClient
-
-
Method Details
-
getScanResult
-
getScanDetails
-
getWebAppCount
-
getScanStatus
-
launchWASScan
-
getWebAppDetails
-
listWebApps
-
listOptionProfiles
-
listAuthRecords
-
getKbData
-
testConnection
- Throws:
Exception
-
getAbsoluteUrl
- Throws:
MalformedURLException
-
getBasicAuthHeader
-
getHttpClient
protected org.apache.http.impl.client.CloseableHttpClient getHttpClient() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException -
sendGetRequest
protected String sendGetRequest(org.apache.http.impl.client.CloseableHttpClient httpClient, String url, Map<String, String> headers) throws IOExceptionExecutes a GET request using Apache HttpClient.- Parameters:
httpClient- the HttpClient instanceurl- the target URLheaders- optional headers (can be null)- Returns:
- the response body as a String
- Throws:
IOException- if an error occurs during the request
-
sendPostRequest
protected String sendPostRequest(org.apache.http.impl.client.CloseableHttpClient httpClient, String url, Map<String, String> headers, String body) throws IOExceptionExecutes a POST request using Apache HttpClient.- Parameters:
httpClient- the HttpClient instanceurl- the target URLheaders- optional headers (can be null)body- the request body (JSON, form data, etc.)- Returns:
- the response body as a String
- Throws:
IOException- if an error occurs during the request
-
setTimeout
public void setTimeout(int timeout) This method use to set connection timeout for http client.- Parameters:
timeout- - int - in secs
-
getAuthorizationHeader
-
getOauthHeaders
-
getCommonHeaders
-
generateJwtTokenUsingClientIdAndClientSecret
-