Interface IqClient
- All Known Implementing Classes:
DefaultIqClient
public interface IqClient
Slim IQ client interface for Gradle plugin - contains only methods used by NexusIqScanTask.
- Since:
- 1.0.1
-
Method Summary
Modifier and TypeMethodDescriptionevaluateApplication(String applicationId, String stageId, ScanResult scanResult, File scanFolder, File jsonResultsFile) Evaluates the scanned application and returns the policy evaluation result.getProprietaryConfigForApplicationEvaluation(String applicationId) Fetches the proprietary config for the given application.scan(String applicationId, ProprietaryConfig proprietaryConfig, Properties properties, List<File> scanTargets, File scanFolder, Map<String, String> envVars, Set<String> licensedFeatures, List<com.sonatype.insight.scan.module.model.Module> modules) Scans components found in the given lists of files and modules using Sonatype IQ Server.voidvalidateServerVersion(String minimalServerVersionRequired) Validates the minimal IQ Server version required.booleanverifyOrCreateApplication(String applicationPublicId, String organizationId) Verifies the applicationPublicId and if such an application does not exist and automatic application creation is enabled, then the method creates the new application under the given organization id and returns true to indicate the application will now be available.
-
Method Details
-
validateServerVersion
Validates the minimal IQ Server version required.- Parameters:
minimalServerVersionRequired- the minimal server version to validate against- Throws:
IqClientException- when communication with IQ Server cannot be performed
-
verifyOrCreateApplication
boolean verifyOrCreateApplication(String applicationPublicId, String organizationId) throws IqClientException Verifies the applicationPublicId and if such an application does not exist and automatic application creation is enabled, then the method creates the new application under the given organization id and returns true to indicate the application will now be available.- Parameters:
applicationPublicId- the application public ID to verifyorganizationId- the organization under which the app will be created- Returns:
- true to indicate the application is verified
- Throws:
IqClientException- when communication with IQ Server cannot be performed
-
getProprietaryConfigForApplicationEvaluation
ProprietaryConfig getProprietaryConfigForApplicationEvaluation(String applicationId) throws IqClientException Fetches the proprietary config for the given application.- Parameters:
applicationId- the application public ID- Returns:
- the proprietary configuration containing packages and regexes to exclude
- Throws:
IqClientException- when communication with IQ Server cannot be performed
-
scan
ScanResult scan(String applicationId, ProprietaryConfig proprietaryConfig, Properties properties, List<File> scanTargets, File scanFolder, Map<String, String> envVars, Set<String> licensedFeatures, List<com.sonatype.insight.scan.module.model.Module> modules) throws IqClientExceptionScans components found in the given lists of files and modules using Sonatype IQ Server.- Parameters:
applicationId- Public application ID from IQ Server.proprietaryConfig- Configuration to exclude known proprietary components.properties- Configuration properties for the scan.scanTargets- List of files to scan.scanFolder- Base directory of the project or binary being scanned.envVars- Environmental variables for the scan.licensedFeatures- IQ licensed features.modules- List of modules to scan.- Returns:
ScanResultinstance with the scan results.- Throws:
IqClientException- If there is an error during the scan process.
-
evaluateApplication
ApplicationPolicyEvaluation evaluateApplication(String applicationId, String stageId, ScanResult scanResult, File scanFolder, File jsonResultsFile) throws IqClientException Evaluates the scanned application and returns the policy evaluation result.- Parameters:
applicationId- the application public IDstageId- the stage ID for evaluationscanResult- the scan result from a previous scanscanFolder- the base directory used during scanningjsonResultsFile- optional file to write JSON results to- Returns:
- the policy evaluation result
- Throws:
IqClientException- when communication with IQ Server cannot be performed
-