|
|
|
|
@ -2,7 +2,6 @@ package com.redhat.pctsec.rest.v1alpha1;
|
|
|
|
|
|
|
|
|
|
import com.redhat.pctsec.model.*; |
|
|
|
|
import com.redhat.pctsec.model.api.request.pssaas; |
|
|
|
|
import com.redhat.pctsec.model.api.request.scanChain; |
|
|
|
|
import com.redhat.pctsec.model.jpa.ScanRepository; |
|
|
|
|
import io.quarkus.security.Authenticated; |
|
|
|
|
import io.vertx.mutiny.core.eventbus.EventBus; |
|
|
|
|
@ -13,7 +12,6 @@ import jakarta.validation.Valid;
|
|
|
|
|
import jakarta.ws.rs.*; |
|
|
|
|
import org.jboss.resteasy.reactive.RestQuery; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Set; |
|
|
|
|
@ -39,7 +37,6 @@ public class ScanResource {
|
|
|
|
|
ScanRequests scanRequests = new ScanRequests(scanRequest); |
|
|
|
|
Scan s = new Scan(); |
|
|
|
|
s.setRequestor("cpaas"); |
|
|
|
|
s.setProductName(scanRequest.productId); |
|
|
|
|
s.setScanRequests(scanRequests); |
|
|
|
|
sr.persist(s); |
|
|
|
|
return s; |
|
|
|
|
@ -55,31 +52,6 @@ public class ScanResource {
|
|
|
|
|
return s.scanRequests.execute(bus); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@POST |
|
|
|
|
@Path("ScanChain") |
|
|
|
|
@Consumes({ "application/json" }) |
|
|
|
|
@Transactional |
|
|
|
|
@Authenticated |
|
|
|
|
public Scan createScanChain(@Valid scanChain scanRequest) |
|
|
|
|
{ |
|
|
|
|
ScanRequests scanRequests = new ScanRequests(scanRequest); |
|
|
|
|
Scan s = new Scan(); |
|
|
|
|
s.setRequestor(scanRequest.requestor); |
|
|
|
|
s.setProductName(scanRequest.productName); |
|
|
|
|
s.setScanRequests(scanRequests); |
|
|
|
|
sr.persist(s); |
|
|
|
|
return s; |
|
|
|
|
} |
|
|
|
|
@POST |
|
|
|
|
@Path("ScanChain/run") |
|
|
|
|
@Consumes({ "application/json" }) |
|
|
|
|
@Transactional |
|
|
|
|
@Authenticated |
|
|
|
|
public List<ScanTask> createRunScanChain(@Valid scanChain scanRequest) |
|
|
|
|
{ |
|
|
|
|
Scan s = this.createScanChain(scanRequest); |
|
|
|
|
return s.scanRequests.execute(bus); |
|
|
|
|
} |
|
|
|
|
@GET |
|
|
|
|
@Path("All") |
|
|
|
|
@Produces({"application/json"}) |
|
|
|
|
|