|
|
|
@ -2,40 +2,20 @@ package com.redhat.pctsec.model; |
|
|
|
|
|
|
|
|
|
|
|
import com.redhat.pctsec.tekton.brewTaskRun; |
|
|
|
import com.redhat.pctsec.tekton.brewTaskRun; |
|
|
|
import com.redhat.pctsec.tekton.scmUrlPipelineRun; |
|
|
|
import com.redhat.pctsec.tekton.scmUrlPipelineRun; |
|
|
|
|
|
|
|
import io.vertx.mutiny.core.eventbus.EventBus; |
|
|
|
import jakarta.enterprise.context.ApplicationScoped; |
|
|
|
import jakarta.enterprise.context.ApplicationScoped; |
|
|
|
import jakarta.inject.Inject; |
|
|
|
import jakarta.inject.Inject; |
|
|
|
import jakarta.inject.Singleton; |
|
|
|
import jakarta.inject.Singleton; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
@ApplicationScoped |
|
|
|
@ApplicationScoped |
|
|
|
public class ScanRequest { |
|
|
|
abstract public class ScanRequest { |
|
|
|
|
|
|
|
|
|
|
|
private HashMap<String, String> metadata; |
|
|
|
|
|
|
|
private HashMap<String, String> oshScanOptions; |
|
|
|
|
|
|
|
private String brewBuild; |
|
|
|
|
|
|
|
private HashMap<String, String> scmurl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Inject |
|
|
|
@Inject |
|
|
|
brewTaskRun btr; |
|
|
|
EventBus bus; |
|
|
|
|
|
|
|
|
|
|
|
@Inject |
|
|
|
private HashMap<String, String> metadata; |
|
|
|
scmUrlPipelineRun plr; |
|
|
|
private HashMap<String, String> oshScanOptions; |
|
|
|
|
|
|
|
|
|
|
|
public ScanRequest(String brewBuildId) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
this.brewBuild = brewBuildId; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ScanRequest(String repo, String ref) |
|
|
|
public abstract void executeScan(); |
|
|
|
{ |
|
|
|
|
|
|
|
this.scmurl = new HashMap<>(); |
|
|
|
|
|
|
|
this.scmurl.put("repo", repo); |
|
|
|
|
|
|
|
this.scmurl.put("ref", repo); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void executeScan(){ |
|
|
|
|
|
|
|
if(this.brewBuild != null && !this.brewBuild.trim().isEmpty()){ |
|
|
|
|
|
|
|
//btr = new brewTaskRun();
|
|
|
|
|
|
|
|
btr.invokeScanTask(this.brewBuild); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|