From b508531e2587206963a3d4014fd372e08ca60fa6 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:32 -0400 Subject: [PATCH 01/48] spelling: associated Signed-off-by: Josh Soref --- notifier/postgres/e2e_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifier/postgres/e2e_test.go b/notifier/postgres/e2e_test.go index 327cbcdb30..7cb34238d6 100644 --- a/notifier/postgres/e2e_test.go +++ b/notifier/postgres/e2e_test.go @@ -21,7 +21,7 @@ const ( // TestE2E performs an end to end test ensuring creating, // retreiving, bookkeeping, and deleting of notifications -// and asssociated data works correctly +// and associated data works correctly func TestE2E(t *testing.T) { integration.NeedDB(t) ctx := zlog.Test(nil, t) From f770eafa03fbc9ae203f281d1bfec12b7ead2092 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:33 -0400 Subject: [PATCH 02/48] spelling: confirms Signed-off-by: Josh Soref --- notifier/postgres/e2e_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifier/postgres/e2e_test.go b/notifier/postgres/e2e_test.go index 7cb34238d6..a0cfd3b055 100644 --- a/notifier/postgres/e2e_test.go +++ b/notifier/postgres/e2e_test.go @@ -100,7 +100,7 @@ func (e *e2e) Run(t *testing.T) { } // PutNotifications adds a set of notifications to the database -// and confims no error occurs +// and confirms no error occurs func (e *e2e) PutNotifications(t *testing.T) { defer func() { e.failed = t.Failed() From 344c512a27f7ef8037601505d4e8bc7d76b4b890 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:34 -0400 Subject: [PATCH 03/48] spelling: constructor Signed-off-by: Josh Soref --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 596271008c..2f30b62c1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ ### Httputil - [ed8ffc5](https://github.com/quay/clair/commit/ed8ffc50b56c9b11873f00bb2deb4fba9107ec95): create package and RateLimiter ### Initialize -- [5df82e1](https://github.com/quay/clair/commit/5df82e19e971c67ebdecf3f92682d4ae897db53a): update call to Libindex contstructor +- [5df82e1](https://github.com/quay/clair/commit/5df82e19e971c67ebdecf3f92682d4ae897db53a): update call to Libindex constructor ### Introspection - [ec59a43](https://github.com/quay/clair/commit/ec59a431032713654e2eb7a29ad7c446dd16a490): enable readiness endpoint From 01f574ec29c8888f671a9596a64965e5c9c07176 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:35 -0400 Subject: [PATCH 04/48] spelling: contain Signed-off-by: Josh Soref --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f30b62c1c..5dfc199e1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -984,7 +984,7 @@ - [eeb13a0](https://github.com/quay/clair/commit/eeb13a02baa5db60b997454af8f059a6381f42da): add index on Vulnerability_Notification.deleted_at - [7cff31a](https://github.com/quay/clair/commit/7cff31a058230a94838b7fd8493380d444c31f5a): add ldfv compound index ### Pkg -- [c3904c9](https://github.com/quay/clair/commit/c3904c9696bddc20a27db9b4142ae704350bbe3f): Add fsutil to contian file system utility functions +- [c3904c9](https://github.com/quay/clair/commit/c3904c9696bddc20a27db9b4142ae704350bbe3f): Add fsutil to contain file system utility functions - [78cef02](https://github.com/quay/clair/commit/78cef02fdad4afd12a2a00df51d457c796278bfa): cerrors -> commonerr - [03bac0f](https://github.com/quay/clair/commit/03bac0f1b6f504a416937e309a62fdfc308dc397): utils/tar.go -> pkg/tarutil ### Pkg/Gitutil From a9530f0512a329389e30d1ca230e8b3f3b8c4561 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:36 -0400 Subject: [PATCH 05/48] spelling: contribution Signed-off-by: Josh Soref --- Documentation/contribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/contribution.md b/Documentation/contribution.md index c8e742e180..617e7c0e39 100644 --- a/Documentation/contribution.md +++ b/Documentation/contribution.md @@ -1,4 +1,4 @@ -# Contribuion +# Contribution The following sections provides information on how to contribute to Clair. - [Commit Style](./contribution/commit_style.md) From df8296f08eefc8b0213803ff08dfc7f33cda7600 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:37 -0400 Subject: [PATCH 06/48] spelling: created Signed-off-by: Josh Soref --- notifier/service/testmode.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notifier/service/testmode.go b/notifier/service/testmode.go index 4c54d81f5c..efc75e91fc 100644 --- a/notifier/service/testmode.go +++ b/notifier/service/testmode.go @@ -49,10 +49,10 @@ func indexerForTestMode(mock *indexer.Mock) { // MatcherForTestMode configures a mock Matcher service for notifier test mode. // // in notifier test mode a notifier.Poller will request "matcher.LatestUpdateOperations" at which point -// a new UO pair will be smithed. +// a new UO pair will be created. // // next a notifier.Processor will request "matcher.UpdateOperations" and look for "test-updater" UOs in which -// the smithed pair will be returned. +// the created pair will be returned. // // finally a notifier.Processor will request to "matcher.UpdateDiff" will be created where a mock added vulnerability // will be returned. From c32672c8d643ca636c2a1842c14ef0a8fd368f2b Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 23 Sep 2021 00:04:54 -0400 Subject: [PATCH 07/48] spelling: current Signed-off-by: Josh Soref --- httptransport/indexstatehandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httptransport/indexstatehandler.go b/httptransport/indexstatehandler.go index 5ee772a697..b9a4dcf47f 100644 --- a/httptransport/indexstatehandler.go +++ b/httptransport/indexstatehandler.go @@ -10,7 +10,7 @@ import ( ) // IndexStateHandler utilizes a Stater to report the -// curent runtime state of an Indexer. +// current runtime state of an Indexer. // // Indexers running with different scanner versions // will produce unique states and indicate to clients From f75bd101c36b2f24babb01964df884ecad5a75c7 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:38 -0400 Subject: [PATCH 08/48] spelling: database Signed-off-by: Josh Soref --- Documentation/concepts/api_internal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/concepts/api_internal.md b/Documentation/concepts/api_internal.md index 4abf673c4f..a9b6ec082f 100644 --- a/Documentation/concepts/api_internal.md +++ b/Documentation/concepts/api_internal.md @@ -11,7 +11,7 @@ Further information and usage is an effort left to the reader. ## Updates Diffs The `update_diff/` endpoint exposes the api for diffing two update operations. -This is used by the notifier to determine the added and removed vulnerabilities on security databsae update. +This is used by the notifier to determine the added and removed vulnerabilities on security database update. ## Update Operation From 7b0ecb5a65e4d10d2c05a43321110f1d88e8e1aa Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:39 -0400 Subject: [PATCH 09/48] spelling: deferred Signed-off-by: Josh Soref --- notifier/amqp/directdeliverer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifier/amqp/directdeliverer.go b/notifier/amqp/directdeliverer.go index 062889f714..e8b919f6da 100644 --- a/notifier/amqp/directdeliverer.go +++ b/notifier/amqp/directdeliverer.go @@ -76,7 +76,7 @@ func (d *DirectDeliverer) Deliver(ctx context.Context, _ uuid.UUID) error { if err != nil { return &clairerror.ErrDeliveryFailed{err} } - // TODO: can tx.Rollback be safely defered? + // TODO: can tx.Rollback be safely deferred? // block loop publishing smaller blocks of max(rollup) length via reslicing. var rollup int = d.conf.Rollup From 4b2249b302ceed66b5960a59e45d44d0cadb6c8f Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 23 Sep 2021 00:05:34 -0400 Subject: [PATCH 10/48] spelling: delivered Signed-off-by: Josh Soref --- notifier/mockstore.go | 2 +- notifier/postgres/store.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notifier/mockstore.go b/notifier/mockstore.go index 98fdb455ed..be37f92c90 100644 --- a/notifier/mockstore.go +++ b/notifier/mockstore.go @@ -91,7 +91,7 @@ func (m *MockStore) SetDelivered(ctx context.Context, id uuid.UUID) error { return m.SetDelivered_(ctx, id) } -// SetDeliveryFailed marks the provided notification id failed to be delivere +// SetDeliveryFailed marks the provided notification id failed to be delivered func (m *MockStore) SetDeliveryFailed(ctx context.Context, id uuid.UUID) error { return m.SetDeliveredFailed_(ctx, id) } diff --git a/notifier/postgres/store.go b/notifier/postgres/store.go index 8290863851..a7ad3f176a 100644 --- a/notifier/postgres/store.go +++ b/notifier/postgres/store.go @@ -82,7 +82,7 @@ func (s *Store) SetDelivered(ctx context.Context, id uuid.UUID) error { return setDelivered(ctx, s.pool, id) } -// SetDeliveryFailed marks the provided notification id failed to be delivere +// SetDeliveryFailed marks the provided notification id failed to be delivered func (s *Store) SetDeliveryFailed(ctx context.Context, id uuid.UUID) error { return setDeliveryFailed(ctx, s.pool, id) } From 2c17a77be01676c239fca19d61a68d7699ce5fe6 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:40 -0400 Subject: [PATCH 11/48] spelling: deserialization Signed-off-by: Josh Soref --- middleware/auth/httpauth_keyserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/auth/httpauth_keyserver.go b/middleware/auth/httpauth_keyserver.go index 3a57f54c56..dbfb8d6da3 100644 --- a/middleware/auth/httpauth_keyserver.go +++ b/middleware/auth/httpauth_keyserver.go @@ -117,7 +117,7 @@ HeaderSearch: jwk, ok := s.cache[ck] s.mu.RUnlock() // If not in our deserialized cache or our response has been served from the - // remote server, do the deserializtion and cache it. + // remote server, do the deserialization and cache it. if !ok || res.Header.Get(httpcache.XFromCache) != "" { jwk = &jose.JSONWebKey{} dec := codec.GetDecoder(res.Body) From aff5627a1af3720de323a8b4dfbb3cdbd2eb61cd Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:42 -0400 Subject: [PATCH 12/48] spelling: destination Signed-off-by: Josh Soref --- config.yaml.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yaml.sample b/config.yaml.sample index 09094dacc0..5123e4861c 100644 --- a/config.yaml.sample +++ b/config.yaml.sample @@ -79,7 +79,7 @@ notifier: cert: "madatory/path/to/cert" key: "madatory/path/to/key" stomp: - desitnation: "notifications" + destination: "notifications" direct: false callback: "http://clair-notifier/notifier/api/v1/notifications" login: From d3ef82f932c8238865798042edab33bdabbc3364 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:43 -0400 Subject: [PATCH 13/48] spelling: diagnostics Signed-off-by: Josh Soref --- introspection/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/introspection/server.go b/introspection/server.go index 83e8dcf458..95017cc41c 100644 --- a/introspection/server.go +++ b/introspection/server.go @@ -134,7 +134,7 @@ func New(ctx context.Context, conf config.Config, health func() bool) (*Server, return i, nil } -// withDiagnotics enables healthz and pprof endpoints +// withDiagnostics enables healthz and pprof endpoints func (i *Server) withDiagnostics(_ context.Context) error { health := i.health i.HandleFunc(HealthEndpoint, func(w http.ResponseWriter, r *http.Request) { From 5b2c02059a8504e5feddece1358e032517cfb715 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:44 -0400 Subject: [PATCH 14/48] spelling: diagram Signed-off-by: Josh Soref --- Documentation/howto/deployment.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/howto/deployment.md b/Documentation/howto/deployment.md index f2be20db59..baa73daee3 100644 --- a/Documentation/howto/deployment.md +++ b/Documentation/howto/deployment.md @@ -14,7 +14,7 @@ In a combined deployment, all the Clair processes run in a single OS process. Th A load balancer is still recommended if you plan on performing TLS termination. Typically this will be a OpenShift route or a Kubernetes ingress. -![combo mode single db deployment diagran](./clairv4_combo_single_db.png) +![combo mode single db deployment diagram](./clairv4_combo_single_db.png) In the above diagram, Clair is running in combo mode and talking to a single database. To configure this model you will provide all node types the same database and start Clair in **combo** mode. @@ -33,7 +33,7 @@ In this mode, any configuration informing Clair how to talk to other nodes is ig For added flexibility, it's also supported to split the databases while in combo mode. -![combo mode multiple db deployment diagran](./clairv4_combo_multi_db.png) +![combo mode multiple db deployment diagram](./clairv4_combo_multi_db.png) In the above diagram, Clair is running in combo mode but database load is split between multiple databases. Since Clair is conceptually a set of micro-services, its processes do not share database tables even when combined into the same OS process. @@ -58,7 +58,7 @@ In a distributed deployment, each Clair process runs in its own OS process. Typi A load balancer **must** be setup in this deployment model. The load balancer will route traffic between Clair nodes along with routing API requests via [path based routing](https://devcentral.f5.com/s/articles/the-three-http-routing-patterns-you-should-know-30764) to the correct services. In a Kubernetes or OpenShift deployment this is usually handled with the Service and Routes abstractions. If deploying on bare metal, a load balancer will need to be configured appropriately. -![distributed mode multiple db deployment diagran](./clairv4_distributed_multi_db.png) +![distributed mode multiple db deployment diagram](./clairv4_distributed_multi_db.png) In the above diagram, a load balancer is configured to route traffic coming from the client to the correct service. This routing is path based routing and requires a layer 7 load balancer. Traefik, Nginx, and HAProxy are all capable of this. As mentioned above, this functionality is native to OpenShift and Kubernetes. From 1dfaefb78959301f0da2dff66d0712d9f7ef8a1b Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:45 -0400 Subject: [PATCH 15/48] spelling: dockerfile Signed-off-by: Josh Soref --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dfc199e1b..3424b1b2b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -773,7 +773,7 @@ - [627b98e](https://github.com/quay/clair/commit/627b98ef3126d517d3e80aef4c2ab9ed3d14b893): fix SQL error reporting ### Db/Pgsql/Migration - [8df8170](https://github.com/quay/clair/commit/8df8170ba54d945cf2e2ad201bcdb8cc09fddc06): convert to pure SQL -### Dckerfile +### Dockerfile - [80f150f](https://github.com/quay/clair/commit/80f150f93bf3b12e6c9bcea2d71ccfa956bd50c9): Add docker-compose.yml ### Detectors/Feature - [fc908e6](https://github.com/quay/clair/commit/fc908e65ba6c0ad3edb344cfb263adff8efe6f4e): add apk feature detector From 08e89cc8b09a26b6dfe68788b59af2c8a43aa148 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:46 -0400 Subject: [PATCH 16/48] spelling: failover Signed-off-by: Josh Soref --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3424b1b2b9..921076c9f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -647,7 +647,7 @@ - [162e8cd](https://github.com/quay/clair/commit/162e8cdafc66be28b021f83da736a2b612ddda99): enable suse updater - [0609ed9](https://github.com/quay/clair/commit/0609ed964b0673806462a24147e6028da85d8a38): removed worker config - [af2c688](https://github.com/quay/clair/commit/af2c68863482ae9f93a2db1533be260468a6ea2d): not properly loaded error ([#140](https://github.com/quay/clair/issues/140)) - - [#140](https://github.com/quay/clair/issues/140) - fixes [#134](https://github.com/quay/clair/issues/134)- [30055af](https://github.com/quay/clair/commit/30055af03e357b44cfbacb3088eab337a94e51e8): fallover correctly to default config + - [#140](https://github.com/quay/clair/issues/140) - fixes [#134](https://github.com/quay/clair/issues/134)- [30055af](https://github.com/quay/clair/commit/30055af03e357b44cfbacb3088eab337a94e51e8): failover correctly to default config - [20af787](https://github.com/quay/clair/commit/20af78743774b18795cbf5210cc97cc172b1880d): fix default fallback - [4fc32d2](https://github.com/quay/clair/commit/4fc32d22713a47eabf5b12b81897fdd34d59935b): add top-level YAML namespace 'clair' - Fixes [#95](https://github.com/quay/clair/issues/95)- [bb7745f](https://github.com/quay/clair/commit/bb7745f3fe21e85b5fe37919e11d6d121e08b9a1): better document example From 7b750815d6e6e6fc985401f072264019882916c6 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 23 Sep 2021 00:06:40 -0400 Subject: [PATCH 17/48] spelling: http Signed-off-by: Josh Soref --- notifier/webhook/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifier/webhook/config.go b/notifier/webhook/config.go index 475b235d1f..981a53fbe7 100644 --- a/notifier/webhook/config.go +++ b/notifier/webhook/config.go @@ -16,7 +16,7 @@ type Config struct { // the notification will be appended to this url Callback string `yaml:"callback" json:"callback"` callback *url.URL - // any htp headers necessary for the request to Target + // any http headers necessary for the request to Target Headers http.Header `yaml:"headers" json:"headers"` // whether the webhook deliverer will sign out going. // if true webhooks will be sent with a jwt signed by From d785cc27a176fea7be15a6fa9e0604a48061b09c Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:47 -0400 Subject: [PATCH 18/48] spelling: indicates Signed-off-by: Josh Soref --- clair-error/errors.go | 4 ++-- clair-error/notifications.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clair-error/errors.go b/clair-error/errors.go index 947b368084..820f02822c 100644 --- a/clair-error/errors.go +++ b/clair-error/errors.go @@ -16,7 +16,7 @@ func (e *ErrRequestFail) Error() string { return fmt.Sprintf("code: %v status %v", e.Code, e.Status) } -// ErrBadManifest inidcates a manifest could not be parsed +// ErrBadManifest indicates a manifest could not be parsed type ErrBadManifest struct { E error } @@ -29,7 +29,7 @@ func (e *ErrBadManifest) Unwrap() error { return e.E } -// ErrBadManifest inidcates a manifest could not be parsed +// ErrBadManifest indicates a manifest could not be parsed type ErrBadIndexReport struct { E error } diff --git a/clair-error/notifications.go b/clair-error/notifications.go index 7298a4723c..e6e3bb958b 100644 --- a/clair-error/notifications.go +++ b/clair-error/notifications.go @@ -6,7 +6,7 @@ import ( "github.com/google/uuid" ) -// ErrNoUpdateOperation inidcates that the queried updater has no +// ErrNoUpdateOperation indicates that the queried updater has no // update operations associated. type ErrNoUpdateOperation struct { Updater string From e5ff8e8def78553fc25f112d59fe02845382eb2c Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:48 -0400 Subject: [PATCH 19/48] spelling: inited Signed-off-by: Josh Soref --- httptransport/vulnerabilityreporthandler.go | 4 ++-- httptransport/vulnerabilityreporthandler_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/httptransport/vulnerabilityreporthandler.go b/httptransport/vulnerabilityreporthandler.go index 3d48ba76db..44ab6b4fbe 100644 --- a/httptransport/vulnerabilityreporthandler.go +++ b/httptransport/vulnerabilityreporthandler.go @@ -59,7 +59,7 @@ func (h *VulnerabilityReportHandler) ServeHTTP(w http.ResponseWriter, r *http.Re return } - initd, err := h.Matcher.Initialized(ctx) + inited, err := h.Matcher.Initialized(ctx) if err != nil { resp := &je.Response{ Code: "internal-server-error", @@ -68,7 +68,7 @@ func (h *VulnerabilityReportHandler) ServeHTTP(w http.ResponseWriter, r *http.Re je.Error(w, resp, http.StatusInternalServerError) return } - if !initd { + if !inited { w.WriteHeader(http.StatusAccepted) return } diff --git a/httptransport/vulnerabilityreporthandler_test.go b/httptransport/vulnerabilityreporthandler_test.go index adc819654d..32e2f7fc65 100644 --- a/httptransport/vulnerabilityreporthandler_test.go +++ b/httptransport/vulnerabilityreporthandler_test.go @@ -14,12 +14,12 @@ import ( ) func TestInitialized(t *testing.T) { - var initd bool + var inited bool digest := claircore.MustParseDigest("sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") h := &VulnerabilityReportHandler{ Matcher: &matcher.Mock{ Initialized_: func(_ context.Context) (bool, error) { - return initd, nil + return inited, nil }, }, Indexer: &indexer.Mock{ @@ -45,7 +45,7 @@ func TestInitialized(t *testing.T) { t.Errorf("unexpected response") } - initd = true + inited = true res, err = c.Get(srv.URL + "/" + digest.String()) if err != nil { t.Fatal(err) From 4188d0ca5837054db805038b388f85e0cc5ea669 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:49 -0400 Subject: [PATCH 20/48] spelling: introspection Signed-off-by: Josh Soref --- middleware/introspection/instrumentedhandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/introspection/instrumentedhandler.go b/middleware/introspection/instrumentedhandler.go index 76ace1bc57..4609381f11 100644 --- a/middleware/introspection/instrumentedhandler.go +++ b/middleware/introspection/instrumentedhandler.go @@ -1,4 +1,4 @@ -package instrospection +package introspection import ( "net/http" From 79e1ae77be8fea194848641ff2a2dec3da39b7e6 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 23 Sep 2021 00:07:39 -0400 Subject: [PATCH 21/48] spelling: javascript Signed-off-by: Josh Soref --- Documentation/reference/api.md | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/reference/api.md b/Documentation/reference/api.md index c6842e4b33..3339a7d558 100644 --- a/Documentation/reference/api.md +++ b/Documentation/reference/api.md @@ -3,7 +3,7 @@ title: ClairV4 v0.1 language_tabs: - python: Python - go: Golang - - javascript: Javascript + - javascript: JavaScript language_clients: - python: "" - go: "" diff --git a/Makefile b/Makefile index f08baa4a9d..ec8a0a0519 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ goimports-local: # you'll need to have npx to run this gen. .PHONY: gen-api-reference gen-api-reference: - npx widdershins --search false --language_tabs 'python:Python' 'go:Golang' 'javascript:Javascript' --summary ./openapi.yaml -o ./Documentation/reference/api.md + npx widdershins --search false --language_tabs 'python:Python' 'go:Golang' 'javascript:JavaScript' --summary ./openapi.yaml -o ./Documentation/reference/api.md # start a local development environment. # each services runs in it's own container to test service->service communication. From 2ab7cac19c7e8b9e9132d14a7cbfaba1069a2db0 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:50 -0400 Subject: [PATCH 22/48] spelling: mandatory Signed-off-by: Josh Soref --- config.yaml.sample | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.yaml.sample b/config.yaml.sample index 5123e4861c..bb2835d5e5 100644 --- a/config.yaml.sample +++ b/config.yaml.sample @@ -76,8 +76,8 @@ notifier: callback: "http://clair-notifier/notifier/api/v1/notifications" tls: root_ca: "optional/path/to/rootca" - cert: "madatory/path/to/cert" - key: "madatory/path/to/key" + cert: "mandatory/path/to/cert" + key: "mandatory/path/to/key" stomp: destination: "notifications" direct: false @@ -87,8 +87,8 @@ notifier: passcode: "passcode" tls: root_ca: "optional/path/to/rootca" - cert: "madatory/path/to/cert" - key: "madatory/path/to/key" + cert: "mandatory/path/to/cert" + key: "mandatory/path/to/key" From 2a9b5e3b565455a6ca3f7f4feacd190be3d83042 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:51 -0400 Subject: [PATCH 23/48] spelling: matcher Signed-off-by: Josh Soref --- httptransport/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httptransport/server.go b/httptransport/server.go index a54aa0f98e..7cb657ec1c 100644 --- a/httptransport/server.go +++ b/httptransport/server.go @@ -137,7 +137,7 @@ func (t *Server) configureDiscovery(_ context.Context) error { func (t *Server) configureComboMode(ctx context.Context) error { // requires both indexer and matcher services if t.indexer == nil || t.matcher == nil { - return clairerror.ErrNotInitialized{Msg: "Combo mode requires both indexer and macher services"} + return clairerror.ErrNotInitialized{Msg: "Combo mode requires both indexer and matcher services"} } err := t.configureIndexerMode(ctx) From 7bc3f7f33c6131a110f2fb02ffbfeab630891535 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:52 -0400 Subject: [PATCH 24/48] spelling: notification Signed-off-by: Josh Soref --- Documentation/concepts/notifications.md | 2 +- Documentation/reference/api.md | 2 +- clair-error/notifications.go | 2 +- notifier/postgres/e2e_test.go | 54 ++++++++++++------------- notifier/postgres/putnotifications.go | 2 +- openapi.yaml | 2 +- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Documentation/concepts/notifications.md b/Documentation/concepts/notifications.md index db80a4fb76..2d0b347d05 100644 --- a/Documentation/concepts/notifications.md +++ b/Documentation/concepts/notifications.md @@ -58,7 +58,7 @@ When you configure notifier for webhook delivery you provide the service with th When the notifier has determined an updated security database has changed the affected status of an indexed manifest, it will deliver the following JSON body to the configured target: ```json { - "notifiction_id": {uuid_string}, + "notification_id": {uuid_string}, "callback": {url_to_notifications} } ``` diff --git a/Documentation/reference/api.md b/Documentation/reference/api.md index 3339a7d558..1c9970d8fd 100644 --- a/Documentation/reference/api.md +++ b/Documentation/reference/api.md @@ -1184,7 +1184,7 @@ Notification |---|---|---|---|---| |id|string|false|none|a unique identifier for this notification| |manifest|string|false|none|The hash of the manifest affected by the provided vulnerability.| -|reason|string|false|none|the reason for the notifcation, [added | removed]| +|reason|string|false|none|the reason for the notification, [added | removed]| |vulnerability|[VulnSummary](#schemavulnsummary)|false|none|A summary of a vulnerability|

Environment

diff --git a/clair-error/notifications.go b/clair-error/notifications.go index e6e3bb958b..1bcc38fdea 100644 --- a/clair-error/notifications.go +++ b/clair-error/notifications.go @@ -31,7 +31,7 @@ func (e ErrBadNotification) Unwrap() error { return e.E } -// ErrDeleteNotification indicates an error while deleting notifcations. +// ErrDeleteNotification indicates an error while deleting notifications. // The wrapped error will contain further details. type ErrDeleteNotification struct { NotificationID uuid.UUID diff --git a/notifier/postgres/e2e_test.go b/notifier/postgres/e2e_test.go index a0cfd3b055..82b6fc757d 100644 --- a/notifier/postgres/e2e_test.go +++ b/notifier/postgres/e2e_test.go @@ -27,7 +27,7 @@ func TestE2E(t *testing.T) { ctx := zlog.Test(nil, t) digest, _ := claircore.ParseDigest("sha256:35c102085707f703de2d9eaad8752d6fe1b8f02b5d2149f1d8357c9cc7fb7d0a") notificationID := uuid.New() - // this function puts a single noification undertest + // this function puts a single notification undertest vuln, vsummary := cctest.GenUniqueVulnerabilities(1, updater)[0], notifier.VulnSummary{} vsummary.FromVulnerability(vuln) notifications := []notifier.Notification{ @@ -39,7 +39,7 @@ func TestE2E(t *testing.T) { } store := TestStore(ctx, t) e := e2e{ - notificaitonID: notificationID, + notificationID: notificationID, updater: updater, updateID: uuid.New(), notification: notifications[0], @@ -59,7 +59,7 @@ func TestE2E(t *testing.T) { // failure type e2e struct { // the notification ID this e2e test will use - notificaitonID uuid.UUID + notificationID uuid.UUID // the updater associated with the set of notifications under test updater string // the update operation ID associated with the set of notifications under test @@ -107,7 +107,7 @@ func (e *e2e) PutNotifications(t *testing.T) { }() opts := notifier.PutOpts{ Updater: e.updater, - NotificationID: e.notificaitonID, + NotificationID: e.notificationID, Notifications: []notifier.Notification{e.notification}, UpdateID: e.updateID, } @@ -131,16 +131,16 @@ func (e *e2e) Created(t *testing.T) { if len(ids) != 1 { t.Fatalf("expected a single notification id. got: %v", ids) } - if !cmp.Equal(ids[0], e.notificaitonID) { - t.Fatalf(cmp.Diff(ids[0], e.notificaitonID)) + if !cmp.Equal(ids[0], e.notificationID) { + t.Fatalf(cmp.Diff(ids[0], e.notificationID)) } - receipt, err := e.store.Receipt(e.ctx, e.notificaitonID) + receipt, err := e.store.Receipt(e.ctx, e.notificationID) if err != nil { t.Fatalf("failed to retrieve receipt by notification id") } - if !cmp.Equal(receipt.NotificationID, e.notificaitonID) { - t.Fatal(cmp.Diff(receipt.NotificationID, e.notificaitonID)) + if !cmp.Equal(receipt.NotificationID, e.notificationID) { + t.Fatal(cmp.Diff(receipt.NotificationID, e.notificationID)) } if !cmp.Equal(receipt.Status, notifier.Created) { t.Fatal(cmp.Diff(receipt.Status, notifier.Delivered)) @@ -150,8 +150,8 @@ func (e *e2e) Created(t *testing.T) { if err != nil { t.Fatalf("failed to retrieve receipt by OUID") } - if !cmp.Equal(receipt.NotificationID, e.notificaitonID) { - t.Fatal(cmp.Diff(receipt.NotificationID, e.notificaitonID)) + if !cmp.Equal(receipt.NotificationID, e.notificationID) { + t.Fatal(cmp.Diff(receipt.NotificationID, e.notificationID)) } if !cmp.Equal(receipt.Status, notifier.Created) { t.Fatal(cmp.Diff(receipt.Status, notifier.Delivered)) @@ -164,12 +164,12 @@ func (e *e2e) Notifcations(t *testing.T) { defer func() { e.failed = t.Failed() }() - notifications, _, err := e.store.Notifications(e.ctx, e.notificaitonID, nil) + notifications, _, err := e.store.Notifications(e.ctx, e.notificationID, nil) if err != nil { t.Fatalf("failed to retrieve persisted notification: %v", err) } if len(notifications) != 1 { - t.Fatalf("expected a single notifcation to be returned for notification id %v but received %d", e.notificaitonID, len(notifications)) + t.Fatalf("expected a single notification to be returned for notification id %v but received %d", e.notificationID, len(notifications)) } opts := cmpopts.IgnoreUnexported(claircore.Digest{}) if !cmp.Equal(notifications[0].Manifest, e.notification.Manifest, opts) { @@ -190,16 +190,16 @@ func (e *e2e) SetDelivered(t *testing.T) { defer func() { e.failed = t.Failed() }() - err := e.store.SetDelivered(e.ctx, e.notificaitonID) + err := e.store.SetDelivered(e.ctx, e.notificationID) if err != nil { t.Fatalf("failed to set notification receipt to delivered") } - receipt, err := e.store.Receipt(e.ctx, e.notificaitonID) + receipt, err := e.store.Receipt(e.ctx, e.notificationID) if err != nil { t.Fatalf("failed to retrieve receipt after setting it's status to delivered") } - if !cmp.Equal(receipt.NotificationID, e.notificaitonID) { - t.Fatal(cmp.Diff(receipt.NotificationID, e.notificaitonID)) + if !cmp.Equal(receipt.NotificationID, e.notificationID) { + t.Fatal(cmp.Diff(receipt.NotificationID, e.notificationID)) } if !cmp.Equal(receipt.Status, notifier.Delivered) { t.Fatal(cmp.Diff(receipt.Status, notifier.Delivered)) @@ -212,16 +212,16 @@ func (e *e2e) SetDeliveryFailed(t *testing.T) { defer func() { e.failed = t.Failed() }() - err := e.store.SetDeliveryFailed(e.ctx, e.notificaitonID) + err := e.store.SetDeliveryFailed(e.ctx, e.notificationID) if err != nil { t.Fatalf("failed to set notification receipt to delivered") } - receipt, err := e.store.Receipt(e.ctx, e.notificaitonID) + receipt, err := e.store.Receipt(e.ctx, e.notificationID) if err != nil { t.Fatalf("failed to retrieve receipt after setting it's status to delete") } - if !cmp.Equal(receipt.NotificationID, e.notificaitonID) { - t.Fatal(cmp.Diff(receipt.NotificationID, e.notificaitonID)) + if !cmp.Equal(receipt.NotificationID, e.notificationID) { + t.Fatal(cmp.Diff(receipt.NotificationID, e.notificationID)) } if !cmp.Equal(receipt.Status, notifier.DeliveryFailed) { t.Fatal(cmp.Diff(receipt.Status, notifier.DeliveryFailed)) @@ -233,8 +233,8 @@ func (e *e2e) SetDeliveryFailed(t *testing.T) { if len(ids) != 1 { t.Fatalf("expected a single notification id. got: %v", ids) } - if !cmp.Equal(ids[0], e.notificaitonID) { - t.Fatalf(cmp.Diff(ids[0], e.notificaitonID)) + if !cmp.Equal(ids[0], e.notificationID) { + t.Fatalf(cmp.Diff(ids[0], e.notificationID)) } } @@ -245,16 +245,16 @@ func (e *e2e) SetDeleted(t *testing.T) { defer func() { e.failed = t.Failed() }() - err := e.store.SetDeleted(e.ctx, e.notificaitonID) + err := e.store.SetDeleted(e.ctx, e.notificationID) if err != nil { t.Fatalf("failed to set notification receipt to delivered") } - receipt, err := e.store.Receipt(e.ctx, e.notificaitonID) + receipt, err := e.store.Receipt(e.ctx, e.notificationID) if err != nil { t.Fatalf("failed to retrieve receipt after setting it's status to delete") } - if !cmp.Equal(receipt.NotificationID, e.notificaitonID) { - t.Fatal(cmp.Diff(receipt.NotificationID, e.notificaitonID)) + if !cmp.Equal(receipt.NotificationID, e.notificationID) { + t.Fatal(cmp.Diff(receipt.NotificationID, e.notificationID)) } if !cmp.Equal(receipt.Status, notifier.Deleted) { t.Fatal(cmp.Diff(receipt.Status, notifier.Deleted)) diff --git a/notifier/postgres/putnotifications.go b/notifier/postgres/putnotifications.go index 075a157064..194281b827 100644 --- a/notifier/postgres/putnotifications.go +++ b/notifier/postgres/putnotifications.go @@ -21,7 +21,7 @@ type notificationJSONB notifier.Notification // putNotifications inserts the provided notifications, updates the latest seen update // operation for the provide updater, and creates a receipt in created status for the -// notifiation id. +// notification id. // // these operations occur under a transcation to preserve an atomic operation. func putNotifications(ctx context.Context, pool *pgxpool.Pool, opts notifier.PutOpts) error { diff --git a/openapi.yaml b/openapi.yaml index 774faed552..7e49adb3ba 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -466,7 +466,7 @@ components: example: |- sha256:35c102085707f703de2d9eaad8752d6fe1b8f02b5d2149f1d8357c9cc7fb7d0a reason: - description: "the reason for the notifcation, [added | removed]" + description: "the reason for the notification, [added | removed]" type: string example: "added" vulnerability: From 52b04eb8cd0c8dee4597ec37a266b08acff3389d Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:58 -0400 Subject: [PATCH 25/48] spelling: notifications Signed-off-by: Josh Soref --- notifier/mockstore.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/notifier/mockstore.go b/notifier/mockstore.go index be37f92c90..90ea1bcce6 100644 --- a/notifier/mockstore.go +++ b/notifier/mockstore.go @@ -8,18 +8,18 @@ import ( // MockStore implements a mock Store. type MockStore struct { - Notifications_ func(ctx context.Context, id uuid.UUID, page *Page) ([]Notification, Page, error) - PutNotifications_ func(ctx context.Context, opts PutOpts) error - PutReceipt_ func(ctx context.Context, updater string, r Receipt) error - DeleteNotitfications_ func(ctx context.Context, id uuid.UUID) error - Receipt_ func(ctx context.Context, id uuid.UUID) (Receipt, error) - ReceiptByUOID_ func(ctx context.Context, id uuid.UUID) (Receipt, error) - Created_ func(ctx context.Context) ([]uuid.UUID, error) - Failed_ func(ctx context.Context) ([]uuid.UUID, error) - Deleted_ func(ctx context.Context) ([]uuid.UUID, error) - SetDelivered_ func(ctx context.Context, id uuid.UUID) error - SetDeliveredFailed_ func(ctx context.Context, id uuid.UUID) error - SetDeleted_ func(ctx context.Context, id uuid.UUID) error + Notifications_ func(ctx context.Context, id uuid.UUID, page *Page) ([]Notification, Page, error) + PutNotifications_ func(ctx context.Context, opts PutOpts) error + PutReceipt_ func(ctx context.Context, updater string, r Receipt) error + DeleteNotifications_ func(ctx context.Context, id uuid.UUID) error + Receipt_ func(ctx context.Context, id uuid.UUID) (Receipt, error) + ReceiptByUOID_ func(ctx context.Context, id uuid.UUID) (Receipt, error) + Created_ func(ctx context.Context) ([]uuid.UUID, error) + Failed_ func(ctx context.Context) ([]uuid.UUID, error) + Deleted_ func(ctx context.Context) ([]uuid.UUID, error) + SetDelivered_ func(ctx context.Context, id uuid.UUID) error + SetDeliveredFailed_ func(ctx context.Context, id uuid.UUID) error + SetDeleted_ func(ctx context.Context, id uuid.UUID) error } // Notifications retrieves the list of notifications associated with a @@ -58,7 +58,7 @@ func (m *MockStore) PutReceipt(ctx context.Context, updater string, r Receipt) e // set deleted after some period of time, thus this condition should not // be checked. func (m *MockStore) DeleteNotifications(ctx context.Context, id uuid.UUID) error { - return m.DeleteNotitfications_(ctx, id) + return m.DeleteNotifications_(ctx, id) } // Receipt returns the Receipt for a given notification id From 7e600b88923626fd3a879df7de182fbcb25ed817 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:40:59 -0400 Subject: [PATCH 26/48] spelling: notifier Signed-off-by: Josh Soref --- notifier/store.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notifier/store.go b/notifier/store.go index 3f7675a740..de66879f50 100644 --- a/notifier/store.go +++ b/notifier/store.go @@ -6,7 +6,7 @@ import ( "github.com/google/uuid" ) -// PutOpts is provided to Notificationer.Put +// PutOpts is provided to Notifier.Put // with fields necessary to persist a notification id type PutOpts struct { // the updater triggering a notification @@ -24,12 +24,12 @@ type PutOpts struct { // Store is an aggregate interface implementing all methods // necessary for a notifier persistence layer type Store interface { - Notificationer + Notifier Receipter } -// Notificationer implements persistence methods for Notification models -type Notificationer interface { +// Notifier implements persistence methods for Notification models +type Notifier interface { // Notifications retrieves the list of notifications associated with a // notification id // From a87859c9cdb2fcc7364fa36545f43f5316ee4360 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:00 -0400 Subject: [PATCH 27/48] spelling: occurred Signed-off-by: Josh Soref --- Documentation/concepts/api_internal.md | 2 +- clair-error/notifications.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/concepts/api_internal.md b/Documentation/concepts/api_internal.md index a9b6ec082f..334e8f4e51 100644 --- a/Documentation/concepts/api_internal.md +++ b/Documentation/concepts/api_internal.md @@ -16,7 +16,7 @@ This is used by the notifier to determine the added and removed vulnerabilities ## Update Operation The `update_operation` endpoint exposes the api for viewing updaters' activity. -This is used by the notifier to determine if new updates have occured and triggers an update diff to see what has changed. +This is used by the notifier to determine if new updates have occurred and triggers an update diff to see what has changed. ## AffectedManifest diff --git a/clair-error/notifications.go b/clair-error/notifications.go index 1bcc38fdea..c759c1d155 100644 --- a/clair-error/notifications.go +++ b/clair-error/notifications.go @@ -69,7 +69,7 @@ func (e ErrReceipt) Unwrap() error { return e.E } -// ErrCreated indicates an error occured when retrieving created notification ids. +// ErrCreated indicates an error occurred when retrieving created notification ids. type ErrCreated struct { E error } @@ -82,7 +82,7 @@ func (e ErrCreated) Unwrap() error { return e.E } -// ErrFailed indicates an error occured when retrieving created notification ids. +// ErrFailed indicates an error occurred when retrieving created notification ids. type ErrFailed struct { E error } @@ -95,7 +95,7 @@ func (e ErrFailed) Unwrap() error { return e.E } -// ErrPutNotifications indicates an issues occured when persisting a slice of +// ErrPutNotifications indicates an issues occurred when persisting a slice of // computed notifications. // The wrapped error will contain further details. type ErrPutNotifications struct { From 8e50f9a7fbc4bf3c3034ded46866c0ec1194ab37 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:01 -0400 Subject: [PATCH 28/48] spelling: operations Signed-off-by: Josh Soref --- httptransport/client/matcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httptransport/client/matcher.go b/httptransport/client/matcher.go index 015b8a5252..d6c9c4df16 100644 --- a/httptransport/client/matcher.go +++ b/httptransport/client/matcher.go @@ -178,7 +178,7 @@ func (c *HTTP) LatestUpdateOperations(ctx context.Context, k driver.UpdateKind) // updateOperations is a private method implementing the common bits for retrieving UpdateOperations // // an ouCache is passed in by the caller to cache any responses providing an etag. -// if a subsequent response provides a StatusNotModified status, the map of UpdateOprations is served from cache. +// if a subsequent response provides a StatusNotModified status, the map of UpdateOperations is served from cache. func (c *HTTP) updateOperations(ctx context.Context, req *http.Request, cache *uoCache) (map[string][]driver.UpdateOperation, error) { res, err := c.c.Do(req) if err != nil { From 2a477e864e9d0d414430df7f9d2d208e6fefb5b7 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:02 -0400 Subject: [PATCH 29/48] spelling: opportunistic Signed-off-by: Josh Soref --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 921076c9f1..0e4401216e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -443,7 +443,7 @@ ### Config - [3ccc6e0](https://github.com/quay/clair/commit/3ccc6e03be0ce1b6c439d5c0649ee785dc7c559f): add support for per-scanner configuration ### Dockerfile -- [5a73cb4](https://github.com/quay/clair/commit/5a73cb49d64e839d7675979b5e3f348d94dd26a5): make -mod=vendor opportunisitic ([#999](https://github.com/quay/clair/issues/999)) +- [5a73cb4](https://github.com/quay/clair/commit/5a73cb49d64e839d7675979b5e3f348d94dd26a5): make -mod=vendor opportunistic ([#999](https://github.com/quay/clair/issues/999)) - [#999](https://github.com/quay/clair/issues/999)### Dockerfile: Update To Alpine - [de32b07](https://github.com/quay/clair/commit/de32b0728ccdbafb85988e2f87618c9d576fc87e): 3.11 for newest rpm ### Go.Mod From 2db3e1cf31f46ccdd94edf1209ee5d9c999f7b6f Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:03 -0400 Subject: [PATCH 30/48] spelling: password Signed-off-by: Josh Soref --- Documentation/reference/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/reference/config.md b/Documentation/reference/config.md index 67a487006e..9dcc53d34d 100644 --- a/Documentation/reference/config.md +++ b/Documentation/reference/config.md @@ -564,7 +564,7 @@ An address in `:` syntax where traces can be submitted. #### `$.trace.jaeger.collector.username` a string value -#### `$.trace.jaeger.collector.passwordd` +#### `$.trace.jaeger.collector.password` a string value #### `$.trace.jaeger.service_name` From faf1efc82b0299bf5d9b2c855e941a903bc1ad0b Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:04 -0400 Subject: [PATCH 31/48] spelling: performs Signed-off-by: Josh Soref --- httptransport/updateoperationhandler_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httptransport/updateoperationhandler_test.go b/httptransport/updateoperationhandler_test.go index 4191b036c7..63db4875fc 100644 --- a/httptransport/updateoperationhandler_test.go +++ b/httptransport/updateoperationhandler_test.go @@ -22,7 +22,7 @@ func TestUpdateOperationHandler(t *testing.T) { t.Run("Errors", testUpdateOperationHandlerErrors) } -// testUpdateOperationHandlerErrors confirms the handler perfoms the correct +// testUpdateOperationHandlerErrors confirms the handler performs the correct // actions when a matcher.Differ is failing. func testUpdateOperationHandlerErrors(t *testing.T) { t.Parallel() From 13829e5b4e98bd9fc2320f06035dfdf765d91cea Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:05 -0400 Subject: [PATCH 32/48] spelling: protocol Signed-off-by: Josh Soref --- notifier/pager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifier/pager.go b/notifier/pager.go index d84e653749..4180115482 100644 --- a/notifier/pager.go +++ b/notifier/pager.go @@ -4,7 +4,7 @@ import ( "github.com/google/uuid" ) -// Page communicates a bare-minimum paging procotol with clients +// Page communicates a bare-minimum paging protocol with clients type Page struct { // the max number of elements returned in a page Size uint64 `json:"size"` From cdf1a8bb0183720e3849898a05b41235a67b3af2 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:07 -0400 Subject: [PATCH 33/48] spelling: provided Signed-off-by: Josh Soref --- notifier/postgres/setdeleted.go | 2 +- notifier/postgres/setdeliveryfailed.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notifier/postgres/setdeleted.go b/notifier/postgres/setdeleted.go index 8c321a586c..7bd3f09c07 100644 --- a/notifier/postgres/setdeleted.go +++ b/notifier/postgres/setdeleted.go @@ -32,7 +32,7 @@ var ( ) ) -// setDeleted will update the receipt's status to "deleted" for the provied +// setDeleted will update the receipt's status to "deleted" for the provided // notification id func setDeleted(ctx context.Context, pool *pgxpool.Pool, id uuid.UUID) error { const ( diff --git a/notifier/postgres/setdeliveryfailed.go b/notifier/postgres/setdeliveryfailed.go index 3c2b8af927..207feb50db 100644 --- a/notifier/postgres/setdeliveryfailed.go +++ b/notifier/postgres/setdeliveryfailed.go @@ -32,7 +32,7 @@ var ( ) ) -// setDeliveryFailed will update the receipt's status to "delivery_failed" for the provied +// setDeliveryFailed will update the receipt's status to "delivery_failed" for the provided // notification id func setDeliveryFailed(ctx context.Context, pool *pgxpool.Pool, id uuid.UUID) error { const ( From e845a851ce12c2c384ae91538fee5ddd75ffc18c Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:08 -0400 Subject: [PATCH 34/48] spelling: representing Signed-off-by: Josh Soref --- config/indexer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/indexer.go b/config/indexer.go index 36c73bb1c4..934f683720 100644 --- a/config/indexer.go +++ b/config/indexer.go @@ -21,7 +21,7 @@ type Indexer struct { // This value tunes how often a waiting Indexer will poll for the lock. // TODO: Move to async operating mode ScanLockRetry int `yaml:"scanlock_retry" json:"scanlock_retry"` - // A positive values represeting quantity. + // A positive values representing quantity. // // Indexers will index a Manifest's layers concurrently. // This value tunes the number of layers an Indexer will scan in parallel. From c22a00cebb3929f1290bbe8b9e246b90e6546871 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:09 -0400 Subject: [PATCH 35/48] spelling: responsible Signed-off-by: Josh Soref --- Documentation/concepts/indexing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/concepts/indexing.md b/Documentation/concepts/indexing.md index 50227f936b..f1beccb01a 100644 --- a/Documentation/concepts/indexing.md +++ b/Documentation/concepts/indexing.md @@ -1,6 +1,6 @@ # Indexing -The [Indexer](../reference/indexer.md) service is responsble for "indexing a manifest". +The [Indexer](../reference/indexer.md) service is responsible for "indexing a manifest". Indexing involves taking a manifest representing a container image and computing its constituent parts. The indexer is trying to discover what packages exist in the image, what distribution the image is derived from, and what package repositories are used within the image. Once this information is computed it is persisted in an IndexReport. From e2ad9c0cf34d400a3e9e46af4010026784fa0130 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:10 -0400 Subject: [PATCH 36/48] spelling: retrieve Signed-off-by: Josh Soref --- notifier/postgres/notification_pagination_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifier/postgres/notification_pagination_test.go b/notifier/postgres/notification_pagination_test.go index 3088f9e9fe..3544c01b9b 100644 --- a/notifier/postgres/notification_pagination_test.go +++ b/notifier/postgres/notification_pagination_test.go @@ -107,7 +107,7 @@ func TestNotePagination(t *testing.T) { for outPage.Next != nil { if err != nil { - t.Fatalf("failed to retreive initial page: %v", err) + t.Fatalf("failed to retrieve initial page: %v", err) } if outPage.Size != tt.pageSize { t.Fatalf("got: %v, want: %v", outPage.Size, tt.pageSize) From 6c6c3e42b0b5b87a4f3853bd4a91d4881c015b65 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:11 -0400 Subject: [PATCH 37/48] spelling: retrieving Signed-off-by: Josh Soref --- Documentation/concepts/api_internal.md | 2 +- clair-error/notifications.go | 2 +- indexer/service.go | 2 +- notifier/postgres/e2e_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/concepts/api_internal.md b/Documentation/concepts/api_internal.md index 334e8f4e51..c8b2c99887 100644 --- a/Documentation/concepts/api_internal.md +++ b/Documentation/concepts/api_internal.md @@ -20,5 +20,5 @@ This is used by the notifier to determine if new updates have occurred and trigg ## AffectedManifest -The `affected_manifest` endpoint exposes the api for retreiving affected manifests given a list of Vulnerabilities. +The `affected_manifest` endpoint exposes the api for retrieving affected manifests given a list of Vulnerabilities. This is used by the notifier to determine the manifests that need to have a notification generated. diff --git a/clair-error/notifications.go b/clair-error/notifications.go index c759c1d155..f1e4018517 100644 --- a/clair-error/notifications.go +++ b/clair-error/notifications.go @@ -55,7 +55,7 @@ func (e ErrNoReceipt) Error() string { return fmt.Sprintf("no receipt exists for notification id %s", e.NotificationID) } -// ErrReceipt indicates an error retreiving a receipt for referenced notification id. +// ErrReceipt indicates an error retrieving a receipt for referenced notification id. type ErrReceipt struct { NotificationID uuid.UUID E error diff --git a/indexer/service.go b/indexer/service.go index d39f437640..a92130dad9 100644 --- a/indexer/service.go +++ b/indexer/service.go @@ -36,7 +36,7 @@ type Indexer interface { Index(ctx context.Context, manifest *claircore.Manifest) (*claircore.IndexReport, error) } -// Reporter is an interface for retreiving an IndexReport given a manifest digest. +// Reporter is an interface for retrieving an IndexReport given a manifest digest. type Reporter interface { IndexReport(ctx context.Context, digest claircore.Digest) (*claircore.IndexReport, bool, error) } diff --git a/notifier/postgres/e2e_test.go b/notifier/postgres/e2e_test.go index 82b6fc757d..817512f847 100644 --- a/notifier/postgres/e2e_test.go +++ b/notifier/postgres/e2e_test.go @@ -20,7 +20,7 @@ const ( ) // TestE2E performs an end to end test ensuring creating, -// retreiving, bookkeeping, and deleting of notifications +// retrieving, bookkeeping, and deleting of notifications // and associated data works correctly func TestE2E(t *testing.T) { integration.NeedDB(t) From 355ee3a5cec9286b3aaae3ca85353342de8f5295 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:12 -0400 Subject: [PATCH 38/48] spelling: semantics Signed-off-by: Josh Soref --- middleware/compress/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/compress/handler.go b/middleware/compress/handler.go index 4e19ec620a..5d28593739 100644 --- a/middleware/compress/handler.go +++ b/middleware/compress/handler.go @@ -114,7 +114,7 @@ func (c *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Find the first accept-encoding we support. // See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 for - // all the sematics. + // all the semantics. for _, a := range ae { switch a.Type { case "gzip": From c84dbe731fe1ef69a8e7f3afe91001ca59ae060c Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:13 -0400 Subject: [PATCH 39/48] spelling: serialization Signed-off-by: Josh Soref --- notifier/callback_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifier/callback_test.go b/notifier/callback_test.go index f56c33b1c5..609ccef70f 100644 --- a/notifier/callback_test.go +++ b/notifier/callback_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" ) -func TestCallbackSerializtion(t *testing.T) { +func TestCallbackSerialization(t *testing.T) { var want = []byte(`{"callback":"https://example.com","notification_id":"00000000-0000-0000-0000-000000000000"}`) cb := Callback{ NotificationID: uuid.Nil, From 8e025b35392d5cda50ae6bfca2c1e192f90828c2 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:14 -0400 Subject: [PATCH 40/48] spelling: successful Signed-off-by: Josh Soref --- Documentation/reference/api.md | 2 +- openapi.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/reference/api.md b/Documentation/reference/api.md index 1c9970d8fd..4c9a5a79a0 100644 --- a/Documentation/reference/api.md +++ b/Documentation/reference/api.md @@ -1285,7 +1285,7 @@ IndexReport |» **additionalProperties**|[Distribution](#schemadistribution)|false|none|An indexed distribution discovered in a layer. See
https://www.freedesktop.org/software/systemd/man/os-release.html
for explanations and example of fields.| |environments|object|true|none|A map of lists containing Environment objects keyed by the
associated Package.id.| |» **additionalProperties**|[[Environment](#schemaenvironment)]|false|none|[The environment a particular package was discovered in.]| -|success|boolean|true|none|A bool indicating succcessful index| +|success|boolean|true|none|A bool indicating successful index| |err|string|true|none|An error message on event of unsuccessful index|

VulnerabilityReport

diff --git a/openapi.yaml b/openapi.yaml index 7e49adb3ba..7cc92916e1 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -547,7 +547,7 @@ components: $ref: '#/components/schemas/Environment' success: type: boolean - description: "A bool indicating succcessful index" + description: "A bool indicating successful index" example: true err: type: string From 627d450e4220269043ba72c8df4a0e4ee9eb2a24 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:15 -0400 Subject: [PATCH 41/48] spelling: transaction Signed-off-by: Josh Soref --- notifier/postgres/putnotifications.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifier/postgres/putnotifications.go b/notifier/postgres/putnotifications.go index 194281b827..1cdfff33e4 100644 --- a/notifier/postgres/putnotifications.go +++ b/notifier/postgres/putnotifications.go @@ -23,7 +23,7 @@ type notificationJSONB notifier.Notification // operation for the provide updater, and creates a receipt in created status for the // notification id. // -// these operations occur under a transcation to preserve an atomic operation. +// these operations occur under a transaction to preserve an atomic operation. func putNotifications(ctx context.Context, pool *pgxpool.Pool, opts notifier.PutOpts) error { const ( insertNotification = `INSERT INTO notification (id) VALUES ($1);` From 790ac140973ad7d6d9d2d59997962fedab969052 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:16 -0400 Subject: [PATCH 42/48] spelling: unify Signed-off-by: Josh Soref --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e4401216e..da15b3e07a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -200,7 +200,7 @@ ### Clairctl - [835af27](https://github.com/quay/clair/commit/835af272fad49342f51adb4633ff639de3cc14a1): fix and codify import arguments - [b9ef107](https://github.com/quay/clair/commit/b9ef1073ca48ed5ed7caaa3e0fbad03a7d83592c): update import and export online help -- [9883e80](https://github.com/quay/clair/commit/9883e80f331190e60de711b0705e9b37017fc5b1): unifiy config, client handling +- [9883e80](https://github.com/quay/clair/commit/9883e80f331190e60de711b0705e9b37017fc5b1): unify config, client handling ### Config - [dc8ba89](https://github.com/quay/clair/commit/dc8ba8912fa482378ef393aa51b4e9528d2877f2): expose notification summary toggle - [bb3cd66](https://github.com/quay/clair/commit/bb3cd669f66345aaa0fc5df6f502f34922cc069e): add 'omitempty' to 'updaters' config struct for correct marshalling From 6d113f6358808f415ab2460713caecd7befb2bfb Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:17 -0400 Subject: [PATCH 43/48] spelling: unintended Signed-off-by: Josh Soref --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da15b3e07a..a3b8884473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -111,7 +111,7 @@ - [1ece08f](https://github.com/quay/clair/commit/1ece08f49434828c8c672f08ec45844b99187983): database metrics for notifier - [84ba35f](https://github.com/quay/clair/commit/84ba35f29ee81849cb2f424b3624895f9bd05a79): implement prometheus http ### Local-Dev -- [1c85589](https://github.com/quay/clair/commit/1c85589abdef98b5af8d4f6e2cd9eb5db6a723a0): remove unintented change in config.yaml +- [1c85589](https://github.com/quay/clair/commit/1c85589abdef98b5af8d4f6e2cd9eb5db6a723a0): remove unintended change in config.yaml ### Logging - [9f3d167](https://github.com/quay/clair/commit/9f3d167d5d85d345c7d0ee666be075a545a553f4): move to zlog throughout ### Matcher From 8ee439396fe08184a990eabd0bf6fb3e58302a40 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:18 -0400 Subject: [PATCH 44/48] spelling: unprivileged Signed-off-by: Josh Soref --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3b8884473..a76be8da1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -480,7 +480,7 @@ ### Config - [b2666e5](https://github.com/quay/clair/commit/b2666e57202d7c690a40d7c86975c13e0b3db56e): set a canonical default port ### Dockerfile -- [33da12a](https://github.com/quay/clair/commit/33da12a3bb9a28fdbcc6302caa4212d38a2acbbb): run as unprivledged user by default +- [33da12a](https://github.com/quay/clair/commit/33da12a3bb9a28fdbcc6302caa4212d38a2acbbb): run as unprivileged user by default ### Documentation - [fe324a5](https://github.com/quay/clair/commit/fe324a58e6be8c36da74afcd5487d0da4a547d5b): start writing v4-specific docs ### Httptransport From 9d012bd4d3941cbe22499cefe4674b42b38bd457 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 23 Sep 2021 00:11:31 -0400 Subject: [PATCH 45/48] spelling: uoid Signed-off-by: Josh Soref --- notifier/postgres/e2e_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifier/postgres/e2e_test.go b/notifier/postgres/e2e_test.go index 817512f847..8aea0c7ef2 100644 --- a/notifier/postgres/e2e_test.go +++ b/notifier/postgres/e2e_test.go @@ -148,7 +148,7 @@ func (e *e2e) Created(t *testing.T) { receipt, err = e.store.ReceiptByUOID(e.ctx, e.updateID) if err != nil { - t.Fatalf("failed to retrieve receipt by OUID") + t.Fatalf("failed to retrieve receipt by UOID") } if !cmp.Equal(receipt.NotificationID, e.notificationID) { t.Fatal(cmp.Diff(receipt.NotificationID, e.notificationID)) From 765d63eb7fa74a396732664b3c0789b3aaa4843b Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:20 -0400 Subject: [PATCH 46/48] spelling: update Signed-off-by: Josh Soref --- config/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config_test.go b/config/config_test.go index 75916a4773..e95df9dba5 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -70,7 +70,7 @@ func Test_Config_Validate_Failure(t *testing.T) { } } -func TestConfigUpateRetention(t *testing.T) { +func TestConfigUpdateRetention(t *testing.T) { var table = []struct { name string conf config.Config From b84dd7011f6ef79c36642dcd90a7842d782f9abe Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 22 Sep 2021 23:41:21 -0400 Subject: [PATCH 47/48] spelling: version Signed-off-by: Josh Soref --- httptransport/discoveryhandler_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httptransport/discoveryhandler_test.go b/httptransport/discoveryhandler_test.go index 32c1e527ab..e9ad49fc52 100644 --- a/httptransport/discoveryhandler_test.go +++ b/httptransport/discoveryhandler_test.go @@ -43,7 +43,7 @@ func TestDiscoveryEndpoint(t *testing.T) { if _, ok := m["openapi"]; !ok { t.Fatalf("returned json did not container openapi key at the root") } - t.Logf("openapi verion: %v", m["openapi"]) + t.Logf("openapi version: %v", m["openapi"]) } func TestDiscoveryFailure(t *testing.T) { From e698321db3cd0bc8c9db0db626443142de6da9fd Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 23 Sep 2021 00:12:42 -0400 Subject: [PATCH 48/48] spelling: vulnerabilities Signed-off-by: Josh Soref --- Documentation/concepts/notifications.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/concepts/notifications.md b/Documentation/concepts/notifications.md index 2d0b347d05..14618437f4 100644 --- a/Documentation/concepts/notifications.md +++ b/Documentation/concepts/notifications.md @@ -2,7 +2,7 @@ ClairV4 implements a notification system. -The notifier service will keep track of new security database updates and inform an interested client if new or removed vulnerabilites affect an indexed manifest. +The notifier service will keep track of new security database updates and inform an interested client if new or removed vulnerabilities affect an indexed manifest. The interested client can subscribe to notifications via several mechanisms: * Webhook delivery