package com.redhat.pctsec.model; import com.redhat.pctsec.tekton.brewTaskRun; import com.redhat.pctsec.tekton.scmUrlPipelineRun; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.inject.Singleton; import java.util.HashMap; @ApplicationScoped public class Scan { private HashMap metadata; private HashMap oshScanOptions; private String brewBuild; private HashMap scmurl; @Inject brewTaskRun btr; @Inject scmUrlPipelineRun plr; public Scan(String brewBuildId) { this.brewBuild = brewBuildId; } public Scan(String repo, String ref) { 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); } } }