|
| 1 | +/* |
| 2 | + * Copyright © 2022 Docker, Inc. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
1 | 17 | package types |
2 | 18 |
|
3 | 19 | type BaseImage struct { |
@@ -48,3 +64,31 @@ type BaseImagesByDiffIdsQuery struct { |
48 | 64 | type ImageByDigestQuery struct { |
49 | 65 | ImageDetailsByDigest BaseImage `graphql:"imageDetailsByDigest(context: {}, digest: $digest, platform: {os: $os, architecture: $architecture, variant: $variant})"` |
50 | 66 | } |
| 67 | + |
| 68 | +type Vulnerability struct { |
| 69 | + Source string `graphql:"source" json:"source,omitempty"` |
| 70 | + SourceId string `graphql:"sourceId" json:"source_id,omitempty"` |
| 71 | + Description string `graphql:"description" json:"description,omitempty"` |
| 72 | + VulnerableRange string `graphql:"vulnerableRange" json:"vulnerable_range,omitempty"` |
| 73 | + FixedBy string `graphql:"fixedBy" json:"fixed_by,omitempty"` |
| 74 | + Url string `graphql:"url" json:"url,omitempty"` |
| 75 | + Cvss struct { |
| 76 | + Score float32 `graphql:"score" json:"score,omitempty"` |
| 77 | + Severity string `graphql:"severity" json:"severity,omitempty"` |
| 78 | + Vector string `graphql:"vector" json:"vector,omitempty"` |
| 79 | + Version string `graphql:"version" json:"version,omitempty"` |
| 80 | + } `graphql:"cvss" json:"cvss,omitempty"` |
| 81 | + Cwes []struct { |
| 82 | + CweId string `graphql:"cweId" json:"cwe_id,omitempty"` |
| 83 | + Name string `graphql:"description" json:"name,omitempty"` |
| 84 | + } `graphql:"cwes" json:"cwes,omitempty"` |
| 85 | +} |
| 86 | + |
| 87 | +type VulnerabilitiesByPurl struct { |
| 88 | + Purl string `graphql:"purl" json:"purl,omitempty"` |
| 89 | + Vulnerabilities []Vulnerability `graphql:"vulnerabilities" json:"vulnerabilities,omitempty"` |
| 90 | +} |
| 91 | + |
| 92 | +type VulnerabilitiesByPurls struct { |
| 93 | + VulnerabilitiesByPackage []VulnerabilitiesByPurl `graphql:"vulnerabilitiesByPackage(context: {}, packageUrls: $purls)"` |
| 94 | +} |
0 commit comments