From e43ec26965987dc2165a47a935834405c5ef93c5 Mon Sep 17 00:00:00 2001 From: Eric Chiang Date: Thu, 4 Jan 2018 12:29:49 -0800 Subject: [PATCH 01/23] update CoC --- code-of-conduct.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 code-of-conduct.md diff --git a/code-of-conduct.md b/code-of-conduct.md new file mode 100644 index 00000000..a234f360 --- /dev/null +++ b/code-of-conduct.md @@ -0,0 +1,61 @@ +## CoreOS Community Code of Conduct + +### Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of +fostering an open and welcoming community, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating +documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free +experience for everyone, regardless of level of experience, gender, gender +identity and expression, sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing others' private information, such as physical or electronic addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently applying these +principles to every aspect of managing this project. Project maintainers who do +not follow or enforce the Code of Conduct may be permanently removed from the +project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting a project maintainer, Brandon Philips +, and/or Rithu John . + +This Code of Conduct is adapted from the Contributor Covenant +(http://contributor-covenant.org), version 1.2.0, available at +http://contributor-covenant.org/version/1/2/0/ + +### CoreOS Events Code of Conduct + +CoreOS events are working conferences intended for professional networking and +collaboration in the CoreOS community. Attendees are expected to behave +according to professional standards and in accordance with their employer’s +policies on appropriate workplace behavior. + +While at CoreOS events or related social networking opportunities, attendees +should not engage in discriminatory or offensive speech or actions including +but not limited to gender, sexuality, race, age, disability, or religion. +Speakers should be especially aware of these concerns. + +CoreOS does not condone any statements by speakers contrary to these standards. +CoreOS reserves the right to deny entrance and/or eject from an event (without +refund) any individual found to be engaging in discriminatory or offensive +speech or actions. + +Please bring any concerns to the immediate attention of designated on-site +staff, Brandon Philips , and/or Rithu John . From 947a8aa00c6f72a20e7fca63993dafaf3185fdc4 Mon Sep 17 00:00:00 2001 From: Joe Ray Date: Fri, 12 Jan 2018 11:53:09 +0000 Subject: [PATCH 02/23] featurens: Ensure RHEL is correctly identified When trying to identify various RedHat releases, RHEL was not being picked up as a centos release because the Oracle Linux regex was too permissive: it would match any release name with ' Linux Server release' in the name. By being more restrictive with the Oracle regex, RHEL is now properly identified. I don't know why the Oracle regex used such a permissive matcher for the name but it still passes all the tests by replacing it with the word 'Oracle'. Fixes #436 --- ext/featurens/redhatrelease/redhatrelease.go | 2 +- ext/featurens/redhatrelease/redhatrelease_test.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/featurens/redhatrelease/redhatrelease.go b/ext/featurens/redhatrelease/redhatrelease.go index 2b15c1e9..0dabc3fa 100644 --- a/ext/featurens/redhatrelease/redhatrelease.go +++ b/ext/featurens/redhatrelease/redhatrelease.go @@ -30,7 +30,7 @@ import ( ) var ( - oracleReleaseRegexp = regexp.MustCompile(`(?P[^\s]*) (Linux Server release) (?P[\d]+)`) + oracleReleaseRegexp = regexp.MustCompile(`(?POracle) (Linux Server release) (?P[\d]+)`) centosReleaseRegexp = regexp.MustCompile(`(?P[^\s]*) (Linux release|release) (?P[\d]+)`) redhatReleaseRegexp = regexp.MustCompile(`(?PRed Hat Enterprise Linux) (Client release|Server release|Workstation release) (?P[\d]+)`) ) diff --git a/ext/featurens/redhatrelease/redhatrelease_test.go b/ext/featurens/redhatrelease/redhatrelease_test.go index 5ee32f18..4a2da907 100644 --- a/ext/featurens/redhatrelease/redhatrelease_test.go +++ b/ext/featurens/redhatrelease/redhatrelease_test.go @@ -42,6 +42,12 @@ func TestDetector(t *testing.T) { "etc/centos-release": []byte(`CentOS release 6.6 (Final)`), }, }, + { + ExpectedNamespace: &database.Namespace{Name: "centos:7"}, + Files: tarutil.FilesMap{ + "etc/redhat-release": []byte(`Red Hat Enterprise Linux Server release 7.2 (Maipo)`), + }, + }, { ExpectedNamespace: &database.Namespace{Name: "centos:7"}, Files: tarutil.FilesMap{ From 45dfabbfea4499d73187411c621ffbda225fafe3 Mon Sep 17 00:00:00 2001 From: Leandro Repolho Date: Tue, 23 Jan 2018 16:11:59 +1100 Subject: [PATCH 03/23] Improve documentation on helm installation The docs were missing the helm dependencies download before running the install, so Postgres was never installed. Also I'm suggesting the user to download the latest version of helm since executing it with 2.5 failed for me, now with 2.7.2 it works fine. --- Documentation/running-clair.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/running-clair.md b/Documentation/running-clair.md index d7dee43d..32212d01 100644 --- a/Documentation/running-clair.md +++ b/Documentation/running-clair.md @@ -44,7 +44,7 @@ A [PostgreSQL 9.4+] database instance is required for all instructions. #### Kubernetes (Helm) If you don't have a local Kubernetes cluster already, check out [minikube]. -This assumes you've already ran `helm init` and you have access to a currently running instance of Tiller. +This assumes you've already ran `helm init`, you have access to a currently running instance of Tiller and that you are running the latest version of helm. [minikube]: https://github.com/kubernetes/minikube @@ -53,6 +53,7 @@ git clone https://github.com/coreos/clair cd clair/contrib/helm cp clair/values.yaml ~/my_custom_values.yaml vi ~/my_custom_values.yaml +helm dependency update clair helm install clair -f ~/my_custom_values.yaml ``` From a75b8ac7ffe3ccd7ff9c4718e547c6c5103e9747 Mon Sep 17 00:00:00 2001 From: Sida Chen Date: Fri, 2 Feb 2018 00:53:40 -0500 Subject: [PATCH 04/23] api,database: updated version_format documentation. Version format documentation is updated in the example of feature struct and created in clair.proto along with accordingly generated swagger and protobuf files. Fixes #514 --- api/v3/clairpb/clair.pb.go | 8 +++++--- api/v3/clairpb/clair.proto | 3 +++ api/v3/clairpb/clair.swagger.json | 3 ++- database/models.go | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/api/v3/clairpb/clair.pb.go b/api/v3/clairpb/clair.pb.go index 19816099..aa2b6f4a 100644 --- a/api/v3/clairpb/clair.pb.go +++ b/api/v3/clairpb/clair.pb.go @@ -158,9 +158,11 @@ func (m *ClairStatus) GetLastUpdateTime() *google_protobuf2.Timestamp { } type Feature struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName" json:"namespace_name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName" json:"namespace_name,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"` + // version_format is the format used by installer package manager to store + // package versions. VersionFormat string `protobuf:"bytes,4,opt,name=version_format,json=versionFormat" json:"version_format,omitempty"` Vulnerabilities []*Vulnerability `protobuf:"bytes,5,rep,name=vulnerabilities" json:"vulnerabilities,omitempty"` } diff --git a/api/v3/clairpb/clair.proto b/api/v3/clairpb/clair.proto index 8d704230..be1eabd8 100644 --- a/api/v3/clairpb/clair.proto +++ b/api/v3/clairpb/clair.proto @@ -45,6 +45,9 @@ message Feature{ string name = 1; string namespace_name = 2; string version = 3; + + // version_format is the format used by installer package manager to store + // package versions. string version_format = 4; repeated Vulnerability vulnerabilities = 5; } diff --git a/api/v3/clairpb/clair.swagger.json b/api/v3/clairpb/clair.swagger.json index 3e54a8a2..8328ee85 100644 --- a/api/v3/clairpb/clair.swagger.json +++ b/api/v3/clairpb/clair.swagger.json @@ -232,7 +232,8 @@ "type": "string" }, "version_format": { - "type": "string" + "type": "string", + "description": "version_format is the format used by installer package manager to store\npackage versions." }, "vulnerabilities": { "type": "array", diff --git a/database/models.go b/database/models.go index fe36fbfc..43d41da9 100644 --- a/database/models.go +++ b/database/models.go @@ -71,8 +71,8 @@ type Namespace struct { // determined. // // e.g. Name: OpenSSL, Version: 1.0, VersionFormat: dpkg. -// dpkg implies the installer package manager but the namespace (might be -// debian:7, debian:8, ...) could not be determined. +// dpkg is the version format of the installer package manager, which in this +// case could be dpkg or apk. type Feature struct { Name string Version string From e9dba0fa8f2b40ccb0413cb968ac3b5461492494 Mon Sep 17 00:00:00 2001 From: Jelto Wodstrcil Date: Mon, 5 Feb 2018 11:34:58 +0100 Subject: [PATCH 05/23] fix whitespace remove in postgresql configmap helm chart --- contrib/helm/clair/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/helm/clair/templates/configmap.yaml b/contrib/helm/clair/templates/configmap.yaml index e30cab3e..7c592bd4 100644 --- a/contrib/helm/clair/templates/configmap.yaml +++ b/contrib/helm/clair/templates/configmap.yaml @@ -14,7 +14,7 @@ data: # PostgreSQL Connection string # https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING # This should be done using secrets or Vault, but for now this will also work - {{- if .Values.config.postgresURI -}} + {{- if .Values.config.postgresURI }} source: "{{ .Values.config.postgresURI }}" {{ else }} source: "postgres://{{ .Values.postgresql.postgresUser }}:{{ .Values.postgresql.postgresPassword }}@{{ template "postgresql.fullname" . }}:5432/{{ .Values.postgresql.postgresDatabase }}?sslmode=disable" From c1a58bf9224bbcd7e0f02ea4065650d220654f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Unbekandt?= Date: Fri, 9 Feb 2018 10:39:17 +0100 Subject: [PATCH 06/23] Documentation: add new 3rd party tool Add a new CLI tool to interact with Clair. --- Documentation/integrations.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/integrations.md b/Documentation/integrations.md index a75235bb..289fbeba 100644 --- a/Documentation/integrations.md +++ b/Documentation/integrations.md @@ -10,6 +10,8 @@ This document tracks projects that integrate with Clair. [Join the community](ht [Yair](https://github.com/yfoelling/yair): a lightweight command-line for working with clair with many different outputs. Mainly designed for usage in a CI Job. +[Paclair](https://github.com/yebinama/paclair): a Python3 CLI tool to interact with Clair (easily configurable to access private registries). + [Clairctl](https://github.com/jgsqware/clairctl): a lightweight command-line tool for working locally with Clair and generate HTML report. [Clair-SQS](https://github.com/zalando-incubator/clair-sqs): a container containing Clair and additional processes that integrate Clair with [Amazon SQS][sqs]. From 64c2853e753d7b0ce974aefecdd2e1a1158c0a7c Mon Sep 17 00:00:00 2001 From: Diederik van der Boor Date: Fri, 9 Feb 2018 13:26:38 +0100 Subject: [PATCH 07/23] Fix helm chart to generate config.postgresURI The configuration was merged with the comment line above due to usage of the {{- ... -}} construct. --- contrib/helm/clair/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/helm/clair/templates/configmap.yaml b/contrib/helm/clair/templates/configmap.yaml index e30cab3e..7c592bd4 100644 --- a/contrib/helm/clair/templates/configmap.yaml +++ b/contrib/helm/clair/templates/configmap.yaml @@ -14,7 +14,7 @@ data: # PostgreSQL Connection string # https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING # This should be done using secrets or Vault, but for now this will also work - {{- if .Values.config.postgresURI -}} + {{- if .Values.config.postgresURI }} source: "{{ .Values.config.postgresURI }}" {{ else }} source: "postgres://{{ .Values.postgresql.postgresUser }}:{{ .Values.postgresql.postgresPassword }}@{{ template "postgresql.fullname" . }}:5432/{{ .Values.postgresql.postgresDatabase }}?sslmode=disable" From e454314beb5e7fa7c6c123d9a7501ec923fb26d9 Mon Sep 17 00:00:00 2001 From: Diederik van der Boor Date: Fri, 9 Feb 2018 13:30:46 +0100 Subject: [PATCH 08/23] Cleanup and improve chart values - be more accurate in memory requests, so chair is scheduled on a host that has that space available. - add an explicit mention for the postgresql.enabled flag --- contrib/helm/clair/values.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/helm/clair/values.yaml b/contrib/helm/clair/values.yaml index a30b8dcb..39e2b3aa 100644 --- a/contrib/helm/clair/values.yaml +++ b/contrib/helm/clair/values.yaml @@ -34,7 +34,7 @@ resources: memory: 1Gi requests: cpu: 100m - memory: 128Mi + memory: 500Mi config: # postgresURI: "postgres://user:password@host:5432/postgres?sslmode=disable" paginationKey: "XxoPtCUzrUv4JV5dS+yQ+MdW7yLEJnRMwigVY/bpgtQ=" @@ -59,6 +59,9 @@ config: # Configuration values for the postgresql dependency. # ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md postgresql: +# The dependant Postgres chart can be disabled, to connect to +# an existing database by defining config.postgresURI + enabled: true cpu: 1000m memory: 1Gi # These values are hardcoded until Helm supports secrets. @@ -68,4 +71,4 @@ postgresql: postgresDatabase: clair persistence: - size: 10Gi \ No newline at end of file + size: 10Gi From 7a06a7a2b4a68c2567a5bcc41c497fdb9d8d2c15 Mon Sep 17 00:00:00 2001 From: Sida Chen Date: Wed, 7 Mar 2018 08:47:54 -0800 Subject: [PATCH 09/23] Helm: Fixed a typo in maintainers field. Maintainers field was incorrectly listing email as one item. --- contrib/helm/clair/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/helm/clair/Chart.yaml b/contrib/helm/clair/Chart.yaml index ba3bdd78..4e76d1c1 100644 --- a/contrib/helm/clair/Chart.yaml +++ b/contrib/helm/clair/Chart.yaml @@ -8,4 +8,4 @@ sources: - https://github.com/coreos/clair maintainers: - name: Jimmy Zelinskie - - email: jimmy.zelinskie@coreos.com + email: jimmy.zelinskie@coreos.com From 4db72b8c26a5754d61931c2fd5a6ee1829b9f016 Mon Sep 17 00:00:00 2001 From: Sida Chen Date: Mon, 19 Mar 2018 21:21:38 -0700 Subject: [PATCH 10/23] README: fixed issues address --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2fe179cf..2cd4987a 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Thus, the project was named `Clair` after the French term which translates to *c ## Contact - IRC: #[clair](irc://irc.freenode.org:6667/#clair) on freenode.org -- Bugs: [issues](https://github.com/coreos/etcd/issues) +- Bugs: [issues](https://github.com/coreos/clair/issues) ## Contributing From e649f8f149e395337b4276ac92f36196a2b73892 Mon Sep 17 00:00:00 2001 From: Tomer H <31274317+tomer-1@users.noreply.github.com> Date: Mon, 2 Apr 2018 19:37:02 +0300 Subject: [PATCH 11/23] Update values.yaml this is supposed to solve the below issue: https://github.com/coreos/clair/issues/414 --- contrib/helm/clair/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/helm/clair/values.yaml b/contrib/helm/clair/values.yaml index 39e2b3aa..dc8e6cef 100644 --- a/contrib/helm/clair/values.yaml +++ b/contrib/helm/clair/values.yaml @@ -30,8 +30,8 @@ ingress: # - chart-example.local resources: limits: - cpu: 100m - memory: 1Gi + cpu: 200m + memory: 1500Mi requests: cpu: 100m memory: 500Mi From 389b6e992790f6e28b77ca5979c0589e43dbe40a Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Wed, 4 Apr 2018 16:16:50 -0400 Subject: [PATCH 12/23] api/v3/clairpb: generate protobufs in docker This removes the requirement of the build machine having protobuf and any extensions installed. --- api/v3/clairpb/Dockerfile | 7 ++++++ api/v3/clairpb/Makefile | 17 ------------- api/v3/clairpb/generate-protobuf.sh | 28 +++++++++++++++++++++ api/v3/clairpb/run_in_docker.sh | 39 +++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 17 deletions(-) create mode 100644 api/v3/clairpb/Dockerfile delete mode 100644 api/v3/clairpb/Makefile create mode 100755 api/v3/clairpb/generate-protobuf.sh create mode 100755 api/v3/clairpb/run_in_docker.sh diff --git a/api/v3/clairpb/Dockerfile b/api/v3/clairpb/Dockerfile new file mode 100644 index 00000000..a8547e29 --- /dev/null +++ b/api/v3/clairpb/Dockerfile @@ -0,0 +1,7 @@ +FROM golang:alpine + +RUN apk add --update --no-cache git bash protobuf-dev + +RUN go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway +RUN go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger +RUN go get -u github.com/golang/protobuf/protoc-gen-go diff --git a/api/v3/clairpb/Makefile b/api/v3/clairpb/Makefile deleted file mode 100644 index 8c193baa..00000000 --- a/api/v3/clairpb/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -all: - protoc -I/usr/local/include -I. \ - -I${GOPATH}/src \ - -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ - --go_out=plugins=grpc:. \ - clair.proto - protoc -I/usr/local/include -I. \ - -I${GOPATH}/src \ - -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ - --grpc-gateway_out=logtostderr=true:. \ - clair.proto - protoc -I/usr/local/include -I. \ - -I${GOPATH}/src \ - -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ - --swagger_out=logtostderr=true:. \ - clair.proto - go generate . \ No newline at end of file diff --git a/api/v3/clairpb/generate-protobuf.sh b/api/v3/clairpb/generate-protobuf.sh new file mode 100755 index 00000000..246edfbd --- /dev/null +++ b/api/v3/clairpb/generate-protobuf.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Copyright 2018 clair authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +DOCKER_REPO_ROOT="$GOPATH/src/github.com/coreos/clair" +IMAGE=${IMAGE:-"quay.io/coreos/clair-gen-proto"} + +docker run --rm -it \ + -v "$DOCKER_REPO_ROOT":"$DOCKER_REPO_ROOT" \ + -w "$DOCKER_REPO_ROOT" \ + "$IMAGE" \ + "./api/v3/clairpb/run_in_docker.sh" diff --git a/api/v3/clairpb/run_in_docker.sh b/api/v3/clairpb/run_in_docker.sh new file mode 100755 index 00000000..28e703ed --- /dev/null +++ b/api/v3/clairpb/run_in_docker.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# Copyright 2018 clair authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +protoc -I/usr/include -I. \ + -I"${GOPATH}/src" \ + -I"${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis" \ + --go_out=plugins=grpc:. \ + ./api/v3/clairpb/clair.proto + +protoc -I/usr/include -I. \ + -I"${GOPATH}/src" \ + -I"${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis" \ + --grpc-gateway_out=logtostderr=true:. \ + ./api/v3/clairpb/clair.proto + +protoc -I/usr/include -I. \ + -I"${GOPATH}/src" \ + -I"${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis" \ + --swagger_out=logtostderr=true:. \ + ./api/v3/clairpb/clair.proto + +go generate . From ec5014f8a13605458faf1894bb905f2123ded0a7 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Wed, 4 Apr 2018 16:17:49 -0400 Subject: [PATCH 13/23] api/v3/clairpb: regen protobufs --- api/v3/clairpb/clair.pb.go | 150 +++++++++++++++--------------- api/v3/clairpb/clair.pb.gw.go | 45 ++++++--- api/v3/clairpb/clair.swagger.json | 2 +- 3 files changed, 107 insertions(+), 90 deletions(-) diff --git a/api/v3/clairpb/clair.pb.go b/api/v3/clairpb/clair.pb.go index 19816099..eac9e8af 100644 --- a/api/v3/clairpb/clair.pb.go +++ b/api/v3/clairpb/clair.pb.go @@ -1,11 +1,11 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: clair.proto +// source: api/v3/clairpb/clair.proto /* Package clairpb is a generated protocol buffer package. It is generated from these files: - clair.proto + api/v3/clairpb/clair.proto It has these top-level messages: Vulnerability @@ -735,7 +735,7 @@ var _AncestryService_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "clair.proto", + Metadata: "api/v3/clairpb/clair.proto", } // Client API for NotificationService service @@ -832,84 +832,84 @@ var _NotificationService_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "clair.proto", + Metadata: "api/v3/clairpb/clair.proto", } -func init() { proto.RegisterFile("clair.proto", fileDescriptor0) } +func init() { proto.RegisterFile("api/v3/clairpb/clair.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1156 bytes of a gzipped FileDescriptorProto + // 1162 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0xdb, 0x46, 0x13, 0x06, 0x25, 0xcb, 0x92, 0x46, 0xf2, 0xd7, 0x5a, 0x51, 0x68, 0xd9, 0x46, 0x1c, 0xbe, 0x78, 0xd3, 0x20, 0x6d, 0x25, 0x54, 0xf6, 0xa1, 0x35, 0xd2, 0x8f, 0xa4, 0x4e, 0xd2, 0x02, 0x49, 0x10, - 0x30, 0xa9, 0x0f, 0xbd, 0x08, 0x6b, 0x72, 0x64, 0x13, 0xa6, 0x48, 0x96, 0xbb, 0xb2, 0x2c, 0x04, + 0x30, 0xa9, 0x0f, 0xbd, 0x08, 0x6b, 0x72, 0x64, 0x13, 0xa6, 0x48, 0x96, 0xbb, 0x92, 0x2c, 0x04, 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0x46, 0xea, 0x6a, 0x32, 0x0a, 0x96, 0x79, 0xff, 0x4f, 0x03, 0xd6, 0xb4, 0x00, 0x2f, + 0x31, 0x9e, 0x78, 0x0e, 0x12, 0x0a, 0xcd, 0xec, 0x74, 0x92, 0x9d, 0xb7, 0xbd, 0x93, 0xce, 0xee, + 0x15, 0xd1, 0xa4, 0x21, 0xab, 0xf5, 0xdd, 0x9b, 0xbf, 0x7e, 0x2e, 0xad, 0x5a, 0xf5, 0x9e, 0x56, + 0xf7, 0xd0, 0xb8, 0x47, 0xce, 0xa1, 0x91, 0x19, 0x13, 0xb2, 0x9d, 0x9e, 0xb1, 0x38, 0xcf, 0x9d, + 0x9d, 0xe2, 0xa0, 0x3a, 0xff, 0xb6, 0x3c, 0x7f, 0x9b, 0x6c, 0xa5, 0xe7, 0xf7, 0x5e, 0xe7, 0xc6, + 0xff, 0xdb, 0xfe, 0xf7, 0x25, 0xd8, 0xcc, 0xb2, 0xa2, 0xfb, 0x64, 0xb0, 0x76, 0x49, 0x06, 0x72, + 0x2b, 0x7b, 0x57, 0xc1, 0x40, 0x75, 0xf6, 0xae, 0x06, 0xa8, 0x82, 0x76, 0x65, 0x41, 0x37, 0xc9, + 0x8d, 0x5e, 0x56, 0x1d, 0xd6, 0x7b, 0x2d, 0x8b, 0x21, 0x53, 0x68, 0x17, 0xab, 0x44, 0xe6, 0x5b, + 0xf0, 0xad, 0x32, 0x76, 0xda, 0x0b, 0x7f, 0xc2, 0x1e, 0x89, 0xbf, 0xce, 0xfa, 0xe2, 0x7b, 0xc5, + 0x17, 0x3f, 0xac, 0x7f, 0xad, 0xff, 0x99, 0x9f, 0x2c, 0xcb, 0xcc, 0xfd, 0x7f, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x51, 0xb7, 0x75, 0x58, 0xc7, 0x0b, 0x00, 0x00, } diff --git a/api/v3/clairpb/clair.pb.gw.go b/api/v3/clairpb/clair.pb.gw.go index 21bfdf12..ebe4435d 100644 --- a/api/v3/clairpb/clair.pb.gw.go +++ b/api/v3/clairpb/clair.pb.gw.go @@ -1,6 +1,5 @@ -// Code generated by protoc-gen-grpc-gateway -// source: clair.proto -// DO NOT EDIT! +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v3/clairpb/clair.proto /* Package clairpb is a reverse proxy. @@ -33,8 +32,10 @@ func request_AncestryService_PostAncestry_0(ctx context.Context, marshaler runti var protoReq PostAncestryRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + if req.ContentLength > 0 { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } } msg, err := client.PostAncestry(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -65,7 +66,7 @@ func request_AncestryService_GetAncestry_0(ctx context.Context, marshaler runtim protoReq.AncestryName, err = runtime.String(val) if err != nil { - return nil, metadata, err + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "ancestry_name", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AncestryService_GetAncestry_0); err != nil { @@ -100,7 +101,7 @@ func request_NotificationService_GetNotification_0(ctx context.Context, marshale protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, err + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_NotificationService_GetNotification_0); err != nil { @@ -131,7 +132,7 @@ func request_NotificationService_MarkNotificationAsRead_0(ctx context.Context, m protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, err + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.MarkNotificationAsRead(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -167,10 +168,18 @@ func RegisterAncestryServiceHandlerFromEndpoint(ctx context.Context, mux *runtim // RegisterAncestryServiceHandler registers the http handlers for service AncestryService to "mux". // The handlers forward requests to the grpc endpoint over "conn". func RegisterAncestryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - client := NewAncestryServiceClient(conn) + return RegisterAncestryServiceHandlerClient(ctx, mux, NewAncestryServiceClient(conn)) +} + +// RegisterAncestryServiceHandler registers the http handlers for service AncestryService to "mux". +// The handlers forward requests to the grpc endpoint over the given implementation of "AncestryServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AncestryServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "AncestryServiceClient" to call the correct interceptors. +func RegisterAncestryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AncestryServiceClient) error { mux.Handle("POST", pattern_AncestryService_PostAncestry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := context.WithCancel(req.Context()) defer cancel() if cn, ok := w.(http.CloseNotifier); ok { go func(done <-chan struct{}, closed <-chan bool) { @@ -199,7 +208,7 @@ func RegisterAncestryServiceHandler(ctx context.Context, mux *runtime.ServeMux, }) mux.Handle("GET", pattern_AncestryService_GetAncestry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := context.WithCancel(req.Context()) defer cancel() if cn, ok := w.(http.CloseNotifier); ok { go func(done <-chan struct{}, closed <-chan bool) { @@ -270,10 +279,18 @@ func RegisterNotificationServiceHandlerFromEndpoint(ctx context.Context, mux *ru // RegisterNotificationServiceHandler registers the http handlers for service NotificationService to "mux". // The handlers forward requests to the grpc endpoint over "conn". func RegisterNotificationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - client := NewNotificationServiceClient(conn) + return RegisterNotificationServiceHandlerClient(ctx, mux, NewNotificationServiceClient(conn)) +} + +// RegisterNotificationServiceHandler registers the http handlers for service NotificationService to "mux". +// The handlers forward requests to the grpc endpoint over the given implementation of "NotificationServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NotificationServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "NotificationServiceClient" to call the correct interceptors. +func RegisterNotificationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NotificationServiceClient) error { mux.Handle("GET", pattern_NotificationService_GetNotification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := context.WithCancel(req.Context()) defer cancel() if cn, ok := w.(http.CloseNotifier); ok { go func(done <-chan struct{}, closed <-chan bool) { @@ -302,7 +319,7 @@ func RegisterNotificationServiceHandler(ctx context.Context, mux *runtime.ServeM }) mux.Handle("DELETE", pattern_NotificationService_MarkNotificationAsRead_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := context.WithCancel(req.Context()) defer cancel() if cn, ok := w.(http.CloseNotifier); ok { go func(done <-chan struct{}, closed <-chan bool) { diff --git a/api/v3/clairpb/clair.swagger.json b/api/v3/clairpb/clair.swagger.json index 3e54a8a2..8ac989e5 100644 --- a/api/v3/clairpb/clair.swagger.json +++ b/api/v3/clairpb/clair.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "clair.proto", + "title": "api/v3/clairpb/clair.proto", "version": "version not set" }, "schemes": [ From 6b9f668ea0b657526b35008f8efd9c8f0a46df9b Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 5 Apr 2018 17:02:13 -0400 Subject: [PATCH 14/23] api/v3/clairpb: document and regenerate protos --- api/v3/clairpb/clair.pb.go | 735 ++++++++++++++++-------------- api/v3/clairpb/clair.pb.gw.go | 50 +- api/v3/clairpb/clair.proto | 307 ++++++++----- api/v3/clairpb/clair.swagger.json | 226 +++++---- api/v3/clairpb/convert.go | 10 +- 5 files changed, 762 insertions(+), 566 deletions(-) diff --git a/api/v3/clairpb/clair.pb.go b/api/v3/clairpb/clair.pb.go index 210c2d4c..7125402e 100644 --- a/api/v3/clairpb/clair.pb.go +++ b/api/v3/clairpb/clair.pb.go @@ -9,19 +9,16 @@ It is generated from these files: It has these top-level messages: Vulnerability - ClairStatus Feature - Ancestry Layer - Notification - IndexedAncestryName - PagedVulnerableAncestries - PostAncestryRequest - PostAncestryResponse + ClairStatus GetAncestryRequest GetAncestryResponse + PostAncestryRequest + PostAncestryResponse GetNotificationRequest GetNotificationResponse + PagedVulnerableAncestries MarkNotificationAsReadRequest */ package clairpb @@ -50,15 +47,23 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Vulnerability struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the vulnerability. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the namespace in which the vulnerability was detected. NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName" json:"namespace_name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` - Link string `protobuf:"bytes,4,opt,name=link" json:"link,omitempty"` - Severity string `protobuf:"bytes,5,opt,name=severity" json:"severity,omitempty"` - Metadata string `protobuf:"bytes,6,opt,name=metadata" json:"metadata,omitempty"` - // fixed_by exists when vulnerability is under feature. + // A description of the vulnerability according to the source for the namespace. + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + // A link to the vulnerability according to the source for the namespace. + Link string `protobuf:"bytes,4,opt,name=link" json:"link,omitempty"` + // How dangerous the vulnerability is. + Severity string `protobuf:"bytes,5,opt,name=severity" json:"severity,omitempty"` + // Namespace agnostic metadata about the vulnerability. + Metadata string `protobuf:"bytes,6,opt,name=metadata" json:"metadata,omitempty"` + // The feature that fixes this vulnerability. + // This field only exists when a vulnerability is a part of a Feature. FixedBy string `protobuf:"bytes,7,opt,name=fixed_by,json=fixedBy" json:"fixed_by,omitempty"` - // affected_versions exists when vulnerability is under notification. + // The Features that are affected by the vulnerability. + // This field only exists when a vulnerability is a part of a Notification. AffectedVersions []*Feature `protobuf:"bytes,8,rep,name=affected_versions,json=affectedVersions" json:"affected_versions,omitempty"` } @@ -123,54 +128,23 @@ func (m *Vulnerability) GetAffectedVersions() []*Feature { return nil } -type ClairStatus struct { - // listers and detectors are processors implemented in this Clair and used to - // scan ancestries - Listers []string `protobuf:"bytes,1,rep,name=listers" json:"listers,omitempty"` - Detectors []string `protobuf:"bytes,2,rep,name=detectors" json:"detectors,omitempty"` - LastUpdateTime *google_protobuf2.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime" json:"last_update_time,omitempty"` -} - -func (m *ClairStatus) Reset() { *m = ClairStatus{} } -func (m *ClairStatus) String() string { return proto.CompactTextString(m) } -func (*ClairStatus) ProtoMessage() {} -func (*ClairStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *ClairStatus) GetListers() []string { - if m != nil { - return m.Listers - } - return nil -} - -func (m *ClairStatus) GetDetectors() []string { - if m != nil { - return m.Detectors - } - return nil -} - -func (m *ClairStatus) GetLastUpdateTime() *google_protobuf2.Timestamp { - if m != nil { - return m.LastUpdateTime - } - return nil -} - type Feature struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the feature. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The name of the namespace in which the feature is detected. NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName" json:"namespace_name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"` - // version_format is the format used by installer package manager to store - // package versions. - VersionFormat string `protobuf:"bytes,4,opt,name=version_format,json=versionFormat" json:"version_format,omitempty"` + // The specific version of this feature. + Version string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"` + // The format used to parse version numbers for the feature. + VersionFormat string `protobuf:"bytes,4,opt,name=version_format,json=versionFormat" json:"version_format,omitempty"` + // The list of vulnerabilities that affect the feature. Vulnerabilities []*Vulnerability `protobuf:"bytes,5,rep,name=vulnerabilities" json:"vulnerabilities,omitempty"` } func (m *Feature) Reset() { *m = Feature{} } func (m *Feature) String() string { return proto.CompactTextString(m) } func (*Feature) ProtoMessage() {} -func (*Feature) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (*Feature) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *Feature) GetName() string { if m != nil { @@ -207,214 +181,187 @@ func (m *Feature) GetVulnerabilities() []*Vulnerability { return nil } -type Ancestry struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Features []*Feature `protobuf:"bytes,2,rep,name=features" json:"features,omitempty"` - Layers []*Layer `protobuf:"bytes,3,rep,name=layers" json:"layers,omitempty"` - // scanned_listers and scanned_detectors are used to scan this ancestry, it - // may be different from listers and detectors in ClairStatus since the - // ancestry could be scanned by previous version of Clair. - ScannedListers []string `protobuf:"bytes,4,rep,name=scanned_listers,json=scannedListers" json:"scanned_listers,omitempty"` - ScannedDetectors []string `protobuf:"bytes,5,rep,name=scanned_detectors,json=scannedDetectors" json:"scanned_detectors,omitempty"` +type Layer struct { + // The sha256 tarsum for the layer. + Hash string `protobuf:"bytes,1,opt,name=hash" json:"hash,omitempty"` } -func (m *Ancestry) Reset() { *m = Ancestry{} } -func (m *Ancestry) String() string { return proto.CompactTextString(m) } -func (*Ancestry) ProtoMessage() {} -func (*Ancestry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (m *Layer) Reset() { *m = Layer{} } +func (m *Layer) String() string { return proto.CompactTextString(m) } +func (*Layer) ProtoMessage() {} +func (*Layer) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } -func (m *Ancestry) GetName() string { +func (m *Layer) GetHash() string { if m != nil { - return m.Name + return m.Hash } return "" } -func (m *Ancestry) GetFeatures() []*Feature { - if m != nil { - return m.Features - } - return nil +type ClairStatus struct { + // The configured list of feature listers used to scan an ancestry. + Listers []string `protobuf:"bytes,1,rep,name=listers" json:"listers,omitempty"` + // The configured list of namespace detectors used to scan an ancestry. + Detectors []string `protobuf:"bytes,2,rep,name=detectors" json:"detectors,omitempty"` + // The time at which the updater last ran. + LastUpdateTime *google_protobuf2.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime" json:"last_update_time,omitempty"` } -func (m *Ancestry) GetLayers() []*Layer { +func (m *ClairStatus) Reset() { *m = ClairStatus{} } +func (m *ClairStatus) String() string { return proto.CompactTextString(m) } +func (*ClairStatus) ProtoMessage() {} +func (*ClairStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *ClairStatus) GetListers() []string { if m != nil { - return m.Layers + return m.Listers } return nil } -func (m *Ancestry) GetScannedListers() []string { +func (m *ClairStatus) GetDetectors() []string { if m != nil { - return m.ScannedListers + return m.Detectors } return nil } -func (m *Ancestry) GetScannedDetectors() []string { +func (m *ClairStatus) GetLastUpdateTime() *google_protobuf2.Timestamp { if m != nil { - return m.ScannedDetectors + return m.LastUpdateTime } return nil } -type Layer struct { - Hash string `protobuf:"bytes,1,opt,name=hash" json:"hash,omitempty"` +type GetAncestryRequest struct { + // The name of the desired ancestry. + AncestryName string `protobuf:"bytes,1,opt,name=ancestry_name,json=ancestryName" json:"ancestry_name,omitempty"` + // Whether to include vulnerabilities or not in the response. + WithVulnerabilities bool `protobuf:"varint,2,opt,name=with_vulnerabilities,json=withVulnerabilities" json:"with_vulnerabilities,omitempty"` + // Whether to include features or not in the response. + WithFeatures bool `protobuf:"varint,3,opt,name=with_features,json=withFeatures" json:"with_features,omitempty"` } -func (m *Layer) Reset() { *m = Layer{} } -func (m *Layer) String() string { return proto.CompactTextString(m) } -func (*Layer) ProtoMessage() {} -func (*Layer) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (m *GetAncestryRequest) Reset() { *m = GetAncestryRequest{} } +func (m *GetAncestryRequest) String() string { return proto.CompactTextString(m) } +func (*GetAncestryRequest) ProtoMessage() {} +func (*GetAncestryRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } -func (m *Layer) GetHash() string { +func (m *GetAncestryRequest) GetAncestryName() string { if m != nil { - return m.Hash + return m.AncestryName } return "" } -type Notification struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Created string `protobuf:"bytes,2,opt,name=created" json:"created,omitempty"` - Notified string `protobuf:"bytes,3,opt,name=notified" json:"notified,omitempty"` - Deleted string `protobuf:"bytes,4,opt,name=deleted" json:"deleted,omitempty"` - Old *PagedVulnerableAncestries `protobuf:"bytes,5,opt,name=old" json:"old,omitempty"` - New *PagedVulnerableAncestries `protobuf:"bytes,6,opt,name=new" json:"new,omitempty"` -} - -func (m *Notification) Reset() { *m = Notification{} } -func (m *Notification) String() string { return proto.CompactTextString(m) } -func (*Notification) ProtoMessage() {} -func (*Notification) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } - -func (m *Notification) GetName() string { +func (m *GetAncestryRequest) GetWithVulnerabilities() bool { if m != nil { - return m.Name + return m.WithVulnerabilities } - return "" + return false } -func (m *Notification) GetCreated() string { +func (m *GetAncestryRequest) GetWithFeatures() bool { if m != nil { - return m.Created + return m.WithFeatures } - return "" + return false } -func (m *Notification) GetNotified() string { - if m != nil { - return m.Notified - } - return "" +type GetAncestryResponse struct { + // The ancestry requested. + Ancestry *GetAncestryResponse_Ancestry `protobuf:"bytes,1,opt,name=ancestry" json:"ancestry,omitempty"` + // The status of Clair at the time of the request. + Status *ClairStatus `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` } -func (m *Notification) GetDeleted() string { - if m != nil { - return m.Deleted - } - return "" -} +func (m *GetAncestryResponse) Reset() { *m = GetAncestryResponse{} } +func (m *GetAncestryResponse) String() string { return proto.CompactTextString(m) } +func (*GetAncestryResponse) ProtoMessage() {} +func (*GetAncestryResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } -func (m *Notification) GetOld() *PagedVulnerableAncestries { +func (m *GetAncestryResponse) GetAncestry() *GetAncestryResponse_Ancestry { if m != nil { - return m.Old + return m.Ancestry } return nil } -func (m *Notification) GetNew() *PagedVulnerableAncestries { +func (m *GetAncestryResponse) GetStatus() *ClairStatus { if m != nil { - return m.New + return m.Status } return nil } -type IndexedAncestryName struct { - // index is unique to name in all streams simultaneously streamed, increasing - // and larger than all indexes in previous page in same stream. - Index int32 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` +type GetAncestryResponse_Ancestry struct { + // The name of the desired ancestry. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The list of features present in the ancestry. + // This will only be provided if requested. + Features []*Feature `protobuf:"bytes,2,rep,name=features" json:"features,omitempty"` + // The layers present in the ancestry. + Layers []*Layer `protobuf:"bytes,3,rep,name=layers" json:"layers,omitempty"` + // The configured list of feature listers used to scan this ancestry. + ScannedListers []string `protobuf:"bytes,4,rep,name=scanned_listers,json=scannedListers" json:"scanned_listers,omitempty"` + // The configured list of namespace detectors used to scan an ancestry. + ScannedDetectors []string `protobuf:"bytes,5,rep,name=scanned_detectors,json=scannedDetectors" json:"scanned_detectors,omitempty"` } -func (m *IndexedAncestryName) Reset() { *m = IndexedAncestryName{} } -func (m *IndexedAncestryName) String() string { return proto.CompactTextString(m) } -func (*IndexedAncestryName) ProtoMessage() {} -func (*IndexedAncestryName) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (m *GetAncestryResponse_Ancestry) Reset() { *m = GetAncestryResponse_Ancestry{} } +func (m *GetAncestryResponse_Ancestry) String() string { return proto.CompactTextString(m) } +func (*GetAncestryResponse_Ancestry) ProtoMessage() {} +func (*GetAncestryResponse_Ancestry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 0} } -func (m *IndexedAncestryName) GetIndex() int32 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *IndexedAncestryName) GetName() string { +func (m *GetAncestryResponse_Ancestry) GetName() string { if m != nil { return m.Name } return "" } -type PagedVulnerableAncestries struct { - CurrentPage string `protobuf:"bytes,1,opt,name=current_page,json=currentPage" json:"current_page,omitempty"` - // if next_page is empty, it signals the end of all pages. - NextPage string `protobuf:"bytes,2,opt,name=next_page,json=nextPage" json:"next_page,omitempty"` - Limit int32 `protobuf:"varint,3,opt,name=limit" json:"limit,omitempty"` - Vulnerability *Vulnerability `protobuf:"bytes,4,opt,name=vulnerability" json:"vulnerability,omitempty"` - Ancestries []*IndexedAncestryName `protobuf:"bytes,5,rep,name=ancestries" json:"ancestries,omitempty"` -} - -func (m *PagedVulnerableAncestries) Reset() { *m = PagedVulnerableAncestries{} } -func (m *PagedVulnerableAncestries) String() string { return proto.CompactTextString(m) } -func (*PagedVulnerableAncestries) ProtoMessage() {} -func (*PagedVulnerableAncestries) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } - -func (m *PagedVulnerableAncestries) GetCurrentPage() string { - if m != nil { - return m.CurrentPage - } - return "" -} - -func (m *PagedVulnerableAncestries) GetNextPage() string { +func (m *GetAncestryResponse_Ancestry) GetFeatures() []*Feature { if m != nil { - return m.NextPage + return m.Features } - return "" + return nil } -func (m *PagedVulnerableAncestries) GetLimit() int32 { +func (m *GetAncestryResponse_Ancestry) GetLayers() []*Layer { if m != nil { - return m.Limit + return m.Layers } - return 0 + return nil } -func (m *PagedVulnerableAncestries) GetVulnerability() *Vulnerability { +func (m *GetAncestryResponse_Ancestry) GetScannedListers() []string { if m != nil { - return m.Vulnerability + return m.ScannedListers } return nil } -func (m *PagedVulnerableAncestries) GetAncestries() []*IndexedAncestryName { +func (m *GetAncestryResponse_Ancestry) GetScannedDetectors() []string { if m != nil { - return m.Ancestries + return m.ScannedDetectors } return nil } type PostAncestryRequest struct { - AncestryName string `protobuf:"bytes,1,opt,name=ancestry_name,json=ancestryName" json:"ancestry_name,omitempty"` - Format string `protobuf:"bytes,2,opt,name=format" json:"format,omitempty"` - Layers []*PostAncestryRequest_PostLayer `protobuf:"bytes,3,rep,name=layers" json:"layers,omitempty"` + // The name of the ancestry being scanned. + // If scanning OCI images, this should be the hash of the manifest. + AncestryName string `protobuf:"bytes,1,opt,name=ancestry_name,json=ancestryName" json:"ancestry_name,omitempty"` + // The format of the image being uploaded. + Format string `protobuf:"bytes,2,opt,name=format" json:"format,omitempty"` + // The layers to be scanned for this particular ancestry. + Layers []*PostAncestryRequest_PostLayer `protobuf:"bytes,3,rep,name=layers" json:"layers,omitempty"` } func (m *PostAncestryRequest) Reset() { *m = PostAncestryRequest{} } func (m *PostAncestryRequest) String() string { return proto.CompactTextString(m) } func (*PostAncestryRequest) ProtoMessage() {} -func (*PostAncestryRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +func (*PostAncestryRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (m *PostAncestryRequest) GetAncestryName() string { if m != nil { @@ -438,8 +385,11 @@ func (m *PostAncestryRequest) GetLayers() []*PostAncestryRequest_PostLayer { } type PostAncestryRequest_PostLayer struct { - Hash string `protobuf:"bytes,1,opt,name=hash" json:"hash,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` + // The hash of the layer. + Hash string `protobuf:"bytes,1,opt,name=hash" json:"hash,omitempty"` + // The location of the layer (URL or filepath). + Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` + // Any HTTP Headers that need to be used if requesting a layer over HTTP(S). Headers map[string]string `protobuf:"bytes,3,rep,name=headers" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` } @@ -447,7 +397,7 @@ func (m *PostAncestryRequest_PostLayer) Reset() { *m = PostAncestryReque func (m *PostAncestryRequest_PostLayer) String() string { return proto.CompactTextString(m) } func (*PostAncestryRequest_PostLayer) ProtoMessage() {} func (*PostAncestryRequest_PostLayer) Descriptor() ([]byte, []int) { - return fileDescriptor0, []int{8, 0} + return fileDescriptor0, []int{6, 0} } func (m *PostAncestryRequest_PostLayer) GetHash() string { @@ -472,13 +422,14 @@ func (m *PostAncestryRequest_PostLayer) GetHeaders() map[string]string { } type PostAncestryResponse struct { + // The status of Clair at the time of the request. Status *ClairStatus `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"` } func (m *PostAncestryResponse) Reset() { *m = PostAncestryResponse{} } func (m *PostAncestryResponse) String() string { return proto.CompactTextString(m) } func (*PostAncestryResponse) ProtoMessage() {} -func (*PostAncestryResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } +func (*PostAncestryResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *PostAncestryResponse) GetStatus() *ClairStatus { if m != nil { @@ -487,127 +438,229 @@ func (m *PostAncestryResponse) GetStatus() *ClairStatus { return nil } -type GetAncestryRequest struct { - AncestryName string `protobuf:"bytes,1,opt,name=ancestry_name,json=ancestryName" json:"ancestry_name,omitempty"` - WithVulnerabilities bool `protobuf:"varint,2,opt,name=with_vulnerabilities,json=withVulnerabilities" json:"with_vulnerabilities,omitempty"` - WithFeatures bool `protobuf:"varint,3,opt,name=with_features,json=withFeatures" json:"with_features,omitempty"` +type GetNotificationRequest struct { + // The current page of previous vulnerabilities for the ancestry. + // This will be empty when it is the first page. + OldVulnerabilityPage string `protobuf:"bytes,1,opt,name=old_vulnerability_page,json=oldVulnerabilityPage" json:"old_vulnerability_page,omitempty"` + // The current page of vulnerabilities for the ancestry. + // This will be empty when it is the first page. + NewVulnerabilityPage string `protobuf:"bytes,2,opt,name=new_vulnerability_page,json=newVulnerabilityPage" json:"new_vulnerability_page,omitempty"` + // The requested maximum number of results per page. + Limit int32 `protobuf:"varint,3,opt,name=limit" json:"limit,omitempty"` + // The name of the notification being requested. + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` } -func (m *GetAncestryRequest) Reset() { *m = GetAncestryRequest{} } -func (m *GetAncestryRequest) String() string { return proto.CompactTextString(m) } -func (*GetAncestryRequest) ProtoMessage() {} -func (*GetAncestryRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } +func (m *GetNotificationRequest) Reset() { *m = GetNotificationRequest{} } +func (m *GetNotificationRequest) String() string { return proto.CompactTextString(m) } +func (*GetNotificationRequest) ProtoMessage() {} +func (*GetNotificationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } -func (m *GetAncestryRequest) GetAncestryName() string { +func (m *GetNotificationRequest) GetOldVulnerabilityPage() string { if m != nil { - return m.AncestryName + return m.OldVulnerabilityPage } return "" } -func (m *GetAncestryRequest) GetWithVulnerabilities() bool { +func (m *GetNotificationRequest) GetNewVulnerabilityPage() string { if m != nil { - return m.WithVulnerabilities + return m.NewVulnerabilityPage } - return false + return "" } -func (m *GetAncestryRequest) GetWithFeatures() bool { +func (m *GetNotificationRequest) GetLimit() int32 { if m != nil { - return m.WithFeatures + return m.Limit } - return false + return 0 } -type GetAncestryResponse struct { - Ancestry *Ancestry `protobuf:"bytes,1,opt,name=ancestry" json:"ancestry,omitempty"` - Status *ClairStatus `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` +func (m *GetNotificationRequest) GetName() string { + if m != nil { + return m.Name + } + return "" } -func (m *GetAncestryResponse) Reset() { *m = GetAncestryResponse{} } -func (m *GetAncestryResponse) String() string { return proto.CompactTextString(m) } -func (*GetAncestryResponse) ProtoMessage() {} -func (*GetAncestryResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } +type GetNotificationResponse struct { + // The notification as requested. + Notification *GetNotificationResponse_Notification `protobuf:"bytes,1,opt,name=notification" json:"notification,omitempty"` +} -func (m *GetAncestryResponse) GetAncestry() *Ancestry { +func (m *GetNotificationResponse) Reset() { *m = GetNotificationResponse{} } +func (m *GetNotificationResponse) String() string { return proto.CompactTextString(m) } +func (*GetNotificationResponse) ProtoMessage() {} +func (*GetNotificationResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *GetNotificationResponse) GetNotification() *GetNotificationResponse_Notification { if m != nil { - return m.Ancestry + return m.Notification } return nil } -func (m *GetAncestryResponse) GetStatus() *ClairStatus { +type GetNotificationResponse_Notification struct { + // The name of the requested notification. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The time at which the notification was created. + Created string `protobuf:"bytes,2,opt,name=created" json:"created,omitempty"` + // The time at which the notification was last sent out. + Notified string `protobuf:"bytes,3,opt,name=notified" json:"notified,omitempty"` + // The time at which a notification has been deleted. + Deleted string `protobuf:"bytes,4,opt,name=deleted" json:"deleted,omitempty"` + // The previous vulnerability and a paginated view of the ancestries it affects. + Old *PagedVulnerableAncestries `protobuf:"bytes,5,opt,name=old" json:"old,omitempty"` + // The newly updated vulnerability and a paginated view of the ancestries it affects. + New *PagedVulnerableAncestries `protobuf:"bytes,6,opt,name=new" json:"new,omitempty"` +} + +func (m *GetNotificationResponse_Notification) Reset() { *m = GetNotificationResponse_Notification{} } +func (m *GetNotificationResponse_Notification) String() string { return proto.CompactTextString(m) } +func (*GetNotificationResponse_Notification) ProtoMessage() {} +func (*GetNotificationResponse_Notification) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{9, 0} +} + +func (m *GetNotificationResponse_Notification) GetName() string { if m != nil { - return m.Status + return m.Name + } + return "" +} + +func (m *GetNotificationResponse_Notification) GetCreated() string { + if m != nil { + return m.Created + } + return "" +} + +func (m *GetNotificationResponse_Notification) GetNotified() string { + if m != nil { + return m.Notified + } + return "" +} + +func (m *GetNotificationResponse_Notification) GetDeleted() string { + if m != nil { + return m.Deleted + } + return "" +} + +func (m *GetNotificationResponse_Notification) GetOld() *PagedVulnerableAncestries { + if m != nil { + return m.Old } return nil } -type GetNotificationRequest struct { - // if the vulnerability_page is empty, it implies the first page. - OldVulnerabilityPage string `protobuf:"bytes,1,opt,name=old_vulnerability_page,json=oldVulnerabilityPage" json:"old_vulnerability_page,omitempty"` - NewVulnerabilityPage string `protobuf:"bytes,2,opt,name=new_vulnerability_page,json=newVulnerabilityPage" json:"new_vulnerability_page,omitempty"` - Limit int32 `protobuf:"varint,3,opt,name=limit" json:"limit,omitempty"` - Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` +func (m *GetNotificationResponse_Notification) GetNew() *PagedVulnerableAncestries { + if m != nil { + return m.New + } + return nil } -func (m *GetNotificationRequest) Reset() { *m = GetNotificationRequest{} } -func (m *GetNotificationRequest) String() string { return proto.CompactTextString(m) } -func (*GetNotificationRequest) ProtoMessage() {} -func (*GetNotificationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } +type PagedVulnerableAncestries struct { + // The identifier for the current page. + CurrentPage string `protobuf:"bytes,1,opt,name=current_page,json=currentPage" json:"current_page,omitempty"` + // The token used to request the next page. + // This will be empty when there are no more pages. + NextPage string `protobuf:"bytes,2,opt,name=next_page,json=nextPage" json:"next_page,omitempty"` + // The requested maximum number of results per page. + Limit int32 `protobuf:"varint,3,opt,name=limit" json:"limit,omitempty"` + // The vulnerability that affects a given set of ancestries. + Vulnerability *Vulnerability `protobuf:"bytes,4,opt,name=vulnerability" json:"vulnerability,omitempty"` + // The ancestries affected by a vulnerability. + Ancestries []*PagedVulnerableAncestries_IndexedAncestryName `protobuf:"bytes,5,rep,name=ancestries" json:"ancestries,omitempty"` +} -func (m *GetNotificationRequest) GetOldVulnerabilityPage() string { +func (m *PagedVulnerableAncestries) Reset() { *m = PagedVulnerableAncestries{} } +func (m *PagedVulnerableAncestries) String() string { return proto.CompactTextString(m) } +func (*PagedVulnerableAncestries) ProtoMessage() {} +func (*PagedVulnerableAncestries) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *PagedVulnerableAncestries) GetCurrentPage() string { if m != nil { - return m.OldVulnerabilityPage + return m.CurrentPage } return "" } -func (m *GetNotificationRequest) GetNewVulnerabilityPage() string { +func (m *PagedVulnerableAncestries) GetNextPage() string { if m != nil { - return m.NewVulnerabilityPage + return m.NextPage } return "" } -func (m *GetNotificationRequest) GetLimit() int32 { +func (m *PagedVulnerableAncestries) GetLimit() int32 { if m != nil { return m.Limit } return 0 } -func (m *GetNotificationRequest) GetName() string { +func (m *PagedVulnerableAncestries) GetVulnerability() *Vulnerability { if m != nil { - return m.Name + return m.Vulnerability } - return "" + return nil } -type GetNotificationResponse struct { - Notification *Notification `protobuf:"bytes,1,opt,name=notification" json:"notification,omitempty"` +func (m *PagedVulnerableAncestries) GetAncestries() []*PagedVulnerableAncestries_IndexedAncestryName { + if m != nil { + return m.Ancestries + } + return nil } -func (m *GetNotificationResponse) Reset() { *m = GetNotificationResponse{} } -func (m *GetNotificationResponse) String() string { return proto.CompactTextString(m) } -func (*GetNotificationResponse) ProtoMessage() {} -func (*GetNotificationResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } +type PagedVulnerableAncestries_IndexedAncestryName struct { + // The index is an ever increasing number associated with the particular ancestry. + // This is useful if you're processing notifications, and need to keep track of the progress of paginating the results. + Index int32 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"` + // The name of the ancestry. + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` +} + +func (m *PagedVulnerableAncestries_IndexedAncestryName) Reset() { + *m = PagedVulnerableAncestries_IndexedAncestryName{} +} +func (m *PagedVulnerableAncestries_IndexedAncestryName) String() string { + return proto.CompactTextString(m) +} +func (*PagedVulnerableAncestries_IndexedAncestryName) ProtoMessage() {} +func (*PagedVulnerableAncestries_IndexedAncestryName) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{10, 0} +} -func (m *GetNotificationResponse) GetNotification() *Notification { +func (m *PagedVulnerableAncestries_IndexedAncestryName) GetIndex() int32 { if m != nil { - return m.Notification + return m.Index } - return nil + return 0 +} + +func (m *PagedVulnerableAncestries_IndexedAncestryName) GetName() string { + if m != nil { + return m.Name + } + return "" } type MarkNotificationAsReadRequest struct { + // The name of the Notification that has been processed. Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` } func (m *MarkNotificationAsReadRequest) Reset() { *m = MarkNotificationAsReadRequest{} } func (m *MarkNotificationAsReadRequest) String() string { return proto.CompactTextString(m) } func (*MarkNotificationAsReadRequest) ProtoMessage() {} -func (*MarkNotificationAsReadRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } +func (*MarkNotificationAsReadRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } func (m *MarkNotificationAsReadRequest) GetName() string { if m != nil { @@ -618,20 +671,20 @@ func (m *MarkNotificationAsReadRequest) GetName() string { func init() { proto.RegisterType((*Vulnerability)(nil), "clairpb.Vulnerability") - proto.RegisterType((*ClairStatus)(nil), "clairpb.ClairStatus") proto.RegisterType((*Feature)(nil), "clairpb.Feature") - proto.RegisterType((*Ancestry)(nil), "clairpb.Ancestry") proto.RegisterType((*Layer)(nil), "clairpb.Layer") - proto.RegisterType((*Notification)(nil), "clairpb.Notification") - proto.RegisterType((*IndexedAncestryName)(nil), "clairpb.IndexedAncestryName") - proto.RegisterType((*PagedVulnerableAncestries)(nil), "clairpb.PagedVulnerableAncestries") + proto.RegisterType((*ClairStatus)(nil), "clairpb.ClairStatus") + proto.RegisterType((*GetAncestryRequest)(nil), "clairpb.GetAncestryRequest") + proto.RegisterType((*GetAncestryResponse)(nil), "clairpb.GetAncestryResponse") + proto.RegisterType((*GetAncestryResponse_Ancestry)(nil), "clairpb.GetAncestryResponse.Ancestry") proto.RegisterType((*PostAncestryRequest)(nil), "clairpb.PostAncestryRequest") proto.RegisterType((*PostAncestryRequest_PostLayer)(nil), "clairpb.PostAncestryRequest.PostLayer") proto.RegisterType((*PostAncestryResponse)(nil), "clairpb.PostAncestryResponse") - proto.RegisterType((*GetAncestryRequest)(nil), "clairpb.GetAncestryRequest") - proto.RegisterType((*GetAncestryResponse)(nil), "clairpb.GetAncestryResponse") proto.RegisterType((*GetNotificationRequest)(nil), "clairpb.GetNotificationRequest") proto.RegisterType((*GetNotificationResponse)(nil), "clairpb.GetNotificationResponse") + proto.RegisterType((*GetNotificationResponse_Notification)(nil), "clairpb.GetNotificationResponse.Notification") + proto.RegisterType((*PagedVulnerableAncestries)(nil), "clairpb.PagedVulnerableAncestries") + proto.RegisterType((*PagedVulnerableAncestries_IndexedAncestryName)(nil), "clairpb.PagedVulnerableAncestries.IndexedAncestryName") proto.RegisterType((*MarkNotificationAsReadRequest)(nil), "clairpb.MarkNotificationAsReadRequest") } @@ -646,8 +699,10 @@ const _ = grpc.SupportPackageIsVersion4 // Client API for AncestryService service type AncestryServiceClient interface { - PostAncestry(ctx context.Context, in *PostAncestryRequest, opts ...grpc.CallOption) (*PostAncestryResponse, error) + // The RPC used to read the results of scanning for a particular ancestry. GetAncestry(ctx context.Context, in *GetAncestryRequest, opts ...grpc.CallOption) (*GetAncestryResponse, error) + // The RPC used to create a new scan of an ancestry. + PostAncestry(ctx context.Context, in *PostAncestryRequest, opts ...grpc.CallOption) (*PostAncestryResponse, error) } type ancestryServiceClient struct { @@ -658,18 +713,18 @@ func NewAncestryServiceClient(cc *grpc.ClientConn) AncestryServiceClient { return &ancestryServiceClient{cc} } -func (c *ancestryServiceClient) PostAncestry(ctx context.Context, in *PostAncestryRequest, opts ...grpc.CallOption) (*PostAncestryResponse, error) { - out := new(PostAncestryResponse) - err := grpc.Invoke(ctx, "/clairpb.AncestryService/PostAncestry", in, out, c.cc, opts...) +func (c *ancestryServiceClient) GetAncestry(ctx context.Context, in *GetAncestryRequest, opts ...grpc.CallOption) (*GetAncestryResponse, error) { + out := new(GetAncestryResponse) + err := grpc.Invoke(ctx, "/clairpb.AncestryService/GetAncestry", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -func (c *ancestryServiceClient) GetAncestry(ctx context.Context, in *GetAncestryRequest, opts ...grpc.CallOption) (*GetAncestryResponse, error) { - out := new(GetAncestryResponse) - err := grpc.Invoke(ctx, "/clairpb.AncestryService/GetAncestry", in, out, c.cc, opts...) +func (c *ancestryServiceClient) PostAncestry(ctx context.Context, in *PostAncestryRequest, opts ...grpc.CallOption) (*PostAncestryResponse, error) { + out := new(PostAncestryResponse) + err := grpc.Invoke(ctx, "/clairpb.AncestryService/PostAncestry", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -679,46 +734,48 @@ func (c *ancestryServiceClient) GetAncestry(ctx context.Context, in *GetAncestry // Server API for AncestryService service type AncestryServiceServer interface { - PostAncestry(context.Context, *PostAncestryRequest) (*PostAncestryResponse, error) + // The RPC used to read the results of scanning for a particular ancestry. GetAncestry(context.Context, *GetAncestryRequest) (*GetAncestryResponse, error) + // The RPC used to create a new scan of an ancestry. + PostAncestry(context.Context, *PostAncestryRequest) (*PostAncestryResponse, error) } func RegisterAncestryServiceServer(s *grpc.Server, srv AncestryServiceServer) { s.RegisterService(&_AncestryService_serviceDesc, srv) } -func _AncestryService_PostAncestry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PostAncestryRequest) +func _AncestryService_GetAncestry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAncestryRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AncestryServiceServer).PostAncestry(ctx, in) + return srv.(AncestryServiceServer).GetAncestry(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/clairpb.AncestryService/PostAncestry", + FullMethod: "/clairpb.AncestryService/GetAncestry", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AncestryServiceServer).PostAncestry(ctx, req.(*PostAncestryRequest)) + return srv.(AncestryServiceServer).GetAncestry(ctx, req.(*GetAncestryRequest)) } return interceptor(ctx, in, info, handler) } -func _AncestryService_GetAncestry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAncestryRequest) +func _AncestryService_PostAncestry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PostAncestryRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AncestryServiceServer).GetAncestry(ctx, in) + return srv.(AncestryServiceServer).PostAncestry(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/clairpb.AncestryService/GetAncestry", + FullMethod: "/clairpb.AncestryService/PostAncestry", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AncestryServiceServer).GetAncestry(ctx, req.(*GetAncestryRequest)) + return srv.(AncestryServiceServer).PostAncestry(ctx, req.(*PostAncestryRequest)) } return interceptor(ctx, in, info, handler) } @@ -727,14 +784,14 @@ var _AncestryService_serviceDesc = grpc.ServiceDesc{ ServiceName: "clairpb.AncestryService", HandlerType: (*AncestryServiceServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "PostAncestry", - Handler: _AncestryService_PostAncestry_Handler, - }, { MethodName: "GetAncestry", Handler: _AncestryService_GetAncestry_Handler, }, + { + MethodName: "PostAncestry", + Handler: _AncestryService_PostAncestry_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/v3/clairpb/clair.proto", @@ -743,7 +800,9 @@ var _AncestryService_serviceDesc = grpc.ServiceDesc{ // Client API for NotificationService service type NotificationServiceClient interface { + // The RPC used to get a particularly Notification. GetNotification(ctx context.Context, in *GetNotificationRequest, opts ...grpc.CallOption) (*GetNotificationResponse, error) + // The RPC used to mark a Notification as read after it has been processed. MarkNotificationAsRead(ctx context.Context, in *MarkNotificationAsReadRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) } @@ -776,7 +835,9 @@ func (c *notificationServiceClient) MarkNotificationAsRead(ctx context.Context, // Server API for NotificationService service type NotificationServiceServer interface { + // The RPC used to get a particularly Notification. GetNotification(context.Context, *GetNotificationRequest) (*GetNotificationResponse, error) + // The RPC used to mark a Notification as read after it has been processed. MarkNotificationAsRead(context.Context, *MarkNotificationAsReadRequest) (*google_protobuf1.Empty, error) } @@ -840,78 +901,78 @@ var _NotificationService_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("api/v3/clairpb/clair.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1162 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0xdb, 0x46, - 0x13, 0x06, 0x25, 0xcb, 0x92, 0x46, 0xf2, 0xd7, 0x5a, 0x51, 0x68, 0xd9, 0x46, 0x1c, 0xbe, 0x78, - 0xd3, 0x20, 0x6d, 0x25, 0x54, 0xf6, 0xa1, 0x35, 0xd2, 0x8f, 0xa4, 0x4e, 0xd2, 0x02, 0x49, 0x10, - 0x30, 0xa9, 0x0f, 0xbd, 0x08, 0x6b, 0x72, 0x64, 0x13, 0xa6, 0x48, 0x96, 0xbb, 0x92, 0x2c, 0x04, - 0xbd, 0xb4, 0xc7, 0x9e, 0xda, 0xfe, 0x8f, 0xfe, 0x84, 0x5e, 0x0b, 0xf4, 0x9a, 0x7b, 0x81, 0x02, - 0xbd, 0xf6, 0x3f, 0x14, 0xbb, 0xdc, 0xa5, 0x48, 0x8b, 0x0e, 0x8c, 0xf6, 0x24, 0xce, 0xcc, 0x33, - 0xbb, 0x33, 0xcf, 0x33, 0x3b, 0x10, 0x74, 0x68, 0xe4, 0xf5, 0x26, 0xfb, 0x3d, 0xc7, 0xa7, 0x5e, - 0x1c, 0x9d, 0x24, 0xbf, 0xdd, 0x28, 0x0e, 0x79, 0x48, 0xaa, 0xca, 0xd9, 0xd9, 0x39, 0x0d, 0xc3, - 0x53, 0x1f, 0x7b, 0x02, 0x4b, 0x83, 0x20, 0xe4, 0x94, 0x7b, 0x61, 0xc0, 0x12, 0x58, 0x67, 0x5b, - 0x45, 0xa5, 0x75, 0x32, 0x1e, 0xf6, 0x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9b, 0x6c, 0xa5, 0xe7, 0xf7, 0x5e, 0xe7, 0xc6, - 0xff, 0xdb, 0xfe, 0xf7, 0x25, 0xd8, 0xcc, 0xb2, 0xa2, 0xfb, 0x64, 0xb0, 0x76, 0x49, 0x06, 0x72, - 0x2b, 0x7b, 0x57, 0xc1, 0x40, 0x75, 0xf6, 0xae, 0x06, 0xa8, 0x82, 0x76, 0x65, 0x41, 0x37, 0xc9, - 0x8d, 0x5e, 0x56, 0x1d, 0xd6, 0x7b, 0x2d, 0x8b, 0x21, 0x53, 0x68, 0x17, 0xab, 0x44, 0xe6, 0x5b, - 0xf0, 0xad, 0x32, 0x76, 0xda, 0x0b, 0x7f, 0xc2, 0x1e, 0x89, 0xbf, 0xce, 0xfa, 0xe2, 0x7b, 0xc5, - 0x17, 0x3f, 0xac, 0x7f, 0xad, 0xff, 0x99, 0x9f, 0x2c, 0xcb, 0xcc, 0xfd, 0x7f, 0x02, 0x00, 0x00, - 0xff, 0xff, 0x51, 0xb7, 0x75, 0x58, 0xc7, 0x0b, 0x00, 0x00, + // 1166 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xdd, 0x6f, 0xdb, 0x54, + 0x14, 0x97, 0xd3, 0xa6, 0x49, 0x4e, 0xd2, 0x8f, 0xdd, 0x86, 0xcc, 0x73, 0x3b, 0xad, 0x33, 0xda, + 0x98, 0xc6, 0x48, 0x44, 0x3a, 0x21, 0x54, 0xf1, 0xd5, 0xd1, 0x6d, 0x20, 0x6d, 0xd3, 0xf0, 0xa0, + 0x0f, 0xbc, 0x44, 0xb7, 0xf6, 0x49, 0x6b, 0xd5, 0xb1, 0x8d, 0xef, 0x4d, 0xd2, 0x68, 0xe2, 0x05, + 0x1e, 0x79, 0x02, 0xfe, 0x0f, 0xfe, 0x04, 0x5e, 0x41, 0x48, 0x3c, 0xed, 0x1d, 0x09, 0x89, 0x3f, + 0x04,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f, 0x82, 0xde, 0xe0, 0x60, 0x66, 0xd6, 0xa4, 0xac, 0x26, 0xe9, 0x07, + 0x33, 0xf2, 0x21, 0x5c, 0xa1, 0xc3, 0x21, 0xba, 0x1c, 0xbd, 0xc1, 0x04, 0x13, 0x26, 0xda, 0x65, + 0xd6, 0xb7, 0x16, 0xee, 0x34, 0xfb, 0x6b, 0x5d, 0xd5, 0xd6, 0xee, 0x23, 0xa4, 0x7c, 0x9c, 0xa0, + 0xb3, 0xa6, 0x55, 0xf7, 0x95, 0xa6, 0xfd, 0x9b, 0x01, 0x35, 0x25, 0xfd, 0x3f, 0xed, 0x30, 0xa1, + 0xa6, 0x82, 0xab, 0x56, 0x68, 0x52, 0x38, 0x50, 0x9f, 0x83, 0x61, 0x94, 0x8c, 0x28, 0x57, 0x0d, + 0x59, 0x56, 0xdc, 0x47, 0x92, 0x49, 0x3e, 0x81, 0xd5, 0x49, 0x6e, 0x36, 0x3e, 0x32, 0xb3, 0x2a, + 0x8b, 0xe8, 0x64, 0x45, 0x14, 0x66, 0xe7, 0x9c, 0x56, 0xb7, 0x37, 0xa0, 0xfa, 0x84, 0xce, 0x30, + 0x11, 0x65, 0x1c, 0x51, 0x76, 0xa4, 0xcb, 0x10, 0xdf, 0xf6, 0x0f, 0x06, 0x34, 0x3f, 0x15, 0x7e, + 0x5e, 0x70, 0xca, 0xc7, 0x4c, 0xe4, 0x1b, 0xf8, 0x8c, 0x63, 0xc2, 0x4c, 0x63, 0x6b, 0x41, 0xe4, + 0xab, 0x48, 0xb2, 0x09, 0x0d, 0x0f, 0x39, 0xba, 0x3c, 0x4a, 0x98, 0x59, 0x91, 0xb2, 0x39, 0x83, + 0xec, 0xc1, 0x5a, 0x40, 0x19, 0x1f, 0x8c, 0x63, 0x8f, 0x72, 0x1c, 0x08, 0x88, 0xc9, 0x82, 0x9b, + 0x7d, 0xab, 0x9b, 0xe2, 0xaf, 0xab, 0xf1, 0xd7, 0xfd, 0x52, 0xe3, 0xcf, 0x59, 0x11, 0x36, 0x5f, + 0x49, 0x13, 0xc1, 0xb4, 0x7f, 0x34, 0x80, 0x3c, 0x46, 0xbe, 0x1b, 0xba, 0xc8, 0x78, 0x32, 0x73, + 0xf0, 0x9b, 0x31, 0x32, 0x4e, 0xde, 0x84, 0x65, 0xaa, 0x58, 0x83, 0xdc, 0x20, 0x5a, 0x9a, 0x29, + 0x3b, 0xfd, 0x2e, 0xb4, 0xa7, 0x3e, 0x3f, 0x1a, 0x9c, 0xee, 0x96, 0x18, 0x4b, 0xdd, 0x59, 0x17, + 0xb2, 0xfd, 0xa2, 0x48, 0xf8, 0x95, 0x26, 0xc3, 0x74, 0xce, 0x4c, 0x66, 0x5c, 0x77, 0x5a, 0x82, + 0xa9, 0x66, 0xcf, 0xec, 0x57, 0x15, 0x58, 0x2f, 0xe4, 0xc4, 0xe2, 0x28, 0x64, 0x48, 0x76, 0xa1, + 0xae, 0xe3, 0xcb, 0x7c, 0x9a, 0xfd, 0x5b, 0xd9, 0x44, 0x4a, 0xf4, 0xbb, 0x19, 0x23, 0x33, 0x23, + 0xf7, 0x60, 0x89, 0xc9, 0xb6, 0xcb, 0x24, 0x9b, 0xfd, 0x76, 0xe6, 0x20, 0x37, 0x12, 0x47, 0xe9, + 0x58, 0x7f, 0x18, 0x50, 0xd7, 0x4e, 0x4a, 0x21, 0x79, 0x0f, 0xea, 0x59, 0x25, 0x95, 0x73, 0x80, + 0x9e, 0x69, 0x90, 0xdb, 0xb0, 0x14, 0x08, 0x58, 0x88, 0xaa, 0x85, 0xee, 0x4a, 0xa6, 0x2b, 0xd1, + 0xe2, 0x28, 0x29, 0x79, 0x0b, 0x56, 0x99, 0x4b, 0xc3, 0x10, 0xbd, 0x81, 0x46, 0xc6, 0xa2, 0x9c, + 0xfe, 0x8a, 0x62, 0x3f, 0x51, 0x00, 0x79, 0x1b, 0xae, 0x68, 0xc5, 0x39, 0x50, 0xaa, 0x52, 0x75, + 0x4d, 0x09, 0xf6, 0x34, 0x5f, 0x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 0x38, 0x0f, 0x97, 0x5d, 0xe6, 0x20, 0xf5, 0xf4, 0x46, 0x95, 0x60, 0xa7, 0xff, + 0xb7, 0x01, 0xab, 0x3a, 0xde, 0x0b, 0x4c, 0x26, 0xbe, 0x8b, 0xe4, 0x18, 0x9a, 0xb9, 0xab, 0x42, + 0x36, 0xca, 0x6f, 0x8d, 0xf4, 0x69, 0x6d, 0x5e, 0x74, 0x88, 0xec, 0x9b, 0xdf, 0xbd, 0xfa, 0xe7, + 0xe7, 0xca, 0x06, 0xb9, 0xd6, 0xd3, 0x8f, 0x6a, 0xef, 0x65, 0xe1, 0xcd, 0xfd, 0x96, 0x50, 0x68, + 0xe5, 0xdf, 0x11, 0xb2, 0x79, 0xd1, 0x8b, 0x66, 0x5d, 0x3f, 0x47, 0xaa, 0xe2, 0xb5, 0x65, 0xbc, + 0x15, 0xbb, 0x91, 0xc5, 0xdb, 0x31, 0xee, 0xf6, 0xbf, 0xaf, 0xc0, 0x7a, 0xbe, 0x2b, 0xba, 0x4e, + 0x06, 0xab, 0xa7, 0x56, 0x92, 0xdc, 0x38, 0x7f, 0x59, 0xd3, 0x04, 0xb6, 0x2e, 0xdb, 0x66, 0xfb, + 0xba, 0xcc, 0xe1, 0x2a, 0x79, 0xa3, 0x97, 0xdf, 0x64, 0xd6, 0x7b, 0x99, 0xd6, 0x3b, 0x85, 0x4e, + 0xf9, 0x94, 0xc8, 0xfc, 0x84, 0x5c, 0x38, 0x46, 0xab, 0x73, 0xe6, 0x5f, 0xce, 0x43, 0xf1, 0x17, + 0x5c, 0x07, 0xbe, 0x5b, 0x1e, 0xf8, 0x41, 0xe3, 0x6b, 0xfd, 0x0f, 0xff, 0x60, 0x49, 0x5a, 0x6e, + 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xee, 0xb6, 0xdc, 0x0f, 0x0c, 0x00, 0x00, } diff --git a/api/v3/clairpb/clair.pb.gw.go b/api/v3/clairpb/clair.pb.gw.go index ebe4435d..5e4cd05c 100644 --- a/api/v3/clairpb/clair.pb.gw.go +++ b/api/v3/clairpb/clair.pb.gw.go @@ -28,21 +28,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -func request_AncestryService_PostAncestry_0(ctx context.Context, marshaler runtime.Marshaler, client AncestryServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PostAncestryRequest - var metadata runtime.ServerMetadata - - if req.ContentLength > 0 { - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - } - - msg, err := client.PostAncestry(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - var ( filter_AncestryService_GetAncestry_0 = &utilities.DoubleArray{Encoding: map[string]int{"ancestry_name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) @@ -78,6 +63,21 @@ func request_AncestryService_GetAncestry_0(ctx context.Context, marshaler runtim } +func request_AncestryService_PostAncestry_0(ctx context.Context, marshaler runtime.Marshaler, client AncestryServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PostAncestryRequest + var metadata runtime.ServerMetadata + + if req.ContentLength > 0 { + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + } + + msg, err := client.PostAncestry(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + var ( filter_NotificationService_GetNotification_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) @@ -178,7 +178,7 @@ func RegisterAncestryServiceHandler(ctx context.Context, mux *runtime.ServeMux, // "AncestryServiceClient" to call the correct interceptors. func RegisterAncestryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AncestryServiceClient) error { - mux.Handle("POST", pattern_AncestryService_PostAncestry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_AncestryService_GetAncestry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() if cn, ok := w.(http.CloseNotifier); ok { @@ -196,18 +196,18 @@ func RegisterAncestryServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_AncestryService_PostAncestry_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_AncestryService_GetAncestry_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_AncestryService_PostAncestry_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_AncestryService_GetAncestry_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_AncestryService_GetAncestry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_AncestryService_PostAncestry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() if cn, ok := w.(http.CloseNotifier); ok { @@ -225,14 +225,14 @@ func RegisterAncestryServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_AncestryService_GetAncestry_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_AncestryService_PostAncestry_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_AncestryService_GetAncestry_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_AncestryService_PostAncestry_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -240,15 +240,15 @@ func RegisterAncestryServiceHandlerClient(ctx context.Context, mux *runtime.Serv } var ( - pattern_AncestryService_PostAncestry_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"ancestry"}, "")) - pattern_AncestryService_GetAncestry_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"ancestry", "ancestry_name"}, "")) + + pattern_AncestryService_PostAncestry_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"ancestry"}, "")) ) var ( - forward_AncestryService_PostAncestry_0 = runtime.ForwardResponseMessage - forward_AncestryService_GetAncestry_0 = runtime.ForwardResponseMessage + + forward_AncestryService_PostAncestry_0 = runtime.ForwardResponseMessage ) // RegisterNotificationServiceHandlerFromEndpoint is same as RegisterNotificationServiceHandler but diff --git a/api/v3/clairpb/clair.proto b/api/v3/clairpb/clair.proto index be1eabd8..0a384383 100644 --- a/api/v3/clairpb/clair.proto +++ b/api/v3/clairpb/clair.proto @@ -1,4 +1,4 @@ -// Copyright 2017 clair authors +// Copyright 2018 clair authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,150 +16,239 @@ syntax = "proto3"; option go_package = "clairpb"; package clairpb; + import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; message Vulnerability { - string name = 1; - string namespace_name = 2; - string description = 3; - string link = 4; - string severity = 5; - string metadata = 6; - // fixed_by exists when vulnerability is under feature. - string fixed_by = 7; - // affected_versions exists when vulnerability is under notification. - repeated Feature affected_versions = 8; -} + // The name of the vulnerability. + string name = 1; -message ClairStatus { - // listers and detectors are processors implemented in this Clair and used to - // scan ancestries - repeated string listers = 1; - repeated string detectors = 2; - google.protobuf.Timestamp last_update_time = 3; -} + // The name of the namespace in which the vulnerability was detected. + string namespace_name = 2; + + // A description of the vulnerability according to the source for the namespace. + string description = 3; + + // A link to the vulnerability according to the source for the namespace. + string link = 4; + + // How dangerous the vulnerability is. + string severity = 5; -message Feature{ - string name = 1; - string namespace_name = 2; - string version = 3; + // Namespace agnostic metadata about the vulnerability. + string metadata = 6; - // version_format is the format used by installer package manager to store - // package versions. - string version_format = 4; - repeated Vulnerability vulnerabilities = 5; + // The feature that fixes this vulnerability. + // This field only exists when a vulnerability is a part of a Feature. + string fixed_by = 7; + + // The Features that are affected by the vulnerability. + // This field only exists when a vulnerability is a part of a Notification. + repeated Feature affected_versions = 8; } -message Ancestry { - string name = 1; - repeated Feature features = 2; - repeated Layer layers = 3; +message Feature { + // The name of the feature. + string name = 1; + + // The name of the namespace in which the feature is detected. + string namespace_name = 2; + + // The specific version of this feature. + string version = 3; + + // The format used to parse version numbers for the feature. + string version_format = 4; - // scanned_listers and scanned_detectors are used to scan this ancestry, it - // may be different from listers and detectors in ClairStatus since the - // ancestry could be scanned by previous version of Clair. - repeated string scanned_listers = 4; - repeated string scanned_detectors = 5; + // The list of vulnerabilities that affect the feature. + repeated Vulnerability vulnerabilities = 5; } -message Layer { - string hash = 1; +message Layer { + // The sha256 tarsum for the layer. + string hash = 1; +} + +service AncestryService { + // The RPC used to read the results of scanning for a particular ancestry. + rpc GetAncestry(GetAncestryRequest) returns (GetAncestryResponse) { + option (google.api.http) = { + get: "/ancestry/{ancestry_name}" + }; + } + + // The RPC used to create a new scan of an ancestry. + rpc PostAncestry(PostAncestryRequest) returns (PostAncestryResponse) { + option (google.api.http) = { + post: "/ancestry" + body: "*" + }; + } } -message Notification { - string name = 1; - string created = 2; - string notified = 3; - string deleted = 4; - PagedVulnerableAncestries old = 5; - PagedVulnerableAncestries new = 6; +message ClairStatus { + // The configured list of feature listers used to scan an ancestry. + repeated string listers = 1; + + // The configured list of namespace detectors used to scan an ancestry. + repeated string detectors = 2; + + // The time at which the updater last ran. + google.protobuf.Timestamp last_update_time = 3; } -message IndexedAncestryName { - // index is unique to name in all streams simultaneously streamed, increasing - // and larger than all indexes in previous page in same stream. - int32 index = 1; - string name = 2; +message GetAncestryRequest { + // The name of the desired ancestry. + string ancestry_name = 1; + + // Whether to include vulnerabilities or not in the response. + bool with_vulnerabilities = 2; + + // Whether to include features or not in the response. + bool with_features = 3; } -message PagedVulnerableAncestries { - string current_page = 1; - // if next_page is empty, it signals the end of all pages. - string next_page = 2; - int32 limit = 3; - Vulnerability vulnerability = 4; - repeated IndexedAncestryName ancestries = 5; +message GetAncestryResponse { + message Ancestry { + // The name of the desired ancestry. + string name = 1; + + // The list of features present in the ancestry. + // This will only be provided if requested. + repeated Feature features = 2; + + // The layers present in the ancestry. + repeated Layer layers = 3; + + // The configured list of feature listers used to scan this ancestry. + repeated string scanned_listers = 4; + + // The configured list of namespace detectors used to scan an ancestry. + repeated string scanned_detectors = 5; + } + + // The ancestry requested. + Ancestry ancestry = 1; + + // The status of Clair at the time of the request. + ClairStatus status = 2; } message PostAncestryRequest { - message PostLayer { - string hash = 1; - string path = 2; - map headers = 3; - } - string ancestry_name = 1; - string format = 2; - repeated PostLayer layers = 3; + message PostLayer { + // The hash of the layer. + string hash = 1; + + // The location of the layer (URL or filepath). + string path = 2; + + // Any HTTP Headers that need to be used if requesting a layer over HTTP(S). + map headers = 3; + } + + // The name of the ancestry being scanned. + // If scanning OCI images, this should be the hash of the manifest. + string ancestry_name = 1; + + // The format of the image being uploaded. + string format = 2; + + // The layers to be scanned for this particular ancestry. + repeated PostLayer layers = 3; } message PostAncestryResponse { - ClairStatus status = 1; + // The status of Clair at the time of the request. + ClairStatus status = 1; } -message GetAncestryRequest { - string ancestry_name = 1; - bool with_vulnerabilities = 2; - bool with_features = 3; -} +service NotificationService { + // The RPC used to get a particularly Notification. + rpc GetNotification(GetNotificationRequest) returns (GetNotificationResponse) { + option (google.api.http) = { + get: "/notifications/{name}" + }; + } -message GetAncestryResponse { - Ancestry ancestry = 1; - ClairStatus status = 2; + // The RPC used to mark a Notification as read after it has been processed. + rpc MarkNotificationAsRead(MarkNotificationAsReadRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/notifications/{name}" + }; + } } message GetNotificationRequest { - // if the vulnerability_page is empty, it implies the first page. - string old_vulnerability_page = 1; - string new_vulnerability_page = 2; - int32 limit = 3; - string name = 4; + // The current page of previous vulnerabilities for the ancestry. + // This will be empty when it is the first page. + string old_vulnerability_page = 1; + + // The current page of vulnerabilities for the ancestry. + // This will be empty when it is the first page. + string new_vulnerability_page = 2; + + // The requested maximum number of results per page. + int32 limit = 3; + + // The name of the notification being requested. + string name = 4; } message GetNotificationResponse { - Notification notification = 1; -} + message Notification { + // The name of the requested notification. + string name = 1; -message MarkNotificationAsReadRequest { - string name = 1; + // The time at which the notification was created. + string created = 2; + + // The time at which the notification was last sent out. + string notified = 3; + + // The time at which a notification has been deleted. + string deleted = 4; + + // The previous vulnerability and a paginated view of the ancestries it affects. + PagedVulnerableAncestries old = 5; + + // The newly updated vulnerability and a paginated view of the ancestries it affects. + PagedVulnerableAncestries new = 6; + } + + // The notification as requested. + Notification notification = 1; } -service AncestryService{ - rpc PostAncestry(PostAncestryRequest) returns (PostAncestryResponse) { - option (google.api.http) = { - post: "/ancestry" - body: "*" - }; - } - - rpc GetAncestry(GetAncestryRequest) returns (GetAncestryResponse) { - option (google.api.http) = { - get: "/ancestry/{ancestry_name}" - }; - } +message PagedVulnerableAncestries { + message IndexedAncestryName { + // The index is an ever increasing number associated with the particular ancestry. + // This is useful if you're processing notifications, and need to keep track of the progress of paginating the results. + int32 index = 1; + + // The name of the ancestry. + string name = 2; + } + + // The identifier for the current page. + string current_page = 1; + + // The token used to request the next page. + // This will be empty when there are no more pages. + string next_page = 2; + + // The requested maximum number of results per page. + int32 limit = 3; + + // The vulnerability that affects a given set of ancestries. + Vulnerability vulnerability = 4; + + // The ancestries affected by a vulnerability. + repeated IndexedAncestryName ancestries = 5; } -service NotificationService{ - rpc GetNotification(GetNotificationRequest) returns (GetNotificationResponse) { - option (google.api.http) = { - get: "/notifications/{name}" - }; - } - - rpc MarkNotificationAsRead(MarkNotificationAsReadRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/notifications/{name}" - }; - } -} \ No newline at end of file +message MarkNotificationAsReadRequest { + // The name of the Notification that has been processed. + string name = 1; +} diff --git a/api/v3/clairpb/clair.swagger.json b/api/v3/clairpb/clair.swagger.json index 8bfd19de..3b450729 100644 --- a/api/v3/clairpb/clair.swagger.json +++ b/api/v3/clairpb/clair.swagger.json @@ -17,6 +17,7 @@ "paths": { "/ancestry": { "post": { + "summary": "The RPC used to create a new scan of an ancestry.", "operationId": "PostAncestry", "responses": { "200": { @@ -43,6 +44,7 @@ }, "/ancestry/{ancestry_name}": { "get": { + "summary": "The RPC used to read the results of scanning for a particular ancestry.", "operationId": "GetAncestry", "responses": { "200": { @@ -61,6 +63,7 @@ }, { "name": "with_vulnerabilities", + "description": "Whether to include vulnerabilities or not in the response.", "in": "query", "required": false, "type": "boolean", @@ -68,6 +71,7 @@ }, { "name": "with_features", + "description": "Whether to include features or not in the response.", "in": "query", "required": false, "type": "boolean", @@ -81,6 +85,7 @@ }, "/notifications/{name}": { "get": { + "summary": "The RPC used to get a particularly Notification.", "operationId": "GetNotification", "responses": { "200": { @@ -99,19 +104,21 @@ }, { "name": "old_vulnerability_page", - "description": "if the vulnerability_page is empty, it implies the first page.", + "description": "The current page of previous vulnerabilities for the ancestry.\nThis will be empty when it is the first page.", "in": "query", "required": false, "type": "string" }, { "name": "new_vulnerability_page", + "description": "The current page of vulnerabilities for the ancestry.\nThis will be empty when it is the first page.", "in": "query", "required": false, "type": "string" }, { "name": "limit", + "description": "The requested maximum number of results per page.", "in": "query", "required": false, "type": "integer", @@ -123,6 +130,7 @@ ] }, "delete": { + "summary": "The RPC used to mark a Notification as read after it has been processed.", "operationId": "MarkNotificationAsRead", "responses": { "200": { @@ -147,53 +155,103 @@ } }, "definitions": { - "PostAncestryRequestPostLayer": { - "type": "object", - "properties": { - "hash": { - "type": "string" - }, - "path": { - "type": "string" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "clairpbAncestry": { + "GetAncestryResponseAncestry": { "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "description": "The name of the desired ancestry." }, "features": { "type": "array", "items": { "$ref": "#/definitions/clairpbFeature" - } + }, + "description": "The list of features present in the ancestry.\nThis will only be provided if requested." }, "layers": { "type": "array", "items": { "$ref": "#/definitions/clairpbLayer" - } + }, + "description": "The layers present in the ancestry." }, "scanned_listers": { "type": "array", "items": { "type": "string" }, - "description": "scanned_listers and scanned_detectors are used to scan this ancestry, it\nmay be different from listers and detectors in ClairStatus since the\nancestry could be scanned by previous version of Clair." + "description": "The configured list of feature listers used to scan this ancestry." }, "scanned_detectors": { "type": "array", "items": { "type": "string" - } + }, + "description": "The configured list of namespace detectors used to scan an ancestry." + } + } + }, + "GetNotificationResponseNotification": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the requested notification." + }, + "created": { + "type": "string", + "description": "The time at which the notification was created." + }, + "notified": { + "type": "string", + "description": "The time at which the notification was last sent out." + }, + "deleted": { + "type": "string", + "description": "The time at which a notification has been deleted." + }, + "old": { + "$ref": "#/definitions/clairpbPagedVulnerableAncestries", + "description": "The previous vulnerability and a paginated view of the ancestries it affects." + }, + "new": { + "$ref": "#/definitions/clairpbPagedVulnerableAncestries", + "description": "The newly updated vulnerability and a paginated view of the ancestries it affects." + } + } + }, + "PagedVulnerableAncestriesIndexedAncestryName": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "format": "int32", + "description": "The index is an ever increasing number associated with the particular ancestry.\nThis is useful if you're processing notifications, and need to keep track of the progress of paginating the results." + }, + "name": { + "type": "string", + "description": "The name of the ancestry." + } + } + }, + "PostAncestryRequestPostLayer": { + "type": "object", + "properties": { + "hash": { + "type": "string", + "description": "The hash of the layer." + }, + "path": { + "type": "string", + "description": "The location of the layer (URL or filepath)." + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Any HTTP Headers that need to be used if requesting a layer over HTTP(S)." } } }, @@ -205,17 +263,19 @@ "items": { "type": "string" }, - "title": "listers and detectors are processors implemented in this Clair and used to\nscan ancestries" + "description": "The configured list of feature listers used to scan an ancestry." }, "detectors": { "type": "array", "items": { "type": "string" - } + }, + "description": "The configured list of namespace detectors used to scan an ancestry." }, "last_update_time": { "type": "string", - "format": "date-time" + "format": "date-time", + "description": "The time at which the updater last ran." } } }, @@ -223,23 +283,27 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "description": "The name of the feature." }, "namespace_name": { - "type": "string" + "type": "string", + "description": "The name of the namespace in which the feature is detected." }, "version": { - "type": "string" + "type": "string", + "description": "The specific version of this feature." }, "version_format": { "type": "string", - "description": "version_format is the format used by installer package manager to store\npackage versions." + "description": "The format used to parse version numbers for the feature." }, "vulnerabilities": { "type": "array", "items": { "$ref": "#/definitions/clairpbVulnerability" - } + }, + "description": "The list of vulnerabilities that affect the feature." } } }, @@ -247,10 +311,12 @@ "type": "object", "properties": { "ancestry": { - "$ref": "#/definitions/clairpbAncestry" + "$ref": "#/definitions/GetAncestryResponseAncestry", + "description": "The ancestry requested." }, "status": { - "$ref": "#/definitions/clairpbClairStatus" + "$ref": "#/definitions/clairpbClairStatus", + "description": "The status of Clair at the time of the request." } } }, @@ -258,20 +324,8 @@ "type": "object", "properties": { "notification": { - "$ref": "#/definitions/clairpbNotification" - } - } - }, - "clairpbIndexedAncestryName": { - "type": "object", - "properties": { - "index": { - "type": "integer", - "format": "int32", - "description": "index is unique to name in all streams simultaneously streamed, increasing\nand larger than all indexes in previous page in same stream." - }, - "name": { - "type": "string" + "$ref": "#/definitions/GetNotificationResponseNotification", + "description": "The notification as requested." } } }, @@ -279,30 +333,8 @@ "type": "object", "properties": { "hash": { - "type": "string" - } - } - }, - "clairpbNotification": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "created": { - "type": "string" - }, - "notified": { - "type": "string" - }, - "deleted": { - "type": "string" - }, - "old": { - "$ref": "#/definitions/clairpbPagedVulnerableAncestries" - }, - "new": { - "$ref": "#/definitions/clairpbPagedVulnerableAncestries" + "type": "string", + "description": "The sha256 tarsum for the layer." } } }, @@ -310,24 +342,28 @@ "type": "object", "properties": { "current_page": { - "type": "string" + "type": "string", + "description": "The identifier for the current page." }, "next_page": { "type": "string", - "description": "if next_page is empty, it signals the end of all pages." + "description": "The token used to request the next page.\nThis will be empty when there are no more pages." }, "limit": { "type": "integer", - "format": "int32" + "format": "int32", + "description": "The requested maximum number of results per page." }, "vulnerability": { - "$ref": "#/definitions/clairpbVulnerability" + "$ref": "#/definitions/clairpbVulnerability", + "description": "The vulnerability that affects a given set of ancestries." }, "ancestries": { "type": "array", "items": { - "$ref": "#/definitions/clairpbIndexedAncestryName" - } + "$ref": "#/definitions/PagedVulnerableAncestriesIndexedAncestryName" + }, + "description": "The ancestries affected by a vulnerability." } } }, @@ -335,16 +371,19 @@ "type": "object", "properties": { "ancestry_name": { - "type": "string" + "type": "string", + "description": "The name of the ancestry being scanned.\nIf scanning OCI images, this should be the hash of the manifest." }, "format": { - "type": "string" + "type": "string", + "description": "The format of the image being uploaded." }, "layers": { "type": "array", "items": { "$ref": "#/definitions/PostAncestryRequestPostLayer" - } + }, + "description": "The layers to be scanned for this particular ancestry." } } }, @@ -352,7 +391,8 @@ "type": "object", "properties": { "status": { - "$ref": "#/definitions/clairpbClairStatus" + "$ref": "#/definitions/clairpbClairStatus", + "description": "The status of Clair at the time of the request." } } }, @@ -360,33 +400,39 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "description": "The name of the vulnerability." }, "namespace_name": { - "type": "string" + "type": "string", + "description": "The name of the namespace in which the vulnerability was detected." }, "description": { - "type": "string" + "type": "string", + "description": "A description of the vulnerability according to the source for the namespace." }, "link": { - "type": "string" + "type": "string", + "description": "A link to the vulnerability according to the source for the namespace." }, "severity": { - "type": "string" + "type": "string", + "description": "How dangerous the vulnerability is." }, "metadata": { - "type": "string" + "type": "string", + "description": "Namespace agnostic metadata about the vulnerability." }, "fixed_by": { "type": "string", - "description": "fixed_by exists when vulnerability is under feature." + "description": "The feature that fixes this vulnerability.\nThis field only exists when a vulnerability is a part of a Feature." }, "affected_versions": { "type": "array", "items": { "$ref": "#/definitions/clairpbFeature" }, - "description": "affected_versions exists when vulnerability is under notification." + "description": "The Features that are affected by the vulnerability.\nThis field only exists when a vulnerability is a part of a Notification." } } }, diff --git a/api/v3/clairpb/convert.go b/api/v3/clairpb/convert.go index a3584587..408b0983 100644 --- a/api/v3/clairpb/convert.go +++ b/api/v3/clairpb/convert.go @@ -48,7 +48,7 @@ func PagedVulnerableAncestriesFromDatabaseModel(dbVuln *database.PagedVulnerable } for index, ancestryName := range dbVuln.Affected { - indexedAncestry := IndexedAncestryName{ + indexedAncestry := PagedVulnerableAncestries_IndexedAncestryName{ Name: ancestryName, Index: int32(index), } @@ -60,9 +60,9 @@ func PagedVulnerableAncestriesFromDatabaseModel(dbVuln *database.PagedVulnerable // NotificationFromDatabaseModel converts database notification, old and new // vulnerabilities' paged vulnerable ancestries to be api notification. -func NotificationFromDatabaseModel(dbNotification database.VulnerabilityNotificationWithVulnerable) (*Notification, error) { +func NotificationFromDatabaseModel(dbNotification database.VulnerabilityNotificationWithVulnerable) (*GetNotificationResponse_Notification, error) { var ( - noti Notification + noti GetNotificationResponse_Notification err error ) @@ -123,8 +123,8 @@ func VulnerabilityWithFixedInFromDatabaseModel(dbVuln database.VulnerabilityWith } // AncestryFromDatabaseModel converts database ancestry to api ancestry. -func AncestryFromDatabaseModel(dbAncestry database.Ancestry) *Ancestry { - ancestry := &Ancestry{ +func AncestryFromDatabaseModel(dbAncestry database.Ancestry) *GetAncestryResponse_Ancestry { + ancestry := &GetAncestryResponse_Ancestry{ Name: dbAncestry.Name, } for _, layer := range dbAncestry.Layers { From d7a751e0d4298442883fde30ee37c529b2bb3719 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Sun, 22 Apr 2018 15:11:41 -0400 Subject: [PATCH 15/23] api/v3: prototool format --- api/v3/clairpb/clair.pb.go | 218 +++++++++++++++--------------- api/v3/clairpb/clair.proto | 82 +++-------- api/v3/clairpb/clair.swagger.json | 44 +++--- api/v3/clairpb/prototool.yaml | 3 + 4 files changed, 153 insertions(+), 194 deletions(-) create mode 100644 api/v3/clairpb/prototool.yaml diff --git a/api/v3/clairpb/clair.pb.go b/api/v3/clairpb/clair.pb.go index 7125402e..2c1ed417 100644 --- a/api/v3/clairpb/clair.pb.go +++ b/api/v3/clairpb/clair.pb.go @@ -26,9 +26,9 @@ package clairpb import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import google_protobuf "github.com/golang/protobuf/ptypes/empty" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" import _ "google.golang.org/genproto/googleapis/api/annotations" -import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" -import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" import ( context "golang.org/x/net/context" @@ -204,7 +204,7 @@ type ClairStatus struct { // The configured list of namespace detectors used to scan an ancestry. Detectors []string `protobuf:"bytes,2,rep,name=detectors" json:"detectors,omitempty"` // The time at which the updater last ran. - LastUpdateTime *google_protobuf2.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime" json:"last_update_time,omitempty"` + LastUpdateTime *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime" json:"last_update_time,omitempty"` } func (m *ClairStatus) Reset() { *m = ClairStatus{} } @@ -226,7 +226,7 @@ func (m *ClairStatus) GetDetectors() []string { return nil } -func (m *ClairStatus) GetLastUpdateTime() *google_protobuf2.Timestamp { +func (m *ClairStatus) GetLastUpdateTime() *google_protobuf1.Timestamp { if m != nil { return m.LastUpdateTime } @@ -670,22 +670,22 @@ func (m *MarkNotificationAsReadRequest) GetName() string { } func init() { - proto.RegisterType((*Vulnerability)(nil), "clairpb.Vulnerability") - proto.RegisterType((*Feature)(nil), "clairpb.Feature") - proto.RegisterType((*Layer)(nil), "clairpb.Layer") - proto.RegisterType((*ClairStatus)(nil), "clairpb.ClairStatus") - proto.RegisterType((*GetAncestryRequest)(nil), "clairpb.GetAncestryRequest") - proto.RegisterType((*GetAncestryResponse)(nil), "clairpb.GetAncestryResponse") - proto.RegisterType((*GetAncestryResponse_Ancestry)(nil), "clairpb.GetAncestryResponse.Ancestry") - proto.RegisterType((*PostAncestryRequest)(nil), "clairpb.PostAncestryRequest") - proto.RegisterType((*PostAncestryRequest_PostLayer)(nil), "clairpb.PostAncestryRequest.PostLayer") - proto.RegisterType((*PostAncestryResponse)(nil), "clairpb.PostAncestryResponse") - proto.RegisterType((*GetNotificationRequest)(nil), "clairpb.GetNotificationRequest") - proto.RegisterType((*GetNotificationResponse)(nil), "clairpb.GetNotificationResponse") - proto.RegisterType((*GetNotificationResponse_Notification)(nil), "clairpb.GetNotificationResponse.Notification") - proto.RegisterType((*PagedVulnerableAncestries)(nil), "clairpb.PagedVulnerableAncestries") - proto.RegisterType((*PagedVulnerableAncestries_IndexedAncestryName)(nil), "clairpb.PagedVulnerableAncestries.IndexedAncestryName") - proto.RegisterType((*MarkNotificationAsReadRequest)(nil), "clairpb.MarkNotificationAsReadRequest") + proto.RegisterType((*Vulnerability)(nil), "coreos.clair.Vulnerability") + proto.RegisterType((*Feature)(nil), "coreos.clair.Feature") + proto.RegisterType((*Layer)(nil), "coreos.clair.Layer") + proto.RegisterType((*ClairStatus)(nil), "coreos.clair.ClairStatus") + proto.RegisterType((*GetAncestryRequest)(nil), "coreos.clair.GetAncestryRequest") + proto.RegisterType((*GetAncestryResponse)(nil), "coreos.clair.GetAncestryResponse") + proto.RegisterType((*GetAncestryResponse_Ancestry)(nil), "coreos.clair.GetAncestryResponse.Ancestry") + proto.RegisterType((*PostAncestryRequest)(nil), "coreos.clair.PostAncestryRequest") + proto.RegisterType((*PostAncestryRequest_PostLayer)(nil), "coreos.clair.PostAncestryRequest.PostLayer") + proto.RegisterType((*PostAncestryResponse)(nil), "coreos.clair.PostAncestryResponse") + proto.RegisterType((*GetNotificationRequest)(nil), "coreos.clair.GetNotificationRequest") + proto.RegisterType((*GetNotificationResponse)(nil), "coreos.clair.GetNotificationResponse") + proto.RegisterType((*GetNotificationResponse_Notification)(nil), "coreos.clair.GetNotificationResponse.Notification") + proto.RegisterType((*PagedVulnerableAncestries)(nil), "coreos.clair.PagedVulnerableAncestries") + proto.RegisterType((*PagedVulnerableAncestries_IndexedAncestryName)(nil), "coreos.clair.PagedVulnerableAncestries.IndexedAncestryName") + proto.RegisterType((*MarkNotificationAsReadRequest)(nil), "coreos.clair.MarkNotificationAsReadRequest") } // Reference imports to suppress errors if they are not otherwise used. @@ -715,7 +715,7 @@ func NewAncestryServiceClient(cc *grpc.ClientConn) AncestryServiceClient { func (c *ancestryServiceClient) GetAncestry(ctx context.Context, in *GetAncestryRequest, opts ...grpc.CallOption) (*GetAncestryResponse, error) { out := new(GetAncestryResponse) - err := grpc.Invoke(ctx, "/clairpb.AncestryService/GetAncestry", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/coreos.clair.AncestryService/GetAncestry", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -724,7 +724,7 @@ func (c *ancestryServiceClient) GetAncestry(ctx context.Context, in *GetAncestry func (c *ancestryServiceClient) PostAncestry(ctx context.Context, in *PostAncestryRequest, opts ...grpc.CallOption) (*PostAncestryResponse, error) { out := new(PostAncestryResponse) - err := grpc.Invoke(ctx, "/clairpb.AncestryService/PostAncestry", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/coreos.clair.AncestryService/PostAncestry", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -754,7 +754,7 @@ func _AncestryService_GetAncestry_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/clairpb.AncestryService/GetAncestry", + FullMethod: "/coreos.clair.AncestryService/GetAncestry", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AncestryServiceServer).GetAncestry(ctx, req.(*GetAncestryRequest)) @@ -772,7 +772,7 @@ func _AncestryService_PostAncestry_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/clairpb.AncestryService/PostAncestry", + FullMethod: "/coreos.clair.AncestryService/PostAncestry", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AncestryServiceServer).PostAncestry(ctx, req.(*PostAncestryRequest)) @@ -781,7 +781,7 @@ func _AncestryService_PostAncestry_Handler(srv interface{}, ctx context.Context, } var _AncestryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "clairpb.AncestryService", + ServiceName: "coreos.clair.AncestryService", HandlerType: (*AncestryServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -803,7 +803,7 @@ type NotificationServiceClient interface { // The RPC used to get a particularly Notification. GetNotification(ctx context.Context, in *GetNotificationRequest, opts ...grpc.CallOption) (*GetNotificationResponse, error) // The RPC used to mark a Notification as read after it has been processed. - MarkNotificationAsRead(ctx context.Context, in *MarkNotificationAsReadRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) + MarkNotificationAsRead(ctx context.Context, in *MarkNotificationAsReadRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) } type notificationServiceClient struct { @@ -816,16 +816,16 @@ func NewNotificationServiceClient(cc *grpc.ClientConn) NotificationServiceClient func (c *notificationServiceClient) GetNotification(ctx context.Context, in *GetNotificationRequest, opts ...grpc.CallOption) (*GetNotificationResponse, error) { out := new(GetNotificationResponse) - err := grpc.Invoke(ctx, "/clairpb.NotificationService/GetNotification", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/coreos.clair.NotificationService/GetNotification", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -func (c *notificationServiceClient) MarkNotificationAsRead(ctx context.Context, in *MarkNotificationAsReadRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { - out := new(google_protobuf1.Empty) - err := grpc.Invoke(ctx, "/clairpb.NotificationService/MarkNotificationAsRead", in, out, c.cc, opts...) +func (c *notificationServiceClient) MarkNotificationAsRead(ctx context.Context, in *MarkNotificationAsReadRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + err := grpc.Invoke(ctx, "/coreos.clair.NotificationService/MarkNotificationAsRead", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -838,7 +838,7 @@ type NotificationServiceServer interface { // The RPC used to get a particularly Notification. GetNotification(context.Context, *GetNotificationRequest) (*GetNotificationResponse, error) // The RPC used to mark a Notification as read after it has been processed. - MarkNotificationAsRead(context.Context, *MarkNotificationAsReadRequest) (*google_protobuf1.Empty, error) + MarkNotificationAsRead(context.Context, *MarkNotificationAsReadRequest) (*google_protobuf.Empty, error) } func RegisterNotificationServiceServer(s *grpc.Server, srv NotificationServiceServer) { @@ -855,7 +855,7 @@ func _NotificationService_GetNotification_Handler(srv interface{}, ctx context.C } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/clairpb.NotificationService/GetNotification", + FullMethod: "/coreos.clair.NotificationService/GetNotification", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NotificationServiceServer).GetNotification(ctx, req.(*GetNotificationRequest)) @@ -873,7 +873,7 @@ func _NotificationService_MarkNotificationAsRead_Handler(srv interface{}, ctx co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/clairpb.NotificationService/MarkNotificationAsRead", + FullMethod: "/coreos.clair.NotificationService/MarkNotificationAsRead", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NotificationServiceServer).MarkNotificationAsRead(ctx, req.(*MarkNotificationAsReadRequest)) @@ -882,7 +882,7 @@ func _NotificationService_MarkNotificationAsRead_Handler(srv interface{}, ctx co } var _NotificationService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "clairpb.NotificationService", + ServiceName: "coreos.clair.NotificationService", HandlerType: (*NotificationServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -901,78 +901,80 @@ var _NotificationService_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("api/v3/clairpb/clair.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1166 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xdd, 0x6f, 0xdb, 0x54, - 0x14, 0x97, 0xd3, 0xa6, 0x49, 0x4e, 0xd2, 0x8f, 0xdd, 0x86, 0xcc, 0x73, 0x3b, 0xad, 0x33, 0xda, - 0x98, 0xc6, 0x48, 0x44, 0x3a, 0x21, 0x54, 0xf1, 0xd5, 0xd1, 0x6d, 0x20, 0x6d, 0xd3, 0xf0, 0xa0, - 0x0f, 0xbc, 0x44, 0xb7, 0xf6, 0x49, 0x6b, 0xd5, 0xb1, 0x8d, 0xef, 0x4d, 0xd2, 0x68, 0xe2, 0x05, - 0x1e, 0x79, 0x02, 0xfe, 0x0f, 0xfe, 0x04, 0x5e, 0x41, 0x48, 0x3c, 0xed, 0x1d, 0x09, 0x89, 0x3f, - 0x04, 0xdd, 0xeb, 0x7b, 0x1d, 0xbb, 0x75, 0xdb, 0x09, 0x9e, 0xe2, 0xf3, 0xfd, 0xf5, 0x3b, 0xf7, - 0x04, 0x2c, 0x1a, 0xfb, 0xbd, 0xc9, 0x76, 0xcf, 0x0d, 0xa8, 0x9f, 0xc4, 0x07, 0xe9, 0x6f, 0x37, - 0x4e, 0x22, 0x1e, 0x91, 0x9a, 0x62, 0x5a, 0x9b, 0x87, 0x51, 0x74, 0x18, 0x60, 0x4f, 0xe8, 0xd2, - 0x30, 0x8c, 0x38, 0xe5, 0x7e, 0x14, 0xb2, 0x54, 0xcd, 0xda, 0x50, 0x52, 0x49, 0x1d, 0x8c, 0x87, - 0x3d, 0x1c, 0xc5, 0x7c, 0xa6, 0x84, 0x37, 0x4e, 0x0b, 0xb9, 0x3f, 0x42, 0xc6,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- 0x15, 0xbb, 0x91, 0xc5, 0xdb, 0x31, 0xee, 0xf6, 0xbf, 0xaf, 0xc0, 0x7a, 0xbe, 0x2b, 0xba, 0x4e, - 0x06, 0xab, 0xa7, 0x56, 0x92, 0xdc, 0x38, 0x7f, 0x59, 0xd3, 0x04, 0xb6, 0x2e, 0xdb, 0x66, 0xfb, - 0xba, 0xcc, 0xe1, 0x2a, 0x79, 0xa3, 0x97, 0xdf, 0x64, 0xd6, 0x7b, 0x99, 0xd6, 0x3b, 0x85, 0x4e, - 0xf9, 0x94, 0xc8, 0xfc, 0x84, 0x5c, 0x38, 0x46, 0xab, 0x73, 0xe6, 0x5f, 0xce, 0x43, 0xf1, 0x17, - 0x5c, 0x07, 0xbe, 0x5b, 0x1e, 0xf8, 0x41, 0xe3, 0x6b, 0xfd, 0x0f, 0xff, 0x60, 0x49, 0x5a, 0x6e, - 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xee, 0xb6, 0xdc, 0x0f, 0x0c, 0x00, 0x00, + // 1189 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x4f, 0x73, 0xdb, 0x44, + 0x14, 0x1f, 0x29, 0x71, 0xec, 0x3c, 0x3b, 0x7f, 0xba, 0x76, 0x53, 0x45, 0x69, 0x21, 0x11, 0x74, + 0xda, 0x69, 0x67, 0xec, 0xa9, 0xcb, 0xa1, 0x94, 0x03, 0x93, 0xb4, 0x49, 0xe9, 0x4c, 0xe9, 0x74, + 0x54, 0xc8, 0x01, 0x0e, 0x9e, 0xb5, 0xf4, 0x9c, 0x68, 0x22, 0x4b, 0x42, 0xbb, 0x76, 0xe2, 0x29, + 0xbd, 0x70, 0xe5, 0x04, 0x1c, 0xf8, 0x16, 0x7c, 0x09, 0xae, 0x9c, 0x80, 0x23, 0xdc, 0x98, 0x81, + 0x2f, 0xc0, 0x9d, 0xd9, 0xd5, 0x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7e, 0xaf, 0x3f, + 0xb1, 0xaa, 0x52, 0x56, 0x95, 0xf4, 0xce, 0x84, 0xec, 0xc0, 0x15, 0x3a, 0x18, 0xa0, 0xc7, 0xd1, + 0xef, 0x8d, 0x31, 0x65, 0xa2, 0x60, 0xab, 0xb6, 0x39, 0x77, 0xbb, 0xde, 0xbd, 0xda, 0x2e, 0xf6, + 0xb6, 0xbd, 0x87, 0x94, 0x8f, 0x52, 0x74, 0x57, 0xb5, 0xfe, 0xbe, 0x52, 0x77, 0x7e, 0x32, 0xa0, + 0xaa, 0xa4, 0xff, 0xa7, 0x27, 0x16, 0x54, 0x55, 0x06, 0xaa, 0x1f, 0x9a, 0x14, 0x0e, 0xd4, 0x67, + 0x6f, 0x10, 0xa7, 0x43, 0xca, 0x55, 0x57, 0x96, 0x14, 0x77, 0x4f, 0x32, 0xc9, 0x2e, 0xac, 0x8c, + 0x0b, 0x03, 0x0a, 0x90, 0x59, 0x15, 0x59, 0xc9, 0x46, 0xb9, 0x92, 0xd2, 0x14, 0xdd, 0x69, 0x1b, + 0x67, 0x03, 0x2a, 0xcf, 0xe8, 0x04, 0x53, 0x51, 0xcb, 0x21, 0x65, 0x87, 0xba, 0x16, 0xf1, 0xed, + 0x7c, 0x6d, 0x40, 0xfd, 0x91, 0xf0, 0xf2, 0x92, 0x53, 0x3e, 0x62, 0x22, 0xe9, 0x30, 0x60, 0x1c, + 0x53, 0x66, 0x19, 0x9b, 0x73, 0x22, 0x69, 0x45, 0x92, 0xeb, 0xb0, 0xe8, 0x23, 0x47, 0x8f, 0xc7, + 0x29, 0xb3, 0x4c, 0x29, 0x3b, 0x65, 0x90, 0xc7, 0xb0, 0x1a, 0x52, 0xc6, 0x7b, 0xa3, 0xc4, 0xa7, + 0x1c, 0x7b, 0x02, 0x8a, 0xb2, 0xea, 0x7a, 0xd7, 0x6e, 0x67, 0x30, 0x6c, 0x6b, 0x9c, 0xb6, 0x3f, + 0xd1, 0x38, 0x75, 0x97, 0x85, 0xcd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 0x00, 0x00, } diff --git a/api/v3/clairpb/clair.proto b/api/v3/clairpb/clair.proto index 0a384383..3166f0ea 100644 --- a/api/v3/clairpb/clair.proto +++ b/api/v3/clairpb/clair.proto @@ -13,37 +13,33 @@ // limitations under the License. syntax = "proto3"; -option go_package = "clairpb"; - -package clairpb; -import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +package coreos.clair; + +option go_package = "clairpb"; +option java_package = "com.coreos.clair.pb"; + message Vulnerability { // The name of the vulnerability. string name = 1; - // The name of the namespace in which the vulnerability was detected. string namespace_name = 2; - // A description of the vulnerability according to the source for the namespace. string description = 3; - // A link to the vulnerability according to the source for the namespace. string link = 4; - // How dangerous the vulnerability is. string severity = 5; - // Namespace agnostic metadata about the vulnerability. string metadata = 6; - // The feature that fixes this vulnerability. // This field only exists when a vulnerability is a part of a Feature. string fixed_by = 7; - // The Features that are affected by the vulnerability. // This field only exists when a vulnerability is a part of a Notification. repeated Feature affected_versions = 8; @@ -52,21 +48,17 @@ message Vulnerability { message Feature { // The name of the feature. string name = 1; - // The name of the namespace in which the feature is detected. string namespace_name = 2; - // The specific version of this feature. string version = 3; - // The format used to parse version numbers for the feature. string version_format = 4; - // The list of vulnerabilities that affect the feature. repeated Vulnerability vulnerabilities = 5; } -message Layer { +message Layer { // The sha256 tarsum for the layer. string hash = 1; } @@ -74,11 +66,8 @@ message Layer { service AncestryService { // The RPC used to read the results of scanning for a particular ancestry. rpc GetAncestry(GetAncestryRequest) returns (GetAncestryResponse) { - option (google.api.http) = { - get: "/ancestry/{ancestry_name}" - }; + option (google.api.http) = { get: "/ancestry/{ancestry_name}" }; } - // The RPC used to create a new scan of an ancestry. rpc PostAncestry(PostAncestryRequest) returns (PostAncestryResponse) { option (google.api.http) = { @@ -91,10 +80,8 @@ service AncestryService { message ClairStatus { // The configured list of feature listers used to scan an ancestry. repeated string listers = 1; - // The configured list of namespace detectors used to scan an ancestry. repeated string detectors = 2; - // The time at which the updater last ran. google.protobuf.Timestamp last_update_time = 3; } @@ -102,10 +89,8 @@ message ClairStatus { message GetAncestryRequest { // The name of the desired ancestry. string ancestry_name = 1; - // Whether to include vulnerabilities or not in the response. bool with_vulnerabilities = 2; - // Whether to include features or not in the response. bool with_features = 3; } @@ -114,69 +99,53 @@ message GetAncestryResponse { message Ancestry { // The name of the desired ancestry. string name = 1; - // The list of features present in the ancestry. // This will only be provided if requested. repeated Feature features = 2; - // The layers present in the ancestry. repeated Layer layers = 3; - // The configured list of feature listers used to scan this ancestry. repeated string scanned_listers = 4; - // The configured list of namespace detectors used to scan an ancestry. repeated string scanned_detectors = 5; } - // The ancestry requested. Ancestry ancestry = 1; - // The status of Clair at the time of the request. - ClairStatus status = 2; + ClairStatus status = 2; } message PostAncestryRequest { message PostLayer { // The hash of the layer. string hash = 1; - // The location of the layer (URL or filepath). string path = 2; - - // Any HTTP Headers that need to be used if requesting a layer over HTTP(S). - map headers = 3; - } - + // Any HTTP Headers that need to be used if requesting a layer over HTTP(S). + map headers = 3; + } // The name of the ancestry being scanned. // If scanning OCI images, this should be the hash of the manifest. string ancestry_name = 1; - // The format of the image being uploaded. string format = 2; - // The layers to be scanned for this particular ancestry. repeated PostLayer layers = 3; } message PostAncestryResponse { // The status of Clair at the time of the request. - ClairStatus status = 1; + ClairStatus status = 1; } service NotificationService { // The RPC used to get a particularly Notification. rpc GetNotification(GetNotificationRequest) returns (GetNotificationResponse) { - option (google.api.http) = { - get: "/notifications/{name}" - }; + option (google.api.http) = { get: "/notifications/{name}" }; } - // The RPC used to mark a Notification as read after it has been processed. rpc MarkNotificationAsRead(MarkNotificationAsReadRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/notifications/{name}" - }; + option (google.api.http) = { delete: "/notifications/{name}" }; } } @@ -184,14 +153,11 @@ message GetNotificationRequest { // The current page of previous vulnerabilities for the ancestry. // This will be empty when it is the first page. string old_vulnerability_page = 1; - // The current page of vulnerabilities for the ancestry. // This will be empty when it is the first page. string new_vulnerability_page = 2; - // The requested maximum number of results per page. int32 limit = 3; - // The name of the notification being requested. string name = 4; } @@ -200,23 +166,17 @@ message GetNotificationResponse { message Notification { // The name of the requested notification. string name = 1; - // The time at which the notification was created. string created = 2; - // The time at which the notification was last sent out. string notified = 3; - // The time at which a notification has been deleted. - string deleted = 4; - + string deleted = 4; // The previous vulnerability and a paginated view of the ancestries it affects. PagedVulnerableAncestries old = 5; - // The newly updated vulnerability and a paginated view of the ancestries it affects. PagedVulnerableAncestries new = 6; } - // The notification as requested. Notification notification = 1; } @@ -226,24 +186,18 @@ message PagedVulnerableAncestries { // The index is an ever increasing number associated with the particular ancestry. // This is useful if you're processing notifications, and need to keep track of the progress of paginating the results. int32 index = 1; - // The name of the ancestry. string name = 2; } - // The identifier for the current page. string current_page = 1; - // The token used to request the next page. // This will be empty when there are no more pages. string next_page = 2; - // The requested maximum number of results per page. - int32 limit = 3; - + int32 limit = 3; // The vulnerability that affects a given set of ancestries. Vulnerability vulnerability = 4; - // The ancestries affected by a vulnerability. repeated IndexedAncestryName ancestries = 5; } diff --git a/api/v3/clairpb/clair.swagger.json b/api/v3/clairpb/clair.swagger.json index 3b450729..55f73b5e 100644 --- a/api/v3/clairpb/clair.swagger.json +++ b/api/v3/clairpb/clair.swagger.json @@ -23,7 +23,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/clairpbPostAncestryResponse" + "$ref": "#/definitions/clairPostAncestryResponse" } } }, @@ -33,7 +33,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/clairpbPostAncestryRequest" + "$ref": "#/definitions/clairPostAncestryRequest" } } ], @@ -50,7 +50,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/clairpbGetAncestryResponse" + "$ref": "#/definitions/clairGetAncestryResponse" } } }, @@ -91,7 +91,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/clairpbGetNotificationResponse" + "$ref": "#/definitions/clairGetNotificationResponse" } } }, @@ -165,14 +165,14 @@ "features": { "type": "array", "items": { - "$ref": "#/definitions/clairpbFeature" + "$ref": "#/definitions/clairFeature" }, "description": "The list of features present in the ancestry.\nThis will only be provided if requested." }, "layers": { "type": "array", "items": { - "$ref": "#/definitions/clairpbLayer" + "$ref": "#/definitions/clairLayer" }, "description": "The layers present in the ancestry." }, @@ -212,11 +212,11 @@ "description": "The time at which a notification has been deleted." }, "old": { - "$ref": "#/definitions/clairpbPagedVulnerableAncestries", + "$ref": "#/definitions/clairPagedVulnerableAncestries", "description": "The previous vulnerability and a paginated view of the ancestries it affects." }, "new": { - "$ref": "#/definitions/clairpbPagedVulnerableAncestries", + "$ref": "#/definitions/clairPagedVulnerableAncestries", "description": "The newly updated vulnerability and a paginated view of the ancestries it affects." } } @@ -255,7 +255,7 @@ } } }, - "clairpbClairStatus": { + "clairClairStatus": { "type": "object", "properties": { "listers": { @@ -279,7 +279,7 @@ } } }, - "clairpbFeature": { + "clairFeature": { "type": "object", "properties": { "name": { @@ -301,13 +301,13 @@ "vulnerabilities": { "type": "array", "items": { - "$ref": "#/definitions/clairpbVulnerability" + "$ref": "#/definitions/clairVulnerability" }, "description": "The list of vulnerabilities that affect the feature." } } }, - "clairpbGetAncestryResponse": { + "clairGetAncestryResponse": { "type": "object", "properties": { "ancestry": { @@ -315,12 +315,12 @@ "description": "The ancestry requested." }, "status": { - "$ref": "#/definitions/clairpbClairStatus", + "$ref": "#/definitions/clairClairStatus", "description": "The status of Clair at the time of the request." } } }, - "clairpbGetNotificationResponse": { + "clairGetNotificationResponse": { "type": "object", "properties": { "notification": { @@ -329,7 +329,7 @@ } } }, - "clairpbLayer": { + "clairLayer": { "type": "object", "properties": { "hash": { @@ -338,7 +338,7 @@ } } }, - "clairpbPagedVulnerableAncestries": { + "clairPagedVulnerableAncestries": { "type": "object", "properties": { "current_page": { @@ -355,7 +355,7 @@ "description": "The requested maximum number of results per page." }, "vulnerability": { - "$ref": "#/definitions/clairpbVulnerability", + "$ref": "#/definitions/clairVulnerability", "description": "The vulnerability that affects a given set of ancestries." }, "ancestries": { @@ -367,7 +367,7 @@ } } }, - "clairpbPostAncestryRequest": { + "clairPostAncestryRequest": { "type": "object", "properties": { "ancestry_name": { @@ -387,16 +387,16 @@ } } }, - "clairpbPostAncestryResponse": { + "clairPostAncestryResponse": { "type": "object", "properties": { "status": { - "$ref": "#/definitions/clairpbClairStatus", + "$ref": "#/definitions/clairClairStatus", "description": "The status of Clair at the time of the request." } } }, - "clairpbVulnerability": { + "clairVulnerability": { "type": "object", "properties": { "name": { @@ -430,7 +430,7 @@ "affected_versions": { "type": "array", "items": { - "$ref": "#/definitions/clairpbFeature" + "$ref": "#/definitions/clairFeature" }, "description": "The Features that are affected by the vulnerability.\nThis field only exists when a vulnerability is a part of a Notification." } diff --git a/api/v3/clairpb/prototool.yaml b/api/v3/clairpb/prototool.yaml new file mode 100644 index 00000000..8fe4dd22 --- /dev/null +++ b/api/v3/clairpb/prototool.yaml @@ -0,0 +1,3 @@ +protoc_version: 3.5.1 +protoc_includes: +- ../../../vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis From f550dd16a01edc17de0e3c658c5f7bc25639a0a1 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Mon, 23 Apr 2018 15:36:52 -0400 Subject: [PATCH 16/23] api/v3: remove dependency on google empty message --- api/v3/clairpb/clair.pb.go | 175 ++++++++++++++++-------------- api/v3/clairpb/clair.proto | 5 +- api/v3/clairpb/clair.swagger.json | 10 +- api/v3/rpc.go | 5 +- 4 files changed, 101 insertions(+), 94 deletions(-) diff --git a/api/v3/clairpb/clair.pb.go b/api/v3/clairpb/clair.pb.go index 2c1ed417..2dd77344 100644 --- a/api/v3/clairpb/clair.pb.go +++ b/api/v3/clairpb/clair.pb.go @@ -20,14 +20,14 @@ It has these top-level messages: GetNotificationResponse PagedVulnerableAncestries MarkNotificationAsReadRequest + MarkNotificationAsReadResponse */ package clairpb import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import google_protobuf "github.com/golang/protobuf/ptypes/empty" -import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" +import google_protobuf "github.com/golang/protobuf/ptypes/timestamp" import _ "google.golang.org/genproto/googleapis/api/annotations" import ( @@ -204,7 +204,7 @@ type ClairStatus struct { // The configured list of namespace detectors used to scan an ancestry. Detectors []string `protobuf:"bytes,2,rep,name=detectors" json:"detectors,omitempty"` // The time at which the updater last ran. - LastUpdateTime *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime" json:"last_update_time,omitempty"` + LastUpdateTime *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime" json:"last_update_time,omitempty"` } func (m *ClairStatus) Reset() { *m = ClairStatus{} } @@ -226,7 +226,7 @@ func (m *ClairStatus) GetDetectors() []string { return nil } -func (m *ClairStatus) GetLastUpdateTime() *google_protobuf1.Timestamp { +func (m *ClairStatus) GetLastUpdateTime() *google_protobuf.Timestamp { if m != nil { return m.LastUpdateTime } @@ -669,6 +669,14 @@ func (m *MarkNotificationAsReadRequest) GetName() string { return "" } +type MarkNotificationAsReadResponse struct { +} + +func (m *MarkNotificationAsReadResponse) Reset() { *m = MarkNotificationAsReadResponse{} } +func (m *MarkNotificationAsReadResponse) String() string { return proto.CompactTextString(m) } +func (*MarkNotificationAsReadResponse) ProtoMessage() {} +func (*MarkNotificationAsReadResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + func init() { proto.RegisterType((*Vulnerability)(nil), "coreos.clair.Vulnerability") proto.RegisterType((*Feature)(nil), "coreos.clair.Feature") @@ -686,6 +694,7 @@ func init() { proto.RegisterType((*PagedVulnerableAncestries)(nil), "coreos.clair.PagedVulnerableAncestries") proto.RegisterType((*PagedVulnerableAncestries_IndexedAncestryName)(nil), "coreos.clair.PagedVulnerableAncestries.IndexedAncestryName") proto.RegisterType((*MarkNotificationAsReadRequest)(nil), "coreos.clair.MarkNotificationAsReadRequest") + proto.RegisterType((*MarkNotificationAsReadResponse)(nil), "coreos.clair.MarkNotificationAsReadResponse") } // Reference imports to suppress errors if they are not otherwise used. @@ -803,7 +812,7 @@ type NotificationServiceClient interface { // The RPC used to get a particularly Notification. GetNotification(ctx context.Context, in *GetNotificationRequest, opts ...grpc.CallOption) (*GetNotificationResponse, error) // The RPC used to mark a Notification as read after it has been processed. - MarkNotificationAsRead(ctx context.Context, in *MarkNotificationAsReadRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) + MarkNotificationAsRead(ctx context.Context, in *MarkNotificationAsReadRequest, opts ...grpc.CallOption) (*MarkNotificationAsReadResponse, error) } type notificationServiceClient struct { @@ -823,8 +832,8 @@ func (c *notificationServiceClient) GetNotification(ctx context.Context, in *Get return out, nil } -func (c *notificationServiceClient) MarkNotificationAsRead(ctx context.Context, in *MarkNotificationAsReadRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { - out := new(google_protobuf.Empty) +func (c *notificationServiceClient) MarkNotificationAsRead(ctx context.Context, in *MarkNotificationAsReadRequest, opts ...grpc.CallOption) (*MarkNotificationAsReadResponse, error) { + out := new(MarkNotificationAsReadResponse) err := grpc.Invoke(ctx, "/coreos.clair.NotificationService/MarkNotificationAsRead", in, out, c.cc, opts...) if err != nil { return nil, err @@ -838,7 +847,7 @@ type NotificationServiceServer interface { // The RPC used to get a particularly Notification. GetNotification(context.Context, *GetNotificationRequest) (*GetNotificationResponse, error) // The RPC used to mark a Notification as read after it has been processed. - MarkNotificationAsRead(context.Context, *MarkNotificationAsReadRequest) (*google_protobuf.Empty, error) + MarkNotificationAsRead(context.Context, *MarkNotificationAsReadRequest) (*MarkNotificationAsReadResponse, error) } func RegisterNotificationServiceServer(s *grpc.Server, srv NotificationServiceServer) { @@ -901,80 +910,80 @@ var _NotificationService_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("api/v3/clairpb/clair.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1189 bytes of a gzipped FileDescriptorProto + // 1191 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x4f, 0x73, 0xdb, 0x44, - 0x14, 0x1f, 0x29, 0x71, 0xec, 0x3c, 0x3b, 0x7f, 0xba, 0x76, 0x53, 0x45, 0x69, 0x21, 0x11, 0x74, - 0xda, 0x69, 0x67, 0xec, 0xa9, 0xcb, 0xa1, 0x94, 0x03, 0x93, 0xb4, 0x49, 0xe9, 0x4c, 0xe9, 0x74, - 0x54, 0xc8, 0x01, 0x0e, 0x9e, 0xb5, 0xf4, 0x9c, 0x68, 0x22, 0x4b, 0x42, 0xbb, 0x76, 0xe2, 0x29, - 0xbd, 0x70, 0xe5, 0x04, 0x1c, 0xf8, 0x16, 0x7c, 0x09, 0xae, 0x9c, 0x80, 0x23, 0xdc, 0x98, 0x81, - 0x2f, 0xc0, 0x9d, 0xd9, 0xd5, 0xae, 0x22, 0x39, 0x26, 0x49, 0xe1, 0x14, 0xbd, 0xff, 0xff, 0x7e, - 0x6f, 0x5f, 0x0c, 0x36, 0x4d, 0x82, 0xce, 0xf8, 0x7e, 0xc7, 0x0b, 0x69, 0x90, 0x26, 0xfd, 0xec, - 0x6f, 0x3b, 0x49, 0x63, 0x1e, 0x93, 0x86, 0x17, 0xa7, 0x18, 0xb3, 0xb6, 0xe4, 0xd9, 0x1b, 0x07, - 0x71, 0x7c, 0x10, 0x62, 0x47, 0xca, 0xfa, 0xa3, 0x41, 0x07, 0x87, 0x09, 0x9f, 0x64, 0xaa, 0xf6, - 0xdb, 0xd3, 0x42, 0x1e, 0x0c, 0x91, 0x71, 0x3a, 0x4c, 0x94, 0xc2, 0x75, 0xa5, 0x20, 0xc2, 0xd1, - 0x28, 0x8a, 0x39, 0xe5, 0x41, 0x1c, 0xb1, 0x4c, 0xea, 0x7c, 0x6f, 0xc2, 0xd2, 0xfe, 0x28, 0x8c, - 0x30, 0xa5, 0xfd, 0x20, 0x0c, 0xf8, 0x84, 0x10, 0x98, 0x8f, 0xe8, 0x10, 0x2d, 0x63, 0xd3, 0xb8, - 0xbd, 0xe8, 0xca, 0x6f, 0x72, 0x13, 0x96, 0xc5, 0x5f, 0x96, 0x50, 0x0f, 0x7b, 0x52, 0x6a, 0x4a, - 0xe9, 0x52, 0xce, 0x7d, 0x2e, 0xd4, 0x36, 0xa1, 0xee, 0x23, 0xf3, 0xd2, 0x20, 0x11, 0x21, 0xac, - 0x39, 0xa9, 0x53, 0x64, 0x09, 0xe7, 0x61, 0x10, 0x1d, 0x59, 0xf3, 0x99, 0x73, 0xf1, 0x4d, 0x6c, - 0xa8, 0x31, 0x1c, 0x63, 0x1a, 0xf0, 0x89, 0x55, 0x91, 0xfc, 0x9c, 0x16, 0xb2, 0x21, 0x72, 0xea, - 0x53, 0x4e, 0xad, 0x85, 0x4c, 0xa6, 0x69, 0xb2, 0x0e, 0xb5, 0x41, 0x70, 0x82, 0x7e, 0xaf, 0x3f, - 0xb1, 0xaa, 0x52, 0x56, 0x95, 0xf4, 0xce, 0x84, 0xec, 0xc0, 0x15, 0x3a, 0x18, 0xa0, 0xc7, 0xd1, - 0xef, 0x8d, 0x31, 0x65, 0xa2, 0x60, 0xab, 0xb6, 0x39, 0x77, 0xbb, 0xde, 0xbd, 0xda, 0x2e, 0xf6, - 0xb6, 0xbd, 0x87, 0x94, 0x8f, 0x52, 0x74, 0x57, 0xb5, 0xfe, 0xbe, 0x52, 0x77, 0x7e, 0x32, 0xa0, - 0xaa, 0xa4, 0xff, 0xa7, 0x27, 0x16, 0x54, 0x55, 0x06, 0xaa, 0x1f, 0x9a, 0x14, 0x0e, 0xd4, 0x67, - 0x6f, 0x10, 0xa7, 0x43, 0xca, 0x55, 0x57, 0x96, 0x14, 0x77, 0x4f, 0x32, 0xc9, 0x2e, 0xac, 0x8c, - 0x0b, 0x03, 0x0a, 0x90, 0x59, 0x15, 0x59, 0xc9, 0x46, 0xb9, 0x92, 0xd2, 0x14, 0xdd, 0x69, 0x1b, - 0x67, 0x03, 0x2a, 0xcf, 0xe8, 0x04, 0x53, 0x51, 0xcb, 0x21, 0x65, 0x87, 0xba, 0x16, 0xf1, 0xed, - 0x7c, 0x6d, 0x40, 0xfd, 0x91, 0xf0, 0xf2, 0x92, 0x53, 0x3e, 0x62, 0x22, 0xe9, 0x30, 0x60, 0x1c, - 0x53, 0x66, 0x19, 0x9b, 0x73, 0x22, 0x69, 0x45, 0x92, 0xeb, 0xb0, 0xe8, 0x23, 0x47, 0x8f, 0xc7, - 0x29, 0xb3, 0x4c, 0x29, 0x3b, 0x65, 0x90, 0xc7, 0xb0, 0x1a, 0x52, 0xc6, 0x7b, 0xa3, 0xc4, 0xa7, - 0x1c, 0x7b, 0x02, 0x8a, 0xb2, 0xea, 0x7a, 0xd7, 0x6e, 0x67, 0x30, 0x6c, 0x6b, 0x9c, 0xb6, 0x3f, - 0xd1, 0x38, 0x75, 0x97, 0x85, 0xcd, 0xa7, 0xd2, 0x44, 0x30, 0x9d, 0x6f, 0x0c, 0x20, 0x4f, 0x90, - 0x6f, 0x47, 0x1e, 0x32, 0x9e, 0x4e, 0x5c, 0xfc, 0x62, 0x84, 0x8c, 0x93, 0x77, 0x60, 0x89, 0x2a, - 0x56, 0xaf, 0x30, 0x8d, 0x86, 0x66, 0xca, 0x76, 0xdf, 0x83, 0xd6, 0x71, 0xc0, 0x0f, 0x7b, 0xd3, - 0x2d, 0x13, 0xb3, 0xa9, 0xb9, 0x4d, 0x21, 0xdb, 0x2f, 0x8b, 0x84, 0x5f, 0x69, 0x32, 0xc8, 0x86, - 0xcd, 0x64, 0xc6, 0x35, 0xb7, 0x21, 0x98, 0x0a, 0x00, 0xcc, 0xf9, 0xd3, 0x84, 0x66, 0x29, 0x27, - 0x96, 0xc4, 0x11, 0x43, 0xb2, 0x07, 0x35, 0x1d, 0x5f, 0xe6, 0x53, 0xef, 0xde, 0x29, 0x8f, 0x65, - 0x86, 0x51, 0x3b, 0x67, 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, 0x9c, 0xa7, 0xd0, 0x2a, 0x87, - 0x54, 0x48, 0x3e, 0x45, 0xa0, 0x71, 0x49, 0x04, 0x3a, 0x3f, 0x18, 0xb0, 0xf6, 0x04, 0xf9, 0xf3, - 0x98, 0x07, 0x83, 0xc0, 0x93, 0x77, 0x45, 0x4f, 0xeb, 0x3d, 0x58, 0x8b, 0x43, 0xbf, 0xb4, 0x86, - 0x93, 0x5e, 0x42, 0x0f, 0xf4, 0xd8, 0x5a, 0x71, 0xe8, 0x97, 0x5e, 0xac, 0x17, 0xf4, 0x00, 0x85, - 0x55, 0x84, 0xc7, 0xb3, 0xac, 0xb2, 0x32, 0x5a, 0x11, 0x1e, 0x9f, 0xb5, 0x6a, 0x41, 0x25, 0x0c, - 0x86, 0x01, 0x97, 0x8b, 0x5b, 0x71, 0x33, 0x22, 0xdf, 0x88, 0xf9, 0xd3, 0x8d, 0x70, 0x7e, 0x33, - 0xe1, 0xda, 0x99, 0x84, 0x55, 0xfd, 0xfb, 0xd0, 0x88, 0x0a, 0x7c, 0xd5, 0x85, 0xee, 0x99, 0x6d, - 0x9e, 0x65, 0xdc, 0x2e, 0x31, 0x4b, 0x7e, 0xec, 0xbf, 0x0c, 0x68, 0x14, 0xc5, 0x33, 0x57, 0xd5, - 0x82, 0xaa, 0x97, 0x22, 0xe5, 0xe8, 0xab, 0x4a, 0x35, 0x29, 0x2e, 0x60, 0xe6, 0x0e, 0x7d, 0x75, - 0x40, 0x72, 0x5a, 0x58, 0xf9, 0x18, 0xa2, 0xb0, 0xca, 0xaa, 0xd4, 0x24, 0x79, 0x1f, 0xe6, 0xe2, - 0xd0, 0x97, 0xe7, 0xb4, 0xde, 0xbd, 0x35, 0x05, 0x38, 0x7a, 0x80, 0x79, 0xef, 0x43, 0x54, 0x40, - 0x08, 0x90, 0xb9, 0xc2, 0x46, 0x98, 0x46, 0x78, 0x2c, 0xaf, 0xed, 0x9b, 0x98, 0x46, 0x78, 0xec, - 0xfc, 0x6c, 0xc2, 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x29, 0x5d, 0xfb, 0x6b, 0x58, 0x99, 0x5a, - 0x5d, 0xf2, 0xee, 0x05, 0x9b, 0x9d, 0xa5, 0x72, 0xf3, 0x52, 0xfb, 0xef, 0xdc, 0x90, 0xd9, 0x5c, - 0x23, 0x57, 0x3b, 0xc5, 0xdd, 0x67, 0x9d, 0x57, 0x59, 0x0f, 0xbe, 0x84, 0xb5, 0xd9, 0x33, 0x24, - 0x53, 0x87, 0xe8, 0xdc, 0x49, 0xdb, 0x6b, 0x67, 0xfe, 0x89, 0xda, 0x15, 0xbf, 0x04, 0x74, 0xf4, - 0x3b, 0xb3, 0xa3, 0xef, 0xbc, 0x05, 0x4d, 0x2f, 0x1e, 0x96, 0x03, 0x25, 0xfd, 0xcf, 0xaa, 0xea, - 0x97, 0x47, 0x7f, 0x41, 0xba, 0xbb, 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfd, 0xb6, 0x68, - 0xf9, 0x92, 0x0c, 0x00, 0x00, + 0x14, 0x1f, 0x29, 0x71, 0xec, 0x3c, 0x3b, 0x7f, 0xba, 0x76, 0x53, 0x45, 0x69, 0x8b, 0x23, 0xe8, + 0xb4, 0x93, 0x30, 0xf6, 0xc4, 0xe1, 0x50, 0xc2, 0x81, 0x49, 0xda, 0xa6, 0x74, 0xa6, 0x74, 0x3a, + 0x2a, 0xe4, 0x00, 0x07, 0xcf, 0x5a, 0x7a, 0x4e, 0x34, 0x91, 0x25, 0xa3, 0x5d, 0x3b, 0xf1, 0x74, + 0x7a, 0xe1, 0xca, 0x09, 0x38, 0xf0, 0x19, 0xb8, 0xf0, 0x25, 0xb8, 0x72, 0x02, 0x8e, 0x70, 0x63, + 0x06, 0xbe, 0x00, 0x77, 0x66, 0x57, 0x2b, 0x45, 0x72, 0xd4, 0x24, 0xa5, 0x27, 0xeb, 0xfd, 0xde, + 0x9f, 0x7d, 0x7f, 0x7e, 0x6f, 0x37, 0x01, 0x93, 0x0e, 0xbd, 0xf6, 0x78, 0x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0x33, 0xf7, 0xaa, 0x9d, 0xeb, 0xad, 0x6c, 0xfb, 0x5a, 0xfb, 0x48, 0xf9, + 0x28, 0x42, 0x7b, 0x39, 0xb1, 0x3f, 0x50, 0xe6, 0xd6, 0x2f, 0x1a, 0x94, 0x95, 0xf6, 0x6d, 0x7a, + 0x62, 0x40, 0x59, 0x65, 0xa0, 0xfa, 0x91, 0x88, 0x22, 0x80, 0xfa, 0xec, 0xf6, 0xc3, 0x68, 0x40, + 0xb9, 0xea, 0xca, 0x82, 0x42, 0xf7, 0x25, 0x48, 0x1e, 0xc1, 0xd2, 0x38, 0x33, 0x20, 0x0f, 0x99, + 0x51, 0x92, 0x95, 0xac, 0xe5, 0x2b, 0xc9, 0x4d, 0xd1, 0x9e, 0xf6, 0xb1, 0xd6, 0xa0, 0xf4, 0x94, + 0x4e, 0x30, 0x12, 0xb5, 0x1c, 0x51, 0x76, 0x94, 0xd4, 0x22, 0xbe, 0xad, 0x6f, 0x34, 0xa8, 0x3e, + 0x10, 0x51, 0x5e, 0x70, 0xca, 0x47, 0x4c, 0x24, 0xed, 0x7b, 0x8c, 0x63, 0xc4, 0x0c, 0xad, 0x39, + 0x23, 0x92, 0x56, 0x22, 0xb9, 0x09, 0xf3, 0x2e, 0x72, 0x74, 0x78, 0x18, 0x31, 0x43, 0x97, 0xba, + 0x33, 0x80, 0x3c, 0x84, 0x65, 0x9f, 0x32, 0xde, 0x1d, 0x0d, 0x5d, 0xca, 0xb1, 0x2b, 0xa8, 0x28, + 0xab, 0xae, 0x76, 0xcc, 0x56, 0x4c, 0xc3, 0x56, 0xc2, 0xd3, 0xd6, 0x67, 0x09, 0x4f, 0xed, 0x45, + 0xe1, 0xf3, 0xb9, 0x74, 0x11, 0xa0, 0xf5, 0xad, 0x06, 0xe4, 0x31, 0xf2, 0xdd, 0xc0, 0x41, 0xc6, + 0xa3, 0x89, 0x8d, 0x5f, 0x8d, 0x90, 0x71, 0xf2, 0x2e, 0x2c, 0x50, 0x05, 0x75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+ 0x83, 0xa5, 0x24, 0xa3, 0x17, 0x18, 0x8d, 0x3d, 0x07, 0xc9, 0x08, 0xaa, 0x99, 0xe7, 0x8a, 0x34, + 0x2f, 0x78, 0xc9, 0xe4, 0xd1, 0xe6, 0xfa, 0xa5, 0x6f, 0x9d, 0xb5, 0xfe, 0xf5, 0x6f, 0x7f, 0x7d, + 0xaf, 0xaf, 0x91, 0xd5, 0x76, 0x72, 0x51, 0xb7, 0x5f, 0xe6, 0xee, 0xf1, 0x57, 0xe4, 0x18, 0x6a, + 0xd9, 0x1b, 0x89, 0xac, 0x5f, 0x7a, 0x41, 0x9a, 0xd6, 0x45, 0x26, 0xea, 0xe4, 0x86, 0x3c, 0x79, + 0xd1, 0x9a, 0x4f, 0x4f, 0xde, 0xd1, 0x36, 0x3a, 0x3f, 0xea, 0x50, 0xcf, 0xb6, 0x25, 0xa9, 0xfd, + 0x15, 0x2c, 0x4d, 0x2d, 0x37, 0x79, 0xef, 0x92, 0xdd, 0x8f, 0x53, 0xb9, 0x73, 0xa5, 0x1b, 0xc2, + 0xba, 0x25, 0xb3, 0xb9, 0x41, 0xae, 0xb7, 0xb3, 0xb7, 0x03, 0x6b, 0xbf, 0x8c, 0x7b, 0xf0, 0x9d, + 0x06, 0x2b, 0xc5, 0x13, 0x23, 0x53, 0x6f, 0xd5, 0x85, 0x64, 0x30, 0xdf, 0xbf, 0x9a, 0x71, 0x3e, + 0xa9, 0x8d, 0xe2, 0xa4, 0xf6, 0x6e, 0x43, 0xdd, 0x09, 0x07, 0xf9, 0x88, 0xc3, 0xde, 0x17, 0x65, + 0xf5, 0x5f, 0x49, 0x6f, 0x4e, 0xfe, 0x31, 0xb7, 0xfd, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, + 0x24, 0x28, 0x46, 0xae, 0x0c, 0x00, 0x00, } diff --git a/api/v3/clairpb/clair.proto b/api/v3/clairpb/clair.proto index 3166f0ea..4dcce1b3 100644 --- a/api/v3/clairpb/clair.proto +++ b/api/v3/clairpb/clair.proto @@ -14,7 +14,6 @@ syntax = "proto3"; -import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "google/api/annotations.proto"; @@ -144,7 +143,7 @@ service NotificationService { option (google.api.http) = { get: "/notifications/{name}" }; } // The RPC used to mark a Notification as read after it has been processed. - rpc MarkNotificationAsRead(MarkNotificationAsReadRequest) returns (google.protobuf.Empty) { + rpc MarkNotificationAsRead(MarkNotificationAsReadRequest) returns (MarkNotificationAsReadResponse) { option (google.api.http) = { delete: "/notifications/{name}" }; } } @@ -206,3 +205,5 @@ message MarkNotificationAsReadRequest { // The name of the Notification that has been processed. string name = 1; } + +message MarkNotificationAsReadResponse {} diff --git a/api/v3/clairpb/clair.swagger.json b/api/v3/clairpb/clair.swagger.json index 55f73b5e..64c8b413 100644 --- a/api/v3/clairpb/clair.swagger.json +++ b/api/v3/clairpb/clair.swagger.json @@ -136,7 +136,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/protobufEmpty" + "$ref": "#/definitions/clairMarkNotificationAsReadResponse" } } }, @@ -338,6 +338,9 @@ } } }, + "clairMarkNotificationAsReadResponse": { + "type": "object" + }, "clairPagedVulnerableAncestries": { "type": "object", "properties": { @@ -435,11 +438,6 @@ "description": "The Features that are affected by the vulnerability.\nThis field only exists when a vulnerability is a part of a Notification." } } - }, - "protobufEmpty": { - "type": "object", - "description": "service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", - "title": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:" } } } diff --git a/api/v3/rpc.go b/api/v3/rpc.go index 109bf17a..02244ff3 100644 --- a/api/v3/rpc.go +++ b/api/v3/rpc.go @@ -18,7 +18,6 @@ import ( "fmt" "github.com/golang/protobuf/ptypes" - google_protobuf1 "github.com/golang/protobuf/ptypes/empty" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -227,7 +226,7 @@ func (s *NotificationServer) GetNotification(ctx context.Context, req *pb.GetNot // MarkNotificationAsRead implements deleting a notification via the Clair gRPC // service. -func (s *NotificationServer) MarkNotificationAsRead(ctx context.Context, req *pb.MarkNotificationAsReadRequest) (*google_protobuf1.Empty, error) { +func (s *NotificationServer) MarkNotificationAsRead(ctx context.Context, req *pb.MarkNotificationAsReadRequest) (*pb.MarkNotificationAsReadResponse, error) { if req.GetName() == "" { return nil, status.Error(codes.InvalidArgument, "notification name should not be empty") } @@ -249,5 +248,5 @@ func (s *NotificationServer) MarkNotificationAsRead(ctx context.Context, req *pb return nil, status.Error(codes.Internal, err.Error()) } - return &google_protobuf1.Empty{}, nil + return &pb.MarkNotificationAsReadResponse{}, nil } From 7492aa31baf5b834088ecb8e8bd6ffd7817e5dd7 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Sun, 22 Apr 2018 15:21:02 -0400 Subject: [PATCH 17/23] travis: fail unformatted protos --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index 576da9fc..ba758209 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,19 @@ go: sudo: required +env: + global: + - PATH=$HOME/.local/bin:$PATH + install: - curl https://glide.sh/get | sh +- mkdir -p $HOME/.local/bin +- curl -o $HOME/.local/bin/prototool -sSL https://github.com/uber/prototool/releases/download/v0.1.0/prototool-$(uname -s)-$(uname -m) +- chmod +x $HOME/.local/bin/prototool script: +- prototool format -d api/v3/clairpb/clair.proto +- prototool lint api/v3/clairpb/clair.proto - go test $(glide novendor | grep -v contrib) dist: trusty From db5dbbe4e983a4ac827f5b6597aac780c03124b3 Mon Sep 17 00:00:00 2001 From: usr42 Date: Tue, 24 Apr 2018 16:14:57 +0200 Subject: [PATCH 18/23] Upgrade to golang:1.10-alpine --- .travis.yml | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 576da9fc..bc002237 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: go go: - - 1.8 + - "1.10" sudo: required diff --git a/Dockerfile b/Dockerfile index 767e4cd1..112bc42c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.8-alpine +FROM golang:1.10-alpine VOLUME /config EXPOSE 6060 6061 From 07a08a4f53cab155814eadde44a847e2389b5bcc Mon Sep 17 00:00:00 2001 From: Mark Eisenblaetter Date: Mon, 7 May 2018 08:22:03 +0200 Subject: [PATCH 19/23] mapping: add ubuntu mapping add new ubuntu 18.03 bionic beaver mapping Fixes #552 --- database/namespace_mapping.go | 1 + 1 file changed, 1 insertion(+) diff --git a/database/namespace_mapping.go b/database/namespace_mapping.go index d7ff67c3..8691ac99 100644 --- a/database/namespace_mapping.go +++ b/database/namespace_mapping.go @@ -45,4 +45,5 @@ var UbuntuReleasesMapping = map[string]string{ "yakkety": "16.10", "zesty": "17.04", "artful": "17.10", + "bionic": "18.04", } From 4c2be5285e1419844377c11484bd684b45948958 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 5 Jul 2018 19:09:45 -0400 Subject: [PATCH 20/23] vulnsrc/alpine: avoid shadowing vars --- ext/vulnsrc/alpine/alpine.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ext/vulnsrc/alpine/alpine.go b/ext/vulnsrc/alpine/alpine.go index 5b6f46e1..051f3c6d 100644 --- a/ext/vulnsrc/alpine/alpine.go +++ b/ext/vulnsrc/alpine/alpine.go @@ -58,19 +58,20 @@ func (u *updater) Update(db database.Datastore) (resp vulnsrc.UpdateResponse, er return } - // Ask the database for the latest commit we successfully applied. - var dbCommit string + // Open a database transaction. tx, err := db.Begin() if err != nil { return } defer tx.Rollback() - dbCommit, ok, err := tx.FindKeyValue(updaterFlag) + // Ask the database for the latest commit we successfully applied. + var dbCommit string + var ok bool + dbCommit, ok, err = tx.FindKeyValue(updaterFlag) if err != nil { return } - if !ok { dbCommit = "" } From c031f8ea0c793ba0462f2b8a204c15ab3a65f1a5 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 5 Jul 2018 19:11:30 -0400 Subject: [PATCH 21/23] vulnsrc/alpine: s/pull/clone --- ext/vulnsrc/alpine/alpine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/vulnsrc/alpine/alpine.go b/ext/vulnsrc/alpine/alpine.go index 051f3c6d..49775f77 100644 --- a/ext/vulnsrc/alpine/alpine.go +++ b/ext/vulnsrc/alpine/alpine.go @@ -194,7 +194,7 @@ func (u *updater) pullRepository() (commit string, err error) { cmd.Dir = u.repositoryLocalPath if out, err := cmd.CombinedOutput(); err != nil { u.Clean() - log.WithError(err).WithField("output", string(out)).Error("could not pull alpine-secdb repository") + log.WithError(err).WithField("output", string(out)).Error("could not clone alpine-secdb repository") return "", commonerr.ErrCouldNotDownload } } else { From 456af5f48c8da8325266209e58cec90f4a3f1f68 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 5 Jul 2018 19:11:50 -0400 Subject: [PATCH 22/23] vulnsrc/ubuntu: use new git-based ubuntu tracker --- ext/vulnsrc/ubuntu/ubuntu.go | 264 +++++++++++++++-------------------- 1 file changed, 116 insertions(+), 148 deletions(-) diff --git a/ext/vulnsrc/ubuntu/ubuntu.go b/ext/vulnsrc/ubuntu/ubuntu.go index 6af0c14c..662c40ba 100644 --- a/ext/vulnsrc/ubuntu/ubuntu.go +++ b/ext/vulnsrc/ubuntu/ubuntu.go @@ -18,14 +18,13 @@ package ubuntu import ( "bufio" - "bytes" + "errors" "fmt" "io" "io/ioutil" "os" "os/exec" "regexp" - "strconv" "strings" log "github.com/sirupsen/logrus" @@ -38,10 +37,9 @@ import ( ) const ( - trackerURI = "https://launchpad.net/ubuntu-cve-tracker" - trackerRepository = "https://launchpad.net/ubuntu-cve-tracker" - updaterFlag = "ubuntuUpdater" - cveURL = "http://people.ubuntu.com/~ubuntu-security/cve/%s" + trackerURI = "https://git.launchpad.net/ubuntu-cve-tracker" + updaterFlag = "ubuntuUpdater" + cveURL = "http://people.ubuntu.com/~ubuntu-security/cve/%s" ) var ( @@ -74,6 +72,8 @@ var ( affectsCaptureRegexp = regexp.MustCompile(`(?P.*)_(?P.*): (?P[^\s]*)( \(+(?P[^()]*)\)+)?`) affectsCaptureRegexpNames = affectsCaptureRegexp.SubexpNames() + + errUnknownRelease = errors.New("found packages with CVEs for a verison of Ubuntu that Clair doesn't know about") ) type updater struct { @@ -84,211 +84,179 @@ func init() { vulnsrc.RegisterUpdater("ubuntu", &updater{}) } -func (u *updater) Update(datastore database.Datastore) (resp vulnsrc.UpdateResponse, err error) { +func (u *updater) Update(db database.Datastore) (resp vulnsrc.UpdateResponse, err error) { log.WithField("package", "Ubuntu").Info("Start fetching vulnerabilities") - // Pull the bzr repository. - if err = u.pullRepository(); err != nil { - return resp, err - } - - // Get revision number. - revisionNumber, err := getRevisionNumber(u.repositoryLocalPath) + // Pull the master branch. + var commit string + commit, err = u.pullRepository() if err != nil { return resp, err } - tx, err := datastore.Begin() + // Open a database transaction. + tx, err := db.Begin() if err != nil { return resp, err } + defer tx.Rollback() - // Get the latest revision number we successfully applied in the database. - dbRevisionNumber, ok, err := tx.FindKeyValue("ubuntuUpdater") + // Ask the database for the latest commit we successfully applied. + var dbCommit string + var ok bool + dbCommit, ok, err = tx.FindKeyValue(updaterFlag) if err != nil { - return resp, err + return } - - if err := tx.Rollback(); err != nil { - return resp, err + if !ok { + dbCommit = "" } - if !ok { - dbRevisionNumber = "" + // Set the updaterFlag to equal the commit processed. + resp.FlagName = updaterFlag + resp.FlagValue = commit + + // Short-circuit if there have been no updates. + if commit == dbCommit { + log.WithField("package", "ubuntu").Debug("no update") + return } // Get the list of vulnerabilities that we have to update. - modifiedCVE, err := collectModifiedVulnerabilities(revisionNumber, dbRevisionNumber, u.repositoryLocalPath) + var modifiedCVE map[string]struct{} + modifiedCVE, err = collectModifiedVulnerabilities(commit, dbCommit, u.repositoryLocalPath) if err != nil { - return resp, err + return } - notes := make(map[string]struct{}) - for cvePath := range modifiedCVE { - // Open the CVE file. - file, err := os.Open(u.repositoryLocalPath + "/" + cvePath) - if err != nil { - // This can happen when a file is modified and then moved in another - // commit. - continue - } - - // Parse the vulnerability. - v, unknownReleases, err := parseUbuntuCVE(file) - if err != nil { - return resp, err - } - - // Add the vulnerability to the response. - resp.Vulnerabilities = append(resp.Vulnerabilities, v) - - // Store any unknown releases as notes. - for k := range unknownReleases { - note := fmt.Sprintf("Ubuntu %s is not mapped to any version number (eg. trusty->14.04). Please update me.", k) - notes[note] = struct{}{} - - // If we encountered unknown Ubuntu release, we don't want the revision - // number to be considered as managed. - dbRevisionNumberInt, _ := strconv.Atoi(dbRevisionNumber) - revisionNumber = dbRevisionNumberInt - } - - // Close the file manually. - // - // We do that instead of using defer because defer works on a function-level scope. - // We would open many files and close them all at once at the end of the function, - // which could lead to exceed fs.file-max. - file.Close() + // Get the list of vulnerabilities. + resp.Vulnerabilities, resp.Notes, err = collectVulnerabilitiesAndNotes(u.repositoryLocalPath, modifiedCVE) + if err != nil { + return } - // Add flag and notes. - resp.FlagName = updaterFlag - resp.FlagValue = strconv.Itoa(revisionNumber) - for note := range notes { - resp.Notes = append(resp.Notes, note) + // The only notes we take are if we encountered unknown Ubuntu release. + // We don't want the commit to be considered as managed in that case. + if len(resp.Notes) != 0 { + resp.FlagValue = dbCommit } return } func (u *updater) Clean() { - os.RemoveAll(u.repositoryLocalPath) + if u.repositoryLocalPath != "" { + os.RemoveAll(u.repositoryLocalPath) + } } -func (u *updater) pullRepository() (err error) { +func (u *updater) pullRepository() (commit string, err error) { // Determine whether we should branch or pull. if _, pathExists := os.Stat(u.repositoryLocalPath); u.repositoryLocalPath == "" || os.IsNotExist(pathExists) { // Create a temporary folder to store the repository. if u.repositoryLocalPath, err = ioutil.TempDir(os.TempDir(), "ubuntu-cve-tracker"); err != nil { - return vulnsrc.ErrFilesystem + return "", vulnsrc.ErrFilesystem } - - // Branch repository. - cmd := exec.Command("bzr", "branch", "--use-existing-dir", trackerRepository, ".") + cmd := exec.Command("git", "clone", trackerURI, ".") cmd.Dir = u.repositoryLocalPath if out, err := cmd.CombinedOutput(); err != nil { - log.WithError(err).WithField("output", string(out)).Error("could not branch Ubuntu repository") - return commonerr.ErrCouldNotDownload + u.Clean() + log.WithError(err).WithField("output", string(out)).Error("could not clone ubuntu-cve-tracker repository") + return "", commonerr.ErrCouldNotDownload + } + } else { + // The repository already exists and it needs to be refreshed via a pull. + cmd := exec.Command("git", "pull") + cmd.Dir = u.repositoryLocalPath + if _, err := cmd.CombinedOutput(); err != nil { + return "", vulnsrc.ErrGitFailure } - - return nil } - // Pull repository. - cmd := exec.Command("bzr", "pull", "--overwrite") + cmd := exec.Command("git", "rev-parse", "HEAD") cmd.Dir = u.repositoryLocalPath - if out, err := cmd.CombinedOutput(); err != nil { - os.RemoveAll(u.repositoryLocalPath) - log.WithError(err).WithField("output", string(out)).Error("could not pull Ubuntu repository") - return commonerr.ErrCouldNotDownload + out, err := cmd.CombinedOutput() + if err != nil { + return "", vulnsrc.ErrGitFailure } - return nil + commit = strings.TrimSpace(string(out)) + return } -func getRevisionNumber(pathToRepo string) (int, error) { - cmd := exec.Command("bzr", "revno") - cmd.Dir = pathToRepo - out, err := cmd.CombinedOutput() - if err != nil { - log.WithError(err).WithField("output", string(out)).Error("could not get Ubuntu repository's revision number") - return 0, commonerr.ErrCouldNotDownload +func collectModifiedVulnerabilities(commit, dbCommit, repositoryLocalPath string) (map[string]struct{}, error) { + modifiedCVE := make(map[string]struct{}) + for _, dirName := range []string{"active", "retired"} { + if err := processDirectory(repositoryLocalPath, dirName, modifiedCVE); err != nil { + return nil, err + } } + return modifiedCVE, nil +} - revno, err := strconv.Atoi(strings.TrimSpace(string(out))) +func processDirectory(repositoryLocalPath, dirName string, modifiedCVE map[string]struct{}) error { + // Open the directory. + d, err := os.Open(repositoryLocalPath + "/" + dirName) if err != nil { - log.WithError(err).WithField("output", string(out)).Error("could not parse Ubuntu repository's revision number") - return 0, commonerr.ErrCouldNotDownload + log.WithError(err).Error("could not open Ubuntu vulnerabilities repository's folder") + return vulnsrc.ErrFilesystem } + defer d.Close() - return revno, nil -} + // Get the FileInfo of all the files in the directory. + names, err := d.Readdirnames(-1) + if err != nil { + log.WithError(err).Error("could not read Ubuntu vulnerabilities repository's folder") + return vulnsrc.ErrFilesystem + } -func collectModifiedVulnerabilities(revision int, dbRevision, repositoryLocalPath string) (map[string]struct{}, error) { - modifiedCVE := make(map[string]struct{}) + // Add the vulnerabilities to the list. + for _, name := range names { + if strings.HasPrefix(name, "CVE-") { + modifiedCVE[dirName+"/"+name] = struct{}{} + } + } - // Handle a brand new database. - if dbRevision == "" { - for _, folder := range []string{"active", "retired"} { - d, err := os.Open(repositoryLocalPath + "/" + folder) - if err != nil { - log.WithError(err).Error("could not open Ubuntu vulnerabilities repository's folder") - return nil, vulnsrc.ErrFilesystem - } + return nil +} - // Get the FileInfo of all the files in the directory. - names, err := d.Readdirnames(-1) - if err != nil { - log.WithError(err).Error("could not read Ubuntu vulnerabilities repository's folder") - return nil, vulnsrc.ErrFilesystem - } +func collectVulnerabilitiesAndNotes(repositoryLocalPath string, modifiedCVE map[string]struct{}) ([]database.VulnerabilityWithAffected, []string, error) { + vulns := make([]database.VulnerabilityWithAffected, 0) + noteSet := make(map[string]struct{}) - // Add the vulnerabilities to the list. - for _, name := range names { - if strings.HasPrefix(name, "CVE-") { - modifiedCVE[folder+"/"+name] = struct{}{} - } - } + for cvePath := range modifiedCVE { + // Open the CVE file. + file, err := os.Open(repositoryLocalPath + "/" + cvePath) + if err != nil { + // This can happen when a file is modified then moved in another commit. + continue + } - // Close the file manually. - // - // We do that instead of using defer because defer works on a function-level scope. - // We would open many files and close them all at once at the end of the function, - // which could lead to exceed fs.file-max. - d.Close() + // Parse the vulnerability. + v, unknownReleases, err := parseUbuntuCVE(file) + if err != nil { + file.Close() + return nil, nil, err } - return modifiedCVE, nil - } + // Add the vulnerability to the response. + vulns = append(vulns, v) - // Handle an up to date database. - dbRevisionInt, _ := strconv.Atoi(dbRevision) - if revision == dbRevisionInt { - log.WithField("package", "Ubuntu").Debug("no update") - return modifiedCVE, nil - } + // Store any unknown releases as notes. + for k := range unknownReleases { + noteSet[errUnknownRelease.Error()+": "+k] = struct{}{} + } - // Handle a database that needs upgrading. - cmd := exec.Command("bzr", "log", "--verbose", "-r"+strconv.Itoa(dbRevisionInt+1)+"..", "-n0") - cmd.Dir = repositoryLocalPath - out, err := cmd.CombinedOutput() - if err != nil { - log.WithError(err).WithField("output", string(out)).Error("could not get Ubuntu vulnerabilities repository logs") - return nil, commonerr.ErrCouldNotDownload + file.Close() } - scanner := bufio.NewScanner(bytes.NewReader(out)) - for scanner.Scan() { - text := strings.TrimSpace(scanner.Text()) - if strings.Contains(text, "CVE-") && (strings.HasPrefix(text, "active/") || strings.HasPrefix(text, "retired/")) { - if strings.Contains(text, " => ") { - text = text[strings.Index(text, " => ")+4:] - } - modifiedCVE[text] = struct{}{} - } + // Convert the note set into a slice. + var notes []string + for note := range noteSet { + notes = append(notes, note) } - return modifiedCVE, nil + return vulns, notes, nil } func parseUbuntuCVE(fileContent io.Reader) (vulnerability database.VulnerabilityWithAffected, unknownReleases map[string]struct{}, err error) { From 5caa821c80a4efa2986728d6f223552b44f6ce15 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 5 Jul 2018 19:15:47 -0400 Subject: [PATCH 23/23] *: remove bzr dependency --- Dockerfile | 2 +- Documentation/running-clair.md | 2 -- cmd/clair/main.go | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 112bc42c..cebc06c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ EXPOSE 6060 6061 ADD . /go/src/github.com/coreos/clair/ WORKDIR /go/src/github.com/coreos/clair/ -RUN apk add --no-cache git bzr rpm xz dumb-init && \ +RUN apk add --no-cache git rpm xz dumb-init && \ go install -v github.com/coreos/clair/cmd/clair && \ mv /go/bin/clair /clair && \ rm -rf /go /usr/local/go diff --git a/Documentation/running-clair.md b/Documentation/running-clair.md index 32212d01..500d115c 100644 --- a/Documentation/running-clair.md +++ b/Documentation/running-clair.md @@ -87,14 +87,12 @@ To build Clair, you need to latest stable version of [Go] and a working [Go envi In addition, Clair requires some additional binaries be installed on the system [$PATH] as runtime dependencies: * [git] -* [bzr] * [rpm] * [xz] [Go]: https://github.com/golang/go/releases [Go environment]: https://golang.org/doc/code.html [git]: https://git-scm.com -[bzr]: http://bazaar.canonical.com/en [rpm]: http://www.rpm.org [xz]: http://tukaani.org/xz [$PATH]: https://en.wikipedia.org/wiki/PATH_(variable) diff --git a/cmd/clair/main.go b/cmd/clair/main.go index e802cbbd..dbb360a8 100644 --- a/cmd/clair/main.go +++ b/cmd/clair/main.go @@ -180,7 +180,7 @@ func main() { flag.Parse() // Check for dependencies. - for _, bin := range []string{"git", "bzr", "rpm", "xz"} { + for _, bin := range []string{"git", "rpm", "xz"} { _, err := exec.LookPath(bin) if err != nil { log.WithError(err).WithField("dependency", bin).Fatal("failed to find dependency")