Class FodApiConnection
- java.lang.Object
-
- org.jenkinsci.plugins.fodupload.FodApi.FodApiConnection
-
public class FodApiConnection extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_SIZE
-
Constructor Summary
Constructors Constructor Description FodApiConnection(String id, String secret, String baseUrl, String apiUrl, FodEnums.GrantType grantType, String scope, boolean executeOnRemoteAgent, Launcher launcher, PrintStream logger)
Constructor that encapsulates the apiConnection
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getApiUrl()
String
getBaseUrl()
DastScanPayloadUpload
getDastScanPayloadUploadInstance(FilePath uploadFile, String releaseId, String apiUri, String correlationId, PrintStream logger)
String
getId()
ScanPayloadUpload
getScanPayloadUploadInstance(SastJobModel uploadRequest, String correlationId, String fragUrl, PrintStream logger)
String
getSecret()
<T> T
parseResponse(ResponseContent response, Type t)
ResponseContent
request(okhttp3.Request request)
ResponseContent
request(HttpRequest request)
<T> T
requestTyped(okhttp3.Request request, Type t)
<T> T
requestTyped(HttpRequest request, Type t)
void
retireToken()
Retire the current token.String
testConnection()
okhttp3.HttpUrl.Builder
urlBuilder()
-
-
-
Field Detail
-
MAX_SIZE
public static final int MAX_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FodApiConnection
public FodApiConnection(String id, String secret, String baseUrl, String apiUrl, FodEnums.GrantType grantType, String scope, boolean executeOnRemoteAgent, Launcher launcher, PrintStream logger)
Constructor that encapsulates the apiConnection- Parameters:
id
- apiConnection idsecret
- apiConnection secretbaseUrl
- apiConnection baseUrl
-
-
Method Detail
-
retireToken
public void retireToken() throws IOException
Retire the current token. Unclear if this actually does anything on the backend.- Throws:
IOException
-
testConnection
public String testConnection() throws IOException
- Throws:
IOException
-
getId
public String getId()
-
getSecret
public String getSecret()
-
getBaseUrl
public String getBaseUrl()
-
getApiUrl
public String getApiUrl()
-
urlBuilder
public okhttp3.HttpUrl.Builder urlBuilder()
-
request
public ResponseContent request(okhttp3.Request request) throws IOException
- Throws:
IOException
-
request
public ResponseContent request(HttpRequest request) throws IOException
- Throws:
IOException
-
requestTyped
public <T> T requestTyped(okhttp3.Request request, Type t) throws IOException
- Throws:
IOException
-
requestTyped
public <T> T requestTyped(HttpRequest request, Type t) throws IOException
- Throws:
IOException
-
parseResponse
public <T> T parseResponse(ResponseContent response, Type t) throws IOException
- Throws:
IOException
-
getScanPayloadUploadInstance
public ScanPayloadUpload getScanPayloadUploadInstance(SastJobModel uploadRequest, String correlationId, String fragUrl, PrintStream logger) throws IOException
- Throws:
IOException
-
getDastScanPayloadUploadInstance
public DastScanPayloadUpload getDastScanPayloadUploadInstance(FilePath uploadFile, String releaseId, String apiUri, String correlationId, PrintStream logger) throws IOException
- Throws:
IOException
-
-