github.com/redhat-appstudio/e2e-tests@v0.0.0-20230619105049-9a422b2094d7/pkg/utils/release/sbom.go (about) 1 /* SBOM of type structures matches Pyxis structure 2 3 When SBOM components are uploaded to Pyxis, key names have to be modified 4 to conform to GraphQL naming conventions. 5 1. Use _ instead of camel case, e.g. camelCase -> camel_case 6 2. Use _ instead of -, e.g. key-with-dash -> key_with_dash 7 See https://github.com/redhat-appstudio/release-service-utils/blob/main/pyxis/upload_sbom.py 8 9 */ 10 11 package release 12 13 // Defines a struct Links with fields for various types of links including artifacts, requests, RPM manifests, 14 // test results, and vulnerabilities. Each field is represented by a corresponding struct type. 15 type Links struct { 16 Artifacts ArtifactLinks `json:"artifacts"` 17 Requests RequestLinks `json:"requests"` 18 RpmManifest RpmManifestLinks `json:"rpm_manifest"` 19 TestResults TestResultsLinks `json:"test_results"` 20 Vulnerabilities VulnerabilitiesLinks `json:"vulnerabilities"` 21 } 22 23 // Defines a struct ArtifactLinks with a single field Href for storing a link related to an artifact. 24 type ArtifactLinks struct { 25 Href string `json:"href"` 26 } 27 28 // Defines a struct RequestLinks with a single field Href for storing a link related to a request. 29 type RequestLinks struct { 30 Href string `json:"href"` 31 } 32 33 // Defines a struct RpmManifestLinks with a single field Href for storing a link to an RPM manifest. 34 type RpmManifestLinks struct { 35 Href string `json:"href"` 36 } 37 38 // Defines a struct TestResultsLinks with a single field Href for storing a link to test results. 39 type TestResultsLinks struct { 40 Href string `json:"href"` 41 } 42 43 // Defines a struct VulnerabilitiesLinks with a single field Href for storing a link. 44 type VulnerabilitiesLinks struct { 45 Href string `json:"href"` 46 } 47 48 // ContentManifest id of content manifest 49 type ContentManifest struct { 50 ID string `json:"_id"` 51 } 52 53 // ContentManifestComponent contains information of components in SBOM 54 type ContentManifestComponent struct { 55 ID string `json:"_id"` 56 Name string `json:"name"` 57 Purl string `json:"purl"` 58 Type string `json:"type"` 59 Version string `json:"version"` 60 } 61 62 // Defines a struct FreshnessGrade with fields for creation date, grade, and start date. 63 type FreshnessGrade struct { 64 CreationDate string `json:"creation_date"` 65 Grade string `json:"grade"` 66 StartDate string `json:"start_date"` 67 } 68 69 // ParsedData general details of env 70 type ParsedData struct { 71 Architecture string `json:"architecture"` 72 DockerVersion string `json:"docker_version"` 73 EnvVariables []string `json:"env_variables"` 74 } 75 76 // Defines a struct Image with various fields representing image properties and metadata. 77 // It includes fields for ID, links, architecture, certification status, content manifest, 78 // content manifest components, creator information, creation date, Docker image digest, 79 // freshness grades, image ID, last update date, last updated by, object type, and parsed data. 80 type Image struct { 81 ID string `json:"_id"` 82 Links Links `json:"_links"` 83 Architecture string `json:"architecture"` 84 Certified bool `json:"certified"` 85 ContentManifest ContentManifest `json:"content_manifest"` 86 ContentManifestComponents []ContentManifestComponent `json:"content_manifest_components"` 87 CreatedBy string `json:"created_by"` 88 CreatedOnBehalfOf interface{} `json:"created_on_behalf_of"` 89 CreationDate string `json:"creation_date"` 90 DockerImageDigest string `json:"docker_image_digest"` 91 FreshnessGrades []FreshnessGrade `json:"freshness_grades"` 92 ImageID string `json:"image_id"` 93 LastUpdateDate string `json:"last_update_date"` 94 LastUpdatedBy string `json:"last_updated_by"` 95 ObjectType string `json:"object_type"` 96 ParsedData ParsedData `json:"parsed_data"` 97 }