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 Details

    • validateServerVersion

      void validateServerVersion(String minimalServerVersionRequired) throws IqClientException
      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 verify
      organizationId - 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 IqClientException
      Scans 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:
      ScanResult instance 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 ID
      stageId - the stage ID for evaluation
      scanResult - the scan result from a previous scan
      scanFolder - the base directory used during scanning
      jsonResultsFile - optional file to write JSON results to
      Returns:
      the policy evaluation result
      Throws:
      IqClientException - when communication with IQ Server cannot be performed