0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2025-01-20 22:52:51 -05:00
zot/pkg/extensions/search/schema.graphql
Andrei Aaron e0d808b196
Include image vulnerability information in ImageSummary (#798)
Return this data as part of GlobalSearch and RepoListWithNewestImage
query results.
This commit also includes refactoring of the CVE scanning logic in
order to better encapsulate trivy specific logic, remove CVE scanning
logic from the graphql resolver.

Signed-off-by: Andrei Aaron <andaaron@cisco.com>
2022-09-28 11:39:54 -07:00

128 lines
No EOL
2.9 KiB
GraphQL

scalar Time
type CVEResultForImage {
Tag: String
CVEList: [CVE]
}
type CVE {
Id: String
Title: String
Description: String
Severity: String
PackageList: [PackageInfo]
}
type PackageInfo {
Name: String
InstalledVersion: String
FixedVersion: String
}
type RepoInfo {
Images: [ImageSummary]
Summary: RepoSummary
}
# Search results in all repos/images/layers
# There will be other more structures for more detailed information
type GlobalSearchResult {
Images: [ImageSummary]
Repos: [RepoSummary]
Layers: [LayerSummary]
}
# Brief on a specific image to be used in queries returning a list of images
# We define an image as a pairing or a repo and a tag belonging to that repo
type ImageSummary {
RepoName: String
Tag: String
Digest: String
ConfigDigest: String
LastUpdated: Time
IsSigned: Boolean
Size: String
Platform: OsArch
Vendor: String
Score: Int
DownloadCount: Int
Layers: [LayerSummary]
Description: String
Licenses: String
Labels: String
Title: String
Source: String
Documentation: String
History: [LayerHistory]
Vulnerabilities: ImageVulnerabilitySummary
}
type ImageVulnerabilitySummary {
MaxSeverity: String
Count: Int
}
# Brief on a specific repo to be used in queries returning a list of repos
type RepoSummary {
Name: String
LastUpdated: Time
Size: String
Platforms: [OsArch]
Vendors: [String]
Score: Int
NewestImage: ImageSummary
DownloadCount: Int
StarCount: Int
IsBookmarked: Boolean
}
# Currently the same as LayerInfo, we can refactor later
# For detailed information on the layer a ImageListForDigest call can be made
type LayerSummary {
Size: String # Int64 is not supported.
Digest: String
Score: Int
}
type HistoryDescription {
Created: Time
"""
CreatedBy is the command which created the layer.
"""
CreatedBy: String
"""
Author is the author of the build point.
"""
Author: String
"""
Comment is a custom message set when creating the layer.
"""
Comment: String
"""
EmptyLayer is used to mark if the history item created a filesystem diff.
"""
EmptyLayer: Boolean
}
type LayerHistory {
Layer: LayerSummary
HistoryDescription: HistoryDescription
}
type OsArch {
Os: String
Arch: String
}
type Query {
CVEListForImage(image: String!): CVEResultForImage!
ImageListForCVE(id: String!): [ImageSummary!]
ImageListWithCVEFixed(id: String!, image: String!): [ImageSummary!]
ImageListForDigest(id: String!): [ImageSummary!]
RepoListWithNewestImage: [RepoSummary!]! # Newest based on created timestamp
ImageList(repo: String!): [ImageSummary!]
ExpandedRepoInfo(repo: String!): RepoInfo!
GlobalSearch(query: String!): GlobalSearchResult!
DerivedImageList(image: String!): [ImageSummary!]
BaseImageList(image: String!): [ImageSummary!]
}