Class QualysCSClient
java.lang.Object
com.qualys.plugins.containerSecurity.common.QualysClient.QualysCSClient
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionQualysCSClient(QualysAuth auth) QualysCSClient(QualysAuth auth, PrintStream stream) -
Method Summary
Modifier and TypeMethodDescriptiongetAbsoluteUrl(String path) protected StringgetAuthEndpoint(Map<String, String> apiMap) protected byte[]Human readable auth type used for logging.protected StringgetAuthUrl(Map<String, String> apiMap) Resolves the full URL used for token generation.protected byte[]Gateway base URL used for all Qualys API calls (same base as used by OAUTH).protected org.apache.http.impl.client.CloseableHttpClientgetImageDetails(String imageSha) protected byte[]Builds the client_credentials form body for the IDP (OIDC) token request.protected booleanvoidsetBuildContext(boolean buildContext) voidsetTimeout(int timeout) This method use to set connection timeout for http client.
-
Field Details
-
stream
-
timeout
protected int timeout
-
-
Constructor Details
-
QualysCSClient
-
QualysCSClient
-
-
Method Details
-
setBuildContext
public void setBuildContext(boolean buildContext) -
getImageDetails
-
getImages
public QualysCSResponse getImages(String imageSha, long nowMinusSeconds) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
testConnection
-
getAbsoluteUrl
- Throws:
MalformedURLException
-
getGatewayBaseUrl
Gateway base URL used for all Qualys API calls (same base as used by OAUTH). -
isOidcAuth
protected boolean isOidcAuth() -
getAuthTypeLabel
Human readable auth type used for logging. OIDC is surfaced as IDP. -
getAuthHeaders
- Throws:
UnsupportedEncodingException
-
getAuthUrl
Resolves the full URL used for token generation. BASIC/OAUTH use the Qualys gateway auth endpoints; IDP (OIDC) uses the external token URL.- Throws:
MalformedURLException
-
getAuthEndpoint
-
getAuthEntity
- Throws:
UnsupportedEncodingException
-
getOidcFormEncodedEntity
Builds the client_credentials form body for the IDP (OIDC) token request.- Throws:
UnsupportedEncodingException
-
getBasicAuthJWTEncodedEntity
- Throws:
UnsupportedEncodingException
-
getHttpClient
protected org.apache.http.impl.client.CloseableHttpClient getHttpClient() -
setTimeout
public void setTimeout(int timeout) This method use to set connection timeout for http client.- Parameters:
timeout- - int - in secs
-