Package co.ostorlab.ci.jenkins.utils
Class RequestHandler
- java.lang.Object
-
- co.ostorlab.ci.jenkins.utils.RequestHandler
-
public class RequestHandler extends Object
-
-
Constructor Summary
Constructors Constructor Description RequestHandler()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull String
check(String uri, Secret apiKey)
Check string.static @NotNull String
createTestCredential(String uri, List<Credentials> credential, Secret apiKey)
Call API to create Test credentials.static @NotNull String
getProgress(String uri, int scanId, Secret apiKey)
Get Scan Progress.static @NotNull String
getRisk(String uri, int scanId, Secret apiKey)
Get Scan Global risk.static @NotNull String
runRequest(String uri, Secret apiKey, String input)
Run request string.static @NotNull String
upload(String uri, Secret apiKey, String fileName, byte[] fileContent, String scanProfile, String platform, Integer scanCredential)
Upload string.
-
-
-
Method Detail
-
getProgress
@NotNull public static @NotNull String getProgress(String uri, int scanId, Secret apiKey) throws IOException
Get Scan Progress.- Parameters:
uri
- the uriscanId
- the scan idapiKey
- the api key- Returns:
- the string
- Throws:
IOException
- the io exception
-
getRisk
@NotNull public static @NotNull String getRisk(String uri, int scanId, Secret apiKey) throws IOException
Get Scan Global risk.- Parameters:
uri
- the uriscanId
- the scan idapiKey
- the api key- Returns:
- the string
- Throws:
IOException
- the io exception
-
check
@NotNull public static @NotNull String check(String uri, Secret apiKey) throws IOException
Check string.- Parameters:
uri
- the uriapiKey
- the api key- Returns:
- the string
- Throws:
IOException
- the io exception
-
runRequest
@NotNull public static @NotNull String runRequest(String uri, Secret apiKey, String input) throws IOException
Run request string.- Parameters:
uri
- the uriapiKey
- the api keyinput
- the input- Returns:
- the string
- Throws:
IOException
- the io exception
-
upload
@NotNull public static @NotNull String upload(String uri, Secret apiKey, String fileName, byte[] fileContent, String scanProfile, String platform, Integer scanCredential) throws IOException
Upload string.- Parameters:
uri
- the uriapiKey
- the api keyfileContent
- the filefileName
- the filescanProfile
- the scanProfileplatform
- the platform- Returns:
- the string
- Throws:
IOException
- the io exception
-
createTestCredential
@NotNull public static @NotNull String createTestCredential(String uri, List<Credentials> credential, Secret apiKey) throws IOException
Call API to create Test credentials.- Parameters:
uri
- The API urlcredential
- the list os credentials to addapiKey
- the api key to authenticate- Returns:
- the response string
- Throws:
IOException
- the io exception
-
-