From 788c7aecc819690ea4025ea7ed15ccaecd984fe2 Mon Sep 17 00:00:00 2001 From: Zach Hill Date: Sat, 7 Sep 2019 01:00:57 -0700 Subject: [PATCH] Some slight renaming of fields in the scanner adapter metadata response spec and move the properties up from the capabilities entry to the top level response (#2) Signed-off-by: Zach Hill --- .../scanner-adapter-openapi-v1.0.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/proposals/assets/pluggable-image-vulnerability-scanning/scanner-adapter-openapi-v1.0.yaml b/proposals/assets/pluggable-image-vulnerability-scanning/scanner-adapter-openapi-v1.0.yaml index 17e61b7c..78d7cd67 100644 --- a/proposals/assets/pluggable-image-vulnerability-scanning/scanner-adapter-openapi-v1.0.yaml +++ b/proposals/assets/pluggable-image-vulnerability-scanning/scanner-adapter-openapi-v1.0.yaml @@ -185,6 +185,8 @@ components: type: array items: $ref: '#/components/schemas/ScannerCapability' + properties: + $ref: "#/components/schemas/ScannerProperties" description: | Represents metadata of a Scanner Adapter which allow Harbor to lookup a scanner capable of scanning a given Artifact stored in its registry and making sure that it @@ -203,34 +205,34 @@ components: Capability consists of the set of recognized artifact MIME types and the set of scanner report MIME types. For example, a scanner capable of analyzing Docker images and producing a vulnerabilities report recognizable by Harbor web console might be represented with the following capability: - - artifact MIME types: + - consumes MIME types: - `application/vnd.oci.image.manifest.v1+json` - `application/vnd.docker.distribution.manifest.v2+json` - - report MIME types: + - produces MIME types: - `application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0` required: - artifact_mime_types - report_mime_types type: object properties: - artifact_mime_types: + consumes_mime_types: type: array items: type: string - description: The set of MIME types of the artifacts supported by the scanner. + description: | + The set of MIME types of the artifacts supported by the scanner to produce the reports specified in the "produces_mime_types". A given + mime type should only be present in one capability item. example: - "application/vnd.oci.image.manifest.v1+json" - "application/vnd.docker.distribution.manifest.v2+json" - report_mime_types: + produces_mime_types: type: array items: type: string description: | - The set of MIME types of reports generated by the scanner. + The set of MIME types of reports generated by the scanner for the consumes_mime_types of the same capability record. example: - "application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0" - properties: - $ref: '#/components/schemas/ScannerProperties' ScanRequest: required: - id