Browse Source
We will use an eventbus to listen for "executed"/triggered ScanRequests and respond with tekton runID to check up on laterrefactor_future_hack
16 changed files with 191 additions and 82 deletions
@ -1,16 +0,0 @@ |
|||||||
package com.redhat.pctsec; |
|
||||||
|
|
||||||
import jakarta.ws.rs.GET; |
|
||||||
import jakarta.ws.rs.Path; |
|
||||||
import jakarta.ws.rs.Produces; |
|
||||||
import jakarta.ws.rs.core.MediaType; |
|
||||||
|
|
||||||
@Path("/hello") |
|
||||||
public class GreetingResource { |
|
||||||
|
|
||||||
@GET |
|
||||||
@Produces(MediaType.TEXT_PLAIN) |
|
||||||
public String hello() { |
|
||||||
return "Hello from RESTEasy Reactive"; |
|
||||||
} |
|
||||||
} |
|
||||||
@ -0,0 +1,21 @@ |
|||||||
|
package com.redhat.pctsec.model; |
||||||
|
|
||||||
|
import java.net.URI; |
||||||
|
import java.net.URL; |
||||||
|
|
||||||
|
public class BrewBuild extends BuildType { |
||||||
|
|
||||||
|
public BrewBuild(String buildRef) { |
||||||
|
super(buildRef); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public URI SCMURL() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public URL URL() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,28 @@ |
|||||||
|
package com.redhat.pctsec.model; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||||
|
import jakarta.persistence.Column; |
||||||
|
import jakarta.persistence.GeneratedValue; |
||||||
|
import jakarta.persistence.GenerationType; |
||||||
|
import jakarta.persistence.Id; |
||||||
|
|
||||||
|
import java.net.URI; |
||||||
|
import java.net.URL; |
||||||
|
|
||||||
|
abstract public class BuildType { |
||||||
|
@Id |
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
@JsonProperty() |
||||||
|
@Column(name="buildref") |
||||||
|
private String buildRef; |
||||||
|
|
||||||
|
public BuildType(String buildRef) |
||||||
|
{ |
||||||
|
this.buildRef = buildRef; |
||||||
|
} |
||||||
|
|
||||||
|
abstract public URI SCMURL(void); |
||||||
|
abstract public URL URL(void); |
||||||
|
} |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
package com.redhat.pctsec.model; |
||||||
|
|
||||||
|
import java.net.URI; |
||||||
|
import java.net.URL; |
||||||
|
|
||||||
|
public class PNCBuild extends BuildType{ |
||||||
|
public PNCBuild(String buildRef) { |
||||||
|
super(buildRef); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public URI SCMURL() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public URL URL() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,44 @@ |
|||||||
|
package com.redhat.pctsec.model; |
||||||
|
|
||||||
|
import jakarta.persistence.*; |
||||||
|
import jakarta.validation.constraints.Email; |
||||||
|
import jakarta.validation.constraints.NotNull; |
||||||
|
|
||||||
|
import java.util.Calendar; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
enum ScanState { |
||||||
|
CREATED, TRIGGERED, RUNNING, SUCCESS, FAIL; |
||||||
|
} |
||||||
|
@Entity |
||||||
|
public class Scan { |
||||||
|
|
||||||
|
@Id |
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
@OneToOne |
||||||
|
@NotNull |
||||||
|
@JoinColumn(name = "product_id", referencedColumnName = "id") |
||||||
|
private String productName; |
||||||
|
|
||||||
|
@Temporal(TemporalType.TIMESTAMP) |
||||||
|
@Column(name="creation_timestamp") |
||||||
|
private Calendar creationTimestamp; |
||||||
|
|
||||||
|
@Column(name="state") |
||||||
|
@Enumerated(EnumType.STRING) |
||||||
|
private ScanState state; |
||||||
|
|
||||||
|
@Column(name="requestor") |
||||||
|
@NotNull |
||||||
|
private String requestor; |
||||||
|
|
||||||
|
@Column(name="report_email") |
||||||
|
@Email |
||||||
|
private String email; |
||||||
|
|
||||||
|
@OneToOne |
||||||
|
@JoinColumn(name = "scan_requests_id", referencedColumnName = "id") |
||||||
|
private ScanRequests scanRequests; |
||||||
|
} |
||||||
@ -0,0 +1,25 @@ |
|||||||
|
package com.redhat.pctsec.model.api.request; |
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude; |
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||||
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
||||||
|
import jakarta.validation.constraints.NotNull; |
||||||
|
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL) |
||||||
|
@JsonPropertyOrder({ |
||||||
|
"type", |
||||||
|
"build-id" |
||||||
|
}) |
||||||
|
public class build { |
||||||
|
@NotNull |
||||||
|
@JsonProperty("type") |
||||||
|
public final String type; |
||||||
|
|
||||||
|
@NotNull |
||||||
|
@JsonProperty("build-id") |
||||||
|
public final String buildId; |
||||||
|
|
||||||
|
public build(@NotNull String type, @NotNull String buildId) { |
||||||
|
this.type = type; |
||||||
|
this.buildId = buildId; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,4 @@ |
|||||||
|
package com.redhat.pctsec.model.api.request; |
||||||
|
|
||||||
|
public class scanChain { |
||||||
|
} |
||||||
@ -1,30 +0,0 @@ |
|||||||
package com.redhat.pctsec.model; |
|
||||||
import java.util.LinkedHashMap; |
|
||||||
import java.util.Map; |
|
||||||
import java.util.Set; |
|
||||||
import com.fasterxml.jackson.annotation.JsonAnyGetter; |
|
||||||
import com.fasterxml.jackson.annotation.JsonAnySetter; |
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude; |
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty; |
|
||||||
import com.fasterxml.jackson.annotation.JsonPropertyDescription; |
|
||||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
|
||||||
import jakarta.validation.Valid; |
|
||||||
import jakarta.validation.constraints.NotNull; |
|
||||||
import jakarta.validation.constraints.Size; |
|
||||||
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL) |
|
||||||
@JsonPropertyOrder({ |
|
||||||
"type", |
|
||||||
"build-id" |
|
||||||
}) |
|
||||||
public class build { |
|
||||||
@NotNull |
|
||||||
@JsonProperty("type") |
|
||||||
public String type; |
|
||||||
|
|
||||||
@NotNull |
|
||||||
@JsonProperty("build-id") |
|
||||||
public String buildId; |
|
||||||
} |
|
||||||
@ -0,0 +1,7 @@ |
|||||||
|
package com.redhat.pctsec.model.osh; |
||||||
|
import picocli.CommandLine.Option; |
||||||
|
import picocli.CommandLine.Parameters; |
||||||
|
|
||||||
|
public class paramMapper { |
||||||
|
|
||||||
|
} |
||||||
@ -1,4 +0,0 @@ |
|||||||
package com.redhat.pctsec.model; |
|
||||||
|
|
||||||
public class scanChain { |
|
||||||
} |
|
||||||
Loading…
Reference in new issue