Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions devguard_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ type DevGuardTarget struct {
type DevGuardRequest struct {
Verb string `json:"verb"`
ProjectExternalEntityID string `json:"projectExternalEntityId"`
ProjectName string `json:"projectName"`
AssetExternalEntityID string `json:"assetExternalEntityId"`
AssetName string `json:"assetName"`
AssetVersion string `json:"assetVersion"`
Sbom json.RawMessage `json:"sbom,omitempty"`
}

type projectAssetsResponse struct {
ProjectExternalEntityID string `json:"projectExternalEntityId"`
ProjectName string `json:"projectName"`
Assets []struct {
AssetExternalEntityID string `json:"assetExternalEntityId"`
AssetName string `json:"assetName"`
Versions []string `json:"versions"`
} `json:"assets"`
}
Expand Down Expand Up @@ -101,7 +105,9 @@ func (g *DevGuardTarget) ProcessSbom(ctx *TargetContext) error {
payload := DevGuardRequest{
Verb: "update",
ProjectExternalEntityID: ctx.Pod.PodNamespace,
ProjectName: ctx.Pod.PodNamespace,
AssetExternalEntityID: assetName,
AssetName: assetName,
AssetVersion: version,
Sbom: json.RawMessage(ctx.Sbom),
}
Expand Down Expand Up @@ -143,7 +149,9 @@ func (g *DevGuardTarget) Remove(images []kubernetes.ImageInNamespace) error {
payload := DevGuardRequest{
Verb: "delete",
ProjectExternalEntityID: img.Namespace,
ProjectName: img.Namespace,
AssetExternalEntityID: name,
AssetName: name,
AssetVersion: version,
}

Expand Down
Loading