Compare commits
6 Commits
refactor
...
18-scancha
| Author | SHA1 | Date |
|---|---|---|
|
|
2fb746abae | 3 years ago |
|
|
9e175ca403 | 3 years ago |
|
|
bad8b847ec | 3 years ago |
|
|
87f45b8329 | 3 years ago |
|
|
c7bd13c3ac | 3 years ago |
|
|
421dce3b6c | 3 years ago |
11 changed files with 197 additions and 7 deletions
@ -1,4 +1,35 @@ |
|||||||
package com.redhat.pctsec.model.api.request; |
package com.redhat.pctsec.model.api.request; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||||
|
import com.fasterxml.jackson.annotation.JsonPropertyDescription; |
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
||||||
|
import jakarta.validation.Valid; |
||||||
|
import jakarta.validation.constraints.NotNull; |
||||||
|
import jakarta.validation.constraints.Size; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Set; |
||||||
|
|
||||||
|
|
||||||
public class scanChain { |
public class scanChain { |
||||||
|
|
||||||
|
@JsonProperty("product_name") |
||||||
|
@JsonPropertyDescription("The product name associated with the scan.") |
||||||
|
@NotNull |
||||||
|
public String productName; |
||||||
|
|
||||||
|
@JsonProperty("urls") |
||||||
|
@JsonDeserialize(as = java.util.LinkedHashSet.class) |
||||||
|
@JsonPropertyDescription("List of source urls to be scanned") |
||||||
|
@Size(min = 1) |
||||||
|
@Valid |
||||||
|
@NotNull |
||||||
|
public Set<scanChainGit> urls; |
||||||
|
|
||||||
|
@JsonProperty("requestor") |
||||||
|
@JsonPropertyDescription("The requesting user") |
||||||
|
@NotNull |
||||||
|
public String requestor; |
||||||
} |
} |
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,34 @@ |
|||||||
|
package com.redhat.pctsec.model.api.request; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||||
|
import jakarta.validation.constraints.NotNull; |
||||||
|
|
||||||
|
import java.net.URI; |
||||||
|
|
||||||
|
|
||||||
|
public class scanChainGit { |
||||||
|
|
||||||
|
|
||||||
|
private URI repo; |
||||||
|
private String ref; |
||||||
|
public scanChainGit(@NotNull URI repo, @NotNull String ref) { |
||||||
|
this.repo = repo; |
||||||
|
this.ref = ref; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@NotNull |
||||||
|
@JsonProperty("url") |
||||||
|
public URI getRepo() { |
||||||
|
return this.repo; |
||||||
|
} |
||||||
|
|
||||||
|
@NotNull |
||||||
|
@JsonProperty("branch") |
||||||
|
public String getRef() { |
||||||
|
|
||||||
|
return this.ref; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,12 @@ |
|||||||
|
package com.redhat.pctsec.model.api.service; |
||||||
|
import jakarta.ws.rs.*; |
||||||
|
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; |
||||||
|
import org.jboss.pnc.dto.Build; |
||||||
|
|
||||||
|
@Path("pnc-rest/v2/builds") |
||||||
|
@RegisterRestClient |
||||||
|
public interface AltPncService { |
||||||
|
@GET |
||||||
|
@Path("{id}") |
||||||
|
Build getBuild(@PathParam("id") String id); |
||||||
|
} |
||||||
@ -0,0 +1,19 @@ |
|||||||
|
package com.redhat.pctsec.model.test; |
||||||
|
|
||||||
|
import com.redhat.pctsec.model.PNCBuild; |
||||||
|
import io.quarkus.test.junit.QuarkusTest; |
||||||
|
import jakarta.inject.Inject; |
||||||
|
import org.junit.jupiter.api.Test; |
||||||
|
|
||||||
|
@QuarkusTest |
||||||
|
public class PNCBuildTest { |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Test |
||||||
|
public void testBuildFetch(){ |
||||||
|
PNCBuild pb = new PNCBuild("AZAQZSPFDRQAA"); |
||||||
|
System.out.println(pb.SCMURL()); |
||||||
|
System.out.println(pb.revision()); |
||||||
|
} |
||||||
|
} |
||||||
@ -1,5 +1,6 @@ |
|||||||
package com.redhat.pctsec.model.osh; |
package com.redhat.pctsec.model.test; |
||||||
|
|
||||||
|
import com.redhat.pctsec.model.osh.paramMapper; |
||||||
import io.quarkus.test.junit.QuarkusTest; |
import io.quarkus.test.junit.QuarkusTest; |
||||||
import jakarta.inject.Inject; |
import jakarta.inject.Inject; |
||||||
import org.junit.jupiter.api.Test; |
import org.junit.jupiter.api.Test; |
||||||
Loading…
Reference in new issue