transformer

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdvisoryCreateRequestToModel added in v1.10.0

func AdvisoryCreateRequestToModel(c dtos.AdvisoryCreate) models.Advisory

func AdvisoryUpdateRequestToModel added in v1.10.0

func AdvisoryUpdateRequestToModel(c dtos.AdvisoryUpdate, advisory models.Advisory) models.Advisory

func AffectedComponentToDTO added in v1.0.1

func AffectedComponentToDTO(ac models.AffectedComponent) dtos.AffectedComponentDTO

func AffectedComponentsFromOSV

func AffectedComponentsFromOSV(osv *dtos.OSV) []models.AffectedComponent

func AffectedPackageToModel added in v1.10.0

func AffectedPackageToModel(c dtos.AffectedPackage) models.AffectedPackage

func ApplyAssetPatchRequestToModel

func ApplyAssetPatchRequestToModel(assetPatch dtos.AssetPatchRequest, asset *models.Asset) bool

func ApplyOrgPatchRequestToModel

func ApplyOrgPatchRequestToModel(p dtos.OrgPatchRequest, org *models.Org) bool

func ApplyProjectPatchRequestToModel

func ApplyProjectPatchRequestToModel(projectPatch dtos.ProjectPatchRequest, project *models.Project) bool

func ApplyReleasePatchRequestToModel

func ApplyReleasePatchRequestToModel(r dtos.ReleasePatchRequest, rel *models.Release)

func ArtifactModelToDTO

func ArtifactModelToDTO(artifact models.Artifact) dtos.ArtifactDTO

func ArtifactRiskHistoryToDTO

func ArtifactRiskHistoryToDTO(history models.ArtifactRiskHistory) dtos.RiskHistoryDTO

func AssetCreateRequestToModel

func AssetCreateRequestToModel(assetCreateRequest dtos.AssetCreateRequest, projectID uuid.UUID) models.Asset

func AssetModelToDTO

func AssetModelToDTO(asset models.Asset) dtos.AssetDTO

func AssetModelToDetailsDTO

func AssetModelToDetailsDTO(asset models.Asset, members []dtos.UserDTO) dtos.AssetDetailsDTO

func AssetModelToDetailsWithSecretsDTO

func AssetModelToDetailsWithSecretsDTO(asset models.Asset, members []dtos.UserDTO) dtos.AssetDetailsWithSecretsDTO

func AssetModelsToDTOs

func AssetModelsToDTOs(assets []models.Asset) []dtos.AssetDTO

func AssetVersionModelToDTO

func AssetVersionModelToDTO(assetVersion models.AssetVersion) dtos.AssetVersionDTO

func BuildArtifactIndex added in v1.8.0

func BuildArtifactIndex(artifacts []models.Artifact) map[uuid.UUID]map[string][]string

func BuildAssetEntries added in v1.8.0

func BuildAssetEntries(assets []models.Asset, versionsByAssetID map[uuid.UUID][]models.AssetVersion, artifactIndex map[uuid.UUID]map[string][]string) []dtos.AssetEntryDTO

func BuildExternalProjectTree added in v1.8.0

func BuildExternalProjectTree(
	projects []models.Project,
	subProjects []models.Project,
	assets []models.Asset,
	assetVersions []models.AssetVersion,
	artifacts []models.Artifact,
) []dtos.ProjectExternalEntityTree

func CSAFVEXToRules added in v1.9.0

func CSAFVEXToRules(advisory *gocsaf.Advisory, assetID uuid.UUID, assetVersionName string, source string) ([]models.VEXRule, error)

CSAFVEXToRules converts a CSAF advisory into VEX rules.

CSAF is path-granular: DevGuard encodes each dependency path as a chain of nested default_component_of relationships (artifact <- p1 <- ... <- vulnerable component). The leaf product of each chain is what a ProductStatus bucket references. This function walks that chain back to reconstruct the exact component-only path and turns it into a (non-wildcard) VEX rule path pattern, so only the path-specific vuln is affected.

func CVEToDTO

func CVEToDTO(cve models.CVE) dtos.CVEDTO

func ComplianceComponentToDTO added in v1.10.0

func ComplianceComponentToDTO(m models.ComplianceComponent) dtos.ComplianceComponentDTO

func ComplianceComponentToDetailsDTO added in v1.10.0

func ComplianceComponentToDetailsDTO(m models.ComplianceComponent) dtos.ComplianceComponentDetailsDTO

func CompliancePostureToDTO added in v1.10.0

func ComponentModelToDTO

func ComponentModelToDTO(m models.Component) dtos.ComponentDTO

func ConvertCompliancePosturesToSystemSecurityPlanOSCAL added in v1.10.0

func ConvertCompliancePosturesToSystemSecurityPlanOSCAL(compliancePostures []dtos.CompliancePostureWithDetailsDTO, frameworkControls []models.FrameworkControl) (oscalTypes.OscalCompleteSchema, error)

func ConvertVulnEventDetailToDto added in v1.3.0

func ConvertVulnEventDetailToDto(e models.VulnEventDetail) dtos.VulnEventDTO

func ConvertVulnEventToDto

func ConvertVulnEventToDto(event models.VulnEvent) dtos.VulnEventDTO

func ConvertVulnEventsToDtos

func ConvertVulnEventsToDtos(events []models.VulnEventDetail) []dtos.VulnEventDTO

func CycloneDXVEXToRules added in v1.9.0

func CycloneDXVEXToRules(bom *cdx.BOM, assetID uuid.UUID, assetVersionName string, source string) ([]models.VEXRule, error)

CycloneDXVEXToRules converts the vulnerabilities of a CycloneDX VEX BOM into VEX rules.

CycloneDX is component-level: Affects[].Ref only carries the vulnerable component PURL, so unless the BOM carries an explicit devguard:pathPattern property (which DevGuard adds for vulns it has already matched to a rule), the reconstructed path pattern is a component-level wildcard that matches every path reaching that component.

func DependencyVulnToDetailedDTO

func DependencyVulnToDetailedDTO(dependencyVuln models.DependencyVuln) dtos.DetailedDependencyVulnDTO

func ExploitModelToDTO

func ExploitModelToDTO(exploit models.Exploit) dtos.ExploitDTO

func FirstPartyVulnDTOToModel added in v1.7.0

func FirstPartyVulnDTOToModel(v dtos.FirstPartyVulnDTO) models.FirstPartyVuln

func FromJSONSnippetContents

func FromJSONSnippetContents(firstPartyVuln models.FirstPartyVuln) (dtos.SnippetContents, error)

func LicenseRiskToDTO

func LicenseRiskToDTO(f models.LicenseRisk) dtos.LicenseRiskDTO

func MaliciousAffectedComponentFromOSV

func MaliciousAffectedComponentFromOSV(osv *dtos.OSV, maliciousPackageID string) []models.MaliciousAffectedComponent

MaliciousAffectedComponentFromOSV converts OSV data to MaliciousAffectedComponent entries

func OSVToCVE

func OSVToCVE(osv *dtos.OSV) models.CVE

func OSVToCVERelationships

func OSVToCVERelationships(osv *dtos.OSV) []models.CVERelationship

need Optimus Prime here

func OpenVEXToRules added in v1.9.0

func OpenVEXToRules(doc *vex.VEX, assetID uuid.UUID, assetVersionName string, source string) ([]models.VEXRule, error)

OpenVEXToRules converts an OpenVEX document into VEX rules.

OpenVEX is component-level: it identifies the vulnerable package by the statement's subcomponent PURL (or the product PURL when no subcomponent is given). The resulting path pattern is therefore a component-level wildcard ["*", componentPurl] that matches any path reaching that component - it does not distinguish individual dependency paths.

func OrgCreateRequestToModel

func OrgCreateRequestToModel(c dtos.OrgCreateRequest) models.Org

func OrgDTOFromModel

func OrgDTOFromModel(org models.Org) dtos.OrgDTO

func OrgSettingsDTOFromModel added in v1.4.0

func OrgSettingsDTOFromModel(org models.Org, members []dtos.UserDTO) dtos.OrgSettingsDTO

func PATModelToDTO added in v1.6.0

func PATModelToDTO(pat models.PAT) dtos.PATDTO

func ProjectCreateRequestToModel

func ProjectCreateRequestToModel(projectCreate dtos.ProjectCreateRequest) models.Project

func ProjectModelToDTO

func ProjectModelToDTO(project models.Project) dtos.ProjectDTO

func RelationshipToDTO

func RelationshipToDTO(relation models.CVERelationship) dtos.RelationshipDTO

func ReleaseCreateRequestToModel

func ReleaseCreateRequestToModel(r dtos.ReleaseCreateRequest, projectID uuid.UUID) models.Release

func ReleaseItemToDTO

func ReleaseItemToDTO(i models.ReleaseItem) dtos.ReleaseItemDTO

func ReleaseToDTO

func ReleaseToDTO(r models.Release) dtos.ReleaseDTO

func SnippetContentsToJSON

func SnippetContentsToJSON(s dtos.SnippetContents) (databasetypes.JSONB, error)

func TransformPackagistToDepsDev added in v1.5.0

func TransformPackagistToDepsDev(
	packagistResponse dtos.PackagistPackageResponse, packageKey string, packageVersion string,
) (dtos.OpenSourceInsightsVersionResponse, error)

func VEXRuleToDTOWithCount

func VEXRuleToDTOWithCount(rule models.VEXRule, appliesToCount int) dtos.VEXRuleDTO

func VEXRuleToRecommendationDTO added in v1.4.0

func VEXRuleToRecommendationDTO(rule models.VEXRule) dtos.VexRuleRecommendation

func VulnInPackageToDTO added in v1.0.1

func VulnInPackageToDTO(vuln models.VulnInPackage) dtos.VulnInPackageDTO

func VulnInPackageToDependencyVulns

func VulnInPackageToDependencyVulns(vuln models.VulnInPackage, sbom *normalize.SBOMGraph, assetID uuid.UUID, assetVersionName string, artifactName string) []models.DependencyVuln

VulnInPackageToDependencyVulns converts a vulnerability to multiple DependencyVuln objects, one for each unique path through the dependency graph. This ensures that the same CVE appearing through different dependency paths (e.g., A -> trivy -> stdlib vs A -> cosign -> stdlib) creates separate vulnerability records.

func VulnInPackageToDependencyVulnsWithoutArtifact

func VulnInPackageToDependencyVulnsWithoutArtifact(vuln models.VulnInPackage, sbom *normalize.SBOMGraph, assetID uuid.UUID, assetVersionName string) []models.DependencyVuln

VulnInPackageToDependencyVulnsWithoutArtifact converts a vulnerability to multiple DependencyVuln objects based on all paths through the dependency graph.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL