From 6f85c09cb29dc1146fbc382e09ffe08059076897 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Thu, 13 Oct 2022 13:00:16 -0400 Subject: [PATCH 01/48] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c9d99c2a..b31fa8e5 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ report.json .idea server/cpuprofile server/memprofile +*.code-workspace From a7735c35a28c44712e7cce0c24bc6b216acb7ffe Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Wed, 19 Oct 2022 16:47:10 -0400 Subject: [PATCH 02/48] init commit --- basculechecks/metrics.go | 8 +- basculemetrics/metrics.go | 8 +- bookkeeping/bookkeeper_test.go | 2 +- device/device.go | 17 ++-- device/devicegate/filterHandler.go | 25 +++-- device/drain/drainer.go | 37 ++++--- device/drain/start.go | 24 ++--- device/handlers.go | 45 +++++---- device/manager.go | 79 +++++++-------- device/manager_test.go | 25 +++-- device/options.go | 10 +- device/registry.go | 6 +- device/rehasher/rehasher.go | 50 +++++----- device/viper.go | 4 +- go.mod | 4 + go.sum | 13 ++- health/health.go | 19 ++-- logging/enrich.go | 53 ---------- logging/enrich_test.go | 81 ---------------- secure/handler/authorizationHandler.go | 40 ++++---- secure/tools/cmd/keyserver/basicHandler.go | 7 +- secure/tools/cmd/keyserver/keyHandler.go | 5 +- secure/tools/cmd/keyserver/keyStore.go | 14 +-- secure/tools/cmd/keyserver/main.go | 52 +++++----- server/log.go | 5 +- server/log_test.go | 3 +- server/viper.go | 71 +++++++------- server/webpa.go | 41 +++----- service/monitor/logging.go | 4 +- service/servicecfg/environment.go | 15 ++- webhook/aws/sns.go | 20 ++-- webhook/aws/sns_handler.go | 108 +++++++++++---------- webhook/aws/sns_test.go | 6 +- xmetrics/options.go | 14 ++- 34 files changed, 376 insertions(+), 539 deletions(-) delete mode 100644 logging/enrich.go delete mode 100644 logging/enrich_test.go diff --git a/basculechecks/metrics.go b/basculechecks/metrics.go index fb65fc86..54585db5 100644 --- a/basculechecks/metrics.go +++ b/basculechecks/metrics.go @@ -20,17 +20,15 @@ package basculechecks import ( "fmt" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/metrics" gokitprometheus "github.com/go-kit/kit/metrics/prometheus" "github.com/go-kit/kit/metrics/provider" "github.com/prometheus/client_golang/prometheus" - "github.com/xmidt-org/themis/xlog" themisXmetrics "github.com/xmidt-org/themis/xmetrics" "github.com/xmidt-org/webpa-common/v2/xmetrics" "go.uber.org/fx" + "go.uber.org/zap" ) // Names for our metrics @@ -122,7 +120,7 @@ func NewAuthCapabilityCheckMeasures(p provider.Provider) *AuthCapabilityCheckMea // custom labels. type BaseMeasuresIn struct { fx.In - Logger log.Logger + Logger *zap.Logger CapabilityCheckOutcome *prometheus.CounterVec `name:"auth_capability_check"` } @@ -137,7 +135,7 @@ func (m MeasuresFactory) NewMeasures(in BaseMeasuresIn) (*AuthCapabilityCheckMea if err != nil { return nil, err } - in.Logger.Log(level.Key(), level.DebugValue(), xlog.MessageKey(), "building auth capability measures", ServerLabel, m.ServerName) + in.Logger.Debug("building auth capability measures", zap.String(ServerLabel, m.ServerName)) return &AuthCapabilityCheckMeasures{ CapabilityCheckOutcome: gokitprometheus.NewCounter(capabilityCheckOutcomeCounterVec), }, nil diff --git a/basculemetrics/metrics.go b/basculemetrics/metrics.go index 8a179cfc..3e6e2a91 100644 --- a/basculemetrics/metrics.go +++ b/basculemetrics/metrics.go @@ -3,15 +3,13 @@ package basculemetrics import ( "fmt" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/metrics" gokitprometheus "github.com/go-kit/kit/metrics/prometheus" "github.com/prometheus/client_golang/prometheus" - "github.com/xmidt-org/themis/xlog" themisXmetrics "github.com/xmidt-org/themis/xmetrics" "github.com/xmidt-org/webpa-common/v2/xmetrics" "go.uber.org/fx" + "go.uber.org/zap" ) // Names for our metrics @@ -127,7 +125,7 @@ func NewAuthValidationMeasures(r xmetrics.Registry) *AuthValidationMeasures { // custom labels. type BaseMeasuresIn struct { fx.In - Logger log.Logger + Logger *zap.Logger NBFHistogram *prometheus.HistogramVec `name:"auth_from_nbf_seconds"` ExpHistogram *prometheus.HistogramVec `name:"auth_from_exp_seconds"` @@ -141,7 +139,7 @@ type ListenerFactory struct { // New builds the metric listener from the provided metrics. func (m ListenerFactory) New(in BaseMeasuresIn) (*MetricListener, error) { - in.Logger.Log(level.Key(), level.DebugValue(), xlog.MessageKey(), "building auth validation measures", ServerLabel, m.ServerName) + in.Logger.Debug("building auth validation measures", zap.String(ServerLabel, m.ServerName)) nbfHistogramVec, err := in.NBFHistogram.CurryWith(prometheus.Labels{ServerLabel: m.ServerName}) if err != nil { return nil, err diff --git a/bookkeeping/bookkeeper_test.go b/bookkeeping/bookkeeper_test.go index a4080a33..1de0b1f6 100644 --- a/bookkeeping/bookkeeper_test.go +++ b/bookkeeping/bookkeeper_test.go @@ -58,7 +58,7 @@ func TestBookkeeper(t *testing.T) { require.NotNil(bookkeeper) req := httptest.NewRequest("GET", "/", nil) - req = req.WithContext(logging.WithLogger(req.Context(), logger)) + req = req.WithContext(zap.WithLogger(req.Context(), logger)) rr := httptest.NewRecorder() diff --git a/device/device.go b/device/device.go index 4fa7a187..5c27bf4e 100644 --- a/device/device.go +++ b/device/device.go @@ -7,11 +7,10 @@ import ( "sync/atomic" "time" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/convey" "github.com/xmidt-org/webpa-common/v2/convey/conveymetric" - - "github.com/go-kit/kit/log" - "github.com/xmidt-org/webpa-common/v2/logging" + "go.uber.org/zap" ) const ( @@ -103,9 +102,7 @@ type Interface interface { type device struct { id ID - errorLog log.Logger - infoLog log.Logger - debugLog log.Logger + logger *zap.Logger statistics Statistics @@ -130,7 +127,7 @@ type deviceOptions struct { Compliance convey.Compliance QueueSize int ConnectedAt time.Time - Logger log.Logger + Logger *zap.Logger Metadata *Metadata } @@ -141,7 +138,7 @@ func newDevice(o deviceOptions) *device { } if o.Logger == nil { - o.Logger = logging.DefaultLogger() + o.Logger = sallust.Default() } if o.QueueSize < 1 { @@ -150,9 +147,7 @@ func newDevice(o deviceOptions) *device { return &device{ id: o.ID, - errorLog: logging.Error(o.Logger, "id", o.ID), - infoLog: logging.Info(o.Logger, "id", o.ID), - debugLog: logging.Debug(o.Logger, "id", o.ID), + logger: o.Logger.With(zap.String("id", string(o.ID))), statistics: NewStatistics(nil, o.ConnectedAt), c: o.C, compliance: o.Compliance, diff --git a/device/devicegate/filterHandler.go b/device/devicegate/filterHandler.go index f45868c6..46f2ac28 100644 --- a/device/devicegate/filterHandler.go +++ b/device/devicegate/filterHandler.go @@ -8,10 +8,9 @@ import ( "io/ioutil" "net/http" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/xhttp" + "go.uber.org/zap" ) // ContextKey is a custom type for setting keys in a request's context @@ -26,7 +25,7 @@ type FilterHandler struct { // GateLogger is used to log extra details about the gate type GateLogger struct { - Logger log.Logger + Logger *zap.Logger } // GetFilters is a handler function that gets all of the filters set on a gate @@ -38,18 +37,18 @@ func (fh *FilterHandler) GetFilters(response http.ResponseWriter, request *http. // UpdateFilters is a handler function that updates the filters stored in a gate func (fh *FilterHandler) UpdateFilters(response http.ResponseWriter, request *http.Request) { - logger := logging.GetLogger(request.Context()) + logger := sallust.Get(request.Context()) message, err := validateRequestBody(request) if err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "error with request body", logging.ErrorKey(), err) + logger.Error("error with request body", zap.Error(err)) xhttp.WriteError(response, http.StatusBadRequest, err) return } if allow, err := checkRequestDetails(message, fh.Gate, true); !allow { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), err) + logger.Error(err.Error(), zap.Error(err)) xhttp.WriteError(response, http.StatusBadRequest, err) return } @@ -66,18 +65,18 @@ func (fh *FilterHandler) UpdateFilters(response http.ResponseWriter, request *ht // DeleteFilter is a handler function used to delete a particular filter stored in the gate func (fh *FilterHandler) DeleteFilter(response http.ResponseWriter, request *http.Request) { - logger := logging.GetLogger(request.Context()) + logger := sallust.Get(request.Context()) message, err := validateRequestBody(request) if err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "error with request body", logging.ErrorKey(), err) + logger.Error("error with request body", zap.Error(err)) xhttp.WriteError(response, http.StatusBadRequest, err) return } if allow, err := checkRequestDetails(message, fh.Gate, false); !allow { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), err) + logger.Error(err.Error(), zap.Error(err)) xhttp.WriteError(response, http.StatusBadRequest, err) return } @@ -98,12 +97,12 @@ func (gl GateLogger) LogFilters(next http.Handler) http.Handler { if filtersJSON, err := json.Marshal(gate); err == nil { response.Header().Set("Content-Type", "application/json") fmt.Fprintf(response, `%s`, filtersJSON) - gl.Logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "gate filters updated", "filters", string(filtersJSON)) + gl.Logger.Info("gate filters updated", zap.String("filters", string(filtersJSON))) } else { - gl.Logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "error with unmarshalling gate", logging.ErrorKey(), err) + gl.Logger.Error("error with unmarshalling gate", zap.Error(err)) } } else { - gl.Logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "gate not found in request context") + gl.Logger.Info("gate not found in request context") } }) diff --git a/device/drain/drainer.go b/device/drain/drainer.go index ad52d7b3..31e8dac4 100644 --- a/device/drain/drainer.go +++ b/device/drain/drainer.go @@ -6,13 +6,12 @@ import ( "sync/atomic" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/metrics/discard" + "go.uber.org/zap" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/device" "github.com/xmidt-org/webpa-common/v2/device/devicegate" - "github.com/xmidt-org/webpa-common/v2/logging" "github.com/xmidt-org/webpa-common/v2/xmetrics" ) @@ -37,12 +36,12 @@ const ( type Option func(*drainer) -func WithLogger(l log.Logger) Option { +func WithLogger(l *zap.Logger) Option { return func(dr *drainer) { if l != nil { dr.logger = l } else { - dr.logger = logging.DefaultLogger() + dr.logger = sallust.Default() } } } @@ -199,7 +198,7 @@ func defaultNewTicker(d time.Duration) (<-chan time.Time, func()) { // New constructs a drainer using the supplied options func New(options ...Option) Interface { dr := &drainer{ - logger: logging.DefaultLogger(), + logger: sallust.Default(), now: time.Now, newTicker: defaultNewTicker, m: metrics{ @@ -232,7 +231,7 @@ type metrics struct { // jobContext stores all the runtime information for a drain job type jobContext struct { id uint32 - logger log.Logger + logger *zap.Logger t *tracker j Job batchSize int @@ -244,7 +243,7 @@ type jobContext struct { // drainer is the internal implementation of Interface type drainer struct { - logger log.Logger + logger *zap.Logger connector device.Connector registry device.Registry now func() time.Time @@ -278,7 +277,7 @@ func (df *drainFilter) AllowConnection(d device.Interface) (bool, device.MatchRe // to disconnect each of them. This method is sensitive to the jc.cancel channel. If canceled, or if // no more devices are available, this method returns false. func (dr *drainer) nextBatch(jc jobContext, batch chan device.ID) (more bool, visited int, skipped int) { - jc.logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "nextBatch starting") + jc.logger.Debug("nextBatch starting") more = true skipped = 0 @@ -295,7 +294,7 @@ func (dr *drainer) nextBatch(jc jobContext, batch chan device.ID) (more bool, vi case batch <- d.ID(): return true case <-jc.cancel: - jc.logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "job canceled") + jc.logger.Error("job canceled", zap.Error(nil)) more = false return false default: @@ -309,7 +308,7 @@ func (dr *drainer) nextBatch(jc jobContext, batch chan device.ID) (more bool, vi } if visited > 0 { - jc.logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "nextBatch", "visited", visited) + jc.logger.Debug("nextBatch", zap.Int("visited", visited)) drained := 0 for finished := false; more && !finished; { select { @@ -318,20 +317,20 @@ func (dr *drainer) nextBatch(jc jobContext, batch chan device.ID) (more bool, vi drained++ } case <-jc.cancel: - jc.logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "job canceled") + jc.logger.Error("job canceled", zap.Error(nil)) more = false default: finished = true } } - jc.logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "nextBatch", "visited", visited, "drained", drained) + jc.logger.Debug("nextBatch", zap.Int("visited", visited), zap.Int("drained", drained)) jc.t.addVisited(visited) jc.t.addDrained(drained) } else { // if no devices were visited (or enqueued), then we must be done. // either a cancellation occurred or no devices are left - dr.logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "no devices visited") + dr.logger.Debug("no devices visited") more = false } @@ -357,13 +356,13 @@ func (dr *drainer) jobFinished(jc jobContext) { close(jc.done) p := jc.t.Progress() - jc.logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "drain complete", "visited", p.Visited, "drained", p.Drained) + jc.logger.Info("drain complete", zap.Int("visited", p.Visited), zap.Int("drained", p.Drained)) } // drain is run as a goroutine to drain devices at a particular rate func (dr *drainer) drain(jc jobContext) { defer dr.jobFinished(jc) - jc.logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "drain starting", "count", jc.j.Count, "rate", jc.j.Rate, "tick", jc.j.Tick) + jc.logger.Info("drain starting", zap.Int("count", jc.j.Count), zap.Int("rate", jc.j.Rate), zap.Duration("tick", jc.j.Tick)) var ( remaining = jc.j.Count @@ -389,7 +388,7 @@ func (dr *drainer) drain(jc jobContext) { more = false } case <-jc.cancel: - jc.logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "job canceled") + jc.logger.Error("job canceled", zap.Error(nil)) more = false } } @@ -398,7 +397,7 @@ func (dr *drainer) drain(jc jobContext) { // disconnect is run as a goroutine to drain devices without a rate, i.e. as fast as possible func (dr *drainer) disconnect(jc jobContext) { defer dr.jobFinished(jc) - jc.logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "drain starting", "count", jc.j.Count) + jc.logger.Info("drain starting", zap.Int("count", jc.j.Count)) var ( remaining = jc.j.Count @@ -430,7 +429,7 @@ func (dr *drainer) Start(j Job) (<-chan struct{}, Job, error) { dr.currentID++ jc := jobContext{ id: dr.currentID, - logger: log.With(dr.logger, "id", dr.currentID), + logger: dr.logger.With(zap.Uint32("id", dr.currentID)), t: &tracker{ started: dr.now().UTC(), counter: dr.m.counter, diff --git a/device/drain/start.go b/device/drain/start.go index 575620f1..660dc98d 100644 --- a/device/drain/start.go +++ b/device/drain/start.go @@ -6,12 +6,12 @@ import ( "net/http" "time" - "github.com/go-kit/kit/log/level" "github.com/gorilla/schema" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/device/devicegate" - "github.com/xmidt-org/webpa-common/v2/logging" "github.com/xmidt-org/webpa-common/v2/xhttp" "github.com/xmidt-org/webpa-common/v2/xhttp/converter" + "go.uber.org/zap" ) type Start struct { @@ -19,9 +19,9 @@ type Start struct { } func (s *Start) ServeHTTP(response http.ResponseWriter, request *http.Request) { - logger := logging.GetLogger(request.Context()) + logger := sallust.Get(request.Context()) if err := request.ParseForm(); err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "unable to parse form", logging.ErrorKey(), err) + logger.Error("unable to parse form", zap.Error(err)) xhttp.WriteError(response, http.StatusBadRequest, err) return } @@ -34,23 +34,23 @@ func (s *Start) ServeHTTP(response http.ResponseWriter, request *http.Request) { decoder.RegisterConverter(time.Duration(0), converter.Duration) if err := decoder.Decode(&input, request.Form); err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "unable to decode request", logging.ErrorKey(), err) + logger.Error("unable to decode request", zap.Error(err)) xhttp.WriteError(response, http.StatusBadRequest, err) return } - msgBytes, e := ioutil.ReadAll(request.Body) + msgBytes, err := ioutil.ReadAll(request.Body) defer request.Body.Close() - if e != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "unable to read request body", logging.ErrorKey(), e) - xhttp.WriteError(response, http.StatusBadRequest, e) + if err != nil { + logger.Error("unable to read request body", zap.Error(err)) + xhttp.WriteError(response, http.StatusBadRequest, err) return } if len(msgBytes) > 0 { if err := json.Unmarshal(msgBytes, &reqBody); err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "unable to unmarshal request body", logging.ErrorKey(), err) + logger.Error("unable to unmarshal request body", zap.Error(err)) xhttp.WriteError(response, http.StatusBadRequest, err) return } @@ -68,13 +68,13 @@ func (s *Start) ServeHTTP(response http.ResponseWriter, request *http.Request) { _, output, err := s.Drainer.Start(input) if err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "unable to start drain job", logging.ErrorKey(), err) + logger.Error("unable to start drain job", zap.Error(err)) xhttp.WriteError(response, http.StatusConflict, err) return } if message, err := json.Marshal(output.ToMap()); err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "unable to marshal response", logging.ErrorKey(), err) + logger.Error("unable to marshal response", zap.Error(err)) } else { response.Header().Set("Content-Type", "application/json") response.Write(message) diff --git a/device/handlers.go b/device/handlers.go index 18f242c4..295b8b30 100644 --- a/device/handlers.go +++ b/device/handlers.go @@ -7,12 +7,11 @@ import ( "sync" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/gorilla/mux" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/xhttp" "github.com/xmidt-org/wrp-go/v3" + "go.uber.org/zap" ) const ( @@ -97,18 +96,18 @@ func useID(f IDFromRequest) func(http.Handler) http.Handler { // to be sent to devices. type MessageHandler struct { // Logger is the sink for logging output. If not set, logging will be sent to a NOP logger - Logger log.Logger + Logger *zap.Logger // Router is the device message Router to use. This field is required. Router Router } -func (mh *MessageHandler) logger() log.Logger { +func (mh *MessageHandler) logger() *zap.Logger { if mh.Logger != nil { return mh.Logger } - return logging.DefaultLogger() + return sallust.Default() } // decodeRequest transforms an HTTP request into a device request. @@ -129,7 +128,7 @@ func (mh *MessageHandler) decodeRequest(httpRequest *http.Request) (deviceReques func (mh *MessageHandler) ServeHTTP(httpResponse http.ResponseWriter, httpRequest *http.Request) { deviceRequest, err := mh.decodeRequest(httpRequest) if err != nil { - mh.logger().Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "Unable to decode request", logging.ErrorKey(), err) + mh.logger().Error("Unable to decode request", zap.Error(err)) xhttp.WriteErrorf( httpResponse, http.StatusBadRequest, @@ -142,7 +141,7 @@ func (mh *MessageHandler) ServeHTTP(httpResponse http.ResponseWriter, httpReques responseFormat, err := wrp.FormatFromContentType(httpRequest.Header.Get("Accept"), deviceRequest.Format) if err != nil { - mh.logger().Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "Unable to determine response WRP format", logging.ErrorKey(), err) + mh.logger().Error("Unable to determine response WRP format", zap.Error(err)) xhttp.WriteErrorf( httpResponse, http.StatusBadRequest, @@ -169,7 +168,7 @@ func (mh *MessageHandler) ServeHTTP(httpResponse http.ResponseWriter, httpReques code = http.StatusBadRequest } - mh.logger().Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "Could not process device request", logging.ErrorKey(), err, "code", code) + mh.logger().Error("Could not process device request", zap.Error(err), zap.Int("code", code)) httpResponse.Header().Set("X-Xmidt-Message-Error", err.Error()) xhttp.WriteErrorf( httpResponse, @@ -179,7 +178,7 @@ func (mh *MessageHandler) ServeHTTP(httpResponse http.ResponseWriter, httpReques ) } else if deviceResponse != nil { if err := EncodeResponse(httpResponse, deviceResponse, responseFormat); err != nil { - mh.logger().Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "Error while writing transaction response", logging.ErrorKey(), err) + mh.logger().Error("Error while writing transaction response", zap.Error(err)) } } @@ -190,30 +189,30 @@ func (mh *MessageHandler) ServeHTTP(httpResponse http.ResponseWriter, httpReques // ConnectHandler is used to initiate a concurrent connection between a Talaria and a device by upgrading a http connection to a websocket type ConnectHandler struct { - Logger log.Logger + Logger *zap.Logger Connector Connector ResponseHeader http.Header } -func (ch *ConnectHandler) logger() log.Logger { +func (ch *ConnectHandler) logger() *zap.Logger { if ch.Logger != nil { return ch.Logger } - return logging.DefaultLogger() + return sallust.Default() } func (ch *ConnectHandler) ServeHTTP(response http.ResponseWriter, request *http.Request) { if device, err := ch.Connector.Connect(response, request, ch.ResponseHeader); err != nil { - logging.Error(ch.logger()).Log(logging.MessageKey(), "Failed to connect device", logging.ErrorKey(), err) + ch.logger().Error("Failed to connect device", zap.Error(err)) } else { - logging.Debug(ch.logger()).Log(logging.MessageKey(), "Connected device", "id", device.ID()) + ch.logger().Debug("Connected device", zap.String("id", string(device.ID()))) } } // ListHandler is an HTTP handler which can take updated JSON device lists. type ListHandler struct { - Logger log.Logger + Logger *zap.Logger Registry Registry Refresh time.Duration @@ -285,7 +284,7 @@ func (lh *ListHandler) updateCache() []byte { } func (lh *ListHandler) ServeHTTP(response http.ResponseWriter, request *http.Request) { - lh.Logger.Log(level.Key(), level.DebugValue(), "handler", "ListHandler", logging.MessageKey(), "ServeHTTP") + lh.Logger.Debug("ServeHTTP", zap.String("handler", "ListHandler")) response.Header().Set("Content-Type", "application/json") if cacheBytes, expired := lh.tryCache(); expired { @@ -298,30 +297,30 @@ func (lh *ListHandler) ServeHTTP(response http.ResponseWriter, request *http.Req // StatHandler is an http.Handler that returns device statistics. The device name is specified // as a gorilla path variable. type StatHandler struct { - Logger log.Logger + Logger *zap.Logger Registry Registry Variable string } func (sh *StatHandler) ServeHTTP(response http.ResponseWriter, request *http.Request) { - sh.Logger.Log(level.Key(), level.DebugValue(), "handler", "StatHandler", logging.MessageKey(), "ServeHTTP") + sh.Logger.Debug("ServeHTTP", zap.String("handler", "StatHandler")) vars := mux.Vars(request) if len(vars) == 0 { - sh.Logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "no path variables present for request") + sh.Logger.Error("no path variables present for request") response.WriteHeader(http.StatusInternalServerError) return } name, ok := vars[sh.Variable] if !ok { - sh.Logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "missing path variable", "variable", sh.Variable) + sh.Logger.Error("missing path variable", zap.String("variable", sh.Variable)) response.WriteHeader(http.StatusInternalServerError) return } id, err := ParseID(name) if err != nil { - sh.Logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "unable to parse identifier", "deviceName", name, logging.ErrorKey(), err) + sh.Logger.Error("unable to parse identifier", zap.Error(err), zap.String("deviceName", name)) response.WriteHeader(http.StatusBadRequest) return } @@ -334,7 +333,7 @@ func (sh *StatHandler) ServeHTTP(response http.ResponseWriter, request *http.Req data, err := d.MarshalJSON() if err != nil { - sh.Logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "unable to marshal device as JSON", "deviceName", name, logging.ErrorKey(), err) + sh.Logger.Error("unable to marshal device as JSON", zap.Error(err), zap.String("deviceName", name)) response.WriteHeader(http.StatusInternalServerError) return } diff --git a/device/manager.go b/device/manager.go index e0e4ef77..1d5264cd 100644 --- a/device/manager.go +++ b/device/manager.go @@ -2,6 +2,7 @@ package device import ( "encoding/json" + "fmt" "io" "net/http" "strconv" @@ -11,11 +12,10 @@ import ( "github.com/xmidt-org/webpa-common/v2/convey" "github.com/xmidt-org/webpa-common/v2/convey/conveymetric" + "go.uber.org/zap" - "github.com/go-kit/kit/log" "github.com/gorilla/websocket" "github.com/xmidt-org/webpa-common/v2/convey/conveyhttp" - "github.com/xmidt-org/webpa-common/v2/logging" "github.com/xmidt-org/webpa-common/v2/xhttp" "github.com/xmidt-org/wrp-go/v3" ) @@ -116,18 +116,15 @@ type ManagerOption func(*manager) // created from the options if one is not supplied. func NewManager(o *Options) Manager { var ( - logger = o.logger() - debugLogger = logging.Debug(logger) - measures = NewMeasures(o.metricsProvider()) - wrpCheck = o.wrpCheck() + logger = o.logger() + measures = NewMeasures(o.metricsProvider()) + wrpCheck = o.wrpCheck() ) - debugLogger.Log(logging.MessageKey(), "source check configuration", "type", wrpCheck.Type) + logger.Debug("source check configuration", zap.String("type", string(wrpCheck.Type))) return &manager{ logger: logger, - errorLog: logging.Error(logger), - debugLog: debugLogger, readDeadline: NewDeadline(o.idlePeriod(), o.now()), writeDeadline: NewDeadline(o.writeTimeout(), o.now()), upgrader: o.upgrader(), @@ -159,9 +156,7 @@ func NewManager(o *Options) Manager { // manager is the internal Manager implementation. type manager struct { - logger log.Logger - errorLog log.Logger - debugLog log.Logger + logger *zap.Logger readDeadline func() time.Time writeDeadline func() time.Time @@ -182,7 +177,7 @@ type manager struct { } func (m *manager) Connect(response http.ResponseWriter, request *http.Request, responseHeader http.Header) (Interface, error) { - m.debugLog.Log(logging.MessageKey(), "device connect", "url", request.URL) + m.logger.Debug("device connect", zap.Any("url", request.URL)) ctx := request.Context() id, ok := GetID(ctx) if !ok { @@ -211,37 +206,37 @@ func (m *manager) Connect(response http.ResponseWriter, request *http.Request, r }) if allow, matchResults := m.filter.AllowConnection(d); !allow { - d.infoLog.Log("filter", "filter match found,", "location", matchResults.Location, "key", matchResults.Key) + d.logger.Info("filter match found", zap.String("location", matchResults.Location), zap.String("key", matchResults.Key)) return nil, ErrorDeviceFilteredOut } if len(metadata.Claims()) < 1 { - d.errorLog.Log(logging.MessageKey(), "missing security information") + d.logger.Error("missing security information") } if cvyErr == nil { - d.infoLog.Log("convey", cvy) + d.logger.Info(fmt.Sprintf("convey: %v", cvy)) } else { - d.errorLog.Log(logging.MessageKey(), "bad or missing convey data", logging.ErrorKey(), cvyErr) + d.logger.Error("bad or missing convey data", zap.Error(cvyErr)) } c, err := m.upgrader.Upgrade(response, request, responseHeader) if err != nil { - d.errorLog.Log(logging.MessageKey(), "failed websocket upgrade", logging.ErrorKey(), err) + d.logger.Error("failed websocket upgrade", zap.Error(err)) return nil, err } - d.debugLog.Log(logging.MessageKey(), "websocket upgrade complete", "localAddress", c.LocalAddr().String()) + d.logger.Debug("websocket upgrade complete", zap.String("localAddress", c.LocalAddr().String())) pinger, err := NewPinger(c, m.measures.Ping, []byte(d.ID()), m.writeDeadline) if err != nil { - d.errorLog.Log(logging.MessageKey(), "unable to create pinger", logging.ErrorKey(), err) + d.logger.Error("unable to create pinger", zap.Error(err)) c.Close() return nil, err } if err := m.devices.add(d); err != nil { - d.errorLog.Log(logging.MessageKey(), "unable to register device", logging.ErrorKey(), err) + d.logger.Error("unable to register device", zap.Error(err)) c.Close() return nil, err } @@ -257,12 +252,12 @@ func (m *manager) Connect(response http.ResponseWriter, request *http.Request, r event.Format = wrp.JSON event.Contents = bytes } else { - d.errorLog.Log(logging.MessageKey(), "unable to marshal the convey header", logging.ErrorKey(), err) + d.logger.Error("unable to marshal the convey header", zap.Error(err)) } } metricClosure, err := m.conveyHWMetric.Update(cvy, "partnerid", metadata.PartnerIDClaim(), "trust", strconv.Itoa(metadata.TrustClaim())) if err != nil { - d.errorLog.Log(logging.MessageKey(), "failed to update convey metrics", logging.ErrorKey(), err) + d.logger.Error("failed to update convey metrics", zap.Error(err)) } d.conveyClosure = metricClosure @@ -295,9 +290,9 @@ func (m *manager) pumpClose(d *device, c io.Closer, reason CloseReason) { closeError := c.Close() - d.errorLog.Log(logging.MessageKey(), "Closed device connection", - "closeError", closeError, "reasonError", reason.Err, "reason", reason.Text, - "finalStatistics", d.Statistics().String()) + d.logger.Error("Closed device connection", + zap.String("closeError", closeError.Error()), zap.String("reasonError", reason.Err.Error()), zap.String("reason", reason.Text), + zap.String("finalStatistics", d.Statistics().String())) m.dispatch( &Event{ @@ -311,7 +306,7 @@ func (m *manager) pumpClose(d *device, c io.Closer, reason CloseReason) { func (m *manager) wrpSourceIsValid(message *wrp.Message, d *device) bool { expectedID := d.ID() if len(strings.TrimSpace(message.Source)) == 0 { - d.errorLog.Log(logging.MessageKey(), "WRP source was empty", "trustLevel", d.Metadata().TrustClaim()) + d.logger.Error("WRP source was empty", zap.Int("trustLevel", d.Metadata().TrustClaim())) if m.enforceWRPSourceCheck { m.measures.WRPSourceCheck.With("outcome", "rejected", "reason", "empty").Add(1) return false @@ -322,7 +317,7 @@ func (m *manager) wrpSourceIsValid(message *wrp.Message, d *device) bool { actualID, err := ParseID(message.Source) if err != nil { - d.errorLog.Log(logging.MessageKey(), "Failed to parse ID from WRP source", "trustLevel", d.Metadata().TrustClaim()) + d.logger.Error("Failed to parse ID from WRP source", zap.Int("trustLevel", d.Metadata().TrustClaim())) if m.enforceWRPSourceCheck { m.measures.WRPSourceCheck.With("outcome", "rejected", "reason", "parse_error").Add(1) return false @@ -332,7 +327,7 @@ func (m *manager) wrpSourceIsValid(message *wrp.Message, d *device) bool { } if expectedID != actualID { - d.errorLog.Log(logging.MessageKey(), "ID in WRP source does not match device's ID", "spoofedID", actualID, "trustLevel", d.Metadata().TrustClaim()) + d.logger.Error("ID in WRP source does not match device's ID", zap.String("spoofedID", string(actualID)), zap.Int("trustLevel", d.Metadata().TrustClaim())) if m.enforceWRPSourceCheck { m.measures.WRPSourceCheck.With("outcome", "rejected", "reason", "id_mismatch").Add(1) return false @@ -356,8 +351,8 @@ func addDeviceMetadataContext(message *wrp.Message, deviceMetadata *Metadata) { // readPump is the goroutine which handles the stream of WRP messages from a device. // This goroutine exits when any error occurs on the connection. func (m *manager) readPump(d *device, r ReadCloser, closeOnce *sync.Once) { - defer d.debugLog.Log(logging.MessageKey(), "readPump exiting") - d.debugLog.Log(logging.MessageKey(), "readPump starting") + defer d.logger.Debug("readPump exiting") + d.logger.Debug("readPump starting") var ( readError error @@ -374,12 +369,12 @@ func (m *manager) readPump(d *device, r ReadCloser, closeOnce *sync.Once) { for { messageType, data, readError := r.ReadMessage() if readError != nil { - d.errorLog.Log(logging.MessageKey(), "read error", logging.ErrorKey(), readError) + d.logger.Error("read error", zap.Error(readError)) return } if messageType != websocket.BinaryMessage { - d.errorLog.Log(logging.MessageKey(), "skipping non-binary frame", "messageType", messageType) + d.logger.Error("skipping non-binary frame", zap.Int("messageType", messageType)) continue } @@ -397,18 +392,18 @@ func (m *manager) readPump(d *device, r ReadCloser, closeOnce *sync.Once) { decoder.ResetBytes(data) err := decoder.Decode(message) if err != nil { - d.errorLog.Log(logging.MessageKey(), "skipping malformed WRP message", logging.ErrorKey(), err) + d.logger.Error("skipping malformed WRP message", zap.Error(err)) continue } err = wrp.UTF8(message) if err != nil { - d.errorLog.Log(logging.MessageKey(), "skipping malformed WRP message", logging.ErrorKey(), err) + d.logger.Error("skipping malformed WRP message", zap.Error(err)) continue } if !m.wrpSourceIsValid(message, d) { - d.errorLog.Log(logging.MessageKey(), "skipping WRP message with invalid source") + d.logger.Error("skipping WRP message with invalid source") continue } @@ -426,7 +421,7 @@ func (m *manager) readPump(d *device, r ReadCloser, closeOnce *sync.Once) { err = encoder.Encode(message) if err != nil { - d.errorLog.Log(logging.MessageKey(), "unable to encode WRP message", logging.ErrorKey(), err) + d.logger.Error("unable to encode WRP message", zap.Error(err)) continue } @@ -443,7 +438,7 @@ func (m *manager) readPump(d *device, r ReadCloser, closeOnce *sync.Once) { ) if err != nil { - d.errorLog.Log(logging.MessageKey(), "Error while completing transaction", "transactionKey", message.TransactionKey(), logging.ErrorKey(), err) + d.logger.Error("Error while completing transaction", zap.Error(err), zap.String("transactionKey", message.TransactionKey())) event.Type = TransactionBroken event.Error = err } else { @@ -458,8 +453,8 @@ func (m *manager) readPump(d *device, r ReadCloser, closeOnce *sync.Once) { // this goroutine exits when either an explicit shutdown is requested or any // error occurs on the connection. func (m *manager) writePump(d *device, w WriteCloser, pinger func() error, closeOnce *sync.Once) { - defer d.debugLog.Log(logging.MessageKey(), "writePump exiting") - d.debugLog.Log(logging.MessageKey(), "writePump starting") + defer d.logger.Debug("writePump exiting") + d.logger.Debug("writePump starting") var ( envelope *envelope @@ -497,7 +492,7 @@ func (m *manager) writePump(d *device, w WriteCloser, pinger func() error, close for { select { case undeliverable := <-d.messages: - d.errorLog.Log(logging.MessageKey(), "undeliverable message", "deviceMessage", undeliverable) + d.logger.Error("undeliverable message", zap.Any("deviceMessage", undeliverable)) m.dispatch(&Event{ Type: MessageFailed, Device: d, @@ -517,7 +512,7 @@ func (m *manager) writePump(d *device, w WriteCloser, pinger func() error, close select { case <-d.shutdown: - d.debugLog.Log(logging.MessageKey(), "explicit shutdown") + d.logger.Debug("explicit shutdown") writeError = w.Close() return diff --git a/device/manager_test.go b/device/manager_test.go index 3cd35870..c3f5e04a 100644 --- a/device/manager_test.go +++ b/device/manager_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/go-kit/kit/log" "github.com/go-kit/kit/metrics" + "go.uber.org/zap" "github.com/xmidt-org/webpa-common/v2/convey" "github.com/xmidt-org/webpa-common/v2/xmetrics" @@ -20,7 +20,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" "github.com/xmidt-org/wrp-go/v3" ) @@ -84,7 +83,7 @@ func testManagerConnectFilterDeny(t *testing.T) { assert := assert.New(t) mockFilter := new(mockFilter) options := &Options{ - Logger: log.NewNopLogger(), + Logger: zap.NewNop(), Filter: mockFilter, } @@ -103,7 +102,7 @@ func testManagerConnectFilterDeny(t *testing.T) { func testManagerConnectMissingDeviceContext(t *testing.T) { assert := assert.New(t) options := &Options{ - Logger: log.NewNopLogger(), + Logger: zap.NewNop(), } manager := NewManager(options) @@ -120,7 +119,7 @@ func testManagerConnectUpgradeError(t *testing.T) { var ( assert = assert.New(t) options = &Options{ - Logger: log.NewNopLogger(), + Logger: zap.NewNop(), Listeners: []Listener{ func(e *Event) { assert.Fail("The listener should not have been called") @@ -146,7 +145,7 @@ func testManagerConnectVisit(t *testing.T) { connections = make(chan Interface, len(testDeviceIDs)) options = &Options{ - Logger: log.NewNopLogger(), + Logger: zap.NewNop(), Listeners: []Listener{ func(event *Event) { if event.Type == Connect { @@ -195,7 +194,7 @@ func testManagerDisconnect(t *testing.T) { disconnections := make(chan Interface, len(testDeviceIDs)) options := &Options{ - Logger: logging.NewTestLogger(nil, t), + Logger: zap.NewNop(), Listeners: []Listener{ func(event *Event) { switch event.Type { @@ -238,7 +237,7 @@ func testManagerDisconnectIf(t *testing.T) { disconnections := make(chan Interface, len(testDeviceIDs)) options := &Options{ - Logger: logging.NewTestLogger(nil, t), + Logger: zap.NewNop(), Listeners: []Listener{ func(event *Event) { switch event.Type { @@ -325,7 +324,7 @@ func testManagerConnectIncludesConvey(t *testing.T) { contents = make(chan []byte, 1) options = &Options{ - Logger: log.NewNopLogger(), + Logger: zap.NewNop(), Listeners: []Listener{ func(event *Event) { if event.Type == Connect { @@ -429,9 +428,9 @@ func TestWRPSourceIsValid(t *testing.T) { BaseLabelPairs map[string]string }{ { - Name: "EmptySource", - IsValid: false, - Source: " ", + Name: "EmptySource", + IsValid: false, + Source: " ", BaseLabelPairs: map[string]string{"reason": "empty"}, }, @@ -461,7 +460,7 @@ func TestWRPSourceIsValid(t *testing.T) { d := new(device) d.id = canonicalID - d.errorLog = log.WithPrefix(logging.NewTestLogger(nil, t), "id", canonicalID) + d.logger = zap.NewNop().With(zap.String("id", string(canonicalID))) d.metadata = new(Metadata) // strict mode diff --git a/device/options.go b/device/options.go index 1b1957a8..db161929 100644 --- a/device/options.go +++ b/device/options.go @@ -3,10 +3,10 @@ package device import ( "time" - "github.com/go-kit/kit/log" "github.com/go-kit/kit/metrics/provider" "github.com/gorilla/websocket" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" + "go.uber.org/zap" ) // Check types for the WRP Source check @@ -71,7 +71,7 @@ type Options struct { // Logger is the output sink for log messages. If not supplied, log output // is sent to a NOP logger. - Logger log.Logger + Logger *zap.Logger // MetricsProvider is the go-kit factory for metrics MetricsProvider provider.Provider @@ -141,12 +141,12 @@ func (o *Options) writeTimeout() time.Duration { return DefaultWriteTimeout } -func (o *Options) logger() log.Logger { +func (o *Options) logger() *zap.Logger { if o != nil && o.Logger != nil { return o.Logger } - return logging.DefaultLogger() + return sallust.Default() } func (o *Options) listeners() []Listener { diff --git a/device/registry.go b/device/registry.go index 4aed8b02..01ae160e 100644 --- a/device/registry.go +++ b/device/registry.go @@ -4,14 +4,14 @@ import ( "errors" "sync" - "github.com/go-kit/kit/log" "github.com/xmidt-org/webpa-common/v2/xmetrics" + "go.uber.org/zap" ) var errDeviceLimitReached = errors.New("Device limit reached") type registryOptions struct { - Logger log.Logger + Logger *zap.Logger Limit int InitialCapacity int Measures Measures @@ -20,7 +20,7 @@ type registryOptions struct { // registry is the internal lookup map for devices. it is bounded by an optional maximum number // of connected devices. type registry struct { - logger log.Logger + logger *zap.Logger lock sync.RWMutex limit int initialCapacity int diff --git a/device/rehasher/rehasher.go b/device/rehasher/rehasher.go index bbd4c492..0ebf1c95 100644 --- a/device/rehasher/rehasher.go +++ b/device/rehasher/rehasher.go @@ -3,13 +3,12 @@ package rehasher import ( "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/metrics" "github.com/go-kit/kit/metrics/provider" + "go.uber.org/zap" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/device" - "github.com/xmidt-org/webpa-common/v2/logging" "github.com/xmidt-org/webpa-common/v2/service" "github.com/xmidt-org/webpa-common/v2/service/monitor" ) @@ -27,10 +26,10 @@ const ( type Option func(*rehasher) // WithLogger configures a rehasher with a logger, using the default logger if l is nil. -func WithLogger(l log.Logger) Option { +func WithLogger(l *zap.Logger) Option { return func(r *rehasher) { if l == nil { - r.logger = logging.DefaultLogger() + r.logger = sallust.Default() } else { r.logger = l } @@ -94,7 +93,7 @@ func New(connector device.Connector, services []string, options ...Option) monit defaultProvider = provider.NewDiscardProvider() r = &rehasher{ - logger: logging.DefaultLogger(), + logger: sallust.Default(), accessorFactory: service.DefaultAccessorFactory, connector: connector, now: time.Now, @@ -126,7 +125,7 @@ func New(connector device.Connector, services []string, options ...Option) monit // rehasher implements monitor.Listener and (1) disconnects all devices when any service discovery error occurs, // and (2) rehashes devices in response to updated instances. type rehasher struct { - logger log.Logger + logger *zap.Logger services map[string]bool accessorFactory service.AccessorFactory isRegistered func(string) bool @@ -140,8 +139,8 @@ type rehasher struct { duration metrics.Gauge } -func (r *rehasher) rehash(svc string, logger log.Logger, accessor service.Accessor) { - logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "rehash starting") +func (r *rehasher) rehash(svc string, logger *zap.Logger, accessor service.Accessor) { + logger.Info("rehash starting") start := r.now() r.timestamp.With(service.ServiceLabel, svc).Set(float64(start.UTC().Unix())) @@ -153,25 +152,23 @@ func (r *rehasher) rehash(svc string, logger log.Logger, accessor service.Access instance, err := accessor.Get(candidate.Bytes()) switch { case err != nil: - logger.Log(level.Key(), level.ErrorValue(), - logging.MessageKey(), "disconnecting device: error during rehash", - logging.ErrorKey(), err, - "id", candidate, + logger.Error("disconnecting device: error during rehash", + zap.Error(err), + zap.String("id", string(candidate)), ) return device.CloseReason{Err: err, Text: RehashError}, true case !r.isRegistered(instance): - logger.Log(level.Key(), level.InfoValue(), - logging.MessageKey(), "disconnecting device: rehashed to another instance", - "instance", instance, - "id", candidate, + logger.Info("disconnecting device: rehashed to another instance", + zap.String("instance", instance), + zap.String("id", string(candidate)), ) return device.CloseReason{Text: RehashOtherInstance}, true default: - logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "device hashed to this instance", "id", candidate) + logger.Debug("device hashed to this instance", zap.String("id", string(candidate))) keepCount++ return device.CloseReason{}, false } @@ -183,7 +180,7 @@ func (r *rehasher) rehash(svc string, logger log.Logger, accessor service.Access r.keep.With(service.ServiceLabel, svc).Set(float64(keepCount)) r.disconnect.With(service.ServiceLabel, svc).Set(float64(disconnectCount)) r.duration.With(service.ServiceLabel, svc).Set(float64(duration / time.Millisecond)) - logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "rehash complete", "disconnectCount", disconnectCount, "duration", duration) + logger.Info("rehash complete", zap.Int("disconnectCount", disconnectCount), zap.Duration("duration", duration)) } func (r *rehasher) MonitorEvent(e monitor.Event) { @@ -191,33 +188,32 @@ func (r *rehasher) MonitorEvent(e monitor.Event) { return } - logger := logging.Enrich( - log.With( - r.logger, - monitor.EventCountKey(), e.EventCount, + logger := sallust.Enrich( + r.logger.With( + zap.Int(monitor.EventCountKey(), e.EventCount), ), e.Instancer, ) switch { case e.Err != nil: - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "disconnecting all devices: service discovery error", logging.ErrorKey(), e.Err) + logger.Error("disconnecting all devices: service discovery error", zap.Error(e.Err)) r.connector.DisconnectAll(device.CloseReason{Err: e.Err, Text: ServiceDiscoveryError}) r.disconnectAllCounter.With(service.ServiceLabel, e.Service, ReasonLabel, DisconnectAllServiceDiscoveryError).Add(1.0) case e.Stopped: - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "disconnecting all devices: service discovery monitor being stopped") + logger.Error("disconnecting all devices: service discovery monitor being stopped") r.connector.DisconnectAll(device.CloseReason{Text: ServiceDiscoveryStopped}) r.disconnectAllCounter.With(service.ServiceLabel, e.Service, ReasonLabel, DisconnectAllServiceDiscoveryStopped).Add(1.0) case e.EventCount == 1: - logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "ignoring initial instances") + logger.Info("ignoring initial instances") case len(e.Instances) > 0: r.rehash(e.Service, logger, r.accessorFactory(e.Instances)) default: - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "disconnecting all devices: service discovery updated with no instances") + logger.Error("disconnecting all devices: service discovery updated with no instances") r.connector.DisconnectAll(device.CloseReason{Text: ServiceDiscoveryNoInstances}) r.disconnectAllCounter.With(service.ServiceLabel, e.Service, ReasonLabel, DisconnectAllServiceDiscoveryNoInstances).Add(1.0) } diff --git a/device/viper.go b/device/viper.go index d8bba272..d9a478d8 100644 --- a/device/viper.go +++ b/device/viper.go @@ -1,8 +1,8 @@ package device import ( - "github.com/go-kit/kit/log" "github.com/spf13/viper" + "go.uber.org/zap" ) const ( @@ -22,7 +22,7 @@ const ( // NewOptions unmarshals a device.Options from a Viper environment. Listeners // must be configured separately. -func NewOptions(logger log.Logger, v *viper.Viper) (o *Options, err error) { +func NewOptions(logger *zap.Logger, v *viper.Viper) (o *Options, err error) { o = new(Options) if v != nil { err = v.Unmarshal(o) diff --git a/go.mod b/go.mod index 74b60ccf..c0dde2a1 100644 --- a/go.mod +++ b/go.mod @@ -35,11 +35,15 @@ require ( github.com/xmidt-org/argus v0.9.2 github.com/xmidt-org/bascule v0.11.0 github.com/xmidt-org/candlelight v0.0.11 + github.com/xmidt-org/sallust v0.1.6 github.com/xmidt-org/themis v0.4.9 github.com/xmidt-org/wrp-go/v3 v3.1.4 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.3 go.uber.org/fx v1.18.2 + go.uber.org/zap v1.23.0 golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c // indirect golang.org/x/tools v0.1.12 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 ) + +replace github.com/xmidt-org/sallust => github.com/xmidt-org/sallust v0.1.7-0.20221019165444-b7de762f6db4 diff --git a/go.sum b/go.sum index 6c9daa6e..78cb18e6 100644 --- a/go.sum +++ b/go.sum @@ -65,8 +65,9 @@ emperror.dev/errors v0.8.1/go.mod h1:YcRvLPh626Ubn2xqtoprejnA5nFha+TJ+2vew48kWuE github.com/Azure/azure-sdk-for-go v16.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-autorest v10.7.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v10.15.3+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I= +github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -1001,9 +1002,8 @@ github.com/xmidt-org/httpaux v0.1.2/go.mod h1:qZnH2uObGPwHnOz8HcPNlbcd3gKEvdmxbI github.com/xmidt-org/httpaux v0.2.1/go.mod h1:mviIlg5fHGb3lAv3l0sbiwVG/q9rqvXaudEYxVrzXdE= github.com/xmidt-org/httpaux v0.3.2 h1:CC8FPiGVtThSRj3fEr9lk2e1bzhhw+l6Vb3BfzfaMG0= github.com/xmidt-org/httpaux v0.3.2/go.mod h1:qmlPisXf80FTi3y4gX43eYbCVruSQyvu+FPx1jzvQG8= -github.com/xmidt-org/sallust v0.1.5/go.mod h1:azcKBypudADIeZ3Em8zGjVq3yQ7n4ueSvM/degHMIxo= -github.com/xmidt-org/sallust v0.1.6 h1:MZAU0rD0flrGrKs6+Nx3mpjwKV6QsWJlEBegRfKVnQ4= -github.com/xmidt-org/sallust v0.1.6/go.mod h1:c6J68AkKaSp0Nc6fSBTwkS1vgc3lVAC3AdofrD10ldA= +github.com/xmidt-org/sallust v0.1.7-0.20221019165444-b7de762f6db4 h1:VdhWhbClSz7fb5eOBctp12xwcJPaMM7lu+bP+qMTvro= +github.com/xmidt-org/sallust v0.1.7-0.20221019165444-b7de762f6db4/go.mod h1:aF2LY90RejCC3sQaj3VWB9cnWzirxMMaXjbbkisDAD0= github.com/xmidt-org/themis v0.4.4/go.mod h1:0qRYFvKdrQhwjxH/1nAiTgBGT4cegJR76gfEYF5P7so= github.com/xmidt-org/themis v0.4.7/go.mod h1:GlsC/hO9lpZKs6mJNZtbDOf/yDT8tS6NN0k3C+YsWFc= github.com/xmidt-org/themis v0.4.9 h1:SnQnyzGRC5H6Wpf8Z4YsdKYp5vjS5oSRKZQOlcqJaJk= @@ -1426,15 +1426,15 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20221006211917-84dc82d7e875 h1:AzgQNqF+FKwyQ5LbVrVqOcuuFB67N47F9+htZYH0wFM= golang.org/x/sys v0.0.0-20221006211917-84dc82d7e875/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1490,7 +1490,6 @@ golang.org/x/tools v0.0.0-20191210221141-98df12377212/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= diff --git a/health/health.go b/health/health.go index 2f5a5b00..60313a27 100644 --- a/health/health.go +++ b/health/health.go @@ -7,8 +7,7 @@ import ( "sync" "time" - "github.com/go-kit/kit/log" - "github.com/xmidt-org/webpa-common/v2/logging" + "go.uber.org/zap" ) // StatsListener receives Stats on regular intervals. @@ -46,8 +45,7 @@ type Health struct { lock sync.Mutex stats Stats statDumpInterval time.Duration - errorLog log.Logger - debugLog log.Logger + logger *zap.Logger statsListeners []StatsListener memInfoReader *MemInfoReader once sync.Once @@ -64,7 +62,7 @@ func (h *Health) RequestTracker(delegate http.Handler) http.Handler { defer func() { if r := recover(); r != nil { - h.errorLog.Log(logging.MessageKey(), "Delegate handler panicked", logging.ErrorKey(), r) + h.logger.Error("Delegate handler panicked", zap.Any("error", r)) // TODO: Probably need an error stat instead of just "denied" h.SendEvent(Inc(TotalRequestsDenied, 1)) @@ -101,14 +99,13 @@ func (h *Health) SendEvent(healthFunc HealthFunc) { } // New creates a Health object with the given statistics. -func New(interval time.Duration, logger log.Logger, options ...Option) *Health { +func New(interval time.Duration, logger *zap.Logger, options ...Option) *Health { initialStats := NewStats(options) return &Health{ stats: initialStats, statDumpInterval: interval, - errorLog: logging.Error(logger), - debugLog: logging.Debug(logger), + logger: logger, memInfoReader: &MemInfoReader{}, } } @@ -117,14 +114,14 @@ func New(interval time.Duration, logger log.Logger, options ...Option) *Health { // Health object is Run, it cannot be Run again. func (h *Health) Run(waitGroup *sync.WaitGroup, shutdown <-chan struct{}) error { h.once.Do(func() { - h.debugLog.Log(logging.MessageKey(), "Health Monitor Started") + h.logger.Info("Health Monitor Started") waitGroup.Add(1) go func() { defer waitGroup.Done() ticker := time.NewTicker(h.statDumpInterval) defer ticker.Stop() - defer h.debugLog.Log(logging.MessageKey(), "Health Monitor Stopped") + defer h.logger.Info("Health Monitor Stopped") for { select { @@ -160,7 +157,7 @@ func (h *Health) ServeHTTP(response http.ResponseWriter, request *http.Request) response.Header().Set("Content-Type", "application/json") if err != nil { - h.errorLog.Log(logging.MessageKey(), "Could not marshal stats", logging.ErrorKey(), err) + h.logger.Error("Could not marshal stats", zap.Error(err)) response.WriteHeader(http.StatusInternalServerError) fmt.Fprintf(response, `{"message": "%s"}\n`, err.Error()) } else { diff --git a/logging/enrich.go b/logging/enrich.go deleted file mode 100644 index 8acc8334..00000000 --- a/logging/enrich.go +++ /dev/null @@ -1,53 +0,0 @@ -package logging - -import "github.com/go-kit/kit/log" - -// Contextual describes an object which can describe itself with metadata for logging. -// Implementing this interface allows code to carry logging context data across API -// boundaries without compromising encapsulation. -type Contextual interface { - Metadata() map[string]interface{} -} - -// enrich is the helper function that emits contextual information into its logger argument. -func enrich(wither func(log.Logger, ...interface{}) log.Logger, logger log.Logger, objects []interface{}) log.Logger { - var keyvals []interface{} - for _, e := range objects { - switch m := e.(type) { - case Contextual: - for k, v := range m.Metadata() { - keyvals = append(keyvals, k, v) - } - - case map[string]interface{}: - for k, v := range m { - keyvals = append(keyvals, k, v) - } - - case map[string]string: - for k, v := range m { - keyvals = append(keyvals, k, v) - } - } - } - - if len(keyvals) > 0 { - return wither(logger, keyvals...) - } - - return logger -} - -// Enrich uses log.With to add contextual information to a logger. The given set of objects are examined to see if they contain -// any metadata. Objects that do not contain metadata are simply ignored. -// -// An object contains metadata if it implements Contextual, is a map[string]interface{}, or is a map[string]string. In those cases, -// the key/value pairs are present in the returned logger. -func Enrich(logger log.Logger, objects ...interface{}) log.Logger { - return enrich(log.With, logger, objects) -} - -// EnrichPrefix is like Enrich, except that it uses log.WithPrefix. -func EnrichPrefix(logger log.Logger, objects ...interface{}) log.Logger { - return enrich(log.WithPrefix, logger, objects) -} diff --git a/logging/enrich_test.go b/logging/enrich_test.go deleted file mode 100644 index 027eed69..00000000 --- a/logging/enrich_test.go +++ /dev/null @@ -1,81 +0,0 @@ -package logging - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -type testContextual struct { - key, value string -} - -func (tc testContextual) Metadata() map[string]interface{} { - return map[string]interface{}{tc.key: tc.value} -} - -func testEnrichNoObjects(t *testing.T) { - var ( - require = require.New(t) - delegate = new(mockLogger) - ) - - logger := Enrich(delegate) - require.NotNil(logger) - - delegate.On("Log", []interface{}{"message", "foobar"}).Return(error(nil)).Once() - logger.Log("message", "foobar") - delegate.AssertExpectations(t) -} - -func testEnrichWithObjects(t *testing.T) { - var ( - require = require.New(t) - delegate = new(mockLogger) - ) - - logger := Enrich(delegate, map[string]string{"key1": "value1"}, nil, map[string]interface{}{"key2": "value2"}, 27, testContextual{"key3", "value3"}) - require.NotNil(logger) - - delegate.On("Log", []interface{}{"key1", "value1", "key2", "value2", "key3", "value3", "message", "foobar"}).Return(error(nil)).Once() - logger.Log("message", "foobar") - delegate.AssertExpectations(t) -} - -func TestEnrich(t *testing.T) { - t.Run("NoObjects", testEnrichNoObjects) - t.Run("WithObjects", testEnrichWithObjects) -} - -func testEnrichPrefixNoObjects(t *testing.T) { - var ( - require = require.New(t) - delegate = new(mockLogger) - ) - - logger := EnrichPrefix(delegate) - require.NotNil(logger) - - delegate.On("Log", []interface{}{"message", "foobar"}).Return(error(nil)).Once() - logger.Log("message", "foobar") - delegate.AssertExpectations(t) -} - -func testEnrichPrefixWithObjects(t *testing.T) { - var ( - require = require.New(t) - delegate = new(mockLogger) - ) - - logger := EnrichPrefix(delegate, map[string]string{"key1": "value1"}, nil, map[string]interface{}{"key2": "value2"}, 27, testContextual{"key3", "value3"}) - require.NotNil(logger) - - delegate.On("Log", []interface{}{"key1", "value1", "key2", "value2", "key3", "value3", "message", "foobar"}).Return(error(nil)).Once() - logger.Log("message", "foobar") - delegate.AssertExpectations(t) -} - -func TestEnrichPrefix(t *testing.T) { - t.Run("NoObjects", testEnrichPrefixNoObjects) - t.Run("WithObjects", testEnrichPrefixWithObjects) -} diff --git a/secure/handler/authorizationHandler.go b/secure/handler/authorizationHandler.go index e3206d7b..4cf9d2a0 100644 --- a/secure/handler/authorizationHandler.go +++ b/secure/handler/authorizationHandler.go @@ -5,11 +5,10 @@ import ( "net/http" "github.com/SermoDigital/jose/jws" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/secure" "github.com/xmidt-org/webpa-common/v2/xhttp" + "go.uber.org/zap" ) const ( @@ -33,7 +32,7 @@ type AuthorizationHandler struct { HeaderName string ForbiddenStatusCode int Validator secure.Validator - Logger log.Logger + Logger *zap.Logger measures *secure.JWTValidationMeasures } @@ -57,12 +56,12 @@ func (a AuthorizationHandler) forbiddenStatusCode() int { return http.StatusForbidden } -func (a AuthorizationHandler) logger() log.Logger { +func (a AuthorizationHandler) logger() *zap.Logger { if a.Logger != nil { return a.Logger } - return logging.DefaultLogger() + return sallust.Default() } // Decorate provides an Alice-compatible constructor that validates requests @@ -77,13 +76,12 @@ func (a AuthorizationHandler) Decorate(delegate http.Handler) http.Handler { headerName = a.headerName() forbiddenStatusCode = a.forbiddenStatusCode() logger = a.logger() - errorLog = logging.Error(logger) ) return http.HandlerFunc(func(response http.ResponseWriter, request *http.Request) { headerValue := request.Header.Get(headerName) if len(headerValue) == 0 { - errorLog.Log(logging.MessageKey(), "missing header", "name", headerName) + logger.Info("missing header", zap.String("name", headerName)) xhttp.WriteErrorf(response, forbiddenStatusCode, "missing header: %s", headerName) if a.measures != nil { @@ -94,7 +92,7 @@ func (a AuthorizationHandler) Decorate(delegate http.Handler) http.Handler { token, err := secure.ParseAuthorization(headerValue) if err != nil { - errorLog.Log(logging.MessageKey(), "invalid authorization header", "name", headerName, logging.ErrorKey(), err) + logger.Error("invalid authorization header", zap.String("name", headerName), zap.Error(err)) xhttp.WriteErrorf(response, forbiddenStatusCode, "Invalid authorization header [%s]: %s", headerName, err.Error()) if a.measures != nil { @@ -114,7 +112,7 @@ func (a AuthorizationHandler) Decorate(delegate http.Handler) http.Handler { valid, err := a.Validator.Validate(sharedContext, token) if err == nil && valid { if err := populateContextValues(token, contextValues); err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "unable to populate context", logging.ErrorKey(), err) + logger.Error("unable to populate context", zap.Error(err)) } // this is absolutely horrible, but it's the only way we can do it for now. @@ -124,23 +122,23 @@ func (a AuthorizationHandler) Decorate(delegate http.Handler) http.Handler { return } - errorLog.Log( - logging.MessageKey(), "request denied", - "validator-response", valid, - "validator-error", err, - "sat-client-id", contextValues.SatClientID, - "method", request.Method, - "url", request.URL, - "user-agent", request.Header.Get("User-Agent"), - "content-length", request.ContentLength, - "remoteAddress", request.RemoteAddr, + logger.Info( + "request denied", + zap.Bool("validator-response", valid), + zap.NamedError("validator-error", err), + zap.String("sat-client-id", contextValues.SatClientID), + zap.String("method", request.Method), + zap.Any("url", request.URL), + zap.String("user-agent", request.Header.Get("User-Agent")), + zap.Int64("content-length", request.ContentLength), + zap.String("remoteAddress", request.RemoteAddr), ) xhttp.WriteError(response, forbiddenStatusCode, "request denied") }) } -//DefineMeasures facilitates clients to define authHandler metrics tools +// DefineMeasures facilitates clients to define authHandler metrics tools func (a *AuthorizationHandler) DefineMeasures(m *secure.JWTValidationMeasures) { a.measures = m } diff --git a/secure/tools/cmd/keyserver/basicHandler.go b/secure/tools/cmd/keyserver/basicHandler.go index e8c25f60..3d334f0f 100644 --- a/secure/tools/cmd/keyserver/basicHandler.go +++ b/secure/tools/cmd/keyserver/basicHandler.go @@ -7,12 +7,11 @@ import ( // BasicHandler provides the common behaviors needed by all keyserver handlers type BasicHandler struct { - keyStore *KeyStore - infoLogger *log.Logger - errorLogger *log.Logger + keyStore *KeyStore + logger *log.Logger } func (handler *BasicHandler) httpError(response http.ResponseWriter, statusCode int, message string) { - handler.errorLogger.Println(message) + handler.logger.Println(message) response.WriteHeader(statusCode) } diff --git a/secure/tools/cmd/keyserver/keyHandler.go b/secure/tools/cmd/keyserver/keyHandler.go index 349d8d45..1e9c9cbe 100644 --- a/secure/tools/cmd/keyserver/keyHandler.go +++ b/secure/tools/cmd/keyserver/keyHandler.go @@ -2,9 +2,10 @@ package main import ( "fmt" - "github.com/gorilla/mux" "net/http" "strings" + + "github.com/gorilla/mux" ) // KeyHandler handles key-related requests @@ -27,7 +28,7 @@ func (handler *KeyHandler) GetKey(response http.ResponseWriter, request *http.Re response.Write(key) } else { message := fmt.Sprintf("No such key: %s", keyID) - handler.errorLogger.Println(message) + handler.logger.Println(message) response.Header().Set("Content-Type", "application/json;charset=UTF-8") response.WriteHeader(http.StatusNotFound) diff --git a/secure/tools/cmd/keyserver/keyStore.go b/secure/tools/cmd/keyserver/keyStore.go index a211aade..deb6ab82 100644 --- a/secure/tools/cmd/keyserver/keyStore.go +++ b/secure/tools/cmd/keyserver/keyStore.go @@ -39,17 +39,17 @@ func (ks *KeyStore) PublicKey(keyID string) (data []byte, ok bool) { } // NewKeyStore exchanges a Configuration for a KeyStore. -func NewKeyStore(infoLogger *log.Logger, c *Configuration) (*KeyStore, error) { +func NewKeyStore(logger *log.Logger, c *Configuration) (*KeyStore, error) { if err := c.Validate(); err != nil { return nil, err } privateKeys := make(map[string]*rsa.PrivateKey, len(c.Keys)+len(c.Generate)) - if err := resolveKeys(infoLogger, c, privateKeys); err != nil { + if err := resolveKeys(logger, c, privateKeys); err != nil { return nil, err } - if err := generateKeys(infoLogger, c, privateKeys); err != nil { + if err := generateKeys(logger, c, privateKeys); err != nil { return nil, err } @@ -70,9 +70,9 @@ func NewKeyStore(infoLogger *log.Logger, c *Configuration) (*KeyStore, error) { }, nil } -func resolveKeys(infoLogger *log.Logger, c *Configuration, privateKeys map[string]*rsa.PrivateKey) error { +func resolveKeys(logger *log.Logger, c *Configuration, privateKeys map[string]*rsa.PrivateKey) error { for keyID, resourceFactory := range c.Keys { - infoLogger.Printf("Key [%s]: loading from resource %#v\n", keyID, resourceFactory) + logger.Printf("Key [%s]: loading from resource %#v\n", keyID, resourceFactory) keyResolver, err := (&key.ResolverFactory{ Factory: *resourceFactory, @@ -98,14 +98,14 @@ func resolveKeys(infoLogger *log.Logger, c *Configuration, privateKeys map[strin return nil } -func generateKeys(infoLogger *log.Logger, c *Configuration, privateKeys map[string]*rsa.PrivateKey) error { +func generateKeys(logger *log.Logger, c *Configuration, privateKeys map[string]*rsa.PrivateKey) error { bits := c.Bits if bits < 1 { bits = DefaultBits } for _, keyID := range c.Generate { - infoLogger.Printf("Key [%s]: generating ...", keyID) + logger.Printf("Key [%s]: generating ...", keyID) if generatedKey, err := rsa.GenerateKey(rand.Reader, bits); err == nil { privateKeys[keyID] = generatedKey diff --git a/secure/tools/cmd/keyserver/main.go b/secure/tools/cmd/keyserver/main.go index e66d8455..2dc22887 100644 --- a/secure/tools/cmd/keyserver/main.go +++ b/secure/tools/cmd/keyserver/main.go @@ -3,42 +3,40 @@ package main import ( "flag" "fmt" - "github.com/gorilla/mux" - "github.com/gorilla/schema" "log" "net/http" "os" + + "github.com/gorilla/mux" + "github.com/gorilla/schema" ) type RouteBuilder struct { - Issuer string - InfoLogger *log.Logger - ErrorLogger *log.Logger - KeyStore *KeyStore + Issuer string + Logger *log.Logger + KeyStore *KeyStore } func (rb RouteBuilder) Build(router *mux.Router) { keyHandler := KeyHandler{ BasicHandler{ - keyStore: rb.KeyStore, - infoLogger: rb.InfoLogger, - errorLogger: rb.ErrorLogger, + keyStore: rb.KeyStore, + logger: rb.Logger, }, } keysRouter := router.Methods("GET").Subrouter() keysRouter.HandleFunc("/keys", keyHandler.ListKeys) - rb.InfoLogger.Println("GET /keys returns a list of the identifiers of available keys") + rb.Logger.Println("GET /keys returns a list of the identifiers of available keys") keysRouter.HandleFunc(fmt.Sprintf("/keys/{%s}", KeyIDVariableName), keyHandler.GetKey) - rb.InfoLogger.Println("GET /keys/{kid} returns the public key associated with the given key identifier. There is no way to look up the associated private key.") + rb.Logger.Println("GET /keys/{kid} returns the public key associated with the given key identifier. There is no way to look up the associated private key.") issueHandler := IssueHandler{ BasicHandler: BasicHandler{ - keyStore: rb.KeyStore, - infoLogger: rb.InfoLogger, - errorLogger: rb.ErrorLogger, + keyStore: rb.KeyStore, + logger: rb.Logger, }, decoder: schema.NewDecoder(), issuer: rb.Issuer, @@ -51,17 +49,16 @@ func (rb RouteBuilder) Build(router *mux.Router) { issueRouter.Methods("GET"). HandlerFunc(issueHandler.SimpleIssue) - rb.InfoLogger.Println("GET /jws?kid={kid} generates a JWT signed with the associated private key. Additional URL parameters are interpreted as reserved claims, e.g. exp") + rb.Logger.Println("GET /jws?kid={kid} generates a JWT signed with the associated private key. Additional URL parameters are interpreted as reserved claims, e.g. exp") issueRouter.Methods("PUT", "POST"). Headers("Content-Type", "application/json"). HandlerFunc(issueHandler.IssueUsingBody) - rb.InfoLogger.Println("PUT/POST /jws generates a JWT signed with the associated private key. Additional URL parmaeters are interpreted as reserved claims, e.g. exp") + rb.Logger.Println("PUT/POST /jws generates a JWT signed with the associated private key. Additional URL parmaeters are interpreted as reserved claims, e.g. exp") } func main() { - infoLogger := log.New(os.Stdout, "[INFO] ", log.LstdFlags|log.LUTC) - errorLogger := log.New(os.Stderr, "[ERROR] ", log.LstdFlags|log.LUTC) + logger := log.New(os.Stdout, "[INFO] ", log.LstdFlags|log.LUTC) var configurationFileName string flag.StringVar(&configurationFileName, "f", "", "the required configuration file") @@ -69,15 +66,15 @@ func main() { configuration, err := ParseConfiguration(configurationFileName) if err != nil { - errorLogger.Fatalf("Unable to parse configuration file: %s\n", err) + logger.Fatalf("Unable to parse configuration file: %s\n", err) } - keyStore, err := NewKeyStore(infoLogger, configuration) + keyStore, err := NewKeyStore(logger, configuration) if err != nil { - errorLogger.Fatalf("Unable to initialize key store: %s\n", err) + logger.Fatalf("Unable to initialize key store: %s\n", err) } - infoLogger.Printf("Initialized key store with %d keys: %s\n", keyStore.Len(), keyStore.KeyIDs()) + logger.Printf("Initialized key store with %d keys: %s\n", keyStore.Len(), keyStore.KeyIDs()) issuer := configuration.Issuer if len(issuer) == 0 { @@ -86,10 +83,9 @@ func main() { router := mux.NewRouter() RouteBuilder{ - Issuer: issuer, - ErrorLogger: errorLogger, - InfoLogger: infoLogger, - KeyStore: keyStore, + Issuer: issuer, + Logger: logger, + KeyStore: keyStore, }.Build(router) bindAddress := configuration.BindAddress @@ -100,9 +96,9 @@ func main() { server := &http.Server{ Addr: bindAddress, Handler: router, - ErrorLog: errorLogger, + ErrorLog: logger, } - infoLogger.Printf("Listening on %s\n", bindAddress) + logger.Printf("Listening on %s\n", bindAddress) log.Fatalln(server.ListenAndServe()) } diff --git a/server/log.go b/server/log.go index 43ad47d4..7c53c93c 100644 --- a/server/log.go +++ b/server/log.go @@ -7,12 +7,13 @@ import ( "github.com/go-kit/kit/log" "github.com/xmidt-org/webpa-common/v2/logging" + "go.uber.org/zap" ) // NewErrorLog creates a new logging.Logger appropriate for http.Server.ErrorLog -func NewErrorLog(serverName string, logger log.Logger) *stdlibLog.Logger { +func NewErrorLog(serverName string, logger *zap.Logger) *stdlibLog.Logger { return stdlibLog.New( - log.NewStdlibAdapter(logger), + zap.NewStdLog(logger).Writer(), serverName, stdlibLog.LstdFlags|stdlibLog.LUTC, ) diff --git a/server/log_test.go b/server/log_test.go index 593c03f6..c541e1dd 100644 --- a/server/log_test.go +++ b/server/log_test.go @@ -9,6 +9,7 @@ import ( "github.com/go-kit/kit/log" "github.com/stretchr/testify/assert" + "go.uber.org/zap/internal/bufferpool" ) const ( @@ -16,7 +17,7 @@ const ( ) func newTestLogger() (verify *bytes.Buffer, logger log.Logger) { - verify = new(bytes.Buffer) + verify = (*bytes.Buffer)(bufferpool.Get()) logger = log.NewLogfmtLogger(log.NewSyncWriter(verify)) return } diff --git a/server/viper.go b/server/viper.go index b72bd0c3..329e3a39 100644 --- a/server/viper.go +++ b/server/viper.go @@ -8,12 +8,11 @@ import ( "strings" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/spf13/pflag" "github.com/spf13/viper" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/xmetrics" + "go.uber.org/zap" ) const ( @@ -89,7 +88,7 @@ func ConfigureFlagSet(applicationName string, f *pflag.FlagSet) { // create CPUProfileFiles creates a cpu profile of the server, its triggered by the optional flag cpuprofile // // the CPU profile is created on the server's start -func CreateCPUProfileFile(v *viper.Viper, fp *pflag.FlagSet, l log.Logger) { +func CreateCPUProfileFile(v *viper.Viper, fp *pflag.FlagSet, l *zap.Logger) { if fp == nil { return } @@ -101,12 +100,12 @@ func CreateCPUProfileFile(v *viper.Viper, fp *pflag.FlagSet, l log.Logger) { f, err := os.Create(flag.Value.String()) if err != nil { - l.Log("could not create CPU profile: ", err) + l.Info(fmt.Sprintf("could not create CPU profile: %v", err)) } defer f.Close() if err := pprof.StartCPUProfile(f); err != nil { - l.Log("could not start CPU profile: ", err) + l.Info(fmt.Sprintf("could not start CPU profile: %v", err)) } defer pprof.StopCPUProfile() @@ -116,7 +115,7 @@ func CreateCPUProfileFile(v *viper.Viper, fp *pflag.FlagSet, l log.Logger) { // // the memory profile is created on the server's exit. // this function should be used within the application. -func CreateMemoryProfileFile(v *viper.Viper, fp *pflag.FlagSet, l log.Logger) { +func CreateMemoryProfileFile(_ *viper.Viper, fp *pflag.FlagSet, l *zap.Logger) { if fp == nil { return } @@ -128,13 +127,13 @@ func CreateMemoryProfileFile(v *viper.Viper, fp *pflag.FlagSet, l log.Logger) { f, err := os.Create(flag.Value.String()) if err != nil { - l.Log("could not create memory profile: ", err) + l.Info(fmt.Sprintf("could not create memory profile: %v", err)) } defer f.Close() runtime.GC() if err := pprof.WriteHeapProfile(f); err != nil { - l.Log("could not write memory profile: ", err) + l.Info(fmt.Sprintf("could not write memory profile: %v", err)) } } @@ -191,20 +190,20 @@ func ConfigureViper(applicationName string, f *pflag.FlagSet, v *viper.Viper) (e Configure is a one-stop shopping function for preparing WebPA configuration. This function does not itself read in configuration from the Viper environment. Typical usage is: - var ( - f = pflag.NewFlagSet() - v = viper.New() - ) + var ( + f = pflag.NewFlagSet() + v = viper.New() + ) - if err := server.Configure("petasos", os.Args, f, v); err != nil { - // deal with the error, possibly just exiting - } + if err := server.Configure("petasos", os.Args, f, v); err != nil { + // deal with the error, possibly just exiting + } - // further customizations to the Viper instance can be done here + // further customizations to the Viper instance can be done here - if err := v.ReadInConfig(); err != nil { - // more error handling - } + if err := v.ReadInConfig(); err != nil { + // more error handling + } Usage of this function is only necessary if custom configuration is needed. Normally, using New will suffice. @@ -227,17 +226,17 @@ Initialize handles the bootstrapping of the server code for a WebPA node. It co reads configuration, and unmarshals the appropriate objects. This function is typically all that's needed to fully instantiate a WebPA server. Typical usage: - var ( - f = pflag.NewFlagSet() - v = viper.New() + var ( + f = pflag.NewFlagSet() + v = viper.New() - // can customize both the FlagSet and the Viper before invoking New - logger, registry, webPA, err = server.Initialize("petasos", os.Args, f, v) - ) + // can customize both the FlagSet and the Viper before invoking New + logger, registry, webPA, err = server.Initialize("petasos", os.Args, f, v) + ) - if err != nil { - // deal with the error, possibly just exiting - } + if err != nil { + // deal with the error, possibly just exiting + } Note that the FlagSet is optional but highly encouraged. If not supplied, then no command-line binding is done for the unmarshalled configuration. @@ -246,7 +245,7 @@ This function always returns a logger, regardless of any errors. This allows cl logger when reporting errors. This function falls back to a logger that writes to os.Stdout if it cannot create a logger from the Viper environment. */ -func Initialize(applicationName string, arguments []string, f *pflag.FlagSet, v *viper.Viper, modules ...xmetrics.Module) (logger log.Logger, registry xmetrics.Registry, webPA *WebPA, err error) { +func Initialize(applicationName string, arguments []string, f *pflag.FlagSet, v *viper.Viper, modules ...xmetrics.Module) (logger *zap.Logger, registry xmetrics.Registry, webPA *WebPA, err error) { defer func() { if err != nil { // never return a WebPA in the presence of an error, to @@ -254,7 +253,7 @@ func Initialize(applicationName string, arguments []string, f *pflag.FlagSet, v webPA = nil // Make sure there's at least a default logger for the caller to use - logger = logging.DefaultLogger() + logger = zap.Must(zap.NewProductionConfig().Build()) } }() @@ -275,8 +274,14 @@ func Initialize(applicationName string, arguments []string, f *pflag.FlagSet, v return } - logger = logging.New(webPA.Log) - logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "initialized Viper environment", "configurationFile", v.ConfigFileUsed()) + var ( + zConfig sallust.Config + ) + // Get touchstone & zap configurations + v.UnmarshalKey("zap", &zConfig) + logger = zap.Must(zConfig.Build()) + + logger.Info("initialized Viper environment", zap.String("configurationFile", v.ConfigFileUsed())) if len(webPA.Metric.MetricsOptions.Namespace) == 0 { webPA.Metric.MetricsOptions.Namespace = applicationName diff --git a/server/webpa.go b/server/webpa.go index b6c7cb74..62befc7a 100644 --- a/server/webpa.go +++ b/server/webpa.go @@ -25,6 +25,7 @@ import ( "github.com/xmidt-org/webpa-common/v2/xhttp" "github.com/xmidt-org/webpa-common/v2/xlistener" "github.com/xmidt-org/webpa-common/v2/xmetrics" + "go.uber.org/zap" ) const ( @@ -64,9 +65,9 @@ type executor interface { Shutdown(ctx context.Context) error } -func RestartableFunc(logger log.Logger, f func() error, errs ...error) error { +func RestartableFunc(logger *zap.Logger, f func() error, errs ...error) error { var err error - logging.Debug(logger).Log(logging.MessageKey(), "starting restartable func", "errors", errs) + logger.Info("starting restartable func", zap.Errors("errors", errs)) breakErrors := make(map[error]bool) for _, elem := range errs { breakErrors[elem] = true @@ -76,44 +77,34 @@ func RestartableFunc(logger log.Logger, f func() error, errs ...error) error { if breakErrors[err] { break } - logging.Debug(logger).Log(logging.MessageKey(), "restartable func making a loop", logging.ErrorKey(), err) + logger.Debug("restartable func making a loop", zap.Error(err)) } - logging.Debug(logger).Log(logging.MessageKey(), "restartable func exiting", logging.ErrorKey(), err) + logger.Info("restartable func exiting", zap.Error(err)) return err } // Serve is like ListenAndServe, but accepts a custom net.Listener -func Serve(logger log.Logger, l net.Listener, e executor, finalizer func()) { +func Serve(logger *zap.Logger, l net.Listener, e executor, finalizer func()) { go func() { defer finalizer() - logger.Log( - level.Key(), level.ErrorValue(), - logging.MessageKey(), "starting server", - ) + logger.Error("starting server") // the assumption is tlsConfig has already been set // Note: the tlsConfig should have the certs and goodness - logger.Log( - level.Key(), level.ErrorValue(), - logging.MessageKey(), "server exited", - logging.ErrorKey(), RestartableFunc(logger, func() error { return e.Serve(l) }, http.ErrServerClosed), + logger.Error("server exited", + zap.Error(RestartableFunc(logger, func() error { return e.Serve(l) }, http.ErrServerClosed)), ) }() } // ListenAndServe invokes the server method -func ListenAndServe(logger log.Logger, e executor, finalizer func()) { +func ListenAndServe(logger *zap.Logger, e executor, finalizer func()) { go func() { defer finalizer() - logger.Log( - level.Key(), level.ErrorValue(), - logging.MessageKey(), "starting server", - ) + logger.Error("starting server") // the assumption is tlsConfig has already been set // Note: the tlsConfig should have the certs and goodness - logger.Log( - level.Key(), level.ErrorValue(), - logging.MessageKey(), "server exited", - logging.ErrorKey(), RestartableFunc(logger, e.ListenAndServe, http.ErrServerClosed), + logger.Error("server exited", + zap.Error(RestartableFunc(logger, e.ListenAndServe, http.ErrServerClosed)), ) }() } @@ -392,7 +383,7 @@ type Health struct { // NewHealth creates a Health instance from this instance's configuration. If the Address // field is not supplied, this method returns nil. -func (h *Health) NewHealth(logger log.Logger, options ...health.Option) *health.Health { +func (h *Health) NewHealth(logger *zap.Logger, options ...health.Option) *health.Health { if len(h.Address) == 0 { return nil } @@ -414,7 +405,7 @@ func (h *Health) NewHealth(logger log.Logger, options ...health.Option) *health. // // If the Address option is not supplied, the health module is considered to be disabled. In that // case, this method simply returns the health parameter as the monitor and a nil server instance. -func (h *Health) New(logger log.Logger, chain alice.Chain, health *health.Health) (*health.Health, *http.Server) { +func (h *Health) New(logger *zap.Logger, chain alice.Chain, health *health.Health) (*health.Health, *http.Server) { if len(h.Address) == 0 { // health is disabled return nil, nil @@ -668,7 +659,7 @@ func (w *WebPA) Prepare(logger log.Logger, health *health.Health, registry xmetr }), done } -//decorateWithBasicMetrics wraps a WebPA server handler with basic instrumentation metrics +// decorateWithBasicMetrics wraps a WebPA server handler with basic instrumentation metrics func (w *WebPA) decorateWithBasicMetrics(p xmetrics.PrometheusProvider, next http.Handler) http.Handler { var ( requestCounter = p.NewCounterVec(APIRequestsTotal) diff --git a/service/monitor/logging.go b/service/monitor/logging.go index eb6f04b6..1038060e 100644 --- a/service/monitor/logging.go +++ b/service/monitor/logging.go @@ -1,10 +1,10 @@ package monitor var ( - eventCountKey interface{} = "eventCount" + eventCountKey string = "eventCount" ) // EventCountKey returns the contextual logging key for the event count -func EventCountKey() interface{} { +func EventCountKey() string { return eventCountKey } diff --git a/service/servicecfg/environment.go b/service/servicecfg/environment.go index 786147bb..65ae41b7 100644 --- a/service/servicecfg/environment.go +++ b/service/servicecfg/environment.go @@ -3,14 +3,13 @@ package servicecfg import ( "errors" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/sd" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service" "github.com/xmidt-org/webpa-common/v2/service/consul" "github.com/xmidt-org/webpa-common/v2/service/zk" "github.com/xmidt-org/webpa-common/v2/xviper" + "go.uber.org/zap" ) var ( @@ -20,9 +19,9 @@ var ( errNoServiceDiscovery = errors.New("No service discovery configured") ) -func NewEnvironment(l log.Logger, u xviper.Unmarshaler, options ...service.Option) (service.Environment, error) { +func NewEnvironment(l *zap.Logger, u xviper.Unmarshaler, options ...service.Option) (service.Environment, error) { if l == nil { - l = logging.DefaultLogger() + l = sallust.Default() } o := new(Options) @@ -40,7 +39,7 @@ func NewEnvironment(l log.Logger, u xviper.Unmarshaler, options ...service.Optio eo = append(eo, options...) if len(o.Fixed) > 0 { - l.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "using a fixed set of instances for service discovery", "instances", o.Fixed) + l.Info("using a fixed set of instances for service discovery", zap.Strings("instances", o.Fixed)) return service.NewEnvironment( append(eo, service.WithInstancers( @@ -56,12 +55,12 @@ func NewEnvironment(l log.Logger, u xviper.Unmarshaler, options ...service.Optio } if o.Zookeeper != nil { - l.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "using zookeeper for service discovery") + l.Info("using zookeeper for service discovery") return zookeeperEnvironmentFactory(l, *o.Zookeeper, eo...) } if o.Consul != nil { - l.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "using consul for service discovery") + l.Info("using consul for service discovery") return consulEnvironmentFactory(l, o.DefaultScheme, *o.Consul, eo...) } diff --git a/webhook/aws/sns.go b/webhook/aws/sns.go index 04416df8..d8f371c5 100644 --- a/webhook/aws/sns.go +++ b/webhook/aws/sns.go @@ -51,8 +51,7 @@ type SNSServer struct { channelSize int64 channelClientTimeout time.Duration - errorLog log.Logger - debugLog log.Logger + logger log.Logger metrics AWSMetrics snsNotificationReceivedChan chan int waitForDns time.Duration @@ -168,13 +167,12 @@ func (ss *SNSServer) Initialize(rtr *mux.Router, selfUrl *url.URL, soaProvider s logger = logging.DefaultLogger() } - ss.errorLog = log.WithPrefix(logger, level.Key(), level.ErrorValue()) - ss.debugLog = log.WithPrefix(logger, level.Key(), level.DebugValue()) + ss.logger = log.WithPrefix(logger, level.Key(), level.ErrorValue()) ss.metrics = metrics ss.snsNotificationReceivedChan = ss.SNSNotificationReceivedInit() - ss.debugLog.Log("selfURL", ss.SelfUrl.String(), "protocol", ss.SelfUrl.Scheme) + ss.logger.Log("selfURL", ss.SelfUrl.String(), "protocol", ss.SelfUrl.Scheme) // Set various SNS POST routes ss.SetSNSRoutes(urlPath, rtr, handler) @@ -190,9 +188,9 @@ func (ss *SNSServer) PrepareAndStart() { ss.Subscribe() } -//DnsReady blocks until the primary server's DNS is up and running or -//until the timeout is reached -//if timeout value is 0s it will try forever +// DnsReady blocks until the primary server's DNS is up and running or +// until the timeout is reached +// if timeout value is 0s it will try forever func (ss *SNSServer) DnsReady() (e error) { // if an SOA provider isn't given, we're done @@ -245,7 +243,7 @@ func (ss *SNSServer) DnsReady() (e error) { } // otherwise, we keep trying ss.metrics.DnsReadyQueryCount.Add(1.0) - ss.debugLog.Log(logging.MessageKey(), "checking if server's DNS is ready", + ss.logger.Log(logging.MessageKey(), "checking if server's DNS is ready", "endpoint", strings.SplitN(ss.SelfUrl.Host, ":", 2)[0]+".", logging.ErrorKey(), err, "response", response) time.Sleep(time.Second) } @@ -267,12 +265,12 @@ func (ss *SNSServer) DnsReady() (e error) { func (ss *SNSServer) ValidateSubscriptionArn(reqSubscriptionArn string) bool { if ss.subscriptionArn.Load() == nil { - ss.errorLog.Log(logging.MessageKey(), "SNS subscriptionArn is nil") + ss.logger.Log(logging.MessageKey(), "SNS subscriptionArn is nil") return false } else if strings.EqualFold(reqSubscriptionArn, ss.subscriptionArn.Load().(string)) { return true } else { - ss.errorLog.Log( + ss.logger.Log( logging.MessageKey(), "SNS Invalid subscription", "reqSubscriptionArn", reqSubscriptionArn, "cfg", ss.subscriptionArn.Load().(string), diff --git a/webhook/aws/sns_handler.go b/webhook/aws/sns_handler.go index f0ad461b..a2ac792d 100644 --- a/webhook/aws/sns_handler.go +++ b/webhook/aws/sns_handler.go @@ -21,7 +21,9 @@ const ( SNS_VALIDATION_ERR = "SNS signature validation error" ) -/* http://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.html +/* + http://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.html + POST / HTTP/1.1 x-amz-sns-message-type: SubscriptionConfirmation x-amz-sns-message-id: 165545c9-2a5c-472c-8df2-7ff2be2b3b1b @@ -32,18 +34,18 @@ Host: example.com Connection: Keep-Alive User-Agent: Amazon Simple Notification Service Agent -{ - "Type" : "SubscriptionConfirmation", - "MessageId" : "165545c9-2a5c-472c-8df2-7ff2be2b3b1b", - "Token" : "2336412f37fb687f5d51e6e241d09c805a5a57b30d712f794cc5f6a988666d92768dd60a747ba6f3beb71854e285d6ad02428b09ceece29417f1f02d609c582afbacc99c583a916b9981dd2728f4ae6fdb82efd087cc3b7849e05798d2d2785c03b0879594eeac82c01f235d0e717736", - "TopicArn" : "arn:aws:sns:us-west-2:123456789012:MyTopic", - "Message" : "You have chosen to subscribe to the topic arn:aws:sns:us-west-2:123456789012:MyTopic.\nTo confirm the subscription, visit the SubscribeURL included in this message.", - "SubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=ConfirmSubscription&TopicArn=arn:aws:sns:us-west-2:123456789012:MyTopic&Token=2336412f37fb687f5d51e6e241d09c805a5a57b30d712f794cc5f6a988666d92768dd60a747ba6f3beb71854e285d6ad02428b09ceece29417f1f02d609c582afbacc99c583a916b9981dd2728f4ae6fdb82efd087cc3b7849e05798d2d2785c03b0879594eeac82c01f235d0e717736", - "Timestamp" : "2012-04-26T20:45:04.751Z", - "SignatureVersion" : "1", - "Signature" : "EXAMPLEpH+DcEwjAPg8O9mY8dReBSwksfg2S7WKQcikcNKWLQjwu6A4VbeS0QHVCkhRS7fUQvi2egU3N858fiTDN6bkkOxYDVrY0Ad8L10Hs3zH81mtnPk5uvvolIC1CXGu43obcgFxeL3khZl8IKvO61GWB6jI9b5+gLPoBc1Q=", - "SigningCertURL" : "https://sns.us-west-2.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem" - } + { + "Type" : "SubscriptionConfirmation", + "MessageId" : "165545c9-2a5c-472c-8df2-7ff2be2b3b1b", + "Token" : "2336412f37fb687f5d51e6e241d09c805a5a57b30d712f794cc5f6a988666d92768dd60a747ba6f3beb71854e285d6ad02428b09ceece29417f1f02d609c582afbacc99c583a916b9981dd2728f4ae6fdb82efd087cc3b7849e05798d2d2785c03b0879594eeac82c01f235d0e717736", + "TopicArn" : "arn:aws:sns:us-west-2:123456789012:MyTopic", + "Message" : "You have chosen to subscribe to the topic arn:aws:sns:us-west-2:123456789012:MyTopic.\nTo confirm the subscription, visit the SubscribeURL included in this message.", + "SubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=ConfirmSubscription&TopicArn=arn:aws:sns:us-west-2:123456789012:MyTopic&Token=2336412f37fb687f5d51e6e241d09c805a5a57b30d712f794cc5f6a988666d92768dd60a747ba6f3beb71854e285d6ad02428b09ceece29417f1f02d609c582afbacc99c583a916b9981dd2728f4ae6fdb82efd087cc3b7849e05798d2d2785c03b0879594eeac82c01f235d0e717736", + "Timestamp" : "2012-04-26T20:45:04.751Z", + "SignatureVersion" : "1", + "Signature" : "EXAMPLEpH+DcEwjAPg8O9mY8dReBSwksfg2S7WKQcikcNKWLQjwu6A4VbeS0QHVCkhRS7fUQvi2egU3N858fiTDN6bkkOxYDVrY0Ad8L10Hs3zH81mtnPk5uvvolIC1CXGu43obcgFxeL3khZl8IKvO61GWB6jI9b5+gLPoBc1Q=", + "SigningCertURL" : "https://sns.us-west-2.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem" + } POST / HTTP/1.1 x-amz-sns-message-type: Notification @@ -56,18 +58,18 @@ Host: example.com Connection: Keep-Alive User-Agent: Amazon Simple Notification Service Agent -{ - "Type" : "Notification", - "MessageId" : "22b80b92-fdea-4c2c-8f9d-bdfb0c7bf324", - "TopicArn" : "arn:aws:sns:us-west-2:123456789012:MyTopic", - "Subject" : "My First Message", - "Message" : "Hello world!", - "Timestamp" : "2012-05-02T00:54:06.655Z", - "SignatureVersion" : "1", - "Signature" : "EXAMPLEw6JRNwm1LFQL4ICB0bnXrdB8ClRMTQFGBqwLpGbM78tJ4etTwC5zU7O3tS6tGpey3ejedNdOJ+1fkIp9F2/LmNVKb5aFlYq+9rk9ZiPph5YlLmWsDcyC5T+Sy9/umic5S0UQc2PEtgdpVBahwNOdMW4JPwk0kAJJztnc=", - "SigningCertURL" : "https://sns.us-west-2.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem", - "UnsubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-west-2:123456789012:MyTopic:c9135db0-26c4-47ec-8998-413945fb5a96" - } + { + "Type" : "Notification", + "MessageId" : "22b80b92-fdea-4c2c-8f9d-bdfb0c7bf324", + "TopicArn" : "arn:aws:sns:us-west-2:123456789012:MyTopic", + "Subject" : "My First Message", + "Message" : "Hello world!", + "Timestamp" : "2012-05-02T00:54:06.655Z", + "SignatureVersion" : "1", + "Signature" : "EXAMPLEw6JRNwm1LFQL4ICB0bnXrdB8ClRMTQFGBqwLpGbM78tJ4etTwC5zU7O3tS6tGpey3ejedNdOJ+1fkIp9F2/LmNVKb5aFlYq+9rk9ZiPph5YlLmWsDcyC5T+Sy9/umic5S0UQc2PEtgdpVBahwNOdMW4JPwk0kAJJztnc=", + "SigningCertURL" : "https://sns.us-west-2.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem", + "UnsubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-west-2:123456789012:MyTopic:c9135db0-26c4-47ec-8998-413945fb5a96" + } */ type MsgAttr struct { Type string @@ -94,11 +96,11 @@ func (ss *SNSServer) SetSNSRoutes(urlPath string, r *mux.Router, handler http.Ha r.HandleFunc(urlPath, ss.SubscribeConfirmHandle).Methods("POST").Headers("x-amz-sns-message-type", "SubscriptionConfirmation") if handler != nil { - ss.debugLog.Log(logging.MessageKey(), "handler not nil", "urlPath", urlPath) + ss.logger.Log(logging.MessageKey(), "handler not nil", "urlPath", urlPath) // handler is supposed to be wrapper that inturn calls NotificationHandle r.Handle(urlPath, handler).Methods("POST").Headers("x-amz-sns-message-type", "Notification") } else { - ss.debugLog.Log(logging.MessageKey(), "handler nil", "urlPath", urlPath) + ss.logger.Log(logging.MessageKey(), "handler nil", "urlPath", urlPath) // if no wrapper handler available then define anonymous handler and directly call NotificationHandle r.HandleFunc(urlPath, func(rw http.ResponseWriter, req *http.Request) { ss.NotificationHandle(rw, req) @@ -115,7 +117,7 @@ func (ss *SNSServer) Subscribe() { Endpoint: aws.String(ss.SelfUrl.String()), } - ss.debugLog.Log("subscribeParams", params) + ss.logger.Log("subscribeParams", params) failCounter := ss.metrics.SNSSubscribeAttempt.With("code", "failure") okayCounter := ss.metrics.SNSSubscribeAttempt.With("code", "okay") @@ -128,7 +130,7 @@ func (ss *SNSServer) Subscribe() { } else { failCounter.Add(1.0) attemptNum := 1 - ss.errorLog.Log(logging.MessageKey(), "SNS subscribe error", "attempt", attemptNum, logging.ErrorKey(), err) + ss.logger.Log(logging.MessageKey(), "SNS subscribe error", "attempt", attemptNum, logging.ErrorKey(), err) attemptNum++ // this is so tests do not timeout @@ -143,7 +145,7 @@ func (ss *SNSServer) Subscribe() { resp, err = ss.SVC.Subscribe(params) if err != nil { failCounter.Add(1.0) - ss.errorLog.Log(logging.MessageKey(), "SNS subscribe error", "attempt", attemptNum, logging.ErrorKey(), err) + ss.logger.Log(logging.MessageKey(), "SNS subscribe error", "attempt", attemptNum, logging.ErrorKey(), err) } else { okayCounter.Add(1.0) break @@ -153,7 +155,7 @@ func (ss *SNSServer) Subscribe() { } } - ss.debugLog.Log("subscribeResponse", resp, logging.MessageKey(), "SNS is not yet ready", "subscriptionArn", *resp.SubscriptionArn) + ss.logger.Log("subscribeResponse", resp, logging.MessageKey(), "SNS is not yet ready", "subscriptionArn", *resp.SubscriptionArn) } // POST handler to receive SNS Confirmation Message @@ -163,7 +165,7 @@ func (ss *SNSServer) SubscribeConfirmHandle(rw http.ResponseWriter, req *http.Re raw, err := DecodeJSONMessage(req, msg) if err != nil { - ss.errorLog.Log(logging.MessageKey(), "SNS read req body error", logging.ErrorKey(), err) + ss.logger.Log(logging.MessageKey(), "SNS read req body error", logging.ErrorKey(), err) xhttp.WriteError(rw, http.StatusBadRequest, "request body error") return } @@ -171,14 +173,14 @@ func (ss *SNSServer) SubscribeConfirmHandle(rw http.ResponseWriter, req *http.Re // Verify SNS Message authenticity by verifying signature valid, v_err := ss.Validate(msg) if !valid || v_err != nil { - ss.errorLog.Log(logging.MessageKey(), "SNS signature validation error", logging.ErrorKey(), v_err) + ss.logger.Log(logging.MessageKey(), "SNS signature validation error", logging.ErrorKey(), v_err) xhttp.WriteError(rw, http.StatusBadRequest, SNS_VALIDATION_ERR) return } // Validate that SubscriptionConfirmation is for the topic you desire to subscribe to if !strings.EqualFold(msg.TopicArn, ss.Config.Sns.TopicArn) { - ss.errorLog.Log( + ss.logger.Log( logging.MessageKey(), "SNS subscription confirmation TopicArn mismatch", "received", msg.TopicArn, "expected", ss.Config.Sns.TopicArn) @@ -188,7 +190,7 @@ func (ss *SNSServer) SubscribeConfirmHandle(rw http.ResponseWriter, req *http.Re // TODO: health.SendEvent(HTH.Set("TotalDataPayloadReceived", int(len(raw)) )) - ss.debugLog.Log( + ss.logger.Log( logging.MessageKey(), "SNS confirmation payload", "raw", string(raw), "msg", msg, @@ -200,15 +202,15 @@ func (ss *SNSServer) SubscribeConfirmHandle(rw http.ResponseWriter, req *http.Re } resp, err := ss.SVC.ConfirmSubscription(params) if err != nil { - ss.errorLog.Log(logging.MessageKey(), "SNS confirm error", logging.ErrorKey(), err) + ss.logger.Log(logging.MessageKey(), "SNS confirm error", logging.ErrorKey(), err) // TODO return error response return } - ss.debugLog.Log(logging.MessageKey(), "SNS confirm response", "response", resp) + ss.logger.Log(logging.MessageKey(), "SNS confirm response", "response", resp) ss.subscriptionArn.Store(*resp.SubscriptionArn) - ss.debugLog.Log(logging.MessageKey(), "SNS is ready", "subscriptionArn", *resp.SubscriptionArn) + ss.logger.Log(logging.MessageKey(), "SNS is ready", "subscriptionArn", *resp.SubscriptionArn) ss.metrics.SNSSubscribed.Add(1.0) // start listenAndPublishMessage go routine @@ -235,7 +237,7 @@ func (ss *SNSServer) NotificationHandle(rw http.ResponseWriter, req *http.Reques raw, err := DecodeJSONMessage(req, msg) if err != nil { - ss.errorLog.Log(logging.MessageKey(), "SNS read req body error", logging.ErrorKey(), err) + ss.logger.Log(logging.MessageKey(), "SNS read req body error", logging.ErrorKey(), err) xhttp.WriteError(rw, http.StatusBadRequest, "request body error") ss.SNSNotificationReceivedCounter(http.StatusBadRequest) return nil @@ -244,14 +246,14 @@ func (ss *SNSServer) NotificationHandle(rw http.ResponseWriter, req *http.Reques // Verify SNS Message authenticity by verifying signature valid, v_err := ss.Validate(msg) if !valid || v_err != nil { - ss.errorLog.Log(logging.MessageKey(), "SNS signature validation error", logging.ErrorKey(), v_err) + ss.logger.Log(logging.MessageKey(), "SNS signature validation error", logging.ErrorKey(), v_err) xhttp.WriteError(rw, http.StatusBadRequest, SNS_VALIDATION_ERR) ss.SNSNotificationReceivedCounter(http.StatusBadRequest) return nil } // TODO: health.SendEvent(HTH.Set("TotalDataPayloadReceived", int(len(raw)) )) - ss.debugLog.Log( + ss.logger.Log( logging.MessageKey(), "SNS notification payload", "raw", string(raw), "msg", msg, @@ -259,7 +261,7 @@ func (ss *SNSServer) NotificationHandle(rw http.ResponseWriter, req *http.Reques // Validate that SubscriptionConfirmation is for the topic you desire to subscribe to if !strings.EqualFold(msg.TopicArn, ss.Config.Sns.TopicArn) { - ss.errorLog.Log( + ss.logger.Log( logging.MessageKey(), "SNS notification TopicArn mismatch", "received", msg.TopicArn, "expected", ss.Config.Sns.TopicArn) @@ -270,9 +272,9 @@ func (ss *SNSServer) NotificationHandle(rw http.ResponseWriter, req *http.Reques EnvAttr := msg.MessageAttributes[MSG_ATTR] msgEnv := EnvAttr.Value - ss.debugLog.Log(logging.MessageKey(), "SNS notification", "envAttr", EnvAttr, "msgEnv", msgEnv) + ss.logger.Log(logging.MessageKey(), "SNS notification", "envAttr", EnvAttr, "msgEnv", msgEnv) if msgEnv != ss.Config.Env { - ss.errorLog.Log(logging.MessageKey(), "SNS environment mismatch", "msgEnv", msgEnv, "config", ss.Config.Env) + ss.logger.Log(logging.MessageKey(), "SNS environment mismatch", "msgEnv", msgEnv, "config", ss.Config.Env) xhttp.WriteError(rw, http.StatusBadRequest, "SNS Msg config env does not match") ss.SNSNotificationReceivedCounter(http.StatusBadRequest) return nil @@ -286,7 +288,7 @@ func (ss *SNSServer) NotificationHandle(rw http.ResponseWriter, req *http.Reques // Publish Notification message to AWS SNS topic func (ss *SNSServer) PublishMessage(message string) error { - ss.debugLog.Log(logging.MessageKey(), "SNS PublishMessage", "called", message) + ss.logger.Log(logging.MessageKey(), "SNS PublishMessage", "called", message) ss.metrics.SNSNotificationSent.Add(1.0) // push Notification message onto notif data channel @@ -323,9 +325,9 @@ func (ss *SNSServer) listenAndPublishMessage() { resp, err := ss.SVC.Publish(params) if err != nil { - ss.errorLog.Log(logging.MessageKey(), "SNS send message error", logging.ErrorKey(), err) + ss.logger.Log(logging.MessageKey(), "SNS send message error", logging.ErrorKey(), err) } - ss.debugLog.Log(logging.MessageKey(), "SNS send message", "response", resp) + ss.logger.Log(logging.MessageKey(), "SNS send message", "response", resp) // TODO : health.SendEvent(HTH.Set("TotalDataPayloadSent", int(len([]byte(resp.GoString()))) )) } @@ -347,10 +349,10 @@ func (ss *SNSServer) Unsubscribe(subArn string) { resp, err := ss.SVC.Unsubscribe(params) if err != nil { - ss.errorLog.Log(logging.MessageKey(), "SNS Unsubscribe error", logging.ErrorKey(), err) + ss.logger.Log(logging.MessageKey(), "SNS Unsubscribe error", logging.ErrorKey(), err) } - ss.debugLog.Log(logging.MessageKey(), "Successfully unsubscribed from the SNS topic", "response", resp) + ss.logger.Log(logging.MessageKey(), "Successfully unsubscribed from the SNS topic", "response", resp) } func (ss *SNSServer) UnsubscribeOldSubscriptions() { @@ -379,13 +381,13 @@ func (ss *SNSServer) ListSubscriptionsByMatchingEndpoint() (*list.List, error) { timeStr = strings.TrimPrefix(timeStr, "/") currentTimestamp, err = strconv.ParseInt(timeStr, 10, 64) if nil != err { - ss.errorLog.Log(logging.MessageKey(), "SNS List Subscriptions timestamp parse error", + ss.logger.Log(logging.MessageKey(), "SNS List Subscriptions timestamp parse error", "selfUrl", ss.SelfUrl.String(), logging.ErrorKey(), err) return nil, err } endpoint := strings.TrimSuffix(ss.SelfUrl.String(), timeStr) endpoint = strings.TrimSuffix(endpoint, "/") - ss.debugLog.Log("currentEndpoint", endpoint, "timestamp", currentTimestamp) + ss.logger.Log("currentEndpoint", endpoint, "timestamp", currentTimestamp) params := &sns.ListSubscriptionsByTopicInput{ TopicArn: aws.String(ss.Config.Sns.TopicArn), @@ -395,7 +397,7 @@ func (ss *SNSServer) ListSubscriptionsByMatchingEndpoint() (*list.List, error) { resp, err := ss.SVC.ListSubscriptionsByTopic(params) if nil != err { - ss.errorLog.Log(logging.MessageKey(), "SNS ListSubscriptionsByTopic error", logging.ErrorKey(), err) + ss.logger.Log(logging.MessageKey(), "SNS ListSubscriptionsByTopic error", logging.ErrorKey(), err) return nil, err } @@ -427,7 +429,7 @@ func (ss *SNSServer) ListSubscriptionsByMatchingEndpoint() (*list.List, error) { } if unsubscribeList != nil { - ss.debugLog.Log(logging.MessageKey(), "SNS Unsubscribe List", "length", unsubscribeList.Len()) + ss.logger.Log(logging.MessageKey(), "SNS Unsubscribe List", "length", unsubscribeList.Len()) } return unsubscribeList, nil } diff --git a/webhook/aws/sns_test.go b/webhook/aws/sns_test.go index f5c9bffd..b7413e3c 100644 --- a/webhook/aws/sns_test.go +++ b/webhook/aws/sns_test.go @@ -155,8 +155,7 @@ func TestInitialize_SNSUrlPathWithTimestamp(t *testing.T) { awsMetrics := ApplyMetricsData(registry) ss.Initialize(nil, selfUrl, "", nil, nil, awsMetrics, func() time.Time { return time.Unix(TEST_UNIX_TIME, 0) }) - require.NotNil(ss.errorLog) - require.NotNil(ss.debugLog) + require.NotNil(ss.logger) assert.Equal(fmt.Sprint(ss.Config.Sns.UrlPath, "/", TEST_UNIX_TIME), selfUrl.Path) assert.Equal("http://host-test:10000/api/v2/aws/sns/1503357402", ss.SelfUrl.String()) } @@ -176,8 +175,7 @@ func TestInitialize_SNSUrlPathWithSlash(t *testing.T) { awsMetrics := ApplyMetricsData(registry) ss.Initialize(nil, selfUrl, "", nil, nil, awsMetrics, func() time.Time { return time.Unix(TEST_UNIX_TIME, 0) }) - require.NotNil(ss.errorLog) - require.NotNil(ss.debugLog) + require.NotNil(ss.logger) assert.Equal(fmt.Sprint(ss.Config.Sns.UrlPath, TEST_UNIX_TIME), selfUrl.Path) assert.Equal("http://host-test:10000/sns/1503357402", ss.SelfUrl.String()) } diff --git a/xmetrics/options.go b/xmetrics/options.go index 4c2cf0dd..55aa7d99 100644 --- a/xmetrics/options.go +++ b/xmetrics/options.go @@ -1,9 +1,8 @@ package xmetrics import ( - "github.com/go-kit/kit/log" "github.com/prometheus/client_golang/prometheus" - "github.com/xmidt-org/webpa-common/v2/logging" + "go.uber.org/zap" ) const ( @@ -14,7 +13,7 @@ const ( // Options is the configurable options for creating a Prometheus registry type Options struct { // Logger is the go-kit logger to use for metrics output. If unset, logging.DefaultLogger() is used. - Logger log.Logger + Logger *zap.Logger // Namespace is the global default namespace for metrics which don't define a namespace (or for ad hoc metrics). // If not supplied, DefaultNamespace is used. @@ -47,12 +46,17 @@ type Options struct { Metrics []Metric } -func (o *Options) logger() log.Logger { +func (o *Options) logger() *zap.Logger { if o != nil && o.Logger != nil { return o.Logger } - return logging.DefaultLogger() + l, err := zap.NewProduction() + if err != nil { + panic(err) + } + + return l } func (o *Options) namespace() string { From 8dc19853e7d1288eb9b10e9013a5fbf85fc377b7 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Fri, 21 Oct 2022 14:47:54 -0400 Subject: [PATCH 03/48] update device --- bookkeeping/bookkeeper.go | 113 ------------------------ device/device_test.go | 4 +- device/devicegate/filterHandler_test.go | 20 ++--- device/drain/drainer_test.go | 18 ++-- device/drain/start_test.go | 12 +-- device/handlers_test.go | 28 +++--- device/options_test.go | 4 +- device/registry_test.go | 14 +-- 8 files changed, 50 insertions(+), 163 deletions(-) delete mode 100644 bookkeeping/bookkeeper.go diff --git a/bookkeeping/bookkeeper.go b/bookkeeping/bookkeeper.go deleted file mode 100644 index f4ee8b31..00000000 --- a/bookkeeping/bookkeeper.go +++ /dev/null @@ -1,113 +0,0 @@ -package bookkeeping - -import ( - "bytes" - "net/http" - "time" - - "github.com/xmidt-org/webpa-common/v2/logging" - "github.com/xmidt-org/webpa-common/v2/xhttp/xcontext" -) - -type CapturedResponse struct { - Code int - Payload []byte - Header http.Header -} - -// RequestFunc takes the request and returns key value pairs from the request -type RequestFunc func(request *http.Request) []interface{} - -// ResponseFunc takes the ResponseWriter and returns key value pairs from the request -type ResponseFunc func(response CapturedResponse) []interface{} - -// handler is for logging of the request and response -type handler struct { - next http.Handler - before []RequestFunc - after []ResponseFunc -} - -// Option provides a single configuration option for a bookkeeping handler -type Option func(h *handler) - -func New(options ...Option) func(next http.Handler) http.Handler { - return func(next http.Handler) http.Handler { - if next == nil { - panic("next can't be nil") - } - h := &handler{ - next: next, - } - for _, o := range options { - o(h) - } - return h - } -} - -// WithRequests take a one or many RequestFuncs to build an Option for logging key value pairs from the -// RequestFun -func WithRequests(requestFuncs ...RequestFunc) Option { - return func(h *handler) { - h.before = append(h.before, requestFuncs...) - } -} - -// WithResponses take a one or many ResponseFunc to build an Option for logging key value pairs from the -// ResponseFunc -func WithResponses(responseFuncs ...ResponseFunc) Option { - return func(h *handler) { - h.after = append(h.after, responseFuncs...) - } -} - -// ServeHTTP handles the bookkeeping given -func (h *handler) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { - kv := []interface{}{logging.MessageKey(), "Bookkeeping transactor"} - for _, before := range h.before { - kv = append(kv, before(request)...) - } - responseWriter, request = xcontext.WithContext(responseWriter, request, request.Context()) - w := &writerInterceptor{ResponseWriter: responseWriter, ContextAware: responseWriter.(xcontext.ContextAware)} - - start := time.Now() - defer func() { - ctx := xcontext.Context(responseWriter, request) - duration := time.Since(start) - - kv = append(kv, "duration", duration) - - response := CapturedResponse{ - Code: w.code, - Payload: w.buffer.Bytes(), - Header: w.Header(), - } - - for _, after := range h.after { - kv = append(kv, after(response)...) - } - - logging.Info(logging.GetLogger(ctx)).Log(kv...) - }() - - h.next.ServeHTTP(w, request) -} - -type writerInterceptor struct { - xcontext.ContextAware - http.ResponseWriter - code int - buffer bytes.Buffer -} - -func (w *writerInterceptor) Write(data []byte) (int, error) { - w.buffer.Write(data) - return w.ResponseWriter.Write(data) - -} - -func (w *writerInterceptor) WriteHeader(code int) { - w.code = code - w.ResponseWriter.WriteHeader(code) -} diff --git a/device/device_test.go b/device/device_test.go index a5dc54c6..294209e8 100644 --- a/device/device_test.go +++ b/device/device_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/wrp-go/v3" ) @@ -52,7 +52,7 @@ func TestDevice(t *testing.T) { ID: record.expectedID, QueueSize: record.expectedQueueSize, ConnectedAt: expectedConnectedAt, - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Metadata: new(Metadata), }) ) diff --git a/device/devicegate/filterHandler_test.go b/device/devicegate/filterHandler_test.go index 8a9da10b..6b5388e5 100644 --- a/device/devicegate/filterHandler_test.go +++ b/device/devicegate/filterHandler_test.go @@ -9,14 +9,14 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func TestServeHTTPGet(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) response = httptest.NewRecorder() request = httptest.NewRequest("GET", "/", nil) @@ -38,8 +38,8 @@ func TestServeHTTPGet(t *testing.T) { func TestBadRequest(t *testing.T) { var ( - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) mockDeviceGate = new(mockDeviceGate) f = FilterHandler{ @@ -105,8 +105,8 @@ func TestBadRequest(t *testing.T) { func TestSuccessfulAdd(t *testing.T) { var ( - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) ) tests := []struct { @@ -173,8 +173,8 @@ func TestSuccessfulAdd(t *testing.T) { func TestDelete(t *testing.T) { var ( - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) assert = assert.New(t) response = httptest.NewRecorder() @@ -196,7 +196,7 @@ func TestDelete(t *testing.T) { func TestGateLogger(t *testing.T) { var ( - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() gate = &FilterGate{ FilterStore: FilterStore(map[string]Set{ "partner-id": &FilterSet{ diff --git a/device/drain/drainer_test.go b/device/drain/drainer_test.go index 5ed0e72f..4c0abde1 100644 --- a/device/drain/drainer_test.go +++ b/device/drain/drainer_test.go @@ -6,12 +6,12 @@ import ( "testing" "time" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/device" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xmidt-org/webpa-common/v2/device/devicegate" - "github.com/xmidt-org/webpa-common/v2/logging" "github.com/xmidt-org/webpa-common/v2/xmetrics/xmetricstest" ) @@ -81,7 +81,7 @@ func testWithLoggerDefault(t *testing.T) { func testWithLoggerCustom(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() d = new(drainer) ) @@ -247,7 +247,7 @@ func testDrainerDrainAll(t *testing.T, deviceCount int) { assert = assert.New(t) require = require.New(t) provider = xmetricstest.NewProvider(nil) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() manager = generateManager(assert, uint64(deviceCount)) @@ -366,7 +366,7 @@ func testDrainerDisconnectAll(t *testing.T, deviceCount int) { assert = assert.New(t) require = require.New(t) provider = xmetricstest.NewProvider(nil) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() manager = generateManager(assert, uint64(deviceCount)) @@ -461,7 +461,7 @@ func testDrainerVisitCancel(t *testing.T) { assert = assert.New(t) require = require.New(t) provider = xmetricstest.NewProvider(nil) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() manager = generateManager(assert, 100) @@ -497,7 +497,7 @@ func testDrainerDisconnectCancel(t *testing.T) { assert = assert.New(t) require = require.New(t) provider = xmetricstest.NewProvider(nil) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() manager = generateManager(assert, 100) @@ -543,7 +543,7 @@ func testDrainerDrainCancel(t *testing.T) { assert = assert.New(t) require = require.New(t) provider = xmetricstest.NewProvider(nil) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() manager = generateManager(assert, 100) @@ -634,7 +634,7 @@ func testDrainFilter(t *testing.T, deviceTypeOne deviceInfo, deviceTypeTwo devic assert = assert.New(t) require = require.New(t) provider = xmetricstest.NewProvider(nil) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() // generate manager with devices that have two different metadatas manager = generateManagerWithDifferentDevices(assert, deviceTypeOne.claims, uint64(deviceTypeOne.count), deviceTypeTwo.claims, uint64(deviceTypeTwo.count)) @@ -791,7 +791,7 @@ func testDisconnectFilter(t *testing.T, deviceTypeOne deviceInfo, deviceTypeTwo assert = assert.New(t) require = require.New(t) provider = xmetricstest.NewProvider(nil) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() // generate manager with devices that have two different metadatas manager = generateManagerWithDifferentDevices(assert, deviceTypeOne.claims, uint64(deviceTypeOne.count), deviceTypeTwo.claims, uint64(deviceTypeTwo.count)) diff --git a/device/drain/start_test.go b/device/drain/start_test.go index d2eae25c..207544d8 100644 --- a/device/drain/start_test.go +++ b/device/drain/start_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/device/devicegate" "github.com/stretchr/testify/assert" - "github.com/xmidt-org/webpa-common/v2/logging" ) func testStartServeHTTPDefaultLogger(t *testing.T) { @@ -75,7 +75,7 @@ func testStartServeHTTPValid(t *testing.T) { done <-chan struct{} = make(chan struct{}) start = Start{d} - ctx = logging.WithLogger(context.Background(), logging.NewTestLogger(nil, t)) + ctx = sallust.With(context.Background(), sallust.Default()) response = httptest.NewRecorder() request = httptest.NewRequest("POST", record.uri, nil).WithContext(ctx) ) @@ -164,7 +164,7 @@ func testStartServeHTTPWithBody(t *testing.T) { done <-chan struct{} = make(chan struct{}) start = Start{d} - ctx = logging.WithLogger(context.Background(), logging.NewTestLogger(nil, t)) + ctx = sallust.With(context.Background(), sallust.Default()) response = httptest.NewRecorder() request = httptest.NewRequest("POST", "/foo?count=22&rate=10&tick=20s", bytes.NewBuffer(record.body)).WithContext(ctx) ) @@ -199,7 +199,7 @@ func testStartServeHTTPParseFormError(t *testing.T) { d = new(mockDrainer) start = Start{d} - ctx = logging.WithLogger(context.Background(), logging.NewTestLogger(nil, t)) + ctx = sallust.With(context.Background(), sallust.Default()) response = httptest.NewRecorder() request = httptest.NewRequest("POST", "/foo?%TT*&&", nil).WithContext(ctx) ) @@ -216,7 +216,7 @@ func testStartServeHTTPInvalidQuery(t *testing.T) { d = new(mockDrainer) start = Start{d} - ctx = logging.WithLogger(context.Background(), logging.NewTestLogger(nil, t)) + ctx = sallust.With(context.Background(), sallust.Default()) response = httptest.NewRecorder() request = httptest.NewRequest("POST", "/foo?count=asdf", nil).WithContext(ctx) ) @@ -235,7 +235,7 @@ func testStartServeHTTPStartError(t *testing.T) { start = Start{d} expectedError = errors.New("expected") - ctx = logging.WithLogger(context.Background(), logging.NewTestLogger(nil, t)) + ctx = sallust.With(context.Background(), sallust.Default()) response = httptest.NewRecorder() request = httptest.NewRequest("POST", "/foo?count=100", nil).WithContext(ctx) ) diff --git a/device/handlers_test.go b/device/handlers_test.go index 3f981984..6d25f90e 100644 --- a/device/handlers_test.go +++ b/device/handlers_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/wrp-go/v3" ) @@ -169,7 +169,7 @@ func TestUseID(t *testing.T) { func testMessageHandlerLogger(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() handler = MessageHandler{} ) @@ -277,7 +277,7 @@ func testMessageHandlerServeHTTPEvent(t *testing.T, requestFormat wrp.Format) { router = new(mockRouter) handler = MessageHandler{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Router: router, } @@ -343,7 +343,7 @@ func testMessageHandlerServeHTTPRequestResponse(t *testing.T, responseFormat, re router = new(mockRouter) device = new(MockDevice) handler = MessageHandler{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Router: router, } @@ -482,7 +482,7 @@ func TestMessageHandler(t *testing.T) { func testConnectHandlerLogger(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() handler = ConnectHandler{} ) @@ -539,7 +539,7 @@ func testListHandlerRefresh(t *testing.T) { var ( assert = assert.New(t) handler = ListHandler{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), } ) @@ -556,7 +556,7 @@ func testListHandlerServeHTTP(t *testing.T) { expectedConnectedAt = time.Now().UTC() expectedUpTime = 47913 * time.Minute registry = new(MockRegistry) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() now = func() time.Time { return expectedConnectedAt.Add(expectedUpTime) @@ -566,7 +566,7 @@ func testListHandlerServeHTTP(t *testing.T) { secondDevice = newDevice(deviceOptions{ID: ID("second"), QueueSize: 1, ConnectedAt: expectedConnectedAt, Logger: logger}) handler = ListHandler{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Registry: registry, } ) @@ -669,7 +669,7 @@ func testStatHandlerNoPathVariables(t *testing.T) { registry = new(MockRegistry) handler = StatHandler{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Registry: registry, } @@ -688,7 +688,7 @@ func testStatHandlerNoDeviceName(t *testing.T) { registry = new(MockRegistry) handler = StatHandler{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Registry: registry, Variable: "deviceID", } @@ -710,7 +710,7 @@ func testStatHandlerInvalidDeviceName(t *testing.T) { registry = new(MockRegistry) handler = StatHandler{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Registry: registry, Variable: "deviceID", } @@ -732,7 +732,7 @@ func testStatHandlerMissingDevice(t *testing.T) { registry = new(MockRegistry) handler = StatHandler{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Registry: registry, Variable: "deviceID", } @@ -757,7 +757,7 @@ func testStatHandlerMarshalJSONFailed(t *testing.T) { device = new(MockDevice) handler = StatHandler{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Registry: registry, Variable: "deviceID", } @@ -784,7 +784,7 @@ func testStatHandlerSuccess(t *testing.T) { device = new(MockDevice) handler = StatHandler{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Registry: registry, Variable: "deviceID", } diff --git a/device/options_test.go b/device/options_test.go index 8db7bd6e..5e2cae3c 100644 --- a/device/options_test.go +++ b/device/options_test.go @@ -7,7 +7,7 @@ import ( "github.com/go-kit/kit/metrics/provider" "github.com/gorilla/websocket" "github.com/stretchr/testify/assert" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func TestOptionsDefault(t *testing.T) { @@ -31,7 +31,7 @@ func TestOptionsDefault(t *testing.T) { func TestOptions(t *testing.T) { var ( assert = assert.New(t) - expectedLogger = logging.DefaultLogger() + expectedLogger = sallust.Default() expectedMetricsProvider = provider.NewPrometheusProvider("test", "test") o = Options{ diff --git a/device/registry_test.go b/device/registry_test.go index 3fc022a1..d2e54061 100644 --- a/device/registry_test.go +++ b/device/registry_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/xmetrics/xmetricstest" ) @@ -15,7 +15,7 @@ func testRegistryAdd(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() p = xmetricstest.NewProvider(nil, Metrics) r = newRegistry(registryOptions{ @@ -72,7 +72,7 @@ func testRegistryAdd(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() p = xmetricstest.NewProvider(nil, Metrics) r = newRegistry(registryOptions{ @@ -136,7 +136,7 @@ func testRegistryRemoveAndGet(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() p = xmetricstest.NewProvider(nil, Metrics) r = newRegistry(registryOptions{ @@ -213,7 +213,7 @@ func testRegistryRemoveIf(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() p = xmetricstest.NewProvider(nil, Metrics) r = newRegistry(registryOptions{ @@ -270,7 +270,7 @@ func testRegistryRemoveAll(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() devices = []*device{ newDevice(deviceOptions{ID: ID("1"), Logger: logger}), @@ -306,7 +306,7 @@ func testRegistryVisit(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() p = xmetricstest.NewProvider(nil, Metrics) r = newRegistry(registryOptions{ From 44739c38fb35fde545092493d9607fd4e8190af0 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Fri, 21 Oct 2022 15:05:58 -0400 Subject: [PATCH 04/48] Update dependencies --- go.mod | 104 ++++++++++++++++++---- go.sum | 272 ++++++++++++--------------------------------------------- 2 files changed, 146 insertions(+), 230 deletions(-) diff --git a/go.mod b/go.mod index c0dde2a1..99de14ad 100644 --- a/go.mod +++ b/go.mod @@ -1,32 +1,25 @@ module github.com/xmidt-org/webpa-common/v2 -go 1.13 +go 1.19 require ( github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2 - github.com/armon/go-metrics v0.4.0 // indirect - github.com/aws/aws-sdk-go v1.44.114 + github.com/aws/aws-sdk-go v1.44.120 github.com/billhathaway/consistentHash v0.0.0-20140718022140-addea16d2229 github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 - github.com/davecgh/go-spew v1.1.1 github.com/go-kit/kit v0.12.0 github.com/go-zookeeper/zk v1.0.3 github.com/goph/emperror v0.17.3-0.20190703203600-60a8d9faa17b github.com/gorilla/mux v1.8.0 github.com/gorilla/schema v1.2.0 github.com/gorilla/websocket v1.5.0 - github.com/hashicorp/consul/api v1.15.2 - github.com/hashicorp/go-hclog v1.2.2 // indirect - github.com/hashicorp/serf v0.10.0 // indirect - github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c // indirect + github.com/hashicorp/consul/api v1.15.3 github.com/jtacoma/uritemplates v1.0.0 github.com/justinas/alice v1.2.0 - github.com/mattn/go-colorable v0.1.13 // indirect github.com/miekg/dns v1.1.50 github.com/mitchellh/mapstructure v1.5.0 github.com/prometheus/client_golang v1.13.0 github.com/segmentio/ksuid v1.0.4 - github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/cast v1.5.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.13.0 @@ -34,16 +27,97 @@ require ( github.com/ugorji/go/codec v1.2.7 github.com/xmidt-org/argus v0.9.2 github.com/xmidt-org/bascule v0.11.0 - github.com/xmidt-org/candlelight v0.0.11 + github.com/xmidt-org/candlelight v0.0.12 github.com/xmidt-org/sallust v0.1.6 github.com/xmidt-org/themis v0.4.9 github.com/xmidt-org/wrp-go/v3 v3.1.4 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.3 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 go.uber.org/fx v1.18.2 go.uber.org/zap v1.23.0 - golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c // indirect - golang.org/x/tools v0.1.12 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 ) -replace github.com/xmidt-org/sallust => github.com/xmidt-org/sallust v0.1.7-0.20221019165444-b7de762f6db4 +require ( + emperror.dev/emperror v0.33.0 // indirect + emperror.dev/errors v0.8.1 // indirect + github.com/GaryBoone/GoStats v0.0.0-20130122001700-1993eafbef57 // indirect + github.com/VividCortex/gohistogram v1.0.0 // indirect + github.com/armon/go-metrics v0.4.1 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-kit/log v0.2.1 // indirect + github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/goccy/go-json v0.9.11 // indirect + github.com/golang-jwt/jwt v3.2.2+incompatible // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-hclog v1.3.1 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-rootcerts v1.0.2 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/serf v0.10.1 // indirect + github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/lestrrat-go/blackmagic v1.0.1 // indirect + github.com/lestrrat-go/httpcc v1.0.1 // indirect + github.com/lestrrat-go/httprc v1.0.4 // indirect + github.com/lestrrat-go/iter v1.0.2 // indirect + github.com/lestrrat-go/jwx/v2 v2.0.6 // indirect + github.com/lestrrat-go/option v1.0.0 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/openzipkin/zipkin-go v0.4.1 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.5 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect + github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/spf13/afero v1.9.2 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/stretchr/objx v0.5.0 // indirect + github.com/subosito/gotenv v1.4.1 // indirect + github.com/xmidt-org/arrange v0.3.0 // indirect + github.com/xmidt-org/chronon v0.1.1 // indirect + github.com/xmidt-org/clortho v0.0.4 // indirect + github.com/xmidt-org/httpaux v0.3.2 // indirect + github.com/xmidt-org/touchstone v0.1.2 // indirect + go.opentelemetry.io/otel v1.11.1 // indirect + go.opentelemetry.io/otel/exporters/jaeger v1.11.1 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.1 // indirect + go.opentelemetry.io/otel/exporters/zipkin v1.11.1 // indirect + go.opentelemetry.io/otel/metric v0.33.0 // indirect + go.opentelemetry.io/otel/sdk v1.11.1 // indirect + go.opentelemetry.io/otel/trace v1.11.1 // indirect + go.uber.org/atomic v1.10.0 // indirect + go.uber.org/dig v1.15.0 // indirect + go.uber.org/multierr v1.8.0 // indirect + golang.org/x/crypto v0.1.0 // indirect + golang.org/x/mod v0.6.0 // indirect + golang.org/x/net v0.1.0 // indirect + golang.org/x/sys v0.1.0 // indirect + golang.org/x/text v0.4.0 // indirect + golang.org/x/tools v0.2.0 // indirect + google.golang.org/protobuf v1.28.1 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +replace github.com/xmidt-org/sallust => /Users/odc/Documents/GitHub/xmidt-org/sallust + +replace github.com/xmidt-org/argus => /Users/odc/Documents/GitHub/xmidt-org/argus diff --git a/go.sum b/go.sum index 78cb18e6..ea26be0d 100644 --- a/go.sum +++ b/go.sum @@ -55,21 +55,15 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -emperror.dev/emperror v0.30.0/go.mod h1:ZasUgT1WGMbTYZzEWmyPuc6pCxRjO6Kp8lZz4FRRIiM= emperror.dev/emperror v0.33.0 h1:urYop6KLYxKVpZbt9ADC4eVG3WDnJFE6Ye3j07wUu/I= emperror.dev/emperror v0.33.0/go.mod h1:CeOIKPcppTE8wn+3xBNcdzdHMMIP77sLOHS0Ik56m+w= -emperror.dev/errors v0.7.0/go.mod h1:X4dljzQehaz3WfBKc6c7bR+ve2ZsRzbBkFBF+HTcW0M= emperror.dev/errors v0.8.0/go.mod h1:YcRvLPh626Ubn2xqtoprejnA5nFha+TJ+2vew48kWuE= emperror.dev/errors v0.8.1 h1:UavXZ5cSX/4u9iyvH6aDcuGkVjeexUGJ7Ij7G4VfQT0= emperror.dev/errors v0.8.1/go.mod h1:YcRvLPh626Ubn2xqtoprejnA5nFha+TJ+2vew48kWuE= -github.com/Azure/azure-sdk-for-go v16.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-autorest v10.7.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v10.15.3+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I= github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/GaryBoone/GoStats v0.0.0-20130122001700-1993eafbef57 h1:EUQH/F+mzJBs53c75r7R5zdM/kz7BHXoWBFsVXzadVw= github.com/GaryBoone/GoStats v0.0.0-20130122001700-1993eafbef57/go.mod h1:5zDl2HgTb/k5i9op9y6IUSiuVkZFpUrWGQbZc9tNR40= @@ -78,8 +72,6 @@ github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXY github.com/InVisionApp/go-health v2.1.0+incompatible/go.mod h1:/+Gv1o8JUsrjC6pi6MN6/CgKJo4OqZ6x77XAnImrzhg= github.com/InVisionApp/go-logger v1.0.1/go.mod h1:+cGTDSn+P8105aZkeOfIhdd7vFO5X1afUHcjvanY0L8= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.4.3/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/NYTimes/gziphandler v1.0.1/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2 h1:koK7z0nSsRiRiBWwa+E714Puh+DO+ZRdIyAXiXzL+lg= github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= @@ -87,10 +79,8 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX github.com/Shopify/sarama v1.30.0/go.mod h1:zujlQQx1kzHsh4jfV1USnptCQrHAEZ2Hk8fTKCulPVs= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/Shopify/toxiproxy/v2 v2.1.6-0.20210914104332-15ea381dcdae/go.mod h1:/cvHQkZ1fst0EmZnA5dFtiQdWCNCFYzb+uE2vqVgvx0= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/airbrake/gobrake v3.6.1+incompatible/go.mod h1:wM4gu3Cn0W0K7GUuVWnlXZU11AGBXMILnrdOU8Kn00o= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -105,24 +95,23 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= github.com/armon/go-metrics v0.3.4/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.8.12/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k= -github.com/aws/aws-sdk-go v1.25.41/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.44.113/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.114 h1:plIkWc/RsHr3DXBj4MEw9sEW4CcL/e2ryokc+CKyq1I= -github.com/aws/aws-sdk-go v1.44.114/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.119 h1:TPkpDsanBMcZaF5wHwpKhjkapRV/b7d2qdC+a+IPbmY= +github.com/aws/aws-sdk-go v1.44.119/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.120 h1:dsOxGf17H9hCVCA4aWpFWEcJMHkX+Uw7l4pGcxb27wM= +github.com/aws/aws-sdk-go v1.44.120/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= @@ -142,7 +131,6 @@ github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCS github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bugsnag/bugsnag-go v1.4.0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/panicwrap v1.2.0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/c9s/goprocinfo v0.0.0-20151025191153-19cb9f127a9c/go.mod h1:uEyr4WpAH4hio6LFriaPkL938XnrvLpNPmQHBdrmbIE= @@ -150,7 +138,6 @@ github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 h1:SjZ2GvvOononHOpK github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8/go.mod h1:uEyr4WpAH4hio6LFriaPkL938XnrvLpNPmQHBdrmbIE= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= -github.com/cenk/backoff v2.0.0+incompatible/go.mod h1:7FtoeaSnHoZnmZzz47cM35Y9nSW7tNyaidugnHTaFDE= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -179,7 +166,6 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coredns/coredns v1.1.2/go.mod h1:zASH/MVDgR6XZTbxvOnsZfffS+31vg6Ackf/wo1+AM0= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -202,14 +188,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d/go. github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= -github.com/denverdino/aliyungo v0.0.0-20170926055100-d3308649c661/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.1.1/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= -github.com/digitalocean/godo v1.10.0/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= -github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= @@ -217,9 +197,7 @@ github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= -github.com/envoyproxy/go-control-plane v0.8.0/go.mod h1:GSSbY9P1neVhdY7G4wu+IK1rk/dqhiCC/4ExuWJZVuk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -229,15 +207,12 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a/go.mod h1:7Ga40egUymuWXxAe151lTNnCv97MddSOVsjpPPkityA= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= @@ -251,14 +226,14 @@ github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3 github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.36.1-0.20180420150025-bda519ae5f4c/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -268,7 +243,6 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -279,20 +253,14 @@ github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= @@ -300,7 +268,6 @@ github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGF github.com/goccy/go-json v0.9.10/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gocql/gocql v0.0.0-20200505093417-effcbd8bcf0e/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= github.com/gocql/gocql v1.2.1/go.mod h1:3gM2c4D3AnkISwBxGnMMsS8Oy4y2lhbPRsH4xnJrHG8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -347,9 +314,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -368,10 +333,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -404,13 +367,10 @@ github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0 github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/goph/emperror v0.17.1/go.mod h1:+ZbQ+fUNO/6FNiUo0ujtMjhgad9Xa6fQL9KhH4LNHic= github.com/goph/emperror v0.17.3-0.20190703203600-60a8d9faa17b h1:3/cwc6wu5QADzKEW2HP7+kZpKgm7OHysQ3ULVVQzQhs= github.com/goph/emperror v0.17.3-0.20190703203600-60a8d9faa17b/go.mod h1:+ZbQ+fUNO/6FNiUo0ujtMjhgad9Xa6fQL9KhH4LNHic= -github.com/gophercloud/gophercloud v0.0.0-20180828235145-f29afc2cceca/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= -github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -428,7 +388,6 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -438,50 +397,36 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= -github.com/hashicorp/consul v1.4.2/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= -github.com/hashicorp/consul v1.7.0 h1:Wr3ccN8CtIpIJ6iRipFt3iggVyMGspt0h3vrwTR/Lrw= -github.com/hashicorp/consul v1.7.0/go.mod h1:vKfXmSQNl6HwO/JqQ2DDLzisBDV49y+JVTkrdW1cnSU= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/api v1.4.0/go.mod h1:xc8u05kyMa3Wjr9eEAsIAo3dg8+LywT5E/Cl7cNS5nU= github.com/hashicorp/consul/api v1.7.0/go.mod h1:1NSuaUUkFaJzMasbfq/11wKYWSR67Xn6r2DXKhuDNFg= github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= -github.com/hashicorp/consul/api v1.15.2 h1:3Q/pDqvJ7udgt/60QOOW/p/PeKioQN+ncYzzCdN2av0= -github.com/hashicorp/consul/api v1.15.2/go.mod h1:v6nvB10borjOuIwNRZYPZiHKrTM/AyrGtd0WVVodKM8= +github.com/hashicorp/consul/api v1.15.3 h1:WYONYL2rxTXtlekAqblR2SCdJsizMDIj/uXb5wNy9zU= +github.com/hashicorp/consul/api v1.15.3/go.mod h1:/g/qgcoBcEXALCNZgRRisyTW0nY86++L0KbeAMXYCeY= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.4.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/consul/sdk v0.6.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/consul/sdk v0.11.0 h1:HRzj8YSCln2yGgCumN5CL8lYlD3gBurnervJRJAZyC4= github.com/hashicorp/consul/sdk v0.11.0/go.mod h1:yPkX5Q6CsxTFMjQQDJwzeNmUUF5NUGGbrDsv9wTb8cw= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.2/go.mod h1:ANbpTX1oAql27TZkKVeW8p1w8NTdnyzPe/0qqPCKohU= -github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de/go.mod h1:xIwEieBHERyEvaeKF/TcHh1Hu+lxPM+n2vT1+g9I4m4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-connlimit v0.2.0/go.mod h1:OUj9FGL1tPIhl/2RCfzYHrIiWj+VVPGNyVPnUX8AqS0= -github.com/hashicorp/go-discover v0.0.0-20191202160150-7ec2cfbda7a2/go.mod h1:NnH5X4UCBEBdTuK2L8s4e4ilJm3UmGX0bANHCz0HSs0= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.2.2 h1:ihRI7YFwcZdiSD7SIenIhHfQH3OuDvWerAUBZbeQS3M= -github.com/hashicorp/go-hclog v1.2.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.3.1 h1:vDwF1DFNZhntP4DAjuTpOw3uEgMUpXh1pB5fW9DqHpo= +github.com/hashicorp/go-hclog v1.3.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.2.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-memdb v1.0.3/go.mod h1:LWQ8R70vPrS4OEY9k28D2z8/Zzyu34NVzeRibGAzHO0= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= @@ -489,13 +434,8 @@ github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHh github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-raftchunking v0.6.1/go.mod h1:cGlg3JtDy7qy6c/3Bu660Mic1JF+7lWqIwCFSb08fX0= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90/go.mod h1:o4zcYY1e0GEZI6eSEr+43QDYmuGglw1qSO6qdHUHCgg= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -504,9 +444,8 @@ github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjG github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -515,52 +454,34 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hil v0.0.0-20160711231837-1e86c6b523c5/go.mod h1:KHvg/R2/dPtaePb16oW4qIyzkMxXOL38xjRN64adsts= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.1.5/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.1.6/go.mod h1:5VDNHjqFMgEcclnwmkCnC99IPwxBmIsxwY8qn+Nl0H4= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.1/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/memberlist v0.4.0 h1:k3uda5gZcltmafuFF+UFqNEl5PrH+yPZ4zkjp1f/H/8= -github.com/hashicorp/memberlist v0.4.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= -github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69/go.mod h1:/z+jUGRBlwVpUZfjute9jWaF6/HuhjuFQuL1YXzVD1Q= -github.com/hashicorp/raft v1.1.1/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= -github.com/hashicorp/raft v1.1.2/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= -github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= -github.com/hashicorp/serf v0.8.2-0.20180907130240-48d579458173/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= +github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= +github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.8.5/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= github.com/hashicorp/serf v0.9.3/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.4/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/serf v0.10.0 h1:89qvvpfMQnz6c2y4pv7j2vUUmeT1+5TSZMexuTbtsPs= -github.com/hashicorp/serf v0.10.0/go.mod h1:bXN03oZc5xlH46k/K1qTrpXb9ERKyY1/i/N5mxvgrZw= -github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= -github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= -github.com/hashicorp/vic v1.5.1-0.20190403131502-bbfe86ec9443/go.mod h1:bEpDU35nTu0ey1EXjwNwPjI9xErAsoOCmcMb9GKvyxo= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= +github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb v1.5.1-0.20180921190457-8d679cf0c36e/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxdb1-client v0.0.0-20200515024757-02f0bf5dbca3/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c h1:qSHzRbhzK8RdXOsAdfDgO49TtqC1oZ+acxPrkfTxcCs= github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da/go.mod h1:ks+b9deReOc7jgqp+e7LuFiCBH6Rm5hL32cLcEAArb4= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= @@ -574,9 +495,7 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/joyent/triton-go v0.0.0-20180628001255-830d2b111e62/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -588,7 +507,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtacoma/uritemplates v1.0.0 h1:xwx5sBF7pPAb0Uj8lDC1Q/aBPpOFyQza7OC705ZlLCo= github.com/jtacoma/uritemplates v1.0.0/go.mod h1:IhIICdE9OcvgUnGwTtJxgBQ+VrTrti5PcbLVSJianO8= -github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -615,7 +533,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= github.com/lestrrat-go/blackmagic v1.0.0/go.mod h1:TNgH//0vYSs8VXDCfkZLgIrVTTXQELZffUV0tz3MtdQ= @@ -640,14 +557,6 @@ github.com/lestrrat/go-jwx v0.0.0-20180221005942-b7d4802280ae/go.mod h1:T+yHdCP6 github.com/lestrrat/go-pdebug v0.0.0-20180220043741-569c97477ae8/go.mod h1:VXFH11P7fHn2iPBsfSW1JacR59rttTcafJnwYcI/IdY= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/likexian/gokit v0.0.0-20190309162924-0a377eecf7aa/go.mod h1:QdfYv6y6qPA9pbBA2qXtoT8BMKha6UyNbxWGWl/9Jfk= -github.com/likexian/gokit v0.0.0-20190418170008-ace88ad0983b/go.mod h1:KKqSnk/VVSW8kEyO2vVCXoanzEutKdlBAPohmGXkxCk= -github.com/likexian/gokit v0.0.0-20190501133040-e77ea8b19cdc/go.mod h1:3kvONayqCaj+UgrRZGpgfXzHdMYCAO0KAt4/8n0L57Y= -github.com/likexian/gokit v0.20.16/go.mod h1:kn+nTv3tqh6yhor9BC4Lfiu58SmH8NmQ2PmEl+uM6nU= -github.com/likexian/simplejson-go v0.0.0-20190409170913-40473a74d76d/go.mod h1:Typ1BfnATYtZ/+/shXfFYLrovhFyuKvzwrdOnIDHlmg= -github.com/likexian/simplejson-go v0.0.0-20190419151922-c1f9f0b4f084/go.mod h1:U4O1vIJvIKwbMZKUJ62lppfdvkCdVd2nfMimHK81eec= -github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b/go.mod h1:3BWwtmKP9cXWwYCr5bkoVDEfLywacOv0s06OBEDpyt8= -github.com/linode/linodego v0.7.1/go.mod h1:ga11n3ivecUrPCHN0rANxKmfWBJVkOXfLMZinAbj2sY= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -659,6 +568,7 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -668,6 +578,7 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -685,16 +596,13 @@ github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.0/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -705,8 +613,6 @@ github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -727,9 +633,7 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= -github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2/go.mod h1:TLb2Sg7HQcgGdloNxkrmtgDNR9uVYF3lfdFIN4Ro6Sk= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -745,8 +649,6 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -765,9 +667,9 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= -github.com/openzipkin/zipkin-go v0.4.0 h1:CtfRrOVZtbDj8rt1WXjklw0kqqJQwICrCKmlfUuBUUw= github.com/openzipkin/zipkin-go v0.4.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ= -github.com/packethost/packngo v0.1.1-0.20180711074735-b9cb5096f54c/go.mod h1:otzZQXgoO96RTzDB/Hycg0qZcXZsWJGJRSXbmEIJ+4M= +github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfPcEO5A= +github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -783,16 +685,12 @@ github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwb github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea/go.mod h1:1VcHEd3ro4QMoHfiNl/j7Jkln9+KQuorp0PItHMJYNg= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20181008045315-2233dee583dc/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= @@ -803,7 +701,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -823,10 +720,10 @@ github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -842,7 +739,6 @@ github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+ github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -857,41 +753,32 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/renier/xmlrpc v0.0.0-20170708154548-ce4a1a486c03/go.mod h1:gRAiPF5C5Nd0eyyRdqIu9qTiFSoZzpTq727b5B8fkkU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rollbar/rollbar-go v1.0.2/go.mod h1:AcFs5f0I+c71bpHlXNNDbOWJiKwjFDtISeXco0L5PKQ= github.com/rubyist/circuitbreaker v2.2.0+incompatible/go.mod h1:Ycs3JgJADPuzJDwffe12k6BZT8hxVi6lFK+gWYJLN4A= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= -github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/ksuid v1.0.2/go.mod h1:BXuJDr2byAiHuQaQtSKoXh1J0YmUDurywOXgB2w+OSU= github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= -github.com/shirou/gopsutil v0.0.0-20181107111621-48177ef5f880/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartystreets/assertions v0.0.0-20180820201707-7c9eb446e3cf/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/softlayer/softlayer-go v0.0.0-20180806151055-260589d94c7d/go.mod h1:Cw4GTlQccdRGSEf6KiMju767x0NEHE0YIVPJSaXjlsw= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -912,13 +799,10 @@ github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb6 github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= -github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= @@ -934,8 +818,9 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.2-0.20180825064932-ef50b0de2877/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -953,8 +838,6 @@ github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= -github.com/tent/http-link-go v0.0.0-20130702225549-ac974c61c2f9/go.mod h1:RHkNRtSLfOK7qBTHaeSX1D6BNpI3qw7NTxsmNr4RvN8= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -968,31 +851,21 @@ github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95 github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/vmware/govmomi v0.18.0/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xmidt-org/argus v0.3.9/go.mod h1:mDFS44R704gl9Fif3gkfAyvnZa53SvMepmXjYWABPvk= -github.com/xmidt-org/argus v0.3.10-0.20201105190057-402fede05764/go.mod h1:lnMCVB/i0gOlUOOd2WbzDDgzTEqP5TipzQ8xKIw+N/I= -github.com/xmidt-org/argus v0.3.10-0.20201217204602-66f69b12c498/go.mod h1:lnMCVB/i0gOlUOOd2WbzDDgzTEqP5TipzQ8xKIw+N/I= -github.com/xmidt-org/argus v0.3.12/go.mod h1:T0oHbqQ1SAjE616Q9f1p+7nsmuvmHNoC0zAIUpUiFuE= -github.com/xmidt-org/argus v0.5.0/go.mod h1:8nMg4ywpWCNPgUzwtWhiPAxklrmVsoxwciGJ/OD4FHE= -github.com/xmidt-org/argus v0.9.2 h1:7p0la++dSgLpVQhzjbLiZwRmGcZd4tYGuvVoYPvO3b4= -github.com/xmidt-org/argus v0.9.2/go.mod h1:GN9JkoDE2iDbJwhfmsLxHt1y6XrsbXgOHDIA4w7eBoo= github.com/xmidt-org/arrange v0.1.9/go.mod h1:PRA8iEZ11L93NsEkDP56x1mZyfDcWxzDULgHj56TaEk= github.com/xmidt-org/arrange v0.3.0 h1:YNO+1lufCx3EeN17xuSRMC1sci9y9rzZVZ+TkWwq9QE= github.com/xmidt-org/arrange v0.3.0/go.mod h1:pCHeb93OFA0QnEJ//Mmly7QqUt7y/w3xllK0VQ3Bigo= -github.com/xmidt-org/bascule v0.8.0/go.mod h1:dPxlbNT3lCwYAtOq2zbzyzTEKgM+azLSbKKcVmgSHBY= -github.com/xmidt-org/bascule v0.8.1/go.mod h1:dPxlbNT3lCwYAtOq2zbzyzTEKgM+azLSbKKcVmgSHBY= github.com/xmidt-org/bascule v0.9.0/go.mod h1:C64nSBtUTTK/f2/mCvvp/qJhav5raD0T+by68DCp/gU= github.com/xmidt-org/bascule v0.10.1/go.mod h1:unqyDUxjulfGFnx4kYWbonTGkVHGWPUjUrBkUi1sjWw= github.com/xmidt-org/bascule v0.11.0 h1:A5RoGFA3XqF7Az1FBF9uEBqhUQ3dLvyhefpS7UkNAvA= github.com/xmidt-org/bascule v0.11.0/go.mod h1:6JnrbmFjVueyUL496MidJYBDotPpuGTGsPOBnCATvQ8= github.com/xmidt-org/candlelight v0.0.5/go.mod h1:j9Q2tzrOAywm+JvvVJjlOmlPJvdlRrOyFjLz33SaU1Y= github.com/xmidt-org/candlelight v0.0.10/go.mod h1:Vy5vSLpwDkphgJ2lOOLBlKOjcgSWq3lA8e0yyVzQCJg= -github.com/xmidt-org/candlelight v0.0.11 h1:nJDD4OBGZPMHreFCsOV+oyQHeI5dHrOY7ehqMRsRo78= -github.com/xmidt-org/candlelight v0.0.11/go.mod h1:2a3m/2kGXG9HC9rtwEh5SiE7fcTOckYPUmma5rKeaQ0= +github.com/xmidt-org/candlelight v0.0.12 h1:euj97KWqR6HSPuLgbtNWWDeJ8AZY8Fbdpp2YRHiCj9c= +github.com/xmidt-org/candlelight v0.0.12/go.mod h1:H8cWj+dum/HH5Pxpd2uUv2C0VuDPKZ50nNQ7CRT4iuA= github.com/xmidt-org/chronon v0.1.1 h1:SzOYkT/nmps3jH4sWu6A52ToKvv5Bu0Gb45/ec5Ty9U= github.com/xmidt-org/chronon v0.1.1/go.mod h1:8VF1skJAouQihpKfXE8oZZkbQpV1TSR/7QltNxq8T4k= github.com/xmidt-org/clortho v0.0.3/go.mod h1:1YypMcDmHVrSqSzpMp4fvwloSKc5PQnHmoaPcKWchHk= @@ -1002,8 +875,6 @@ github.com/xmidt-org/httpaux v0.1.2/go.mod h1:qZnH2uObGPwHnOz8HcPNlbcd3gKEvdmxbI github.com/xmidt-org/httpaux v0.2.1/go.mod h1:mviIlg5fHGb3lAv3l0sbiwVG/q9rqvXaudEYxVrzXdE= github.com/xmidt-org/httpaux v0.3.2 h1:CC8FPiGVtThSRj3fEr9lk2e1bzhhw+l6Vb3BfzfaMG0= github.com/xmidt-org/httpaux v0.3.2/go.mod h1:qmlPisXf80FTi3y4gX43eYbCVruSQyvu+FPx1jzvQG8= -github.com/xmidt-org/sallust v0.1.7-0.20221019165444-b7de762f6db4 h1:VdhWhbClSz7fb5eOBctp12xwcJPaMM7lu+bP+qMTvro= -github.com/xmidt-org/sallust v0.1.7-0.20221019165444-b7de762f6db4/go.mod h1:aF2LY90RejCC3sQaj3VWB9cnWzirxMMaXjbbkisDAD0= github.com/xmidt-org/themis v0.4.4/go.mod h1:0qRYFvKdrQhwjxH/1nAiTgBGT4cegJR76gfEYF5P7so= github.com/xmidt-org/themis v0.4.7/go.mod h1:GlsC/hO9lpZKs6mJNZtbDOf/yDT8tS6NN0k3C+YsWFc= github.com/xmidt-org/themis v0.4.9 h1:SnQnyzGRC5H6Wpf8Z4YsdKYp5vjS5oSRKZQOlcqJaJk= @@ -1014,16 +885,9 @@ github.com/xmidt-org/touchstone v0.1.2 h1:XftgpxlRGvUd+ZSZMzFskgRHwTM7hDYwvCd6Ex github.com/xmidt-org/touchstone v0.1.2/go.mod h1:2xVJVO8FE393Aofw/FD8Cu9wXES4n1AlJP109Nk7/gg= github.com/xmidt-org/webpa-common v1.1.0/go.mod h1:oCpKzOC+9h2vYHVzAU/06tDTQuBN4RZz+rhgIXptpOI= github.com/xmidt-org/webpa-common v1.3.2/go.mod h1:oCpKzOC+9h2vYHVzAU/06tDTQuBN4RZz+rhgIXptpOI= -github.com/xmidt-org/webpa-common v1.10.2-0.20200604164000-f07406b4eb63/go.mod h1:Fmt3wIxBzwJY0KeRHX6RaLZx2xpKTbXCLEA3Xtd6kq8= -github.com/xmidt-org/webpa-common v1.11.2/go.mod h1:BaP0q1tlorm1Egq2qeLelon4Avy9n1eKJQAYhL3Zxg0= github.com/xmidt-org/webpa-common v1.11.4/go.mod h1:ffQHH+pCRnoxtdbyIkCbOSDVhV62X47UA64fugPyu30= -github.com/xmidt-org/webpa-common v1.11.5-0.20210120003553-3d03d7329aee/go.mod h1:NtJzdNhDznwjWiRKDnj/vxdQZnPOhuQ6haemx+nDMSY= github.com/xmidt-org/webpa-common v1.11.5/go.mod h1:jMyROPQmgvNS+P0csPodDMikqesqPFzlb3v/JVw2SmY= -github.com/xmidt-org/webpa-common v1.11.9 h1:whfyOOTAWQmlN6CfowozbbqQfEqo/49MIxV36z/o2gY= github.com/xmidt-org/webpa-common v1.11.9/go.mod h1:lSfUaPF/LA6PCHviTQk1XuTtqvdFcHzyACwdtH94ZfU= -github.com/xmidt-org/wrp-go v1.3.4 h1:7kj+1VXRNNEI7G0Z3z7C58QpIXrWzTw/eI79FdAhyPA= -github.com/xmidt-org/wrp-go v1.3.4/go.mod h1:EWC9BgcYYO1hKgLzz6VFPpg3LU6ZWSDV/uNiWC7zP+o= -github.com/xmidt-org/wrp-go/v2 v2.0.1/go.mod h1:v0HK0go/7OSVDvKbnXsUn6c+M987p0yyxWEs8/Fmf60= github.com/xmidt-org/wrp-go/v3 v3.0.1/go.mod h1:08zAEevd+fM81/asCgsMJdgO8sfKLvqclqJGX1pphnE= github.com/xmidt-org/wrp-go/v3 v3.1.4 h1:ug5U3h4NkEtZVu49Ff5leVh+AMlNN8JA6jcOBb6lsAQ= github.com/xmidt-org/wrp-go/v3 v3.1.4/go.mod h1:ZJmcF+K7oKYivfTVlqi4njph+PxQj3WNWL1AqN2bdCw= @@ -1033,7 +897,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= @@ -1054,7 +917,6 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib v0.19.0 h1:x6Josyb/V+aDHg6IozzmZMaOhE+0Jb2NvEAM4/0Gftc= go.opentelemetry.io/contrib v0.19.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.19.0/go.mod h1:ze4w2zyQP+FvZjaahHaUVD7h4razLhDOsZD3qFKXc3c= go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.36.1/go.mod h1:XU1EB47dq4JIrePPJWy6DrqTZcMSA93K+NWaEIx0qYU= @@ -1062,47 +924,52 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.19.0/go.mod h1: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.1/go.mod h1:W6/Lb2w3nD2K/l+4SzaqJUr2Ibj2uHA+PdFZlO5cWus= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.3 h1:SGz6Fnp7blR+sskRZkyuFDb3qI1d8I0ygLh13F+sw6I= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.3/go.mod h1:+OXcluxum2GicWQ9lMXLQkLkOWoaw20OrVbYq6kkPks= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 h1:aUEBEdCa6iamGzg6fuYxDA8ThxvOG240mAvWDU+XLio= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4/go.mod h1:l2MdsbKTocpPS5nQZscqTR9jd8u96VYZdcpF8Sye7mA= go.opentelemetry.io/contrib/propagators v0.19.0/go.mod h1:4QOdZClXISU5S43xZxk5tYaWcpb+lehqfKtE6PK6msE= go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg= go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= -go.opentelemetry.io/otel v1.11.0 h1:kfToEGMDq6TrVrJ9Vht84Y8y9enykSZzDDZglV0kIEk= -go.opentelemetry.io/otel v1.11.0/go.mod h1:H2KtuEphyMvlhZ+F7tg9GRhAOe60moNx61Ex+WmiKkk= +go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= +go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= go.opentelemetry.io/otel/exporters/jaeger v1.7.0/go.mod h1:PwQAOqBgqbLQRKlj466DuD2qyMjbtcPpfPfj+AqbSBs= go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs= -go.opentelemetry.io/otel/exporters/jaeger v1.10.0 h1:7W3aVVjEYayu/GOqOVF4mbTvnCuxF1wWu3eRxFGQXvw= go.opentelemetry.io/otel/exporters/jaeger v1.10.0/go.mod h1:n9IGyx0fgyXXZ/i0foLHNxtET9CzXHzZeKCucvRBFgA= -go.opentelemetry.io/otel/exporters/stdout v0.19.0 h1:6+QJvepCJ/YS3rOlsnjhVo527ohlPowOBgsZThR9Hoc= +go.opentelemetry.io/otel/exporters/jaeger v1.11.1 h1:F9Io8lqWdGyIbY3/SOGki34LX/l+7OL0gXNxjqwcbuQ= +go.opentelemetry.io/otel/exporters/jaeger v1.11.1/go.mod h1:lRa2w3bQ4R4QN6zYsDgy7tEezgoKEu7Ow2g35Y75+KI= go.opentelemetry.io/otel/exporters/stdout v0.19.0/go.mod h1:UI2JnNRaSt9ChIHkk4+uqieH27qKt9isV9e2qRorCtg= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.7.0/go.mod h1:K4GDXPY6TjUiwbOh+DkKaEdCF8y+lvMoM6SeAPyfCCM= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.9.0/go.mod h1:Fl1iS5ZhWgXXXTdJMuBSVsS5nkL5XluHbg97kjOuYU4= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.10.0 h1:c9UtMu/qnbLlVwTwt+ABrURrioEruapIslTDYZHJe2w= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.10.0/go.mod h1:h3Lrh9t3Dnqp3NPwAZx7i37UFX7xrfnO1D+fuClREOA= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.1 h1:3Yvzs7lgOw8MmbxmLRsQGwYdCubFmUHSooKaEhQunFQ= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.1/go.mod h1:pyHDt0YlyuENkD2VwHsiRDf+5DfI3EH7pfhUYW6sQUE= go.opentelemetry.io/otel/exporters/trace/jaeger v0.19.0/go.mod h1:BliRm9d7rH44N6CzBQ0OPEPfMqSzf4WvFFvyoocOW9Y= go.opentelemetry.io/otel/exporters/trace/zipkin v0.19.0/go.mod h1:ONsRnXqWLUtdSaLOziKSCaw3r20gFBhnXr8rj6L9cZQ= go.opentelemetry.io/otel/exporters/zipkin v1.7.0/go.mod h1:9YBXeOMFLQGwNEjsxMRiWPGoJX83usGMhbCmxUbNe5I= go.opentelemetry.io/otel/exporters/zipkin v1.9.0/go.mod h1:HyIvYIu37wV4Wx5azd7e05x9k/dOz9KB4x0plw2QNvs= -go.opentelemetry.io/otel/exporters/zipkin v1.10.0 h1:HcPAFsFpEBKF+G5NIOA+gBsxifd3Ej+wb+KsdBLa15E= go.opentelemetry.io/otel/exporters/zipkin v1.10.0/go.mod h1:HdfvgwcOoCB0+zzrTHycW6btjK0zNpkz2oTGO815SCI= +go.opentelemetry.io/otel/exporters/zipkin v1.11.1 h1:JlJ3/oQoyqlrPDCfsSVFcHgGeHvZq+hr1VPWtiYCXTo= +go.opentelemetry.io/otel/exporters/zipkin v1.11.1/go.mod h1:T4S6aVwIS1+MHA+dJHCcPROtZe6ORwnv5vMKPRapsFw= go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc= go.opentelemetry.io/otel/metric v0.32.1/go.mod h1:iLPP7FaKMAD5BIxJ2VX7f2KTuz//0QK2hEUyti5psqQ= -go.opentelemetry.io/otel/metric v0.32.3 h1:dMpnJYk2KULXr0j8ph6N7+IcuiIQXlPXD4kix9t7L9c= -go.opentelemetry.io/otel/metric v0.32.3/go.mod h1:pgiGmKohxHyTPHGOff+vrtIH39/R9fiO/WoenUQ3kcc= +go.opentelemetry.io/otel/metric v0.33.0 h1:xQAyl7uGEYvrLAiV/09iTJlp1pZnQ9Wl793qbVvED1E= +go.opentelemetry.io/otel/metric v0.33.0/go.mod h1:QlTYc+EnYNq/M2mNk1qDDMRLpqCOj2f/r5c7Fd5FYaI= go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA= go.opentelemetry.io/otel/sdk v0.19.0/go.mod h1:ouO7auJYMivDjywCHA6bqTI7jJMVQV1HdKR5CmH8DGo= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= -go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY= go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE= +go.opentelemetry.io/otel/sdk v1.11.1 h1:F7KmQgoHljhUuJyA+9BiU+EkJfyX5nVVF4wyzWZpKxs= +go.opentelemetry.io/otel/sdk v1.11.1/go.mod h1:/l3FE4SupHJ12TduVjUkZtlfFqDCQJlOlithYrdktys= go.opentelemetry.io/otel/sdk/export/metric v0.19.0/go.mod h1:exXalzlU6quLTXiv29J+Qpj/toOzL3H5WvpbbjouTBo= go.opentelemetry.io/otel/sdk/metric v0.19.0/go.mod h1:t12+Mqmj64q1vMpxHlCGXGggo0sadYxEG6U+Us/9OA4= go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= -go.opentelemetry.io/otel/trace v1.11.0 h1:20U/Vj42SX+mASlXLmSGBg6jpI1jQtv682lZtTAOVFI= -go.opentelemetry.io/otel/trace v1.11.0/go.mod h1:nyYjis9jy0gytE9LXGU+/m1sHTKbRY0fX0hulNNDP1U= +go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ= +go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1113,14 +980,12 @@ go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/dig v1.7.0/go.mod h1:z+dSd2TP9Usi48jL8M3v63iSBVkiwtVyMKxMZYYauPg= -go.uber.org/dig v1.9.0/go.mod h1:X34SnWGr8Fyla9zQNO2GSO2D+TIuqB14OS8JhYocIyw= go.uber.org/dig v1.10.0/go.mod h1:X34SnWGr8Fyla9zQNO2GSO2D+TIuqB14OS8JhYocIyw= go.uber.org/dig v1.14.0/go.mod h1:jHAn/z1Ld1luVVyGKOAIFYz/uBFqKjjEEdIqVAqfQ2o= go.uber.org/dig v1.14.1/go.mod h1:52EKx/Vjdpz9EzeNcweC4YMsTrDdFn9mS/+Uw5ZnVTI= go.uber.org/dig v1.15.0 h1:vq3YWr8zRj1eFGC7Gvf907hE0eRjPTZ1d3xHadD6liE= go.uber.org/dig v1.15.0/go.mod h1:pKHs0wMynzL6brANhB2hLMro+zalv1osARTviTcqHLM= go.uber.org/fx v1.9.0/go.mod h1:mFdUyAUuJ3w4jAckiKSKbldsxy1ojpAMJ+dVZg5Y0Aw= -go.uber.org/fx v1.12.0/go.mod h1:egT3Kyg1JFYQkvKLZ3EsykxkNrZxgXS+gKoKo7abERY= go.uber.org/fx v1.13.0/go.mod h1:bREWhavnedxpJeTq9pQT53BbvwhUv7TcpsOqcH4a+3w= go.uber.org/fx v1.13.1/go.mod h1:bREWhavnedxpJeTq9pQT53BbvwhUv7TcpsOqcH4a+3w= go.uber.org/fx v1.17.1/go.mod h1:yO7KN5rhlARljyo4LR047AjaV6J+KFzd/Z7rnTbEn0A= @@ -1159,7 +1024,6 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1169,15 +1033,15 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b h1:huxqepDufQpLLIRXiVkTvnxrzJlpwmIWAObmcCcUFr0= golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1205,7 +1069,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -1218,8 +1081,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1283,10 +1146,8 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c h1:JVAXQ10yGGVbSyoer5VILysz6YKjdNT2bsvlayjqhes= -golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/oauth2 v0.0.0-20170807180024-9a379c6b3e95/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1321,7 +1182,6 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1330,18 +1190,14 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1427,10 +1283,10 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221006211917-84dc82d7e875/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= @@ -1440,14 +1296,14 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1527,6 +1383,8 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1538,7 +1396,6 @@ gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJ gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.0.0-20180829000535-087779f1d2c9/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1589,7 +1446,6 @@ google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1668,15 +1524,12 @@ google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -1725,9 +1578,7 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0/go.mod h1:OdE7CF6DbADk7lN8LIKRzRJTTZXIjtWgA5THM5lhBAw= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1738,7 +1589,6 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -1750,7 +1600,6 @@ gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -1776,13 +1625,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -istio.io/gogo-genproto v0.0.0-20190124151557-6d926a6e6feb/go.mod h1:eIDJ6jNk/IeJz6ODSksHl5Aiczy5JUq6vFhJWI5OtiI= -k8s.io/api v0.0.0-20180806132203-61b11ee65332/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/api v0.0.0-20190325185214-7544f9db76f6/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/apimachinery v0.0.0-20180821005732-488889b0007f/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apimachinery v0.0.0-20190223001710-c182ff3b9841/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/client-go v8.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= From dc71abfda5c091f0472ea5566279981ffbbfc9ac Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Fri, 21 Oct 2022 15:06:11 -0400 Subject: [PATCH 05/48] Update go.sum --- go.sum | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/go.sum b/go.sum index ea26be0d..a250e65a 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,6 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.44.113/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.119 h1:TPkpDsanBMcZaF5wHwpKhjkapRV/b7d2qdC+a+IPbmY= -github.com/aws/aws-sdk-go v1.44.119/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.44.120 h1:dsOxGf17H9hCVCA4aWpFWEcJMHkX+Uw7l4pGcxb27wM= github.com/aws/aws-sdk-go v1.44.120/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= @@ -142,7 +140,6 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -546,7 +543,6 @@ github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbq github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI= github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= github.com/lestrrat-go/jwx v0.9.2/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/YNA/UnBk= -github.com/lestrrat-go/jwx v1.2.25 h1:tAx93jN2SdPvFn08fHNAhqFJazn5mBBOB8Zli0g0otA= github.com/lestrrat-go/jwx v1.2.25/go.mod h1:zoNuZymNl5lgdcu6P7K6ie2QRll5HVfF4xwxBBK1NxY= github.com/lestrrat-go/jwx/v2 v2.0.5/go.mod h1:Wot5JT7sGDorqS+dBi6Cfu6MzsDZP+sAOnQbOJ8rpIA= github.com/lestrrat-go/jwx/v2 v2.0.6 h1:RlyYNLV892Ed7+FTfj1ROoF6x7WxL965PGTHso/60G0= @@ -568,7 +564,6 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -578,7 +573,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -843,7 +837,6 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= @@ -922,8 +915,6 @@ go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.19 go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.36.1/go.mod h1:XU1EB47dq4JIrePPJWy6DrqTZcMSA93K+NWaEIx0qYU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.19.0/go.mod h1:7RDsakVbjb124lYDEjKuHTuzdqf04hLMEvPv/ufmqMs= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.1/go.mod h1:W6/Lb2w3nD2K/l+4SzaqJUr2Ibj2uHA+PdFZlO5cWus= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.3 h1:SGz6Fnp7blR+sskRZkyuFDb3qI1d8I0ygLh13F+sw6I= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.3/go.mod h1:+OXcluxum2GicWQ9lMXLQkLkOWoaw20OrVbYq6kkPks= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 h1:aUEBEdCa6iamGzg6fuYxDA8ThxvOG240mAvWDU+XLio= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4/go.mod h1:l2MdsbKTocpPS5nQZscqTR9jd8u96VYZdcpF8Sye7mA= go.opentelemetry.io/contrib/propagators v0.19.0/go.mod h1:4QOdZClXISU5S43xZxk5tYaWcpb+lehqfKtE6PK6msE= @@ -1180,8 +1171,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1381,8 +1372,6 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From f311b5b901c5035be3e1baf6e40b16dddd101ae6 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Mon, 24 Oct 2022 09:24:55 -0400 Subject: [PATCH 06/48] remove bookkeeping package --- bookkeeping/bookkeeper_test.go | 91 ----------- bookkeeping/requestResponse.go | 102 ------------ bookkeeping/requestResponse_test.go | 245 ---------------------------- 3 files changed, 438 deletions(-) delete mode 100644 bookkeeping/bookkeeper_test.go delete mode 100644 bookkeeping/requestResponse.go delete mode 100644 bookkeeping/requestResponse_test.go diff --git a/bookkeeping/bookkeeper_test.go b/bookkeeping/bookkeeper_test.go deleted file mode 100644 index 1de0b1f6..00000000 --- a/bookkeeping/bookkeeper_test.go +++ /dev/null @@ -1,91 +0,0 @@ -package bookkeeping - -import ( - "net/http" - "net/http/httptest" - "testing" - - gokithttp "github.com/go-kit/kit/transport/http" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" - "github.com/xmidt-org/webpa-common/v2/logging/logginghttp" - "github.com/xmidt-org/webpa-common/v2/xhttp/xcontext" -) - -func TestEmptyBookkeeper(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - transactorCalled = false - - bookkeeper = New() - logger = logging.NewCaptureLogger() - ) - require.NotNil(bookkeeper) - req := httptest.NewRequest("GET", "/", nil) - req = req.WithContext(logging.WithLogger(req.Context(), logger)) - - handler := http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { - transactorCalled = true - writer.Write([]byte("payload")) - writer.WriteHeader(200) - }) - rr := httptest.NewRecorder() - - bookkeeper(handler).ServeHTTP(rr, req) - assert.True(transactorCalled) - - select { - case result := <-logger.Output(): - assert.Len(result, 4) - default: - assert.Fail("CaptureLogger must capture something") - - } -} - -func TestBookkeeper(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - transactorCalled = false - - bookkeeper = New(WithResponses(Code)) - logger = logging.NewCaptureLogger() - ) - - require.NotNil(bookkeeper) - req := httptest.NewRequest("GET", "/", nil) - - req = req.WithContext(zap.WithLogger(req.Context(), logger)) - - rr := httptest.NewRecorder() - - customLogInfo := xcontext.Populate( - logginghttp.SetLogger(logger, - logginghttp.RequestInfo, - ), - gokithttp.PopulateRequestContext, - ) - - handler := http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { - transactorCalled = true - writer.Write([]byte("payload")) - writer.WriteHeader(200) - }) - - bookkeeper(customLogInfo(handler)).ServeHTTP(rr, req) - - assert.True(transactorCalled) - - select { - case result := <-logger.Output(): - assert.Len(result, 8) - assert.Equal(req.RequestURI, result["requestURI"]) - assert.Equal(200, result["code"]) - default: - assert.Fail("CaptureLogger must capture something") - - } -} diff --git a/bookkeeping/requestResponse.go b/bookkeeping/requestResponse.go deleted file mode 100644 index e0ae8848..00000000 --- a/bookkeeping/requestResponse.go +++ /dev/null @@ -1,102 +0,0 @@ -package bookkeeping - -import ( - "io/ioutil" - "net/http" - "net/textproto" - "strings" - - "github.com/xmidt-org/webpa-common/v2/xhttp" -) - -func Code(response CapturedResponse) []interface{} { - return []interface{}{"code", response.Code} -} - -func RequestBody(request *http.Request) []interface{} { - err := xhttp.EnsureRewindable(request) - if err != nil { - return []interface{}{} - } - data, err := ioutil.ReadAll(request.Body) - request.Body.Close() - if err != nil { - return []interface{}{} - } - xhttp.Rewind(request) - if len(data) == 0 { - return []interface{}{"req-body", "empty body"} - } - return []interface{}{"req-body", string(data)} - -} - -func ResponseBody(response CapturedResponse) []interface{} { - if response.Payload == nil { - return []interface{}{"res-body", "empty body"} - } - - return []interface{}{"res-body", string(response.Payload)} - -} - -func RequestHeaders(headers ...string) RequestFunc { - canonicalizedHeaders := getCanoicalizedHeaders(headers...) - return func(request *http.Request) []interface{} { - return parseHeader(request.Header, canonicalizedHeaders) - } -} - -func ResponseHeaders(headers ...string) ResponseFunc { - canonicalizedHeaders := getCanoicalizedHeaders(headers...) - return func(response CapturedResponse) []interface{} { - return parseHeader(response.Header, canonicalizedHeaders) - } -} - -func getCanoicalizedHeaders(headers ...string) []string { - canonicalizedHeaders := make([]string, len(headers)) - for i := 0; i < len(headers); i++ { - canonicalizedHeaders[i] = textproto.CanonicalMIMEHeaderKey(headers[i]) - } - return canonicalizedHeaders -} - -func parseHeader(header http.Header, canonicalizedHeaders []string) []interface{} { - kv := make([]interface{}, 0) - for _, key := range canonicalizedHeaders { - if values := header[key]; len(values) > 0 { - kv = append(kv, key, values) - } - } - return kv -} - -func parseHeaderWithPrefix(header http.Header, canonicalizedHeaders []string) []interface{} { - kv := make([]interface{}, 0) - for _, prefix := range canonicalizedHeaders { - for key, results := range header { - if strings.HasPrefix(key, prefix) && len(results) > 0 { - kv = append(kv, key, results) - } - } - } - return kv -} - -func RequestHeadersWithPrefix(headers ...string) RequestFunc { - canonicalizedHeaders := getCanoicalizedHeaders(headers...) - return func(request *http.Request) []interface{} { - if request == nil { - return []interface{}{} - } - return parseHeaderWithPrefix(request.Header, canonicalizedHeaders) - } -} - -func ResponseHeadersWithPrefix(headers ...string) ResponseFunc { - canonicalizedHeaders := getCanoicalizedHeaders(headers...) - return func(response CapturedResponse) []interface{} { - return parseHeaderWithPrefix(response.Header, canonicalizedHeaders) - } -} diff --git a/bookkeeping/requestResponse_test.go b/bookkeeping/requestResponse_test.go deleted file mode 100644 index b8cc49ee..00000000 --- a/bookkeeping/requestResponse_test.go +++ /dev/null @@ -1,245 +0,0 @@ -package bookkeeping - -import ( - "fmt" - "net/http" - "net/http/httptest" - "reflect" - "strconv" - "strings" - "testing" - - "github.com/davecgh/go-spew/spew" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func testHeaders(t *testing.T, originalHeader http.Header, headersToCopy []string, expectedKeyValues []interface{}) { - var ( - assert = assert.New(t) - require = require.New(t) - - request = &http.Request{ - Header: originalHeader, - } - - rf = RequestHeaders(headersToCopy...) - ) - - require.NotNil(rf) - returnedKeyValuePair := rf(request) - assert.Equal(expectedKeyValues, returnedKeyValuePair) -} - -func TestBookkeepingHeaders(t *testing.T) { - testData := []struct { - originalHeader http.Header - headersToCopy []string - expectedResponse []interface{} - }{ - { - http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}, - nil, - []interface{}{}, - }, - { - http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}, - []string{"X-Does-Not-Exist"}, - []interface{}{}, - }, - { - http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}, - []string{"X-Does-Not-Exist", "X-Test-1"}, - []interface{}{"X-Test-1", []string{"foo"}}, - }, - { - http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}, - []string{"X-Does-Not-Exist", "x-test-1"}, - []interface{}{"X-Test-1", []string{"foo"}}, - }, - { - http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}, - []string{"X-Test-1"}, - []interface{}{"X-Test-1", []string{"foo"}}, - }, - { - http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}, - []string{"X-Test-3", "X-Test-1"}, - []interface{}{"X-Test-1", []string{"foo"}}, - }, - { - http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}, - []string{"x-TeST-3", "X-tESt-1"}, - []interface{}{"X-Test-1", []string{"foo"}}, - }, - { - http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}, - []string{"X-Test-3", "X-Test-1", "X-Test-2"}, - []interface{}{"X-Test-1", []string{"foo"}, "X-Test-2", []string{"foo", "bar"}}, - }, - { - http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}, - []string{"X-TEST-3", "x-TEsT-1", "x-TesT-2"}, - []interface{}{"X-Test-1", []string{"foo"}, "X-Test-2", []string{"foo", "bar"}}, - }, - } - - for i, record := range testData { - t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { - t.Logf("%#v", record) - testHeaders(t, record.originalHeader, record.headersToCopy, record.expectedResponse) - }) - } -} - -func testReturnHeadersWithPrefix(t *testing.T, request *http.Request, headerPrefixToCopy []string, expectedKV []interface{}) { - var ( - require = require.New(t) - rf = RequestHeadersWithPrefix(headerPrefixToCopy...) - ) - - require.NotNil(rf) - kv := rf(request) - - f := func(i []interface{}, c chan<- map[string]interface{}) { - m := make(map[string]interface{}) - for _, v := range i { - m["test"] = v - } - - c <- m - } - - c1, c2 := make(chan map[string]interface{}), make(chan map[string]interface{}) - go f(kv, c1) - go f(expectedKV, c2) - - kvMap, expectedkvMap := <-c1, <-c2 - - if ok := reflect.DeepEqual(expectedKV, kv); !ok { - t.Errorf("\nExpecting: %v\n but got: %v\n", spew.Sdump(expectedkvMap), spew.Sdump(kvMap)) - } -} - -func TestReturnHeadersWithPrefix(t *testing.T) { - testData := []struct { - request *http.Request - prefixs []string - expectedKV []interface{} - }{ - { - nil, - nil, - []interface{}{}, - }, - { - &http.Request{}, - nil, - []interface{}{}, - }, - { - &http.Request{Header: http.Header{"X-Test-1": []string{"foo"}}}, - nil, - []interface{}{}, - }, - { - &http.Request{Header: http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}}, - []string{"X-Does-Not-Exist"}, - []interface{}{}, - }, - { - &http.Request{Header: http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}}, - []string{"X-Does-Not-Exist", "X-Test-1"}, - []interface{}{"X-Test-1", []string{"foo"}}, - }, - { - &http.Request{Header: http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}}, - []string{"X-Does-Not-Exist", "x-TeSt-1"}, - []interface{}{"X-Test-1", []string{"foo"}}, - }, - { - &http.Request{Header: http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}}, - []string{"X-Test-3", "X-Test-1"}, - []interface{}{"X-Test-1", []string{"foo"}}, - }, - { - &http.Request{Header: http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}}, - []string{"x-TeST-3", "X-tESt-1"}, - []interface{}{"X-Test-1", []string{"foo"}}, - }, - { - &http.Request{Header: http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}}, - []string{"X-Test-3", "X-Test-1", "X-Test-2"}, - []interface{}{"X-Test-1", []string{"foo"}, "X-Test-2", []string{"foo", "bar"}}, - }, - { - &http.Request{Header: http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}}, - []string{"X-TEST-3", "x-TEsT-1", "x-TesT-2"}, - []interface{}{"X-Test-1", []string{"foo"}, "X-Test-2", []string{"foo", "bar"}}, - }, - { - &http.Request{Header: http.Header{"X-Test-1": []string{"foo"}, "X-Test-2": []string{"foo", "bar"}, "X-Test-3": []string{}}}, - []string{"X-TEST"}, - []interface{}{"X-Test-1", []string{"foo"}, "X-Test-2", []string{"foo", "bar"}}, - }, - } - - for i, record := range testData { - t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { - t.Logf("%#v", record) - testReturnHeadersWithPrefix(t, record.request, record.prefixs, record.expectedKV) - }) - } -} - -func testRequestBody(t *testing.T, request *http.Request, expectedKV []interface{}) { - assert := assert.New(t) - - var kv []interface{} - assert.NotPanics(func() { - kv = RequestBody(request) - }) - assert.Equal(expectedKV, kv) -} - -func TestRequestBody(t *testing.T) { - testData := []struct { - request *http.Request - expected []interface{} - }{ - {httptest.NewRequest("POST", "http://foobar.com:8080", nil), []interface{}{"req-body", "empty body"}}, - {httptest.NewRequest("POST", "http://foobar.com:8080", strings.NewReader("payload")), []interface{}{"req-body", "payload"}}, - } - for i, record := range testData { - t.Run(strconv.Itoa(i), func(t *testing.T) { - t.Logf("%#v", record) - testRequestBody(t, record.request, record.expected) - }) - } -} - -func testResponseBody(t *testing.T, response CapturedResponse, expectedKV []interface{}) { - assert := assert.New(t) - - var kv []interface{} - assert.NotPanics(func() { - kv = ResponseBody(response) - }) - assert.Equal(expectedKV, kv) -} - -func TestResponseBody(t *testing.T) { - testData := []struct { - response CapturedResponse - expected []interface{} - }{ - {CapturedResponse{}, []interface{}{"res-body", "empty body"}}, - {CapturedResponse{Payload: []byte("payload")}, []interface{}{"res-body", "payload"}}, - } - for i, record := range testData { - t.Run(strconv.Itoa(i), func(t *testing.T) { - t.Logf("%#v", record) - testResponseBody(t, record.response, record.expected) - }) - } -} From 3fe9bff543c6d2f1b380d4f152af6d2f28c08c5c Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Mon, 24 Oct 2022 09:25:13 -0400 Subject: [PATCH 07/48] update device logging --- device/rehasher/rehasher_test.go | 16 ++++++++-------- device/viper_test.go | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/device/rehasher/rehasher_test.go b/device/rehasher/rehasher_test.go index fc2dafaa..f7de3c5a 100644 --- a/device/rehasher/rehasher_test.go +++ b/device/rehasher/rehasher_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/device" - "github.com/xmidt-org/webpa-common/v2/logging" "github.com/xmidt-org/webpa-common/v2/service" "github.com/xmidt-org/webpa-common/v2/service/monitor" "github.com/xmidt-org/webpa-common/v2/xmetrics/xmetricstest" @@ -78,7 +78,7 @@ func testNewNilMetricsProvider(t *testing.T) { r = New( connector, []string{"talaria"}, - WithLogger(logging.NewTestLogger(nil, t)), + WithLogger(sallust.Default()), WithIsRegistered(isRegistered), WithMetricsProvider(nil), ) @@ -112,7 +112,7 @@ func testRehasherServiceDiscoveryError(t *testing.T) { r = New( connector, []string{"talaria", "caduceus"}, - WithLogger(logging.NewTestLogger(nil, t)), + WithLogger(sallust.Default()), WithIsRegistered(isRegistered), WithMetricsProvider(provider), ) @@ -150,7 +150,7 @@ func testRehasherServiceDiscoveryStopped(t *testing.T) { r = New( connector, []string{"caduceus"}, - WithLogger(logging.NewTestLogger(nil, t)), + WithLogger(sallust.Default()), WithIsRegistered(isRegistered), WithMetricsProvider(provider), ) @@ -188,7 +188,7 @@ func testRehasherInitialEvent(t *testing.T) { r = New( connector, []string{"talaria"}, - WithLogger(logging.NewTestLogger(nil, t)), + WithLogger(sallust.Default()), WithIsRegistered(isRegistered), WithMetricsProvider(provider), ) @@ -222,7 +222,7 @@ func testRehasherSkippedService(t *testing.T) { r = New( connector, []string{"caduceus"}, - WithLogger(logging.NewTestLogger(nil, t)), + WithLogger(sallust.Default()), WithIsRegistered(isRegistered), WithMetricsProvider(provider), ) @@ -260,7 +260,7 @@ func testRehasherNoInstances(t *testing.T) { r = New( connector, []string{"caduceus"}, - WithLogger(logging.NewTestLogger(nil, t)), + WithLogger(sallust.Default()), WithIsRegistered(isRegistered), WithMetricsProvider(provider), ) @@ -340,7 +340,7 @@ func testRehasherRehash(t *testing.T) { r = New( connector, []string{"talaria", "caduceus"}, - WithLogger(logging.NewTestLogger(nil, t)), + WithLogger(sallust.Default()), WithIsRegistered(isRegistered), WithAccessorFactory(accessorFactory), WithMetricsProvider(provider), diff --git a/device/viper_test.go b/device/viper_test.go index 9fc2cbdd..5a4d0a84 100644 --- a/device/viper_test.go +++ b/device/viper_test.go @@ -7,14 +7,14 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func TestNewOptions(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.DefaultLogger() + logger = sallust.Default() configuration = `{ "device": { "manager": { @@ -45,7 +45,7 @@ func TestNewOptionsUnmarshalError(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.DefaultLogger() + logger = sallust.Default() configuration = `{ "device": { "manager": { @@ -71,7 +71,7 @@ func TestNewOptionsNilViper(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.DefaultLogger() + logger = sallust.Default() ) o, err := NewOptions(logger, nil) From 03fd475bb5be0de7191a69ee73ed624f90aa1c13 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Mon, 24 Oct 2022 09:25:26 -0400 Subject: [PATCH 08/48] update health tests --- health/health_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/health/health_test.go b/health/health_test.go index 87e8e91d..93b5cd48 100644 --- a/health/health_test.go +++ b/health/health_test.go @@ -11,14 +11,14 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) // setupHealth supplies a Health object with useful test configuration func setupHealth(t *testing.T) *Health { return New( time.Duration(69)*time.Second, - logging.NewTestLogger(nil, t), + sallust.Default(), ) } From b6fd603686fafc60d434f2c618ff9fe1fb1a291e Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 25 Oct 2022 11:10:38 -0400 Subject: [PATCH 09/48] remove logging package --- logging/captureLogger.go | 47 ------ logging/captureLogger_test.go | 41 ------ logging/logginghttp/setLogger.go | 113 -------------- logging/logginghttp/setLogger_test.go | 202 -------------------------- 4 files changed, 403 deletions(-) delete mode 100644 logging/captureLogger.go delete mode 100644 logging/captureLogger_test.go delete mode 100644 logging/logginghttp/setLogger.go delete mode 100644 logging/logginghttp/setLogger_test.go diff --git a/logging/captureLogger.go b/logging/captureLogger.go deleted file mode 100644 index 643641af..00000000 --- a/logging/captureLogger.go +++ /dev/null @@ -1,47 +0,0 @@ -package logging - -import ( - "fmt" - - "github.com/go-kit/kit/log" -) - -// CaptureLogger is a go-kit Logger which dispatches log key/value pairs to a channel -// for test assertions and verifications. Primarily useful for test code. -// -// The Log method of this type will panic if the number of key/value pairs is not odd, which -// is appropriate for test code. -type CaptureLogger interface { - log.Logger - - // Output returns the channel on which each log event is recorded as a map of key/value pairs - Output() <-chan map[interface{}]interface{} -} - -type captureLogger struct { - output chan map[interface{}]interface{} -} - -func (cl *captureLogger) Output() <-chan map[interface{}]interface{} { - return cl.output -} - -func (cl *captureLogger) Log(kv ...interface{}) error { - if len(kv)%2 != 0 { - panic(fmt.Errorf("Invalid key/value count: %d", len(kv))) - } - - m := make(map[interface{}]interface{}, len(kv)/2) - for i := 0; i < len(kv); i += 2 { - m[kv[i]] = kv[i+1] - } - - cl.output <- m - return nil -} - -func NewCaptureLogger() CaptureLogger { - return &captureLogger{ - output: make(chan map[interface{}]interface{}, 10), - } -} diff --git a/logging/captureLogger_test.go b/logging/captureLogger_test.go deleted file mode 100644 index 9e548d18..00000000 --- a/logging/captureLogger_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package logging - -import ( - "errors" - "testing" - - "github.com/go-kit/kit/log/level" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestCaptureLogger(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - - expectedMessage = "a message" - expectedError = errors.New("an error") - - logger = NewCaptureLogger() - ) - - require.NotNil(logger) - output := logger.Output() - require.NotNil(output) - - assert.Panics(func() { - logger.Log("oops") - }) - - logger.Log(level.Key(), level.ErrorValue(), MessageKey(), expectedMessage, ErrorKey(), expectedError, "count", 12, "name", "foobar") - m := <-output - require.NotNil(m) - - assert.Len(m, 5) - assert.Equal(level.ErrorValue(), m[level.Key()]) - assert.Equal(expectedMessage, m[MessageKey()]) - assert.Equal(expectedError, m[ErrorKey()]) - assert.Equal(12, m["count"]) - assert.Equal("foobar", m["name"]) -} diff --git a/logging/logginghttp/setLogger.go b/logging/logginghttp/setLogger.go deleted file mode 100644 index 361c5149..00000000 --- a/logging/logginghttp/setLogger.go +++ /dev/null @@ -1,113 +0,0 @@ -package logginghttp - -import ( - "context" - "net/http" - "net/textproto" - - "github.com/go-kit/kit/log" - "github.com/gorilla/mux" - "github.com/xmidt-org/webpa-common/v2/logging" -) - -var ( - requestMethodKey interface{} = "requestMethod" - requestURIKey interface{} = "requestURI" - remoteAddrKey interface{} = "remoteAddr" -) - -// RequestMethodKey returns the contextual logging key for an HTTP request's method -func RequestMethodKey() interface{} { - return requestMethodKey -} - -// RequestURIKey returns the contextual logging key for an HTTP request's unmodified URI -func RequestURIKey() interface{} { - return requestURIKey -} - -// RemoteAddr returns the contextual logging key for an HTTP request's remote address, -// as filled in by the enclosing http.Server. -func RemoteAddrKey() interface{} { - return remoteAddrKey -} - -// LoggerFunc is a strategy for adding key/value pairs (possibly) based on an HTTP request. -// Functions of this type must append key/value pairs to the supplied slice and then return -// the new slice. -type LoggerFunc func([]interface{}, *http.Request) []interface{} - -// RequestInfo is a LoggerFunc that adds the request information described by logging keys in this package. -func RequestInfo(kv []interface{}, request *http.Request) []interface{} { - return append(kv, - requestMethodKey, request.Method, - requestURIKey, request.RequestURI, - remoteAddrKey, request.RemoteAddr, - ) - -} - -// Header returns a logger func that extracts the value of a header and inserts it as the -// value of a logging key. If the header is not present in the request, a blank string -// is set as the logging key's value. -func Header(headerName, keyName string) LoggerFunc { - headerName = textproto.CanonicalMIMEHeaderKey(headerName) - - return func(kv []interface{}, request *http.Request) []interface{} { - values := request.Header[headerName] - switch len(values) { - case 0: - return append(kv, keyName, "") - case 1: - return append(kv, keyName, values[0]) - default: - return append(kv, keyName, values) - } - } -} - -// PathVariable returns a LoggerFunc that extracts the value of a gorilla/mux path variable and inserts -// it into the value of a logging key. If the variable is not present, a blank string is -// set as the logging key's value. -func PathVariable(variableName, keyName string) LoggerFunc { - return func(kv []interface{}, request *http.Request) []interface{} { - variables := mux.Vars(request) - if len(variables) > 0 { - return append(kv, keyName, variables[variableName]) - } - - return append(kv, keyName, "") - } -} - -// SetLogger produces a go-kit RequestFunc that inserts a go-kit Logger into the context. -// Zero or more LoggerFuncs can be provided to added key/values. Note that nothing is added to -// the base logger by default. If no LoggerFuncs are supplied, the base Logger is added to the -// context as is. In particular, RequestInfo must be used to inject the request method, uri, etc. -// -// The base logger must be non-nil. There is no default applied. -// -// The returned function can be used with xcontext.Populate. -func SetLogger(base log.Logger, lf ...LoggerFunc) func(context.Context, *http.Request) context.Context { - if base == nil { - panic("The base Logger cannot be nil") - } - - if len(lf) > 0 { - return func(ctx context.Context, request *http.Request) context.Context { - kv := []interface{}{} - for _, f := range lf { - kv = f(kv, request) - } - - return logging.WithLogger( - ctx, - log.With(base, kv...), - ) - } - } - - return func(ctx context.Context, _ *http.Request) context.Context { - return logging.WithLogger(ctx, base) - } -} diff --git a/logging/logginghttp/setLogger_test.go b/logging/logginghttp/setLogger_test.go deleted file mode 100644 index 2ff1dcc3..00000000 --- a/logging/logginghttp/setLogger_test.go +++ /dev/null @@ -1,202 +0,0 @@ -package logginghttp - -import ( - "context" - "net/http/httptest" - "testing" - - "github.com/gorilla/mux" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" -) - -func TestRequestMethodKey(t *testing.T) { - assert := assert.New(t) - assert.Equal(requestMethodKey, RequestMethodKey()) -} - -func TestRequestURIKey(t *testing.T) { - assert := assert.New(t) - assert.Equal(requestURIKey, RequestURIKey()) -} - -func TestRemoteAddrKey(t *testing.T) { - assert := assert.New(t) - assert.Equal(remoteAddrKey, RemoteAddrKey()) -} - -func TestRequestInfo(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - request = httptest.NewRequest("GET", "/test/foo/bar", nil) - ) - - request.RemoteAddr = "127.0.0.1:1234" - - kv := RequestInfo(nil, request) - require.NotNil(kv) - require.Len(kv, 6) - assert.Equal(requestMethodKey, kv[0]) - assert.Equal("GET", kv[1]) - assert.Equal(requestURIKey, kv[2]) - assert.Equal("/test/foo/bar", kv[3]) - assert.Equal(remoteAddrKey, kv[4]) - assert.Equal("127.0.0.1:1234", kv[5]) -} - -func testHeaderMissing(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - request = httptest.NewRequest("GET", "/", nil) - ) - - kv := Header("X-Test", "key")(nil, request) - require.NotNil(kv) - require.Len(kv, 2) - assert.Equal("key", kv[0]) - assert.Equal("", kv[1]) -} - -func testHeaderSingleValue(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - request = httptest.NewRequest("GET", "/", nil) - ) - - request.Header.Set("X-Test", "value") - kv := Header("X-Test", "key")(nil, request) - require.NotNil(kv) - require.Len(kv, 2) - assert.Equal("key", kv[0]) - assert.Equal("value", kv[1]) -} - -func testHeaderMultiValue(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - request = httptest.NewRequest("GET", "/", nil) - ) - - request.Header.Add("X-Test", "value1") - request.Header.Add("X-Test", "value2") - kv := Header("X-Test", "key")(nil, request) - require.NotNil(kv) - require.Len(kv, 2) - assert.Equal("key", kv[0]) - assert.Equal([]string{"value1", "value2"}, kv[1]) -} - -func TestHeader(t *testing.T) { - t.Run("Missing", testHeaderMissing) - t.Run("SingleValue", testHeaderSingleValue) - t.Run("MultiValue", testHeaderMultiValue) -} - -func testPathVariableMissing(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - request = httptest.NewRequest("GET", "/", nil) - ) - - kv := PathVariable("test", "key")(nil, request) - require.NotNil(kv) - require.Len(kv, 2) - assert.Equal("key", kv[0]) - assert.Equal("", kv[1]) -} - -func testPathVariableValue(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - variables = map[string]string{ - "test": "foobar", - } - - request = mux.SetURLVars( - httptest.NewRequest("GET", "/", nil), - variables, - ) - ) - - kv := PathVariable("test", "key")(nil, request) - require.NotNil(kv) - require.Len(kv, 2) - assert.Equal("key", kv[0]) - assert.Equal("foobar", kv[1]) -} - -func TestPathVariable(t *testing.T) { - t.Run("Missing", testPathVariableMissing) - t.Run("Value", testPathVariableValue) -} - -func testSetLoggerNilBase(t *testing.T) { - assert := assert.New(t) - assert.Panics(func() { - SetLogger(nil) - }) -} - -func testSetLoggerBaseOnly(t *testing.T) { - var ( - assert = assert.New(t) - - base = logging.NewTestLogger(nil, t) - request = httptest.NewRequest("GET", "/", nil) - ctx = SetLogger(base)(context.Background(), request) - ) - - assert.Equal(base, logging.GetLogger(ctx)) -} - -func testSetLoggerCustom(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - - variables = map[string]string{ - "test": "path variable value", - } - - request = mux.SetURLVars( - httptest.NewRequest("GET", "/test/uri", nil), - variables, - ) - - base = logging.NewCaptureLogger() - ) - - request.RemoteAddr = "10.0.0.1:7777" - request.Header.Set("X-Test", "header value") - - logger := logging.GetLogger( - SetLogger( - base, - RequestInfo, Header("X-Test", "key1"), PathVariable("test", "key2"), - )(context.Background(), request), - ) - - require.NotEqual(base, logger) - logger.Log(logging.MessageKey(), "test message") - - entry := <-base.Output() - assert.Equal("GET", entry[requestMethodKey]) - assert.Equal("/test/uri", entry[requestURIKey]) - assert.Equal("10.0.0.1:7777", entry[remoteAddrKey]) - assert.Equal("header value", entry["key1"]) - assert.Equal("path variable value", entry["key2"]) - assert.Equal("test message", entry[logging.MessageKey()]) -} - -func TestSetLogger(t *testing.T) { - t.Run("NilBase", testSetLoggerNilBase) - t.Run("BaseOnly", testSetLoggerBaseOnly) - t.Run("Custom", testSetLoggerCustom) -} From e51307627b6d869fe3252354f6e03038260465dd Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 25 Oct 2022 11:10:43 -0400 Subject: [PATCH 10/48] Update context.go --- logging/context.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/logging/context.go b/logging/context.go index fb863254..2dc19102 100644 --- a/logging/context.go +++ b/logging/context.go @@ -4,6 +4,7 @@ import ( "context" "github.com/go-kit/kit/log" + "go.uber.org/zap" ) type contextKey uint32 @@ -11,7 +12,7 @@ type contextKey uint32 const loggerKey contextKey = 1 // WithLogger adds the given Logger to the context so that it can be retrieved with Logger -func WithLogger(parent context.Context, logger log.Logger) context.Context { +func WithLogger(parent context.Context, logger *zap.Logger) context.Context { return context.WithValue(parent, loggerKey, logger) } From f17e48a90b9ec00cea705dfdd50e29d6dc2bded2 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 25 Oct 2022 11:11:19 -0400 Subject: [PATCH 11/48] removing logging package --- logging/context.go | 27 ------------------------- logging/context_test.go | 45 ----------------------------------------- 2 files changed, 72 deletions(-) delete mode 100644 logging/context.go delete mode 100644 logging/context_test.go diff --git a/logging/context.go b/logging/context.go deleted file mode 100644 index 2dc19102..00000000 --- a/logging/context.go +++ /dev/null @@ -1,27 +0,0 @@ -package logging - -import ( - "context" - - "github.com/go-kit/kit/log" - "go.uber.org/zap" -) - -type contextKey uint32 - -const loggerKey contextKey = 1 - -// WithLogger adds the given Logger to the context so that it can be retrieved with Logger -func WithLogger(parent context.Context, logger *zap.Logger) context.Context { - return context.WithValue(parent, loggerKey, logger) -} - -// GetLogger retrieves the go-kit logger associated with the context. If no logger is -// present in the context, DefaultLogger is returned instead. -func GetLogger(ctx context.Context) log.Logger { - if logger, ok := ctx.Value(loggerKey).(log.Logger); ok { - return logger - } - - return DefaultLogger() -} diff --git a/logging/context_test.go b/logging/context_test.go deleted file mode 100644 index 0823aa18..00000000 --- a/logging/context_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package logging - -import ( - "context" - "testing" - - "github.com/go-kit/kit/log" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestWithLogger(t *testing.T) { - var ( - require = require.New(t) - assert = assert.New(t) - ctx = WithLogger(context.Background(), DefaultLogger()) - ) - - require.NotNil(ctx) - - logger, ok := ctx.Value(loggerKey).(log.Logger) - assert.NotNil(logger) - assert.True(ok) -} - -func testGetLoggerMissing(t *testing.T) { - assert := assert.New(t) - assert.NotNil(GetLogger(context.Background())) -} - -func testGetLoggerPresent(t *testing.T) { - var ( - require = require.New(t) - assert = assert.New(t) - ctx = WithLogger(context.Background(), New(nil)) - ) - - require.NotNil(ctx) - assert.NotNil(GetLogger(ctx)) -} - -func TestGetLogger(t *testing.T) { - t.Run("Missing", testGetLoggerMissing) - t.Run("Present", testGetLoggerPresent) -} From ed6aa5f8531ea403d5f79d2596ccd1f76ffa8090 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 25 Oct 2022 11:11:42 -0400 Subject: [PATCH 12/48] remove logging utility from middleware package --- middleware/logging.go | 33 -------------------- middleware/logging_test.go | 63 -------------------------------------- 2 files changed, 96 deletions(-) delete mode 100644 middleware/logging.go delete mode 100644 middleware/logging_test.go diff --git a/middleware/logging.go b/middleware/logging.go deleted file mode 100644 index b4980e5d..00000000 --- a/middleware/logging.go +++ /dev/null @@ -1,33 +0,0 @@ -package middleware - -import ( - "context" - - "github.com/go-kit/kit/endpoint" - "github.com/go-kit/kit/log" - "github.com/xmidt-org/webpa-common/v2/logging" -) - -// loggable is the interface implemented by any message object which is associated with a go-kit Logger -type loggable interface { - Logger() log.Logger -} - -// Logging is a go-kit middleware that inserts any associated logger from requests into the context. -// Requests that do not provide a Logger() log.Logger method are simply ignored. -// -// This middleware is primarily useful because go-kit does not allow you to alter the context when requests -// are decoded. That means that any contextual logger created when the request was decoded isn't visible -// in the context, unless something like this middleware is used. -func Logging(next endpoint.Endpoint) endpoint.Endpoint { - return func(ctx context.Context, value interface{}) (interface{}, error) { - if l, ok := value.(loggable); ok { - return next( - logging.WithLogger(ctx, l.Logger()), - value, - ) - } - - return next(ctx, value) - } -} diff --git a/middleware/logging_test.go b/middleware/logging_test.go deleted file mode 100644 index a1b965b7..00000000 --- a/middleware/logging_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package middleware - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" -) - -func testLoggingWithLoggable(t *testing.T) { - var ( - require = require.New(t) - assert = assert.New(t) - expectedLogger = logging.NewTestLogger(nil, t) - loggable = new(mockLoggable) - expectedResponse = "expected response" - - logging = Logging(func(ctx context.Context, value interface{}) (interface{}, error) { - assert.Equal(loggable, value) - assert.Equal(expectedLogger, logging.GetLogger(ctx)) - return expectedResponse, nil - }) - ) - - require.NotNil(logging) - - loggable.On("Logger").Return(expectedLogger).Once() - - actual, err := logging(context.Background(), loggable) - assert.Equal(expectedResponse, actual) - assert.NoError(err) - - loggable.AssertExpectations(t) -} - -func testLoggingWithoutLoggable(t *testing.T) { - var ( - require = require.New(t) - assert = assert.New(t) - - expectedRequest = "expected request" - expectedResponse = "expected response" - - logging = Logging(func(ctx context.Context, value interface{}) (interface{}, error) { - assert.Equal(expectedRequest, value) - assert.Equal(logging.DefaultLogger(), logging.GetLogger(ctx)) - return expectedResponse, nil - }) - ) - - require.NotNil(logging) - - actual, err := logging(context.Background(), expectedRequest) - assert.Equal(expectedResponse, actual) - assert.NoError(err) -} - -func TestLogging(t *testing.T) { - t.Run("WithLoggable", testLoggingWithLoggable) - t.Run("WithoutLoggable", testLoggingWithoutLoggable) -} From e99d0a60695c8b9c285661266cb7927103b306a0 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 25 Oct 2022 11:12:05 -0400 Subject: [PATCH 13/48] update middleware mocks --- middleware/mocks_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/middleware/mocks_test.go b/middleware/mocks_test.go index 5852bcad..524e210a 100644 --- a/middleware/mocks_test.go +++ b/middleware/mocks_test.go @@ -1,14 +1,14 @@ package middleware import ( - "github.com/go-kit/kit/log" "github.com/stretchr/testify/mock" + "go.uber.org/zap" ) type mockLoggable struct { mock.Mock } -func (m *mockLoggable) Logger() log.Logger { - return m.Called().Get(0).(log.Logger) +func (m *mockLoggable) Logger() *zap.Logger { + return m.Called().Get(0).(*zap.Logger) } From 7f9ca665c9ce112cd114338fe42eaba74b01a643 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Thu, 27 Oct 2022 14:54:26 -0400 Subject: [PATCH 14/48] Update monitor.go --- service/monitor/monitor.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/service/monitor/monitor.go b/service/monitor/monitor.go index 473ca5ae..6250156e 100644 --- a/service/monitor/monitor.go +++ b/service/monitor/monitor.go @@ -5,10 +5,10 @@ import ( "sync" "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/sd" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service" + "go.uber.org/zap" ) var errNoInstances = errors.New("No instances to monitor") @@ -30,10 +30,10 @@ type Option func(*monitor) // WithLogger sets a go-kit Logger for this monitor. This logger will be enriched with information // about each instancer, if available. If nil, the default logger is used instead. -func WithLogger(l log.Logger) Option { +func WithLogger(l *zap.Logger) Option { return func(m *monitor) { if l == nil { - m.logger = logging.DefaultLogger() + m.logger = sallust.Default() } else { m.logger = l } @@ -94,7 +94,7 @@ func WithEnvironment(e service.Environment) Option { func New(options ...Option) (Interface, error) { var ( m = &monitor{ - logger: logging.DefaultLogger(), + logger: sallust.Default(), stopped: make(chan struct{}), filter: DefaultFilter(), } @@ -114,7 +114,7 @@ func New(options ...Option) (Interface, error) { // monitor is the internal implementation of Monitor. This type is a shared context // among all goroutines that monitor a (key, instancer) pair. type monitor struct { - logger log.Logger + logger *zap.Logger instancers service.Instancers filter Filter listeners Listeners @@ -146,7 +146,7 @@ func (m *monitor) start() error { svc = svcName } } - go m.dispatchEvents(k, svc, logging.Enrich(m.logger, v), v) + go m.dispatchEvents(k, svc, sallust.Enrich(m.logger, v), v) } return nil @@ -155,18 +155,18 @@ func (m *monitor) start() error { // dispatchEvents is a goroutine that consumes service discovery events from an sd.Instancer // and dispatches those events zero or more Listeners. If configured, the filter is used to // preprocess the set of instances sent to the listener. -func (m *monitor) dispatchEvents(key, service string, l log.Logger, i sd.Instancer) { +func (m *monitor) dispatchEvents(key, service string, l *zap.Logger, i sd.Instancer) { var ( eventCount = 0 eventCounter log.Valuer = func() interface{} { return eventCount } - logger = log.With(l, EventCountKey(), eventCounter) + logger = l.With(zap.Any(EventCountKey(), eventCounter)) events = make(chan sd.Event, 10) ) - logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "subscription monitor starting") + logger.Info("subscription monitor starting") defer i.Deregister(events) i.Register(events) @@ -183,10 +183,10 @@ func (m *monitor) dispatchEvents(key, service string, l log.Logger, i sd.Instanc } if sdEvent.Err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "service discovery error", logging.ErrorKey(), sdEvent.Err) + logger.Error("service discovery error", zap.Error(sdEvent.Err)) event.Err = sdEvent.Err } else { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "service discovery update", "instances", sdEvent.Instances) + logger.Error("service discovery update", zap.Strings("instances", sdEvent.Instances)) if len(sdEvent.Instances) > 0 { event.Instances = m.filter(sdEvent.Instances) } @@ -195,12 +195,12 @@ func (m *monitor) dispatchEvents(key, service string, l log.Logger, i sd.Instanc m.listeners.MonitorEvent(event) case <-m.stopped: - logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "subscription monitor was stopped") + logger.Info("subscription monitor was stopped") m.listeners.MonitorEvent(Event{Key: key, Service: service, Instancer: i, EventCount: eventCount, Stopped: true}) return case <-m.closed: - logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "subscription monitor exiting due to external closure") + logger.Info("subscription monitor exiting due to external closure") m.Stop() // ensure that the Stopped state is correct m.listeners.MonitorEvent(Event{Key: key, Service: service, Instancer: i, EventCount: eventCount, Stopped: true}) return From 0007b38c3acf56a762f665a65597f9405f0417da Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Thu, 27 Oct 2022 15:04:52 -0400 Subject: [PATCH 15/48] removing enrich @johnabass hey john I'm not sure how we envisioned `Enrich` to interact with go-kit sd.Instancer. It's not clear how `Instancer` would enrich logging atm Here's a past note we left behind // Instancer is the go-kit sd.Instancer which sent this event. This instance can be used to enrich // logging via sallust.Enrich. --- device/rehasher/rehasher.go | 8 ++------ service/monitor/monitor.go | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/device/rehasher/rehasher.go b/device/rehasher/rehasher.go index 0ebf1c95..9908c055 100644 --- a/device/rehasher/rehasher.go +++ b/device/rehasher/rehasher.go @@ -188,12 +188,8 @@ func (r *rehasher) MonitorEvent(e monitor.Event) { return } - logger := sallust.Enrich( - r.logger.With( - zap.Int(monitor.EventCountKey(), e.EventCount), - ), - e.Instancer, - ) + logger := r.logger.With( + zap.Int(monitor.EventCountKey(), e.EventCount), zap.Any(e.Service, e.Instancer)) switch { case e.Err != nil: diff --git a/service/monitor/monitor.go b/service/monitor/monitor.go index 6250156e..f7ef6cce 100644 --- a/service/monitor/monitor.go +++ b/service/monitor/monitor.go @@ -146,7 +146,7 @@ func (m *monitor) start() error { svc = svcName } } - go m.dispatchEvents(k, svc, sallust.Enrich(m.logger, v), v) + go m.dispatchEvents(k, svc, m.logger.With(zap.Any(k, v)), v) } return nil From 6df0a3e8eaf3abb54c268317262cc5a51792f223 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:09:36 -0400 Subject: [PATCH 16/48] remove package basculechecks --- basculechecks/capabilitiesmap.go | 94 ------ basculechecks/capabilitiesmap_test.go | 175 ---------- basculechecks/capabilitiesvalidator.go | 150 --------- basculechecks/capabilitiesvalidator_test.go | 319 ------------------ basculechecks/capabilitycheck.go | 98 ------ basculechecks/capabilitycheck_test.go | 151 --------- basculechecks/doc.go | 29 -- basculechecks/metrics.go | 150 --------- basculechecks/metrics_test.go | 34 -- basculechecks/metricvalidator.go | 179 ---------- basculechecks/metricvalidator_test.go | 351 -------------------- basculechecks/mocks_test.go | 32 -- 12 files changed, 1762 deletions(-) delete mode 100644 basculechecks/capabilitiesmap.go delete mode 100644 basculechecks/capabilitiesmap_test.go delete mode 100644 basculechecks/capabilitiesvalidator.go delete mode 100644 basculechecks/capabilitiesvalidator_test.go delete mode 100644 basculechecks/capabilitycheck.go delete mode 100644 basculechecks/capabilitycheck_test.go delete mode 100644 basculechecks/doc.go delete mode 100644 basculechecks/metrics.go delete mode 100644 basculechecks/metrics_test.go delete mode 100644 basculechecks/metricvalidator.go delete mode 100644 basculechecks/metricvalidator_test.go delete mode 100644 basculechecks/mocks_test.go diff --git a/basculechecks/capabilitiesmap.go b/basculechecks/capabilitiesmap.go deleted file mode 100644 index 5b3f1955..00000000 --- a/basculechecks/capabilitiesmap.go +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright 2020 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -package basculechecks - -import ( - "errors" - - "github.com/goph/emperror" - "github.com/xmidt-org/bascule" -) - -var ( - ErrNilDefaultChecker = errors.New("default checker cannot be nil") - ErrEmptyEndpoint = errors.New("endpoint provided is empty") -) - -// CapabilitiesMap runs a capability check based on the value of the parsedURL, -// which is the key to the CapabilitiesMap's map. The parsedURL is expected to -// be some regex values, allowing for bucketing of urls that contain some kind -// of ID or otherwise variable portion of a URL. -type CapabilitiesMap struct { - Checkers map[string]CapabilityChecker - DefaultChecker CapabilityChecker -} - -// Check uses the parsed endpoint value to determine which CapabilityChecker to -// run against the capabilities in the auth provided. If there is no -// CapabilityChecker for the endpoint, the default is used. As long as one -// capability is found to be authorized by the CapabilityChecker, no error is -// returned. -func (c CapabilitiesMap) Check(auth bascule.Authentication, vs ParsedValues) (string, error) { - if auth.Token == nil { - return TokenMissingValues, ErrNoToken - } - - if auth.Request.URL == nil { - return TokenMissingValues, ErrNoURL - } - - if vs.Endpoint == "" { - return EmptyParsedURL, ErrEmptyEndpoint - } - - capabilities, reason, err := getCapabilities(auth.Token.Attributes()) - if err != nil { - return reason, err - } - - // determine which CapabilityChecker to use. - checker, ok := c.Checkers[vs.Endpoint] - if !ok || checker == nil { - checker = c.DefaultChecker - } - reqURL := auth.Request.URL.EscapedPath() - method := auth.Request.Method - - // if the checker is nil, we treat it like a checker that always returns - // false. - if checker == nil { - return NoCapabilitiesMatch, emperror.With(ErrNoValidCapabilityFound, - "capabilitiesFound", capabilities, "request URL", reqURL, - "request method", method, "parsed URL", vs.Endpoint, - "checker", checker) - } - - // if one of the capabilities is good, then the request is authorized - // for this endpoint. - for _, capability := range capabilities { - if checker.Authorized(capability, reqURL, method) { - return "", nil - } - } - - return NoCapabilitiesMatch, emperror.With(ErrNoValidCapabilityFound, - "capabilitiesFound", capabilities, "request URL", reqURL, - "request method", method, "parsed URL", vs.Endpoint, - "checker", checker) - -} diff --git a/basculechecks/capabilitiesmap_test.go b/basculechecks/capabilitiesmap_test.go deleted file mode 100644 index cb1518e5..00000000 --- a/basculechecks/capabilitiesmap_test.go +++ /dev/null @@ -1,175 +0,0 @@ -/** - * Copyright 2020 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -package basculechecks - -import ( - "net/url" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/bascule" -) - -func TestCapabilitiesMapCheck(t *testing.T) { - goodDefault := ConstCheck("default checker") - checkersMap := map[string]CapabilityChecker{ - "a": ConstCheck("meh"), - "bcedef": ConstCheck("yay"), - "all": ConstCheck("good"), - "fallback": nil, - } - cm := CapabilitiesMap{ - Checkers: checkersMap, - DefaultChecker: goodDefault, - } - nilCM := CapabilitiesMap{} - goodCapabilities := []string{ - "test", - "", - "yay", - "...", - } - goodToken := bascule.NewToken("test", "princ", - bascule.NewAttributes(map[string]interface{}{CapabilityKey: goodCapabilities})) - defaultCapabilities := []string{ - "test", - "", - "default checker", - "...", - } - defaultToken := bascule.NewToken("test", "princ", - bascule.NewAttributes(map[string]interface{}{CapabilityKey: defaultCapabilities})) - badToken := bascule.NewToken("", "", nil) - tests := []struct { - description string - cm CapabilitiesMap - token bascule.Token - includeURL bool - endpoint string - expectedReason string - expectedErr error - }{ - { - description: "Success", - cm: cm, - token: goodToken, - includeURL: true, - endpoint: "bcedef", - }, - { - description: "Success Not in Map", - cm: cm, - token: defaultToken, - includeURL: true, - endpoint: "b", - }, - { - description: "Success Nil Map Value", - cm: cm, - token: defaultToken, - includeURL: true, - endpoint: "fallback", - }, - { - description: "No Match Error", - cm: cm, - token: goodToken, - includeURL: true, - endpoint: "b", - expectedReason: NoCapabilitiesMatch, - expectedErr: ErrNoValidCapabilityFound, - }, - { - description: "No Match with Default Checker Error", - cm: cm, - token: defaultToken, - includeURL: true, - endpoint: "bcedef", - expectedReason: NoCapabilitiesMatch, - expectedErr: ErrNoValidCapabilityFound, - }, - { - description: "No Match Nil Default Checker Error", - cm: nilCM, - token: defaultToken, - includeURL: true, - endpoint: "bcedef", - expectedReason: NoCapabilitiesMatch, - expectedErr: ErrNoValidCapabilityFound, - }, - { - description: "No Token Error", - cm: cm, - token: nil, - includeURL: true, - expectedReason: TokenMissingValues, - expectedErr: ErrNoToken, - }, - { - description: "No Request URL Error", - cm: cm, - token: goodToken, - includeURL: false, - expectedReason: TokenMissingValues, - expectedErr: ErrNoURL, - }, - { - description: "Empty Endpoint Error", - cm: cm, - token: goodToken, - includeURL: true, - endpoint: "", - expectedReason: EmptyParsedURL, - expectedErr: ErrEmptyEndpoint, - }, - { - description: "Get Capabilities Error", - cm: cm, - token: badToken, - includeURL: true, - endpoint: "b", - expectedReason: UndeterminedCapabilities, - expectedErr: ErrNilAttributes, - }, - } - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - assert := assert.New(t) - require := require.New(t) - auth := bascule.Authentication{ - Token: tc.token, - } - if tc.includeURL { - goodURL, err := url.Parse("/test") - require.Nil(err) - auth.Request = bascule.Request{ - URL: goodURL, - Method: "GET", - } - } - reason, err := tc.cm.Check(auth, ParsedValues{Endpoint: tc.endpoint}) - assert.Equal(tc.expectedReason, reason) - if err == nil || tc.expectedErr == nil { - assert.Equal(tc.expectedErr, err) - return - } - assert.Contains(err.Error(), tc.expectedErr.Error()) - }) - } -} diff --git a/basculechecks/capabilitiesvalidator.go b/basculechecks/capabilitiesvalidator.go deleted file mode 100644 index 16d3da50..00000000 --- a/basculechecks/capabilitiesvalidator.go +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Copyright 2020 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -package basculechecks - -import ( - "context" - "errors" - "fmt" - - "github.com/goph/emperror" - "github.com/spf13/cast" - "github.com/xmidt-org/bascule" -) - -var ( - ErrNoVals = errors.New("expected at least one value") - ErrNoAuth = errors.New("couldn't get request info: authorization not found") - ErrNoToken = errors.New("no token found in Auth") - ErrNoValidCapabilityFound = errors.New("no valid capability for endpoint") - ErrNilAttributes = errors.New("nil attributes interface") - ErrNoURL = errors.New("invalid URL found in Auth") -) - -const ( - CapabilityKey = "capabilities" -) - -var ( - partnerKeys = []string{"allowedResources", "allowedPartners"} -) - -func PartnerKeys() []string { - return partnerKeys -} - -// CapabilityChecker is an object that can determine if a capability provides -// authorization to the endpoint. -type CapabilityChecker interface { - Authorized(string, string, string) bool -} - -// CapabilitiesValidator checks the capabilities provided in a -// bascule.Authentication object to determine if a request is authorized. It -// can also provide a function to be used in authorization middleware that -// pulls the Authentication object from a context before checking it. -type CapabilitiesValidator struct { - Checker CapabilityChecker -} - -// CreateValidator creates a function that determines whether or not a -// client is authorized to make a request to an endpoint. It uses the -// bascule.Authentication from the context to get the information needed by the -// CapabilityChecker to determine authorization. -func (c CapabilitiesValidator) CreateValidator(errorOut bool) bascule.ValidatorFunc { - return func(ctx context.Context, _ bascule.Token) error { - auth, ok := bascule.FromContext(ctx) - if !ok { - if errorOut { - return ErrNoAuth - } - return nil - } - - _, err := c.Check(auth, ParsedValues{}) - if err != nil && errorOut { - return err - } - - return nil - } -} - -// Check takes the needed values out of the given Authentication object in -// order to determine if a request is authorized. It determines this through -// iterating through each capability and calling the CapabilityChecker. If no -// capability authorizes the client for the given endpoint and method, it is -// unauthorized. -func (c CapabilitiesValidator) Check(auth bascule.Authentication, _ ParsedValues) (string, error) { - if auth.Token == nil { - return TokenMissingValues, ErrNoToken - } - vals, reason, err := getCapabilities(auth.Token.Attributes()) - if err != nil { - return reason, err - } - - if auth.Request.URL == nil { - return TokenMissingValues, ErrNoURL - } - reqURL := auth.Request.URL.EscapedPath() - method := auth.Request.Method - err = c.checkCapabilities(vals, reqURL, method) - if err != nil { - return NoCapabilitiesMatch, err - } - return "", nil -} - -// checkCapabilities uses a CapabilityChecker to check if each capability -// provided is authorized. If an authorized capability is found, no error is -// returned. -func (c CapabilitiesValidator) checkCapabilities(capabilities []string, reqURL string, method string) error { - for _, val := range capabilities { - if c.Checker.Authorized(val, reqURL, method) { - return nil - } - } - return emperror.With(ErrNoValidCapabilityFound, "capabilitiesFound", capabilities, "urlToMatch", reqURL, "methodToMatch", method) - -} - -// getCapabilities runs some error checks while getting the list of -// capabilities from the attributes. -func getCapabilities(attributes bascule.Attributes) ([]string, string, error) { - if attributes == nil { - return []string{}, UndeterminedCapabilities, ErrNilAttributes - } - - val, ok := attributes.Get(CapabilityKey) - if !ok { - return []string{}, UndeterminedCapabilities, fmt.Errorf("couldn't get capabilities using key %v", CapabilityKey) - } - - vals, err := cast.ToStringSliceE(val) - if err != nil { - return []string{}, UndeterminedCapabilities, fmt.Errorf("capabilities \"%v\" not the expected string slice: %v", val, err) - } - - if len(vals) == 0 { - return []string{}, EmptyCapabilitiesList, ErrNoVals - } - - return vals, "", nil - -} diff --git a/basculechecks/capabilitiesvalidator_test.go b/basculechecks/capabilitiesvalidator_test.go deleted file mode 100644 index ace03ab5..00000000 --- a/basculechecks/capabilitiesvalidator_test.go +++ /dev/null @@ -1,319 +0,0 @@ -/** - * Copyright 2020 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -package basculechecks - -import ( - "context" - "errors" - "net/url" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/bascule" -) - -func TestCapabilitiesChecker(t *testing.T) { - var v interface{} - v = CapabilitiesValidator{} - _, ok := v.(CapabilitiesChecker) - assert.True(t, ok) -} - -func TestCapabilitiesValidatorFunc(t *testing.T) { - capabilities := []string{ - "test", - "a", - "joweiafuoiuoiwauf", - "it's a match", - } - goodURL, err := url.Parse("/test") - require.Nil(t, err) - goodRequest := bascule.Request{ - URL: goodURL, - Method: "GET", - } - tests := []struct { - description string - includeAuth bool - includeToken bool - errorOut bool - errExpected bool - }{ - { - description: "Success", - includeAuth: true, - includeToken: true, - errorOut: true, - }, - { - description: "No Auth Error", - errorOut: true, - errExpected: true, - }, - { - description: "No Auth Suppressed Error", - }, - { - description: "Check Error", - includeAuth: true, - errorOut: true, - errExpected: true, - }, - { - description: "Check Suppressed Error", - includeAuth: true, - }, - } - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - assert := assert.New(t) - ctx := context.Background() - auth := bascule.Authentication{ - Request: goodRequest, - } - if tc.includeToken { - auth.Token = bascule.NewToken("test", "princ", - bascule.NewAttributes(map[string]interface{}{CapabilityKey: capabilities})) - } - if tc.includeAuth { - ctx = bascule.WithAuthentication(ctx, auth) - } - c := CapabilitiesValidator{ - Checker: ConstCheck("it's a match"), - } - err := c.CreateValidator(tc.errorOut)(ctx, bascule.NewToken("", "", nil)) - if tc.errExpected { - assert.NotNil(err) - return - } - assert.Nil(err) - }) - } -} - -func TestCapabilitiesValidatorCheck(t *testing.T) { - capabilities := []string{ - "test", - "a", - "joweiafuoiuoiwauf", - "it's a match", - } - pv := ParsedValues{} - tests := []struct { - description string - includeToken bool - includeAttributes bool - includeURL bool - checker CapabilityChecker - expectedReason string - expectedErr error - }{ - { - description: "Success", - includeAttributes: true, - includeURL: true, - checker: ConstCheck("it's a match"), - expectedErr: nil, - }, - { - description: "No Token Error", - expectedReason: TokenMissingValues, - expectedErr: ErrNoToken, - }, - { - description: "Get Capabilities Error", - includeToken: true, - expectedReason: UndeterminedCapabilities, - expectedErr: ErrNilAttributes, - }, - { - description: "No URL Error", - includeAttributes: true, - expectedReason: TokenMissingValues, - expectedErr: ErrNoURL, - }, - { - description: "Check Capabilities Error", - includeAttributes: true, - includeURL: true, - checker: AlwaysCheck(false), - expectedReason: NoCapabilitiesMatch, - expectedErr: ErrNoValidCapabilityFound, - }, - } - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - assert := assert.New(t) - require := require.New(t) - c := CapabilitiesValidator{ - Checker: tc.checker, - } - a := bascule.Authentication{} - if tc.includeToken { - a.Token = bascule.NewToken("", "", nil) - } - if tc.includeAttributes { - a.Token = bascule.NewToken("test", "princ", - bascule.NewAttributes(map[string]interface{}{CapabilityKey: capabilities})) - } - if tc.includeURL { - goodURL, err := url.Parse("/test") - require.Nil(err) - a.Request = bascule.Request{ - URL: goodURL, - Method: "GET", - } - } - reason, err := c.Check(a, pv) - assert.Equal(tc.expectedReason, reason) - if err == nil || tc.expectedErr == nil { - assert.Equal(tc.expectedErr, err) - return - } - assert.Contains(err.Error(), tc.expectedErr.Error()) - }) - } -} - -func TestCheckCapabilities(t *testing.T) { - capabilities := []string{ - "test", - "a", - "joweiafuoiuoiwauf", - "it's a match", - } - - tests := []struct { - description string - goodCapability string - expectedErr error - }{ - { - description: "Success", - goodCapability: "it's a match", - }, - { - description: "No Capability Found Error", - expectedErr: ErrNoValidCapabilityFound, - }, - } - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - assert := assert.New(t) - c := CapabilitiesValidator{ - Checker: ConstCheck(tc.goodCapability), - } - err := c.checkCapabilities(capabilities, "", "") - if err == nil || tc.expectedErr == nil { - assert.Equal(tc.expectedErr, err) - return - } - assert.Contains(err.Error(), tc.expectedErr.Error()) - }) - } -} - -func TestGetCapabilities(t *testing.T) { - type testType int - goodKeyVal := []string{"cap1", "cap2"} - emptyVal := []string{} - getCapabilitiesErr := errors.New("couldn't get capabilities using key") - badCapabilitiesErr := errors.New("not the expected string slice") - tests := []struct { - description string - nilAttributes bool - missingAttribute bool - keyValue interface{} - expectedVals []string - expectedReason string - expectedErr error - }{ - { - description: "Success", - keyValue: goodKeyVal, - expectedVals: goodKeyVal, - expectedReason: "", - expectedErr: nil, - }, - { - description: "Nil Attributes Error", - nilAttributes: true, - expectedVals: emptyVal, - expectedReason: UndeterminedCapabilities, - expectedErr: ErrNilAttributes, - }, - { - description: "No Attribute Error", - missingAttribute: true, - expectedVals: emptyVal, - expectedReason: UndeterminedCapabilities, - expectedErr: getCapabilitiesErr, - }, - { - description: "Nil Capabilities Error", - keyValue: nil, - expectedVals: emptyVal, - expectedReason: UndeterminedCapabilities, - expectedErr: badCapabilitiesErr, - }, - { - description: "Non List Capabilities Error", - keyValue: struct{ string }{"abcd"}, - expectedVals: emptyVal, - expectedReason: UndeterminedCapabilities, - expectedErr: badCapabilitiesErr, - }, - { - description: "Non String List Capabilities Error", - keyValue: []testType{0, 1, 2}, - expectedVals: emptyVal, - expectedReason: UndeterminedCapabilities, - expectedErr: badCapabilitiesErr, - }, - { - description: "Empty Capabilities Error", - keyValue: emptyVal, - expectedVals: emptyVal, - expectedReason: EmptyCapabilitiesList, - expectedErr: ErrNoVals, - }, - } - - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - assert := assert.New(t) - m := map[string]interface{}{CapabilityKey: tc.keyValue} - if tc.missingAttribute { - m = map[string]interface{}{} - } - attributes := bascule.NewAttributes(m) - if tc.nilAttributes { - attributes = nil - } - vals, reason, err := getCapabilities(attributes) - assert.Equal(tc.expectedVals, vals) - assert.Equal(tc.expectedReason, reason) - if err == nil || tc.expectedErr == nil { - assert.Equal(tc.expectedErr, err) - } else { - assert.Contains(err.Error(), tc.expectedErr.Error()) - } - }) - } -} diff --git a/basculechecks/capabilitycheck.go b/basculechecks/capabilitycheck.go deleted file mode 100644 index 27097b41..00000000 --- a/basculechecks/capabilitycheck.go +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright 2020 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -package basculechecks - -import ( - "fmt" - "regexp" - "strings" -) - -// AlwaysCheck is a CapabilityChecker that always returns either true or false. -type AlwaysCheck bool - -// Authorized returns the saved boolean value, rather than checking the -// parameters given. -func (a AlwaysCheck) Authorized(_, _, _ string) bool { - return bool(a) -} - -// ConstCheck is a basic capability checker that determines a capability is -// authorized if it matches the ConstCheck's string. -type ConstCheck string - -// Authorized validates the capability provided against the stored string. -func (c ConstCheck) Authorized(capability, _, _ string) bool { - return string(c) == capability -} - -// EndpointRegexCheck uses a regular expression to validate an endpoint and -// method provided in a capability against the endpoint hit and method used for -// the request. -type EndpointRegexCheck struct { - prefixToMatch *regexp.Regexp - acceptAllMethod string -} - -// NewEndpointRegexCheck creates an object that implements the -// CapabilityChecker interface. It takes a prefix that is expected at the -// beginning of a capability and a string that, if provided in the capability, -// authorizes all methods for that endpoint. After the prefix, the -// EndpointRegexCheck expects there to be an endpoint regular expression and an -//http method - separated by a colon. The expected format of a capability is: -// : -func NewEndpointRegexCheck(prefix string, acceptAllMethod string) (EndpointRegexCheck, error) { - matchPrefix, err := regexp.Compile("^" + prefix + "(.+):(.+?)$") - if err != nil { - return EndpointRegexCheck{}, fmt.Errorf("failed to compile prefix [%v]: %w", prefix, err) - } - - e := EndpointRegexCheck{ - prefixToMatch: matchPrefix, - acceptAllMethod: acceptAllMethod, - } - return e, nil -} - -// Authorized checks the capability against the endpoint hit and method used. -// If the capability has the correct prefix and is meant to be used with the -// method provided to access the endpoint provided, it is authorized. -func (e EndpointRegexCheck) Authorized(capability string, urlToMatch string, methodToMatch string) bool { - matches := e.prefixToMatch.FindStringSubmatch(capability) - - if matches == nil || len(matches) < 2 { - return false - } - - method := matches[2] - if method != e.acceptAllMethod && method != strings.ToLower(methodToMatch) { - return false - } - - re, err := regexp.Compile(matches[1]) //url regex that capability grants access to - if err != nil { - return false - } - - matchIdxs := re.FindStringIndex(urlToMatch) - if matchIdxs == nil || matchIdxs[0] != 0 { - return false - } - - return true -} diff --git a/basculechecks/capabilitycheck_test.go b/basculechecks/capabilitycheck_test.go deleted file mode 100644 index 2f8930b2..00000000 --- a/basculechecks/capabilitycheck_test.go +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Copyright 2020 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -package basculechecks - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestAlwaysCheck(t *testing.T) { - assert := assert.New(t) - alwaysTrue := AlwaysCheck(true) - assert.True(alwaysTrue.Authorized("a", "b", "c")) - alwaysFalse := AlwaysCheck(false) - assert.False(alwaysFalse.Authorized("a", "b", "c")) -} - -func TestConstCapabilityChecker(t *testing.T) { - var v interface{} - v = ConstCheck("test") - _, ok := v.(CapabilityChecker) - assert.True(t, ok) -} - -func TestConstCheck(t *testing.T) { - tests := []struct { - description string - capability string - okExpected bool - }{ - { - description: "Success", - capability: "perfectmatch", - okExpected: true, - }, - { - description: "Not a Match", - capability: "meh", - okExpected: false, - }, - } - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - assert := assert.New(t) - c := ConstCheck("perfectmatch") - ok := c.Authorized(tc.capability, "ignored1", "ignored2") - assert.Equal(tc.okExpected, ok) - }) - } -} - -func TestEndpointRegexCapabilityChecker(t *testing.T) { - assert := assert.New(t) - var v interface{} - v, err := NewEndpointRegexCheck("test", "") - assert.Nil(err) - _, ok := v.(CapabilityChecker) - assert.True(ok) -} -func TestNewEndpointRegexError(t *testing.T) { - e, err := NewEndpointRegexCheck(`\M`, "") - assert := assert.New(t) - assert.Empty(e) - assert.NotNil(err) -} - -func TestEndpointRegexCheck(t *testing.T) { - tests := []struct { - description string - prefix string - acceptAllMethod string - capability string - url string - method string - okExpected bool - }{ - { - description: "Success", - prefix: "a:b:c:", - acceptAllMethod: "all", - capability: "a:b:c:.*:get", - url: "/test/ffff//", - method: "get", - okExpected: true, - }, - { - description: "No Match Error", - prefix: "a:b:c:", - capability: "a:.*:get", - method: "get", - }, - { - description: "Wrong Method Error", - prefix: "a:b:c:", - acceptAllMethod: "all", - capability: "a:b:c:.*:get", - method: "post", - }, - { - description: "Regex Doesn't Compile Error", - prefix: "a:b:c:", - acceptAllMethod: "all", - capability: `a:b:c:\M:get`, - method: "get", - }, - { - description: "URL Doesn't Match Capability Error", - prefix: "a:b:c:", - acceptAllMethod: "all", - capability: "a:b:c:[A..Z]+:get", - url: "1111", - method: "get", - }, - { - description: "URL Capability Match Wrong Location Error", - prefix: "a:b:c:", - acceptAllMethod: "all", - capability: "a:b:c:[A..Z]+:get", - url: "11AAAAA", - method: "get", - }, - } - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - assert := assert.New(t) - require := require.New(t) - e, err := NewEndpointRegexCheck(tc.prefix, tc.acceptAllMethod) - require.Nil(err) - require.NotEmpty(e) - ok := e.Authorized(tc.capability, tc.url, tc.method) - assert.Equal(tc.okExpected, ok) - }) - } -} diff --git a/basculechecks/doc.go b/basculechecks/doc.go deleted file mode 100644 index 0fe6ad51..00000000 --- a/basculechecks/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright 2021 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -/* -Package basculechecks provides bascule validators for JWT capability checking. - -Deprecated: basculechecks is no longer planned to be used by future WebPA/XMiDT -services. - -This package is frozen and no new functionality will be added. Fixes may be made -in order to maintain compatibility with github.com/xmidt-org/bascule for -services dependent on this package. -*/ - -package basculechecks diff --git a/basculechecks/metrics.go b/basculechecks/metrics.go deleted file mode 100644 index 54585db5..00000000 --- a/basculechecks/metrics.go +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Copyright 2020 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -package basculechecks - -import ( - "fmt" - - "github.com/go-kit/kit/metrics" - gokitprometheus "github.com/go-kit/kit/metrics/prometheus" - "github.com/go-kit/kit/metrics/provider" - "github.com/prometheus/client_golang/prometheus" - themisXmetrics "github.com/xmidt-org/themis/xmetrics" - "github.com/xmidt-org/webpa-common/v2/xmetrics" - - "go.uber.org/fx" - "go.uber.org/zap" -) - -// Names for our metrics -const ( - AuthCapabilityCheckOutcome = "auth_capability_check" -) - -// labels -const ( - OutcomeLabel = "outcome" - ReasonLabel = "reason" - ClientIDLabel = "clientid" - EndpointLabel = "endpoint" - PartnerIDLabel = "partnerid" - ServerLabel = "server" -) - -// outcomes -const ( - RejectedOutcome = "rejected" - AcceptedOutcome = "accepted" - // reasons - TokenMissing = "auth_missing" - UndeterminedPartnerID = "undetermined_partner_ID" - UndeterminedCapabilities = "undetermined_capabilities" - EmptyCapabilitiesList = "empty_capabilities_list" - TokenMissingValues = "auth_is_missing_values" - NoCapabilityChecker = "no_capability_checker" - NoCapabilitiesMatch = "no_capabilities_match" - EmptyParsedURL = "empty_parsed_URL" -) - -// help messages -const ( - capabilityCheckHelpMsg = "Counter for the capability checker, providing outcome information by client, partner, and endpoint" -) - -// Metrics returns the Metrics relevant to this package targeting our older non uber/fx applications. -// To initialize the metrics, use NewAuthCapabilityCheckMeasures(). -func Metrics() []xmetrics.Metric { - return []xmetrics.Metric{ - { - Name: AuthCapabilityCheckOutcome, - Type: xmetrics.CounterType, - Help: capabilityCheckHelpMsg, - LabelNames: []string{OutcomeLabel, ReasonLabel, ClientIDLabel, PartnerIDLabel, EndpointLabel}, - }, - } -} - -// ProvideMetrics provides the metrics relevant to this package as uber/fx options. -// This is now deprecated in favor of ProvideMetricsVec. -func ProvideMetrics() fx.Option { - return fx.Provide( - themisXmetrics.ProvideCounter(prometheus.CounterOpts{ - Name: AuthCapabilityCheckOutcome, - Help: capabilityCheckHelpMsg, - ConstLabels: nil, - }, OutcomeLabel, ReasonLabel, ClientIDLabel, PartnerIDLabel, EndpointLabel), - ) -} - -// ProvideMetricsVec provides the metrics relevant to this package as uber/fx options. -// The provided metrics are prometheus vectors which gives access to more advanced operations such as CurryWith(labels). -func ProvideMetricsVec() fx.Option { - return fx.Provide( - themisXmetrics.ProvideCounterVec(prometheus.CounterOpts{ - Name: AuthCapabilityCheckOutcome, - Help: capabilityCheckHelpMsg, - ConstLabels: nil, - }, ServerLabel, OutcomeLabel, ReasonLabel, ClientIDLabel, PartnerIDLabel, EndpointLabel), - ) -} - -// AuthCapabilityCheckMeasures describes the defined metrics that will be used by clients -type AuthCapabilityCheckMeasures struct { - CapabilityCheckOutcome metrics.Counter -} - -// NewAuthCapabilityCheckMeasures realizes desired metrics. It's intended to be used alongside Metrics() for -// our older non uber/fx applications. -func NewAuthCapabilityCheckMeasures(p provider.Provider) *AuthCapabilityCheckMeasures { - return &AuthCapabilityCheckMeasures{ - CapabilityCheckOutcome: p.NewCounter(AuthCapabilityCheckOutcome), - } -} - -// BaseMeasuresIn is an uber/fx parameter with base metrics ready to be curried into child metrics based on -// custom labels. -type BaseMeasuresIn struct { - fx.In - Logger *zap.Logger - CapabilityCheckOutcome *prometheus.CounterVec `name:"auth_capability_check"` -} - -// MeasuresFactory facilitates the creation of child metrics based on server labels. -type MeasuresFactory struct { - ServerName string -} - -// NewMeasures builds the metric listener from the provided raw metrics. -func (m MeasuresFactory) NewMeasures(in BaseMeasuresIn) (*AuthCapabilityCheckMeasures, error) { - capabilityCheckOutcomeCounterVec, err := in.CapabilityCheckOutcome.CurryWith(prometheus.Labels{ServerLabel: m.ServerName}) - if err != nil { - return nil, err - } - in.Logger.Debug("building auth capability measures", zap.String(ServerLabel, m.ServerName)) - return &AuthCapabilityCheckMeasures{ - CapabilityCheckOutcome: gokitprometheus.NewCounter(capabilityCheckOutcomeCounterVec), - }, nil -} - -// Annotated provides the measures as an annotated component with the name "[SERVER]_bascule_capability_measures" -func (m MeasuresFactory) Annotated() fx.Annotated { - return fx.Annotated{ - Name: fmt.Sprintf("%s_bascule_capability_measures", m.ServerName), - Target: m.NewMeasures, - } -} diff --git a/basculechecks/metrics_test.go b/basculechecks/metrics_test.go deleted file mode 100644 index 185edbbf..00000000 --- a/basculechecks/metrics_test.go +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright 2020 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -package basculechecks - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/xmidt-org/webpa-common/v2/xmetrics" -) - -func newTestAuthCapabilityCheckMeasure() *AuthCapabilityCheckMeasures { - return NewAuthCapabilityCheckMeasures(xmetrics.MustNewRegistry(nil, Metrics)) -} - -func TestSimpleRun(t *testing.T) { - assert := assert.New(t) - assert.NotNil(newTestAuthCapabilityCheckMeasure()) -} diff --git a/basculechecks/metricvalidator.go b/basculechecks/metricvalidator.go deleted file mode 100644 index e35c2bc7..00000000 --- a/basculechecks/metricvalidator.go +++ /dev/null @@ -1,179 +0,0 @@ -/** - * Copyright 2020 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -package basculechecks - -import ( - "context" - "fmt" - "regexp" - - "github.com/spf13/cast" - "github.com/xmidt-org/bascule" -) - -// CapabilitiesChecker is an object that can determine if a request is -// authorized given a bascule.Authentication object. If it's not authorized, a -// reason and error are given for logging and metrics. -type CapabilitiesChecker interface { - Check(auth bascule.Authentication, vals ParsedValues) (string, error) -} - -// ParsedValues are values determined from the bascule Authentication. -type ParsedValues struct { - // Endpoint is the string representation of a regular expression that - // matches the URL for the request. The main benefit of this string is it - // most likely won't include strings that change from one request to the - // next (ie, device ID). - Endpoint string - // Partner is a string representation of the list of partners found in the - // JWT, where: - // - any list including "*" as a partner is determined to be "wildcard". - // - when the list is <1 item, the partner is determined to be "none". - // - when the list is >1 item, the partner is determined to be "many". - // - when the list is only one item, that is the partner value. - Partner string -} - -// MetricValidator determines if a request is authorized and then updates a -// metric to show those results. -type MetricValidator struct { - C CapabilitiesChecker - Measures *AuthCapabilityCheckMeasures - Endpoints []*regexp.Regexp -} - -// CreateValidator provides a function for authorization middleware. The -// function parses the information needed for the CapabilitiesChecker, calls it -// to determine if the request is authorized, and maintains the results in a -// metric. The function can actually mark the request as unauthorized or just -// update the metric and allow the request, depending on configuration. This -// allows for monitoring before being more strict with authorization. -func (m MetricValidator) CreateValidator(errorOut bool) bascule.ValidatorFunc { - return func(ctx context.Context, _ bascule.Token) error { - // if we're not supposed to error out, the outcome should be accepted on failure - failureOutcome := AcceptedOutcome - if errorOut { - // if we actually error out, the outcome is the request being rejected - failureOutcome = RejectedOutcome - } - - auth, ok := bascule.FromContext(ctx) - if !ok { - m.Measures.CapabilityCheckOutcome.With(OutcomeLabel, failureOutcome, ReasonLabel, TokenMissing, ClientIDLabel, "", PartnerIDLabel, "", EndpointLabel, "").Add(1) - if errorOut { - return ErrNoAuth - } - return nil - } - - client, partnerID, endpoint, reason, err := m.prepMetrics(auth) - labels := []string{ClientIDLabel, client, PartnerIDLabel, partnerID, EndpointLabel, endpoint} - if err != nil { - labels = append(labels, OutcomeLabel, failureOutcome, ReasonLabel, reason) - m.Measures.CapabilityCheckOutcome.With(labels...).Add(1) - if errorOut { - return err - } - return nil - } - - v := ParsedValues{ - Endpoint: endpoint, - Partner: partnerID, - } - - reason, err = m.C.Check(auth, v) - if err != nil { - labels = append(labels, OutcomeLabel, failureOutcome, ReasonLabel, reason) - m.Measures.CapabilityCheckOutcome.With(labels...).Add(1) - if errorOut { - return err - } - return nil - } - - labels = append(labels, OutcomeLabel, AcceptedOutcome, ReasonLabel, "") - m.Measures.CapabilityCheckOutcome.With(labels...).Add(1) - return nil - } -} - -// prepMetrics gathers the information needed for metric label information. It -// gathers the client ID, partnerID, and endpoint (bucketed) for more information -// on the metric when a request is unauthorized. -func (m MetricValidator) prepMetrics(auth bascule.Authentication) (string, string, string, string, error) { - if auth.Token == nil { - return "", "", "", TokenMissingValues, ErrNoToken - } - client := auth.Token.Principal() - if auth.Token.Attributes() == nil { - return client, "", "", TokenMissingValues, ErrNilAttributes - } - - partnerVal, ok := bascule.GetNestedAttribute(auth.Token.Attributes(), PartnerKeys()...) - if !ok { - return client, "", "", UndeterminedPartnerID, fmt.Errorf("couldn't get partner IDs from attributes using keys %v", PartnerKeys()) - } - partnerIDs, err := cast.ToStringSliceE(partnerVal) - if err != nil { - return client, "", "", UndeterminedPartnerID, fmt.Errorf("partner IDs \"%v\" couldn't be cast to string slice: %v", partnerVal, err) - } - partnerID := DeterminePartnerMetric(partnerIDs) - - if auth.Request.URL == nil { - return client, partnerID, "", TokenMissingValues, ErrNoURL - } - escapedURL := auth.Request.URL.EscapedPath() - endpoint := determineEndpointMetric(m.Endpoints, escapedURL) - return client, partnerID, endpoint, "", nil -} - -// DeterminePartnerMetric takes a list of partners and decides what the partner -// metric label should be. -func DeterminePartnerMetric(partners []string) string { - if len(partners) < 1 { - return "none" - } - if len(partners) == 1 { - if partners[0] == "*" { - return "wildcard" - } - return partners[0] - } - for _, partner := range partners { - if partner == "*" { - return "wildcard" - } - } - return "many" -} - -// determineEndpointMetric takes a list of regular expressions and applies them -// to the url of the request to decide what the endpoint metric label should be. -func determineEndpointMetric(endpoints []*regexp.Regexp, urlHit string) string { - for _, r := range endpoints { - idxs := r.FindStringIndex(urlHit) - if idxs == nil { - continue - } - if idxs[0] == 0 { - return r.String() - } - } - return "not_recognized" -} diff --git a/basculechecks/metricvalidator_test.go b/basculechecks/metricvalidator_test.go deleted file mode 100644 index 57c4b20f..00000000 --- a/basculechecks/metricvalidator_test.go +++ /dev/null @@ -1,351 +0,0 @@ -/** - * Copyright 2020 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -package basculechecks - -import ( - "context" - "errors" - "net/url" - "regexp" - "testing" - - "github.com/go-kit/kit/metrics/generic" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/bascule" -) - -func TestMetricValidatorFunc(t *testing.T) { - goodURL, err := url.Parse("/test") - require.Nil(t, err) - capabilities := []string{ - "test", - "a", - "joweiafuoiuoiwauf", - "it's a match", - } - goodAttributes := bascule.NewAttributes(map[string]interface{}{ - CapabilityKey: capabilities, - "allowedResources": map[string]interface{}{ - "allowedPartners": []string{"meh"}, - }, - }) - - tests := []struct { - description string - includeAuth bool - attributes bascule.Attributes - checkCallExpected bool - checkReason string - checkErr error - errorOut bool - errExpected bool - }{ - { - description: "Success", - includeAuth: true, - attributes: goodAttributes, - checkCallExpected: true, - errorOut: true, - }, - { - description: "Include Auth Error", - errorOut: true, - errExpected: true, - }, - { - description: "Include Auth Suppressed Error", - errorOut: false, - }, - { - description: "Prep Metrics Error", - includeAuth: true, - attributes: nil, - errorOut: true, - errExpected: true, - }, - { - description: "Prep Metrics Suppressed Error", - includeAuth: true, - attributes: nil, - errorOut: false, - }, - { - description: "Check Error", - includeAuth: true, - attributes: goodAttributes, - checkCallExpected: true, - checkReason: NoCapabilitiesMatch, - checkErr: errors.New("test check error"), - errorOut: true, - errExpected: true, - }, - { - description: "Check Suppressed Error", - includeAuth: true, - attributes: goodAttributes, - checkCallExpected: true, - checkReason: NoCapabilitiesMatch, - checkErr: errors.New("test check error"), - errorOut: false, - }, - } - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - assert := assert.New(t) - - ctx := context.Background() - auth := bascule.Authentication{ - Token: bascule.NewToken("test", "princ", tc.attributes), - Request: bascule.Request{ - URL: goodURL, - Method: "GET", - }, - } - if tc.includeAuth { - ctx = bascule.WithAuthentication(ctx, auth) - } - mockCapabilitiesChecker := new(mockCapabilitiesChecker) - if tc.checkCallExpected { - mockCapabilitiesChecker.On("Check", mock.Anything, mock.Anything).Return(tc.checkReason, tc.checkErr).Once() - } - - counter := generic.NewCounter("test_capability_check") - mockMeasures := AuthCapabilityCheckMeasures{ - CapabilityCheckOutcome: counter, - } - - m := MetricValidator{ - C: mockCapabilitiesChecker, - Measures: &mockMeasures, - } - err := m.CreateValidator(tc.errorOut)(ctx, nil) - mockCapabilitiesChecker.AssertExpectations(t) - if tc.errExpected { - assert.NotNil(err) - return - } - assert.Nil(err) - }) - } -} - -func TestPrepMetrics(t *testing.T) { - type testType int - var ( - goodURL = "/asnkfn/aefkijeoij/aiogj" - matchingURL = "/fnvvdsjkfji/mac:12345544322345334/geigosj" - client = "special" - prepErr = errors.New("couldn't get partner IDs from attributes") - badValErr = errors.New("couldn't be cast to string slice") - goodEndpoint = `/fnvvdsjkfji/.*/geigosj\b` - goodRegex = regexp.MustCompile(goodEndpoint) - unusedEndpoint = `/a/b\b` - unusedRegex = regexp.MustCompile(unusedEndpoint) - ) - - tests := []struct { - description string - noPartnerID bool - partnerIDs interface{} - url string - includeToken bool - includeAttributes bool - includeURL bool - expectedPartner string - expectedEndpoint string - expectedReason string - expectedErr error - }{ - { - description: "Success", - partnerIDs: []string{"partner"}, - url: goodURL, - includeToken: true, - includeAttributes: true, - includeURL: true, - expectedPartner: "partner", - expectedEndpoint: "not_recognized", - expectedReason: "", - expectedErr: nil, - }, - { - description: "Success Abridged URL", - partnerIDs: []string{"partner"}, - url: matchingURL, - includeToken: true, - includeAttributes: true, - includeURL: true, - expectedPartner: "partner", - expectedEndpoint: goodEndpoint, - expectedReason: "", - expectedErr: nil, - }, - { - description: "Nil Token Error", - expectedReason: TokenMissingValues, - expectedErr: ErrNoToken, - }, - { - description: "Nil Token Attributes Error", - url: goodURL, - includeToken: true, - expectedReason: TokenMissingValues, - expectedErr: ErrNilAttributes, - }, - { - description: "No Partner ID Error", - noPartnerID: true, - url: goodURL, - includeToken: true, - includeAttributes: true, - expectedPartner: "", - expectedEndpoint: "", - expectedReason: UndeterminedPartnerID, - expectedErr: prepErr, - }, - { - description: "Non String Slice Partner ID Error", - partnerIDs: []testType{0, 1, 2}, - url: goodURL, - includeToken: true, - includeAttributes: true, - expectedPartner: "", - expectedEndpoint: "", - expectedReason: UndeterminedPartnerID, - expectedErr: badValErr, - }, - { - description: "Non Slice Partner ID Error", - partnerIDs: struct{ string }{}, - url: goodURL, - includeToken: true, - includeAttributes: true, - expectedPartner: "", - expectedEndpoint: "", - expectedReason: UndeterminedPartnerID, - expectedErr: badValErr, - }, - { - description: "Nil URL Error", - partnerIDs: []string{"partner"}, - url: goodURL, - includeToken: true, - includeAttributes: true, - expectedPartner: "partner", - expectedReason: TokenMissingValues, - expectedErr: ErrNoURL, - }, - } - - m := MetricValidator{ - Endpoints: []*regexp.Regexp{unusedRegex, goodRegex}, - } - - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - require := require.New(t) - assert := assert.New(t) - - // setup auth - token := bascule.NewToken("mehType", client, nil) - if tc.includeAttributes { - a := map[string]interface{}{ - "allowedResources": map[string]interface{}{ - "allowedPartners": tc.partnerIDs, - }, - } - - if tc.noPartnerID { - a["allowedResources"] = 5 - } - attributes := bascule.NewAttributes(a) - token = bascule.NewToken("mehType", client, attributes) - } - auth := bascule.Authentication{ - Authorization: "testAuth", - Request: bascule.Request{ - Method: "get", - }, - } - if tc.includeToken { - auth.Token = token - } - if tc.includeURL { - u, err := url.ParseRequestURI(tc.url) - require.Nil(err) - auth.Request.URL = u - } - - c, partner, endpoint, reason, err := m.prepMetrics(auth) - if tc.includeToken { - assert.Equal(client, c) - } - assert.Equal(tc.expectedPartner, partner) - assert.Equal(tc.expectedEndpoint, endpoint) - assert.Equal(tc.expectedReason, reason) - if err == nil || tc.expectedErr == nil { - assert.Equal(tc.expectedErr, err) - } else { - assert.Contains(err.Error(), tc.expectedErr.Error()) - } - }) - } -} - -func TestDeterminePartnerMetric(t *testing.T) { - tests := []struct { - description string - partnersInput []string - expectedResult string - }{ - { - description: "No Partners", - expectedResult: "none", - }, - { - description: "one wildcard", - partnersInput: []string{"*"}, - expectedResult: "wildcard", - }, - { - description: "one partner", - partnersInput: []string{"TestPartner"}, - expectedResult: "TestPartner", - }, - { - description: "many partners", - partnersInput: []string{"partner1", "partner2", "partner3"}, - expectedResult: "many", - }, - { - description: "many partners with wildcard", - partnersInput: []string{"partner1", "partner2", "partner3", "*"}, - expectedResult: "wildcard", - }, - } - - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - assert := assert.New(t) - partner := DeterminePartnerMetric(tc.partnersInput) - assert.Equal(tc.expectedResult, partner) - }) - } -} diff --git a/basculechecks/mocks_test.go b/basculechecks/mocks_test.go deleted file mode 100644 index ac8fcdce..00000000 --- a/basculechecks/mocks_test.go +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2020 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -package basculechecks - -import ( - "github.com/stretchr/testify/mock" - "github.com/xmidt-org/bascule" -) - -type mockCapabilitiesChecker struct { - mock.Mock -} - -func (m *mockCapabilitiesChecker) Check(auth bascule.Authentication, v ParsedValues) (string, error) { - args := m.Called(auth, v) - return args.String(0), args.Error(1) -} From edd0096daba7eb02ebf2277ed59057d635ee36e8 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:10:04 -0400 Subject: [PATCH 17/48] remove package basculemetrics --- basculemetrics/doc.go | 30 ------ basculemetrics/metricListener.go | 84 --------------- basculemetrics/metrics.go | 170 ------------------------------- basculemetrics/metrics_test.go | 17 ---- 4 files changed, 301 deletions(-) delete mode 100644 basculemetrics/doc.go delete mode 100644 basculemetrics/metricListener.go delete mode 100644 basculemetrics/metrics.go delete mode 100644 basculemetrics/metrics_test.go diff --git a/basculemetrics/doc.go b/basculemetrics/doc.go deleted file mode 100644 index d02f5ec4..00000000 --- a/basculemetrics/doc.go +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright 2021 Comcast Cable Communications Management, LLC - * - * 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. - * - */ - -/* -Package basculemetrics provides bascule-compatible metric middleware that tracks -if requests were authorized or not. - -Deprecated: basculemetrics is no longer planned to be used by future WebPA/XMiDT -services. - -This package is frozen and no new functionality will be added. Fixes may be made -in order to maintain compatibility with github.com/xmidt-org/bascule for -services dependent on this package. -*/ - -package basculemetrics diff --git a/basculemetrics/metricListener.go b/basculemetrics/metricListener.go deleted file mode 100644 index 8919dea5..00000000 --- a/basculemetrics/metricListener.go +++ /dev/null @@ -1,84 +0,0 @@ -package basculemetrics - -import ( - "time" - - "github.com/SermoDigital/jose/jwt" - "github.com/xmidt-org/bascule" - "github.com/xmidt-org/bascule/basculehttp" -) - -type MetricListener struct { - expLeeway time.Duration - nbfLeeway time.Duration - measures *AuthValidationMeasures -} - -func (m *MetricListener) OnAuthenticated(auth bascule.Authentication) { - now := time.Now() - - if m.measures == nil { - return // measure tools are not defined, skip - } - - if auth.Token == nil { - return - } - - m.measures.ValidationOutcome.With(OutcomeLabel, "Accepted").Add(1) - - c, ok := auth.Token.Attributes().Get("claims") - if !ok { - return // if there aren't any claims, skip - } - claims, ok := c.(jwt.Claims) - if !ok { - return // if claims aren't what we expect, skip - } - - //how far did we land from the NBF (in seconds): ie. -1 means 1 sec before, 1 means 1 sec after - if nbf, nbfPresent := claims.NotBefore(); nbfPresent { - nbf = nbf.Add(-m.nbfLeeway) - offsetToNBF := now.Sub(nbf).Seconds() - m.measures.NBFHistogram.Observe(offsetToNBF) - } - - //how far did we land from the EXP (in seconds): ie. -1 means 1 sec before, 1 means 1 sec after - if exp, expPresent := claims.Expiration(); expPresent { - exp = exp.Add(m.expLeeway) - offsetToEXP := now.Sub(exp).Seconds() - m.measures.ExpHistogram.Observe(offsetToEXP) - } -} - -func (m *MetricListener) OnErrorResponse(e basculehttp.ErrorResponseReason, _ error) { - if m.measures == nil { - return - } - m.measures.ValidationOutcome.With(OutcomeLabel, e.String()).Add(1) -} - -type Option func(m *MetricListener) - -func WithExpLeeway(e time.Duration) Option { - return func(m *MetricListener) { - m.expLeeway = e - } -} - -func WithNbfLeeway(n time.Duration) Option { - return func(m *MetricListener) { - m.nbfLeeway = n - } -} - -func NewMetricListener(m *AuthValidationMeasures, options ...Option) *MetricListener { - listener := MetricListener{ - measures: m, - } - - for _, o := range options { - o(&listener) - } - return &listener -} diff --git a/basculemetrics/metrics.go b/basculemetrics/metrics.go deleted file mode 100644 index 3e6e2a91..00000000 --- a/basculemetrics/metrics.go +++ /dev/null @@ -1,170 +0,0 @@ -package basculemetrics - -import ( - "fmt" - - "github.com/go-kit/kit/metrics" - gokitprometheus "github.com/go-kit/kit/metrics/prometheus" - "github.com/prometheus/client_golang/prometheus" - themisXmetrics "github.com/xmidt-org/themis/xmetrics" - "github.com/xmidt-org/webpa-common/v2/xmetrics" - "go.uber.org/fx" - "go.uber.org/zap" -) - -// Names for our metrics -const ( - AuthValidationOutcome = "auth_validation" - NBFHistogram = "auth_from_nbf_seconds" - EXPHistogram = "auth_from_exp_seconds" -) - -// labels -const ( - OutcomeLabel = "outcome" - ServerLabel = "server" -) - -// help messages -const ( - authValidationOutcomeHelpMsg = "Counter for success and failure reason results through bascule" - nbfHelpMsg = "Difference (in seconds) between time of JWT validation and nbf (including leeway)" - expHelpMsg = "Difference (in seconds) between time of JWT validation and exp (including leeway)" -) - -// Metrics returns the Metrics relevant to this package targeting our older non uber/fx applications. -// To initialize the metrics, use NewAuthValidationMeasures(). -func Metrics() []xmetrics.Metric { - return []xmetrics.Metric{ - { - Name: AuthValidationOutcome, - Type: xmetrics.CounterType, - Help: authValidationOutcomeHelpMsg, - LabelNames: []string{OutcomeLabel}, - }, - { - Name: NBFHistogram, - Type: xmetrics.HistogramType, - Help: nbfHelpMsg, - Buckets: []float64{-61, -11, -2, -1, 0, 9, 60}, // defines the upper inclusive (<=) bounds - }, - { - Name: EXPHistogram, - Type: xmetrics.HistogramType, - Help: expHelpMsg, - Buckets: []float64{-61, -11, -2, -1, 0, 9, 60}, - }, - } -} - -// ProvideMetrics provides the metrics relevant to this package as uber/fx options. -// This is now deprecated in favor of ProvideMetricsVec. -func ProvideMetrics() fx.Option { - return fx.Provide( - themisXmetrics.ProvideCounter(prometheus.CounterOpts{ - Name: AuthValidationOutcome, - Help: authValidationOutcomeHelpMsg, - ConstLabels: nil, - }, OutcomeLabel), - themisXmetrics.ProvideHistogram(prometheus.HistogramOpts{ - Name: NBFHistogram, - - Help: nbfHelpMsg, - Buckets: []float64{-61, -11, -2, -1, 0, 9, 60}, // defines the upper inclusive (<=) bounds - }), - themisXmetrics.ProvideHistogram(prometheus.HistogramOpts{ - Name: EXPHistogram, - Help: expHelpMsg, - Buckets: []float64{-61, -11, -2, -1, 0, 9, 60}, - }), - ) -} - -// ProvideMetricsVec provides the metrics relevant to this package as uber/fx options. -// The provided metrics are prometheus vectors which gives access to more advanced operations such as CurryWith(labels). -func ProvideMetricsVec() fx.Option { - return fx.Provide( - themisXmetrics.ProvideCounterVec(prometheus.CounterOpts{ - Name: AuthValidationOutcome, - Help: authValidationOutcomeHelpMsg, - ConstLabels: nil, - }, ServerLabel, OutcomeLabel), - themisXmetrics.ProvideHistogramVec(prometheus.HistogramOpts{ - Name: NBFHistogram, - Help: nbfHelpMsg, - Buckets: []float64{-61, -11, -2, -1, 0, 9, 60}, // defines the upper inclusive (<=) bounds - }, ServerLabel), - themisXmetrics.ProvideHistogramVec(prometheus.HistogramOpts{ - Name: EXPHistogram, - Help: expHelpMsg, - Buckets: []float64{-61, -11, -2, -1, 0, 9, 60}, - }, ServerLabel), - ) -} - -// AuthValidationMeasures describes the defined metrics that will be used by clients -type AuthValidationMeasures struct { - fx.In - - NBFHistogram metrics.Histogram - ExpHistogram metrics.Histogram - ValidationOutcome metrics.Counter -} - -// NewAuthValidationMeasures realizes desired metrics. It's intended to be used alongside Metrics() for -// our older non uber/fx applications. -func NewAuthValidationMeasures(r xmetrics.Registry) *AuthValidationMeasures { - return &AuthValidationMeasures{ - NBFHistogram: gokitprometheus.NewHistogram(r.NewHistogramVec(NBFHistogram)), - ExpHistogram: gokitprometheus.NewHistogram(r.NewHistogramVec(EXPHistogram)), - ValidationOutcome: r.NewCounter(AuthValidationOutcome), - } -} - -// BaseMeasuresIn is an uber/fx parameter with base metrics ready to be curried into child metrics based on -// custom labels. -type BaseMeasuresIn struct { - fx.In - Logger *zap.Logger - - NBFHistogram *prometheus.HistogramVec `name:"auth_from_nbf_seconds"` - ExpHistogram *prometheus.HistogramVec `name:"auth_from_exp_seconds"` - ValidationOutcome *prometheus.CounterVec `name:"auth_validation"` -} - -// ListenerFactory facilitates the creation of a server-aware metric listener. -type ListenerFactory struct { - ServerName string -} - -// New builds the metric listener from the provided metrics. -func (m ListenerFactory) New(in BaseMeasuresIn) (*MetricListener, error) { - in.Logger.Debug("building auth validation measures", zap.String(ServerLabel, m.ServerName)) - nbfHistogramVec, err := in.NBFHistogram.CurryWith(prometheus.Labels{ServerLabel: m.ServerName}) - if err != nil { - return nil, err - } - expHistogramVec, err := in.ExpHistogram.CurryWith(prometheus.Labels{ServerLabel: m.ServerName}) - if err != nil { - return nil, err - } - validationOutcomeCounterVec, err := in.ValidationOutcome.CurryWith(prometheus.Labels{ServerLabel: m.ServerName}) - if err != nil { - return nil, err - } - - measures := &AuthValidationMeasures{ - NBFHistogram: gokitprometheus.NewHistogram(nbfHistogramVec.(*prometheus.HistogramVec)), - ExpHistogram: gokitprometheus.NewHistogram(expHistogramVec.(*prometheus.HistogramVec)), - ValidationOutcome: gokitprometheus.NewCounter(validationOutcomeCounterVec), - } - return NewMetricListener(measures), nil -} - -// Annotated provides the listener as an annotated component with the name "[SERVER]_bascule_metric_listener" -func (m ListenerFactory) Annotated() fx.Annotated { - return fx.Annotated{ - Name: fmt.Sprintf("%s_bascule_metric_listener", m.ServerName), - Target: m.New, - } -} diff --git a/basculemetrics/metrics_test.go b/basculemetrics/metrics_test.go deleted file mode 100644 index e0e93987..00000000 --- a/basculemetrics/metrics_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package basculemetrics - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/xmidt-org/webpa-common/v2/xmetrics" -) - -func newTestAuthValidationMeasure() *AuthValidationMeasures { - return NewAuthValidationMeasures(xmetrics.MustNewRegistry(nil, Metrics)) -} - -func TestSimpleRun(t *testing.T) { - assert := assert.New(t) - assert.NotNil(newTestAuthValidationMeasure()) -} From 07d35c433cba7513b37b825fc3d1869b15f8c7dd Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:10:17 -0400 Subject: [PATCH 18/48] remove package capacitor --- capacitor/capacitor.go | 179 ------------------------- capacitor/capacitor_test.go | 222 -------------------------------- capacitor/capacitortest/mock.go | 36 ------ capacitor/doc.go | 5 - 4 files changed, 442 deletions(-) delete mode 100644 capacitor/capacitor.go delete mode 100644 capacitor/capacitor_test.go delete mode 100644 capacitor/capacitortest/mock.go delete mode 100644 capacitor/doc.go diff --git a/capacitor/capacitor.go b/capacitor/capacitor.go deleted file mode 100644 index 70a5640b..00000000 --- a/capacitor/capacitor.go +++ /dev/null @@ -1,179 +0,0 @@ -package capacitor - -import ( - "sync" - "sync/atomic" - "time" - - "github.com/xmidt-org/webpa-common/v2/clock" -) - -// DefaultDelay is the default time a capacitor waits to execute the most recently -// submitted function -const DefaultDelay time.Duration = time.Second - -// Interface represents a capacitor of function calls which will discharge after -// a configurable period of time. -type Interface interface { - // Submit submits a function for execution. The function will not be executed immediately. - // Instead, after a configurable period of time, the most recent function passed to Submit will - // be executed. The previous ones are ignored. - Submit(func()) - - // Discharge forcibly discharges this capacitor. The most recent function passed to Submit is - // executed, and the internal state is reset so that the next call to Submit will start the - // process of delaying function calls all over again. - Discharge() - - // Cancel terminates any waiting function call without executing it. As with Discharge, the - // internal state is reset so that Submit calls will delay functions as normal again. - Cancel() -} - -// Option represents a configuration option for a capacitor -type Option func(*capacitor) - -func WithDelay(d time.Duration) Option { - return func(c *capacitor) { - if d > 0 { - c.delay = d - } else { - c.delay = DefaultDelay - } - } -} - -func WithClock(cl clock.Interface) Option { - return func(c *capacitor) { - if cl != nil { - c.c = cl - } else { - c.c = clock.System() - } - } -} - -// New creates a capacitor with the given options. -func New(o ...Option) Interface { - c := &capacitor{ - delay: DefaultDelay, - c: clock.System(), - } - - for _, f := range o { - f(c) - } - - return c -} - -// delayer is the internal job type that holds the context for a single, delayed -// charge of the capacitor -type delayer struct { - current atomic.Value - timer <-chan time.Time - terminate chan bool - cleanup func() -} - -func (d *delayer) discharge() { - d.terminate <- true -} - -func (d *delayer) cancel() { - d.terminate <- false -} - -func (d *delayer) execute() { - if f, ok := d.current.Load().(func()); f != nil && ok { - f() - } -} - -// run is called as a goroutine and will exit when either the timer channel -// is signalled or the terminate channel receives a value. -func (d *delayer) run() { - defer d.cleanup() - - select { - case <-d.timer: - // since the timer can fire at the same time as Discharge or Cancel, - // we want to make sure that any type of explicit termination trumps the timer - select { - case discharge := <-d.terminate: - if discharge { - d.execute() - } - - default: - d.execute() - } - - case discharge := <-d.terminate: - if discharge { - d.execute() - } - } -} - -// capacitor implements Interface, and provides an atomically updated delayer job -type capacitor struct { - lock sync.Mutex - delay time.Duration - c clock.Interface - d *delayer -} - -func (c *capacitor) Submit(v func()) { - c.lock.Lock() - if c.d == nil { - var ( - t = c.c.NewTimer(c.delay) - d = &delayer{ - terminate: make(chan bool, 1), - timer: t.C(), - } - ) - - d.current.Store(v) - - // create a cleanup closure that stops the timer and - // ensures that the given delayer is cleared, allowing - // for barging. - d.cleanup = func() { - t.Stop() - c.lock.Lock() - if c.d == d { - c.d = nil - } - c.lock.Unlock() - } - - c.d = d - go c.d.run() - } else { - c.d.current.Store(v) - } - - c.lock.Unlock() -} - -func (c *capacitor) Discharge() { - c.lock.Lock() - if c.d != nil { - c.d.discharge() - c.d = nil - } - - c.lock.Unlock() -} - -func (c *capacitor) Cancel() { - c.lock.Lock() - if c.d != nil { - c.d.cancel() - c.d = nil - } - - c.lock.Unlock() -} diff --git a/capacitor/capacitor_test.go b/capacitor/capacitor_test.go deleted file mode 100644 index e5257921..00000000 --- a/capacitor/capacitor_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package capacitor - -import ( - "fmt" - "sync" - "sync/atomic" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/clock/clocktest" -) - -func ExampleBasicUsage() { - var ( - c = New() - w = new(sync.WaitGroup) - ) - - w.Add(1) - - // this may or may not be executed, depending on timing of the machine where this is run - c.Submit(func() {}) - - // we'll wait until this is executed - c.Submit(func() { - fmt.Println("Discharged") - w.Done() - }) - - w.Wait() - - // Output: - // Discharged -} - -func testWithDelayDefault(t *testing.T) { - var ( - assert = assert.New(t) - c = new(capacitor) - ) - - WithDelay(0)(c) - assert.Equal(DefaultDelay, c.delay) -} - -func testWithDelayCustom(t *testing.T) { - var ( - assert = assert.New(t) - c = new(capacitor) - ) - - WithDelay(31 * time.Minute)(c) - assert.Equal(31*time.Minute, c.delay) -} - -func TestWithDelay(t *testing.T) { - t.Run("Default", testWithDelayDefault) - t.Run("Custom", testWithDelayCustom) -} - -func testWithClockDefault(t *testing.T) { - var ( - assert = assert.New(t) - c = new(capacitor) - ) - - WithClock(nil)(c) - assert.NotNil(c.c) -} - -func testWithClockCustom(t *testing.T) { - var ( - assert = assert.New(t) - cl = new(clocktest.Mock) - c = new(capacitor) - ) - - WithClock(cl)(c) - assert.Equal(cl, c.c) -} - -func TestWithClock(t *testing.T) { - t.Run("Default", testWithClockDefault) - t.Run("Custom", testWithClockCustom) -} - -func testCapacitorSubmit(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - - stopped = make(chan struct{}) - calls int32 - f = func() { - atomic.AddInt32(&calls, 1) - } - - cl = new(clocktest.Mock) - timer = new(clocktest.MockTimer) - trigger = make(chan time.Time, 1) - c = New(WithDelay(time.Minute), WithClock(cl)) - ) - - require.NotNil(c) - cl.OnNewTimer(time.Minute, timer).Once() - timer.OnC(trigger).Once() - timer.OnStop(true).Once().Run(func(mock.Arguments) { - close(stopped) - }) - - for i := 0; i < 10; i++ { - c.Submit(f) - } - - trigger <- time.Time{} - - select { - case <-stopped: - // passing - case <-time.After(5 * time.Second): - assert.Fail("The capacitor did not discharge properly") - } - - cl.AssertExpectations(t) - timer.AssertExpectations(t) - assert.Equal(int32(1), atomic.LoadInt32(&calls)) -} - -func testCapacitorDischarge(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - - stopped = make(chan struct{}) - calls int32 - f = func() { - atomic.AddInt32(&calls, 1) - } - - cl = new(clocktest.Mock) - timer = new(clocktest.MockTimer) - trigger = make(chan time.Time) - c = New(WithDelay(time.Minute), WithClock(cl)) - ) - - require.NotNil(c) - cl.OnNewTimer(time.Minute, timer).Once() - timer.OnC(trigger).Once() - timer.OnStop(true).Once().Run(func(mock.Arguments) { - close(stopped) - }) - - for i := 0; i < 10; i++ { - c.Submit(f) - } - - c.Discharge() - c.Discharge() // idempotent - - select { - case <-stopped: - // passing - case <-time.After(5 * time.Second): - assert.Fail("The capacitor did not discharge properly") - } - - cl.AssertExpectations(t) - timer.AssertExpectations(t) - assert.Equal(int32(1), atomic.LoadInt32(&calls)) -} - -func testCapacitorCancel(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - - stopped = make(chan struct{}) - calls int32 - f = func() { - atomic.AddInt32(&calls, 1) - } - - cl = new(clocktest.Mock) - timer = new(clocktest.MockTimer) - trigger = make(chan time.Time) - c = New(WithDelay(time.Minute), WithClock(cl)) - ) - - require.NotNil(c) - cl.OnNewTimer(time.Minute, timer).Once() - timer.OnC(trigger).Once() - timer.OnStop(true).Once().Run(func(mock.Arguments) { - close(stopped) - }) - - for i := 0; i < 10; i++ { - c.Submit(f) - } - - c.Cancel() - c.Cancel() // idempotent - - select { - case <-stopped: - // passing - case <-time.After(5 * time.Second): - assert.Fail("The capacitor did not discharge properly") - } - - cl.AssertExpectations(t) - timer.AssertExpectations(t) - assert.Zero(atomic.LoadInt32(&calls)) -} - -func TestCapacitor(t *testing.T) { - t.Run("Submit", testCapacitorSubmit) - t.Run("Discharge", testCapacitorDischarge) - t.Run("Cancel", testCapacitorCancel) -} diff --git a/capacitor/capacitortest/mock.go b/capacitor/capacitortest/mock.go deleted file mode 100644 index 58e16e28..00000000 --- a/capacitor/capacitortest/mock.go +++ /dev/null @@ -1,36 +0,0 @@ -package capacitortest - -import ( - "github.com/stretchr/testify/mock" - "github.com/xmidt-org/webpa-common/v2/capacitor" -) - -type Mock struct { - mock.Mock -} - -var _ capacitor.Interface = (*Mock)(nil) - -func (m *Mock) Submit(f func()) { - m.Called(f) -} - -func (m *Mock) OnSubmit(f func()) *mock.Call { - return m.On("Submit", f) -} - -func (m *Mock) Discharge() { - m.Called() -} - -func (m *Mock) OnDischarge() *mock.Call { - return m.On("Discharge") -} - -func (m *Mock) Cancel() { - m.Called() -} - -func (m *Mock) OnCancel() *mock.Call { - return m.On("Cancel") -} diff --git a/capacitor/doc.go b/capacitor/doc.go deleted file mode 100644 index 2185d63a..00000000 --- a/capacitor/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -/* - Package capacitor provides a configurable delay for a series of function calls. A capacitor is discharged - when it is time to actually invoke the target function. -*/ -package capacitor From 5cfd43bde86ef3fb61ac60921b45a4651e702176 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:11:13 -0400 Subject: [PATCH 19/48] remove packages clock* --- clock/clock.go | 34 ------------- clock/clocktest/doc.go | 4 -- clock/clocktest/mocks.go | 101 --------------------------------------- clock/doc.go | 4 -- clock/ticker.go | 20 -------- clock/timer.go | 24 ---------- 6 files changed, 187 deletions(-) delete mode 100644 clock/clock.go delete mode 100644 clock/clocktest/doc.go delete mode 100644 clock/clocktest/mocks.go delete mode 100644 clock/doc.go delete mode 100644 clock/ticker.go delete mode 100644 clock/timer.go diff --git a/clock/clock.go b/clock/clock.go deleted file mode 100644 index 409b67f8..00000000 --- a/clock/clock.go +++ /dev/null @@ -1,34 +0,0 @@ -package clock - -import "time" - -// Interface represents a clock with the same core functionality available as in the stdlib time package -type Interface interface { - Now() time.Time - Sleep(time.Duration) - NewTicker(time.Duration) Ticker - NewTimer(time.Duration) Timer -} - -type systemClock struct{} - -func (sc systemClock) Now() time.Time { - return time.Now() -} - -func (sc systemClock) Sleep(d time.Duration) { - time.Sleep(d) -} - -func (sc systemClock) NewTicker(d time.Duration) Ticker { - return systemTicker{time.NewTicker(d)} -} - -func (sc systemClock) NewTimer(d time.Duration) Timer { - return systemTimer{time.NewTimer(d)} -} - -// System returns a clock backed by the time package -func System() Interface { - return systemClock{} -} diff --git a/clock/clocktest/doc.go b/clock/clocktest/doc.go deleted file mode 100644 index 5dcd0b84..00000000 --- a/clock/clocktest/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -/* -Package clocktest provides a testable clock implementation -*/ -package clocktest diff --git a/clock/clocktest/mocks.go b/clock/clocktest/mocks.go deleted file mode 100644 index ba3711a1..00000000 --- a/clock/clocktest/mocks.go +++ /dev/null @@ -1,101 +0,0 @@ -package clocktest - -import ( - "time" - - "github.com/stretchr/testify/mock" - "github.com/xmidt-org/webpa-common/v2/clock" -) - -// Mock is a stretchr mock for a clock. In addition to implementing clock.Interface and supplying -// mock behavior, other methods that make mocking a bit easier are supplied. -type Mock struct { - mock.Mock -} - -var _ clock.Interface = (*Mock)(nil) - -func (m *Mock) Now() time.Time { - return m.Called().Get(0).(time.Time) -} - -func (m *Mock) OnNow(v time.Time) *mock.Call { - return m.On("Now").Return(v) -} - -func (m *Mock) Sleep(d time.Duration) { - m.Called(d) -} - -func (m *Mock) OnSleep(d time.Duration) *mock.Call { - return m.On("Sleep", d) -} - -func (m *Mock) NewTimer(d time.Duration) clock.Timer { - return m.Called(d).Get(0).(clock.Timer) -} - -func (m *Mock) OnNewTimer(d time.Duration, t clock.Timer) *mock.Call { - return m.On("NewTimer", d).Return(t) -} - -func (m *Mock) NewTicker(d time.Duration) clock.Ticker { - return m.Called(d).Get(0).(clock.Ticker) -} - -func (m *Mock) OnNewTicker(d time.Duration, t clock.Ticker) *mock.Call { - return m.On("NewTicker", d).Return(t) -} - -// MockTimer is a stretchr mock for the clock.Timer interface -type MockTimer struct { - mock.Mock -} - -var _ clock.Timer = (*MockTimer)(nil) - -func (m *MockTimer) C() <-chan time.Time { - return m.Called().Get(0).(<-chan time.Time) -} - -func (m *MockTimer) OnC(c <-chan time.Time) *mock.Call { - return m.On("C").Return(c) -} - -func (m *MockTimer) Reset(d time.Duration) bool { - return m.Called(d).Bool(0) -} - -func (m *MockTimer) OnReset(d time.Duration, r bool) *mock.Call { - return m.On("Reset", d).Return(r) -} - -func (m *MockTimer) Stop() bool { - return m.Called().Bool(0) -} - -func (m *MockTimer) OnStop(r bool) *mock.Call { - return m.On("Stop").Return(r) -} - -type MockTicker struct { - mock.Mock -} - -var _ clock.Ticker = (*MockTicker)(nil) - -func (m *MockTicker) C() <-chan time.Time { - return m.Called().Get(0).(<-chan time.Time) -} - -func (m *MockTicker) OnC(c <-chan time.Time) *mock.Call { - return m.On("C").Return(c) -} - -func (m *MockTicker) Stop() { - m.Called() -} - -func (m *MockTicker) OnStop() *mock.Call { - return m.On("Stop") -} diff --git a/clock/doc.go b/clock/doc.go deleted file mode 100644 index d4b98c29..00000000 --- a/clock/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -/* -Package clock implements a standard clock interface that can be used in place of the time package. -*/ -package clock diff --git a/clock/ticker.go b/clock/ticker.go deleted file mode 100644 index ecaab346..00000000 --- a/clock/ticker.go +++ /dev/null @@ -1,20 +0,0 @@ -package clock - -import "time" - -type Ticker interface { - C() <-chan time.Time - Stop() -} - -type systemTicker struct { - *time.Ticker -} - -func (st systemTicker) C() <-chan time.Time { - return st.Ticker.C -} - -func WrapTicker(t *time.Ticker) Ticker { - return systemTicker{t} -} diff --git a/clock/timer.go b/clock/timer.go deleted file mode 100644 index e965b95a..00000000 --- a/clock/timer.go +++ /dev/null @@ -1,24 +0,0 @@ -package clock - -import "time" - -// Timer represents an event source triggered at a particular time. It is the analog of time.Timer. -type Timer interface { - C() <-chan time.Time - Reset(time.Duration) bool - Stop() bool -} - -type systemTimer struct { - *time.Timer -} - -func (st systemTimer) C() <-chan time.Time { - return st.Timer.C -} - -// WrapTimer wraps a time.Timer in a clock.Timer. A typical usage would be -// WrapTimer(time.NewTimer(time.Second)). -func WrapTimer(t *time.Timer) Timer { - return systemTimer{t} -} From 002924ec7906e22fd516bd7e4a772385db2047f5 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:11:53 -0400 Subject: [PATCH 20/48] remove portions of concurrent package --- concurrent/keyValue.go | 141 ------------------------- concurrent/keyValue_test.go | 201 ------------------------------------ 2 files changed, 342 deletions(-) delete mode 100644 concurrent/keyValue.go delete mode 100644 concurrent/keyValue_test.go diff --git a/concurrent/keyValue.go b/concurrent/keyValue.go deleted file mode 100644 index ed13a43e..00000000 --- a/concurrent/keyValue.go +++ /dev/null @@ -1,141 +0,0 @@ -package concurrent - -import ( - "sync" -) - -// KeyValueStorage is the map type used by KeyValue. It is the type that is -// directly modifiable by operations. -type KeyValueStorage map[interface{}]interface{} - -// KeyValueOperation represents an atomic operation that is allowed to mutate the -// storage of a KeyValue. Operations are always executed within a critical -// section bounded by a write lock. -type KeyValueOperation interface { - Execute(KeyValueStorage) -} - -// KeyValueOperationFunc is a function type that implements KeyValueOperation. -type KeyValueOperationFunc func(KeyValueStorage) - -func (f KeyValueOperationFunc) Execute(storage KeyValueStorage) { - f(storage) -} - -// KeyValueTransformer is a binary operation that produces a result from a key/value pair. -// Transformers cannot mutate the storage of a KeyValue. Transformers are always -// executed within the context of a read lock. Multiple transformers can execute -// simultaneously. -type KeyValueTransformer interface { - Execute(key, value interface{}) interface{} -} - -// KeyValueTransformerFunc is a function type that implements KeyValueTransformer. -type KeyValueTransformerFunc func(key, value interface{}) interface{} - -func (f KeyValueTransformerFunc) Execute(key, value interface{}) interface{} { - return f(key, value) -} - -// KeyValue is a concurrent mapping of arbitrary types with a completely asynchronous API. -// Instances of this type must be created via NewKeyValue. -type KeyValue struct { - storage KeyValueStorage - lock sync.RWMutex -} - -// NewKeyValue initializes and returns a distinct KeyValue instance. -func NewKeyValue() *KeyValue { - return &KeyValue{ - storage: make(KeyValueStorage), - } -} - -// Apply uses the given transformer to produce a result for each key/value pair in the storage. -// A channel of channels is returned: The channel has a buffer size of 1 and will receive another -// channel containing the results of applying the transformer. -func (kv *KeyValue) Apply(transformer KeyValueTransformer) <-chan chan interface{} { - output := make(chan chan interface{}, 1) - go func() { - kv.lock.RLock() - defer kv.lock.RUnlock() - defer close(output) - - results := make(chan interface{}, len(kv.storage)) - defer close(results) - output <- results - - for key, value := range kv.storage { - results <- transformer.Execute(key, value) - } - }() - - return output -} - -// Keys is a special usage of Apply: It returns a channel which in turn receives a channel -// containing the keys in the internal storage. -func (kv *KeyValue) Keys() <-chan chan interface{} { - return kv.Apply( - KeyValueTransformerFunc( - func(key, value interface{}) interface{} { return key }, - ), - ) -} - -// Values is a special usage of Apply: It returns a channel which in turn receives a channel -// containing the values in the internal storage. -func (kv *KeyValue) Values() <-chan chan interface{} { - return kv.Apply( - KeyValueTransformerFunc( - func(key, value interface{}) interface{} { return value }, - ), - ) -} - -// Do asynchronously executes a bulk operation against the internal storage. -// This method contends on the internal write lock. -func (kv *KeyValue) Do(operation KeyValueOperation) { - go func() { - kv.lock.Lock() - defer kv.lock.Unlock() - operation.Execute(kv.storage) - }() -} - -// Get asynchronously obtains the value associated with the given key. The returned -// channel always receives exactly one (1) value. It will receive nil if the given -// key was not present in the storage. -func (kv *KeyValue) Get(key interface{}) <-chan interface{} { - output := make(chan interface{}, 1) - go func() { - kv.lock.RLock() - defer kv.lock.RUnlock() - defer close(output) - output <- kv.storage[key] - }() - - return output -} - -// Add asynchronously adds (or, replaces) a key/value pair. -func (kv *KeyValue) Add(key, value interface{}) { - go func() { - kv.lock.Lock() - defer kv.lock.Unlock() - kv.storage[key] = value - }() -} - -// Delete asynchronously removes zero or more keys from the internal storage. -func (kv *KeyValue) Delete(keys ...interface{}) { - if len(keys) > 0 { - go func() { - kv.lock.Lock() - defer kv.lock.Unlock() - for _, key := range keys { - delete(kv.storage, key) - } - }() - } -} diff --git a/concurrent/keyValue_test.go b/concurrent/keyValue_test.go deleted file mode 100644 index 941662ab..00000000 --- a/concurrent/keyValue_test.go +++ /dev/null @@ -1,201 +0,0 @@ -package concurrent - -import ( - "github.com/stretchr/testify/assert" - "sort" - "sync" - "testing" - "time" -) - -func TestKeyValueEmpty(t *testing.T) { - assert := assert.New(t) - testWaitGroup := &sync.WaitGroup{} - - keyValue := NewKeyValue() - if !assert.NotNil(keyValue) { - return - } - - assert.Nil(<-keyValue.Get(1)) - - testWaitGroup.Add(1) - keyValue.Do( - KeyValueOperationFunc(func(storage KeyValueStorage) { - defer testWaitGroup.Done() - assert.Equal(0, len(storage)) - }), - ) - testWaitGroup.Wait() - - for range <-keyValue.Keys() { - t.Error("Should not have received any keys in an empty KeyValue") - } - - for range <-keyValue.Values() { - t.Error("Should not have received any values in an empty KeyValue") - } -} - -func TestKeyValueBasics(t *testing.T) { - assert := assert.New(t) - testWaitGroup := &sync.WaitGroup{} - - keyValue := NewKeyValue() - if !assert.NotNil(keyValue) { - return - } - - keyValue.Add(1, "one") - keyValue.Add(2, "two") - keyValue.Add(3, "three") - time.Sleep(50 * time.Millisecond) - - assert.Equal("one", <-keyValue.Get(1)) - assert.Equal("two", <-keyValue.Get(2)) - assert.Equal("three", <-keyValue.Get(3)) - assert.Nil(<-keyValue.Get(-192347192874918273)) - - testWaitGroup.Add(1) - keyValue.Do( - KeyValueOperationFunc(func(storage KeyValueStorage) { - defer testWaitGroup.Done() - assert.Equal( - KeyValueStorage(map[interface{}]interface{}{ - 1: "one", - 2: "two", - 3: "three", - }), - storage, - ) - }), - ) - testWaitGroup.Wait() - - { - expectedKeys := []int{1, 2, 3} - sort.Ints(expectedKeys) - actualKeys := []int{} - for key := range <-keyValue.Keys() { - actualKeys = append(actualKeys, key.(int)) - } - - sort.Ints(actualKeys) - assert.Equal(expectedKeys, actualKeys) - } - - { - expectedValues := []string{"one", "two", "three"} - sort.Strings(expectedValues) - actualValues := []string{} - for value := range <-keyValue.Values() { - actualValues = append(actualValues, value.(string)) - } - - sort.Strings(actualValues) - assert.Equal(expectedValues, actualValues) - } - - keyValue.Delete(1, 2) - time.Sleep(50 * time.Millisecond) - - assert.Nil(<-keyValue.Get(1)) - assert.Nil(<-keyValue.Get(2)) - assert.Equal("three", <-keyValue.Get(3)) - - testWaitGroup.Add(1) - keyValue.Do( - KeyValueOperationFunc(func(storage KeyValueStorage) { - defer testWaitGroup.Done() - assert.Equal( - KeyValueStorage(map[interface{}]interface{}{ - 3: "three", - }), - storage, - ) - }), - ) - testWaitGroup.Wait() - - { - expectedKeys := []int{3} - actualKeys := []int{} - for key := range <-keyValue.Keys() { - actualKeys = append(actualKeys, key.(int)) - } - - assert.Equal(expectedKeys, actualKeys) - } - - { - expectedValues := []string{"three"} - actualValues := []string{} - for value := range <-keyValue.Values() { - actualValues = append(actualValues, value.(string)) - } - - assert.Equal(expectedValues, actualValues) - } -} - -func BenchmarkKeyValueConcurrency(b *testing.B) { - keyValue := NewKeyValue() - - b.RunParallel( - func(pb *testing.PB) { - key := 0 - for pb.Next() { - keyValue.Add(key, "value") - key++ - } - }, - ) - - b.RunParallel( - func(pb *testing.PB) { - key := b.N - for pb.Next() { - keyValue.Delete(key) - key-- - } - }, - ) - - b.RunParallel( - func(pb *testing.PB) { - key := 0 - for pb.Next() { - <-keyValue.Get(key) - key++ - } - }, - ) - - b.RunParallel( - func(pb *testing.PB) { - for pb.Next() { - <-keyValue.Keys() - } - }, - ) - - b.RunParallel( - func(pb *testing.PB) { - for pb.Next() { - <-keyValue.Values() - } - }, - ) - - b.RunParallel( - func(pb *testing.PB) { - for pb.Next() { - keyValue.Do( - KeyValueOperationFunc(func(storage KeyValueStorage) { - storage[239847129] = "another value" - }), - ) - } - }, - ) -} From c68603a380538a18eeb7eb02c2a3c8d141c37d4a Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:13:31 -0400 Subject: [PATCH 21/48] remove portions of convey package --- convey/context.go | 14 -------------- convey/context_test.go | 33 --------------------------------- 2 files changed, 47 deletions(-) delete mode 100644 convey/context.go delete mode 100644 convey/context_test.go diff --git a/convey/context.go b/convey/context.go deleted file mode 100644 index b5f449ef..00000000 --- a/convey/context.go +++ /dev/null @@ -1,14 +0,0 @@ -package convey - -import "context" - -type contextKey struct{} - -func NewContext(parent context.Context, v C) context.Context { - return context.WithValue(parent, contextKey{}, v) -} - -func FromContext(ctx context.Context) (C, bool) { - v, ok := ctx.Value(contextKey{}).(C) - return v, ok -} diff --git a/convey/context_test.go b/convey/context_test.go deleted file mode 100644 index b8010b19..00000000 --- a/convey/context_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package convey - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestNewContext(t *testing.T) { - var ( - assert = assert.New(t) - ctx = NewContext(context.Background(), C{"foo": "bar"}) - ) - - assert.Equal(C{"foo": "bar"}, ctx.Value(contextKey{})) -} - -func TestFromContext(t *testing.T) { - var ( - assert = assert.New(t) - ctx = context.Background() - ) - - v, ok := FromContext(ctx) - assert.Empty(v) - assert.False(ok) - - ctx = context.WithValue(ctx, contextKey{}, C{"foo": "bar"}) - v, ok = FromContext(ctx) - assert.Equal(C{"foo": "bar"}, v) - assert.True(ok) -} From 66e91511296b90e716474ef866232a868d06ea5b Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:13:55 -0400 Subject: [PATCH 22/48] remove package hash --- hash/doc.go | 4 -- hash/serviceHash.go | 54 ------------------ hash/serviceHash_test.go | 115 --------------------------------------- 3 files changed, 173 deletions(-) delete mode 100644 hash/doc.go delete mode 100644 hash/serviceHash.go delete mode 100644 hash/serviceHash_test.go diff --git a/hash/doc.go b/hash/doc.go deleted file mode 100644 index 93bcc43a..00000000 --- a/hash/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -/* -Package hash provides a simple API for managing service hashes. -*/ -package hash diff --git a/hash/serviceHash.go b/hash/serviceHash.go deleted file mode 100644 index d0536f5b..00000000 --- a/hash/serviceHash.go +++ /dev/null @@ -1,54 +0,0 @@ -package hash - -import ( - "errors" - "sync/atomic" - "unsafe" -) - -var ( - ServiceHashHolderUninitialized = errors.New("ServiceHashHolder is not initialized") -) - -// ServiceHash represents a component which can return URLs as strings based -// on arbitrary keys. -type ServiceHash interface { - // Get returns the service URL associated with the given key. - Get([]byte) (string, error) -} - -// ServiceHashHolder represents an atomic pointer to a ServiceHash. This pointer -// can be used without locking. This type implements ServiceHash. The current -// reference is used via the ServiceHash interface. -type ServiceHashHolder struct { - current unsafe.Pointer -} - -var _ ServiceHash = (*ServiceHashHolder)(nil) - -// reference returns the current, unsafe reference -func (holder *ServiceHashHolder) reference() *ServiceHash { - return (*ServiceHash)(atomic.LoadPointer(&holder.current)) -} - -func (holder *ServiceHashHolder) Get(key []byte) (string, error) { - reference := holder.reference() - if reference == nil { - return "", ServiceHashHolderUninitialized - } - - return (*reference).Get(key) -} - -// Update atomically updates the current ServiceHash instance. Subsequent calls to Get() -// will use the newHash instance. -func (holder *ServiceHashHolder) Update(newHash ServiceHash) { - atomic.StorePointer(&holder.current, unsafe.Pointer(&newHash)) -} - -// Connected checks whether this holder has any hash entries. -// This implementations handler.Connection, which allows this holder -// to participate in request gating. -func (holder *ServiceHashHolder) Connected() bool { - return holder.reference() != nil -} diff --git a/hash/serviceHash_test.go b/hash/serviceHash_test.go deleted file mode 100644 index 967707d2..00000000 --- a/hash/serviceHash_test.go +++ /dev/null @@ -1,115 +0,0 @@ -package hash - -import ( - "errors" - "sync" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/xmidt-org/webpa-common/v2/concurrent" -) - -const ( - testKey = "this value does not matter" -) - -var ( - successMessage1 = "first success message" - successMessage2 = "second success message" - errorMessage1 = "first error message" - errorMessage2 = "second error message" -) - -type errorServiceHash string - -func (hash errorServiceHash) Get([]byte) (string, error) { - return "", errors.New(string(hash)) -} - -type successServiceHash string - -func (hash successServiceHash) Get([]byte) (string, error) { - return string(hash), nil -} - -func TestServiceHashHolderUninitialized(t *testing.T) { - assert := assert.New(t) - var holder ServiceHashHolder - assert.False(holder.Connected()) - - value, err := holder.Get([]byte(testKey)) - assert.Equal(ServiceHashHolderUninitialized, err) - assert.Empty(value) -} - -func TestServiceHashHolderGet(t *testing.T) { - assert := assert.New(t) - var gets = []struct { - value *string - errorMessage *string - }{ - {&successMessage1, nil}, - {nil, &errorMessage1}, - {&successMessage2, nil}, - {nil, &errorMessage2}, - {&successMessage2, nil}, - {&successMessage1, nil}, - {nil, &errorMessage2}, - } - - var holder ServiceHashHolder - assert.False(holder.Connected()) - - for _, record := range gets { - if record.value != nil { - holder.Update(successServiceHash(*record.value)) - actual, err := holder.Get([]byte(testKey)) - assert.Equal(*record.value, actual) - assert.Nil(err) - } else { - holder.Update(errorServiceHash(*record.errorMessage)) - actual, err := holder.Get([]byte(testKey)) - assert.Empty(actual) - assert.NotNil(err) - } - } -} - -func TestServiceHashHolderConcurrent(t *testing.T) { - assert := assert.New(t) - - var holder ServiceHashHolder - assert.False(holder.Connected()) - - available := []ServiceHash{ - successServiceHash(successMessage1), - errorServiceHash(errorMessage1), - successServiceHash(successMessage2), - errorServiceHash(errorMessage2), - } - - const getCount int = 100 - updates := make(chan ServiceHash, getCount) - for index := 0; index < getCount; index++ { - updates <- available[index%len(available)] - } - - close(updates) - const routineCount int = 3 - waitGroup := &sync.WaitGroup{} - waitGroup.Add(routineCount) - for index := 0; index < routineCount; index++ { - go func() { - defer waitGroup.Done() - holder.Get([]byte(testKey)) - - for update := range updates { - holder.Update(update) - holder.Get([]byte(testKey)) - } - }() - } - - assert.True(concurrent.WaitTimeout(waitGroup, 15*time.Second)) -} From 6730ef9602ae36a4d0f4fbdfeeb4403255b86fc9 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:14:41 -0400 Subject: [PATCH 23/48] remove package and subpackages logging --- logging/doc.go | 8 -- logging/logger.go | 127 ------------------------- logging/logger_test.go | 189 ------------------------------------- logging/mocks_test.go | 56 ----------- logging/options.go | 66 ------------- logging/options_test.go | 63 ------------- logging/testLogger.go | 37 -------- logging/testLogger_test.go | 28 ------ logging/viper.go | 34 ------- logging/viper_test.go | 113 ---------------------- 10 files changed, 721 deletions(-) delete mode 100644 logging/doc.go delete mode 100644 logging/logger.go delete mode 100644 logging/logger_test.go delete mode 100644 logging/mocks_test.go delete mode 100644 logging/options.go delete mode 100644 logging/options_test.go delete mode 100644 logging/testLogger.go delete mode 100644 logging/testLogger_test.go delete mode 100644 logging/viper.go delete mode 100644 logging/viper_test.go diff --git a/logging/doc.go b/logging/doc.go deleted file mode 100644 index 698abb18..00000000 --- a/logging/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -/* -Package logging provides basic configurability for the go-kit/log packages. - -Deprecated: logging is no longer planned to be used by future WebPA/XMiDT services. - -This package is frozen and no new functionality will be added. -*/ -package logging diff --git a/logging/logger.go b/logging/logger.go deleted file mode 100644 index 2a0e5ef0..00000000 --- a/logging/logger.go +++ /dev/null @@ -1,127 +0,0 @@ -package logging - -import ( - "os" - "strings" - - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" -) - -var ( - defaultLogger = log.NewJSONLogger(log.NewSyncWriter(os.Stdout)) - - callerKey interface{} = "caller" - messageKey interface{} = "msg" - errorKey interface{} = "error" - timestampKey interface{} = "ts" -) - -// CallerKey returns the logging key to be used for the stack location of the logging call -func CallerKey() interface{} { - return callerKey -} - -// MessageKey returns the logging key to be used for the textual message of the log entry -func MessageKey() interface{} { - return messageKey -} - -// ErrorKey returns the logging key to be used for error instances -func ErrorKey() interface{} { - return errorKey -} - -// TimestampKey returns the logging key to be used for the timestamp -func TimestampKey() interface{} { - return timestampKey -} - -// DefaultLogger returns a global singleton NOP logger. -// This returned instance is safe for concurrent access. -func DefaultLogger() log.Logger { - return defaultLogger -} - -// New creates a go-kit Logger from a set of options. The options object can be nil, -// in which case a default logger that logs to os.Stdout is returned. The returned logger -// includes the timestamp in UTC format and will filter according to the Level field. -// -// In order to allow arbitrary decoration, this function does not insert the caller information. -// Use either DefaultCaller in this package or the go-kit/kit/log API to add a Caller to the -// returned Logger. -func New(o *Options) log.Logger { - return NewFilter( - log.WithPrefix( - o.loggerFactory()(o.output()), - TimestampKey(), log.DefaultTimestampUTC, - ), - o, - ) -} - -// NewFilter applies the Options filtering rules in the package to an arbitrary go-kit Logger. -func NewFilter(next log.Logger, o *Options) log.Logger { - switch strings.ToUpper(o.level()) { - case "DEBUG": - return level.NewFilter(next, level.AllowDebug()) - - case "INFO": - return level.NewFilter(next, level.AllowInfo()) - - case "WARN": - return level.NewFilter(next, level.AllowWarn()) - - default: - return level.NewFilter(next, level.AllowError()) - } -} - -// DefaultCaller produces a contextual logger as with log.With, but automatically prepends the -// caller under the CallerKey. -// -// The logger returned by this function should not be further decorated. This will cause the -// callstack to include the decorators, which is pointless. Instead, decorate the next parameter -// prior to passing it to this function. -func DefaultCaller(next log.Logger, keyvals ...interface{}) log.Logger { - return log.WithPrefix( - next, - append([]interface{}{CallerKey(), log.DefaultCaller}, keyvals...)..., - ) -} - -// Error places both the caller and a constant error level into the prefix of the returned logger. -// Additional key value pairs may also be added. -func Error(next log.Logger, keyvals ...interface{}) log.Logger { - return log.WithPrefix( - next, - append([]interface{}{CallerKey(), log.DefaultCaller, level.Key(), level.ErrorValue()}, keyvals...)..., - ) -} - -// Info places both the caller and a constant info level into the prefix of the returned logger. -// Additional key value pairs may also be added. -func Info(next log.Logger, keyvals ...interface{}) log.Logger { - return log.WithPrefix( - next, - append([]interface{}{CallerKey(), log.DefaultCaller, level.Key(), level.InfoValue()}, keyvals...)..., - ) -} - -// Warn places both the caller and a constant warn level into the prefix of the returned logger. -// Additional key value pairs may also be added. -func Warn(next log.Logger, keyvals ...interface{}) log.Logger { - return log.WithPrefix( - next, - append([]interface{}{CallerKey(), log.DefaultCaller, level.Key(), level.WarnValue()}, keyvals...)..., - ) -} - -// Debug places both the caller and a constant debug level into the prefix of the returned logger. -// Additional key value pairs may also be added. -func Debug(next log.Logger, keyvals ...interface{}) log.Logger { - return log.WithPrefix( - next, - append([]interface{}{CallerKey(), log.DefaultCaller, level.Key(), level.DebugValue()}, keyvals...)..., - ) -} diff --git a/logging/logger_test.go b/logging/logger_test.go deleted file mode 100644 index 2b5b4823..00000000 --- a/logging/logger_test.go +++ /dev/null @@ -1,189 +0,0 @@ -package logging - -import ( - "strings" - "testing" - - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" -) - -func TestCallerKey(t *testing.T) { - assert := assert.New(t) - assert.Equal(callerKey, CallerKey()) -} - -func TestMessageKey(t *testing.T) { - assert := assert.New(t) - assert.Equal(messageKey, MessageKey()) -} - -func TestErrorKey(t *testing.T) { - assert := assert.New(t) - assert.Equal(errorKey, ErrorKey()) -} - -func TestTimestampKey(t *testing.T) { - assert := assert.New(t) - assert.Equal(timestampKey, TimestampKey()) -} - -func TestDefaultLogger(t *testing.T) { - assert := assert.New(t) - assert.Equal(defaultLogger, DefaultLogger()) -} - -func TestNew(t *testing.T) { - assert := assert.New(t) - - assert.NotNil(New(nil)) - assert.NotNil(New(new(Options))) -} - -func testNewFilter(t *testing.T, o *Options) { - var ( - assert = assert.New(t) - next = new(mockLogger) - ) - - switch strings.ToUpper(o.level()) { - case "DEBUG": - next.On("Log", mock.MatchedBy(matchLevel(level.DebugValue()))). - Run(expectKeys(assert, MessageKey())). - Return(nil). - Once() - fallthrough - - case "INFO": - next.On("Log", mock.MatchedBy(matchLevel(level.InfoValue()))). - Run(expectKeys(assert, MessageKey())). - Return(nil). - Once() - fallthrough - - case "WARN": - next.On("Log", mock.MatchedBy(matchLevel(level.WarnValue()))). - Run(expectKeys(assert, MessageKey())). - Return(nil). - Once() - fallthrough - - default: - next.On("Log", mock.MatchedBy(matchLevel(level.ErrorValue()))). - Run(expectKeys(assert, MessageKey())). - Return(nil). - Once() - } - - filter := NewFilter(next, o) - filter.Log(level.Key(), level.DebugValue(), MessageKey(), "debug message") - filter.Log(level.Key(), level.InfoValue(), MessageKey(), "info message") - filter.Log(level.Key(), level.WarnValue(), MessageKey(), "warn message") - filter.Log(level.Key(), level.ErrorValue(), MessageKey(), "error message") - - next.AssertExpectations(t) -} - -func TestNewFilter(t *testing.T) { - t.Run("Nil", func(t *testing.T) { testNewFilter(t, nil) }) - t.Run("Default", func(t *testing.T) { testNewFilter(t, new(Options)) }) - t.Run("Error", func(t *testing.T) { testNewFilter(t, &Options{Level: "error"}) }) - t.Run("Warn", func(t *testing.T) { testNewFilter(t, &Options{Level: "warn"}) }) - t.Run("Info", func(t *testing.T) { testNewFilter(t, &Options{Level: "info"}) }) - t.Run("Debug", func(t *testing.T) { testNewFilter(t, &Options{Level: "debug"}) }) -} - -func testDefaultCallerSimple(t *testing.T) { - var ( - assert = assert.New(t) - next = new(mockLogger) - ) - - next.On("Log", mock.MatchedBy(func([]interface{}) bool { return true })). - Run(expectKeys(assert, CallerKey(), MessageKey())). - Return(expectKeys(assert, MessageKey())). - Once() - - decorated := DefaultCaller(next) - decorated.Log(MessageKey(), "message") - - next.AssertExpectations(t) -} - -func testDefaultCallerKeyvals(t *testing.T) { - var ( - assert = assert.New(t) - next = new(mockLogger) - ) - - next.On("Log", mock.MatchedBy(func([]interface{}) bool { return true })). - Run(expectKeys(assert, CallerKey(), MessageKey())). - Return(expectKeys(assert, MessageKey(), "foo")). - Once() - - decorated := DefaultCaller(next, "foo", "bar") - decorated.Log(MessageKey(), "message") - - next.AssertExpectations(t) -} - -func TestDefaultCaller(t *testing.T) { - t.Run("Simple", testDefaultCallerSimple) - t.Run("Keyvals", testDefaultCallerKeyvals) -} - -func testLevelledLogger(t *testing.T, factory func(log.Logger, ...interface{}) log.Logger, expected level.Value) { - var ( - assert = assert.New(t) - next = new(mockLogger) - ) - - next.On("Log", mock.MatchedBy(matchLevel(expected))). - Run(expectKeys(assert, level.Key(), CallerKey(), MessageKey())). - Return(nil). - Once() - - decorated := factory(next) - decorated.Log(level.Key(), expected, MessageKey(), "message") - - next.AssertExpectations(t) -} - -func testLevelledLoggerKeyvals(t *testing.T, factory func(log.Logger, ...interface{}) log.Logger, expected level.Value) { - var ( - assert = assert.New(t) - next = new(mockLogger) - ) - - next.On("Log", mock.MatchedBy(matchLevel(expected))). - Run(expectKeys(assert, level.Key(), "foo", CallerKey(), MessageKey())). - Return(nil). - Once() - - decorated := factory(next, "foo", "bar") - decorated.Log(MessageKey(), "message") - - next.AssertExpectations(t) -} - -func TestError(t *testing.T) { - t.Run("Simple", func(t *testing.T) { testLevelledLogger(t, Error, level.ErrorValue()) }) - t.Run("Keyvals", func(t *testing.T) { testLevelledLoggerKeyvals(t, Error, level.ErrorValue()) }) -} - -func TestInfo(t *testing.T) { - t.Run("Simple", func(t *testing.T) { testLevelledLogger(t, Info, level.InfoValue()) }) - t.Run("Keyvals", func(t *testing.T) { testLevelledLoggerKeyvals(t, Info, level.InfoValue()) }) -} - -func TestWarn(t *testing.T) { - t.Run("Simple", func(t *testing.T) { testLevelledLogger(t, Warn, level.WarnValue()) }) - t.Run("Keyvals", func(t *testing.T) { testLevelledLoggerKeyvals(t, Warn, level.WarnValue()) }) -} - -func TestDebug(t *testing.T) { - t.Run("Simple", func(t *testing.T) { testLevelledLogger(t, Debug, level.DebugValue()) }) - t.Run("Keyvals", func(t *testing.T) { testLevelledLoggerKeyvals(t, Debug, level.DebugValue()) }) -} diff --git a/logging/mocks_test.go b/logging/mocks_test.go deleted file mode 100644 index a0d11c76..00000000 --- a/logging/mocks_test.go +++ /dev/null @@ -1,56 +0,0 @@ -package logging - -import ( - "github.com/go-kit/kit/log/level" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" -) - -type mockLogger struct { - mock.Mock -} - -func (m *mockLogger) Log(keyvals ...interface{}) error { - arguments := m.Called(keyvals) - first, _ := arguments.Get(0).(error) - return first -} - -// matchLevel returns a mock.MatchedBy function which matches Log methods on an expected log level -func matchLevel(expected level.Value) interface{} { - return func(keyvals []interface{}) bool { - for i := 0; i < len(keyvals); i += 2 { - if keyvals[i] == level.Key() { - return keyvals[i+1] == expected - } - } - - return false - } -} - -// expectKeys produces a mock.Run function which verifies that the given logging keys -// are present in the set of arguments. Values are not checked by the returned function. -func expectKeys(assert *assert.Assertions, keys ...interface{}) func(mock.Arguments) { - return func(arguments mock.Arguments) { - expected := make(map[interface{}]bool) - for _, k := range keys { - expected[k] = true - } - - keyvals := arguments.Get(0).([]interface{}) - for i := 0; i < len(keyvals); i += 2 { - delete(expected, keyvals[i]) - } - - assert.Empty(expected, "Missing keys: %v", expected) - } -} - -type mockTestSink struct { - mock.Mock -} - -func (m *mockTestSink) Log(values ...interface{}) { - m.Called(values) -} diff --git a/logging/options.go b/logging/options.go deleted file mode 100644 index fbe2f84a..00000000 --- a/logging/options.go +++ /dev/null @@ -1,66 +0,0 @@ -package logging - -import ( - "io" - "os" - - "github.com/go-kit/kit/log" - "gopkg.in/natefinch/lumberjack.v2" -) - -const ( - StdoutFile = "stdout" -) - -// Options stores the configuration of a Logger. Lumberjack is used for rolling files. -type Options struct { - // File is the system file path for the log file. If set to "stdout", this will log to os.Stdout. - // Otherwise, a lumberjack.Logger is created - File string `json:"file"` - - // MaxSize is the lumberjack MaxSize - MaxSize int `json:"maxsize"` - - // MaxAge is the lumberjack MaxAge - MaxAge int `json:"maxage"` - - // MaxBackups is the lumberjack MaxBackups - MaxBackups int `json:"maxbackups"` - - // JSON is a flag indicating whether JSON logging output is used. The default is false, - // meaning that logfmt output is used. - JSON bool `json:"json"` - - // Level is the error level to output: ERROR, INFO, WARN, or DEBUG. Any unrecognized string, - // including the empty string, is equivalent to passing ERROR. - Level string `json:"level"` -} - -func (o *Options) output() io.Writer { - if o != nil && len(o.File) > 0 && o.File != StdoutFile { - return &lumberjack.Logger{ - Filename: o.File, - MaxSize: o.MaxSize, - MaxAge: o.MaxAge, - MaxBackups: o.MaxBackups, - } - } - - return log.NewSyncWriter(os.Stdout) -} - -func (o *Options) loggerFactory() func(io.Writer) log.Logger { - if o != nil && o.JSON { - return log.NewJSONLogger - } - - return log.NewLogfmtLogger -} - -func (o *Options) level() string { - if o != nil { - return o.Level - } - - return "" -} diff --git a/logging/options_test.go b/logging/options_test.go deleted file mode 100644 index a6a69652..00000000 --- a/logging/options_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package logging - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "gopkg.in/natefinch/lumberjack.v2" -) - -func testOptionsLoggerFactory(t *testing.T) { - assert := assert.New(t) - - for _, o := range []*Options{nil, new(Options), {JSON: true}, {JSON: false}} { - assert.NotNil(o.loggerFactory()) - } -} - -func testOptionsOutput(t *testing.T) { - assert := assert.New(t) - - for _, o := range []*Options{nil, {File: StdoutFile}} { - output := o.output() - assert.NotNil(output) - assert.NotPanics(func() { - _, err := output.Write([]byte("expected output: this shouldn't panic\n")) - assert.NoError(err) - }) - } - - var ( - rolling = &Options{ - File: "foobar.log", - MaxSize: 689328, - MaxAge: 9, - MaxBackups: 454, - } - - output = rolling.output() - lumberjackLogger, ok = output.(*lumberjack.Logger) - ) - - assert.True(ok) - assert.Equal("foobar.log", lumberjackLogger.Filename) - assert.Equal(689328, lumberjackLogger.MaxSize) - assert.Equal(9, lumberjackLogger.MaxAge) - assert.Equal(454, lumberjackLogger.MaxBackups) -} - -func testOptionsLevel(t *testing.T) { - assert := assert.New(t) - - for _, o := range []*Options{nil, new(Options)} { - assert.Empty(o.level()) - } - - assert.Equal("info", (&Options{Level: "info"}).level()) -} - -func TestOptions(t *testing.T) { - t.Run("LoggerFactory", testOptionsLoggerFactory) - t.Run("Output", testOptionsOutput) - t.Run("Level", testOptionsLevel) -} diff --git a/logging/testLogger.go b/logging/testLogger.go deleted file mode 100644 index 76cfb522..00000000 --- a/logging/testLogger.go +++ /dev/null @@ -1,37 +0,0 @@ -package logging - -import ( - "os" - "testing" - - "github.com/go-kit/kit/log" -) - -// testSink is implemented by testing.T and testing.B -type testSink interface { - Log(...interface{}) -} - -// NewTestLogger produces a go-kit Logger which logs to stdout only if -// the verbose testing mode. -// Note: Although originally intended to delegate data to testSink, -// intermittent data races have forced us to stick to writing directly -// to stdout and do the verbose check outselves. -func NewTestLogger(o *Options, _ testSink) log.Logger { - if !testing.Verbose() { - return log.NewNopLogger() - } - - if o == nil { - // we want to see all log output in tests by default - o = &Options{Level: "DEBUG"} - } - - return NewFilter( - log.With( - o.loggerFactory()(log.NewSyncWriter(os.Stdout)), - TimestampKey(), log.DefaultTimestampUTC, - ), - o, - ) -} diff --git a/logging/testLogger_test.go b/logging/testLogger_test.go deleted file mode 100644 index 130d8864..00000000 --- a/logging/testLogger_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package logging - -import ( - "testing" - - "github.com/go-kit/kit/log/level" - "github.com/stretchr/testify/mock" -) - -func testTestLogger(t *testing.T, o *Options) { - var testSink = new(mockTestSink) - - testSink.AssertNotCalled(t, "Log", mock.Anything) - - testLogger := NewTestLogger(o, testSink) - testLogger.Log(level.Key(), level.DebugValue(), MessageKey(), "debug message") - testLogger.Log(level.Key(), level.InfoValue(), MessageKey(), "info message") - testLogger.Log(level.Key(), level.WarnValue(), MessageKey(), "warn message") - testLogger.Log(level.Key(), level.ErrorValue(), MessageKey(), "error message") - - testSink.AssertExpectations(t) -} - -func TestNewTestLogger(t *testing.T) { - t.Run("NilLogsAll", func(t *testing.T) { testTestLogger(t, nil) }) - t.Run("DefaultLogsError", func(t *testing.T) { testTestLogger(t, new(Options)) }) - t.Run("InfoLogsInfoWarnError", func(t *testing.T) { testTestLogger(t, &Options{Level: "info"}) }) -} diff --git a/logging/viper.go b/logging/viper.go deleted file mode 100644 index f2c26ccd..00000000 --- a/logging/viper.go +++ /dev/null @@ -1,34 +0,0 @@ -package logging - -import ( - "github.com/spf13/viper" -) - -const ( - // LoggingKey is the Viper subkey under which logging should be stored. - // NewOptions *does not* assume this key. - LoggingKey = "log" -) - -// Sub returns the standard child Viper, using LoggingKey, for this package. -// If passed nil, this function returns nil. -func Sub(v *viper.Viper) *viper.Viper { - if v != nil { - return v.Sub(LoggingKey) - } - - return nil -} - -// FromViper produces an Options from a (possibly nil) Viper instance. -// Callers should use FromViper(Sub(v)) if the standard subkey is desired. -func FromViper(v *viper.Viper) (*Options, error) { - o := new(Options) - if v != nil { - if err := v.Unmarshal(o); err != nil { - return nil, err - } - } - - return o, nil -} diff --git a/logging/viper_test.go b/logging/viper_test.go deleted file mode 100644 index fa5a7316..00000000 --- a/logging/viper_test.go +++ /dev/null @@ -1,113 +0,0 @@ -package logging - -import ( - "strings" - "testing" - - "github.com/spf13/viper" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestSub(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - v = viper.New() - ) - - assert.Nil(Sub(nil)) - assert.Nil(Sub(v)) - - v.SetConfigType("json") - require.NoError(v.ReadConfig(strings.NewReader(` - {"log": { - "file": "foobar.log" - }} - `))) - - child := Sub(v) - require.NotNil(child) - assert.Equal("foobar.log", child.GetString("file")) -} - -func testFromViperNil(t *testing.T) { - var ( - assert = assert.New(t) - o, err = FromViper(nil) - ) - - assert.NotNil(o) - assert.NoError(err) - -} - -func testFromViperMissing(t *testing.T) { - var ( - assert = assert.New(t) - o, err = FromViper(viper.New()) - ) - - assert.NotNil(o) - assert.NoError(err) - -} - -func testFromViperError(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - badConfiguration = ` - {"maxage": "this is not a valid integer"} - ` - - v = viper.New() - ) - - v.SetConfigType("json") - require.NoError(v.ReadConfig(strings.NewReader(badConfiguration))) - - o, err := FromViper(v) - assert.Nil(o) - assert.Error(err) -} - -func testFromViperUnmarshal(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - configuration = ` - { - "file": "foobar.log", - "maxsize": 459234098, - "maxage": 52, - "maxbackups": 452, - "json": true, - "level": "info" - } - ` - - v = viper.New() - ) - - v.SetConfigType("json") - require.NoError(v.ReadConfig(strings.NewReader(configuration))) - - o, err := FromViper(v) - require.NotNil(o) - require.Nil(err) - - assert.Equal("foobar.log", o.File) - assert.Equal(459234098, o.MaxSize) - assert.Equal(52, o.MaxAge) - assert.Equal(452, o.MaxBackups) - assert.True(o.JSON) - assert.Equal("info", o.Level) -} - -func TestFromViper(t *testing.T) { - t.Run("Nil", testFromViperNil) - t.Run("Missing", testFromViperMissing) - t.Run("Error", testFromViperError) - t.Run("Unmarshal", testFromViperUnmarshal) -} From 7a370873c2d6aea1b19ac6190ae55598fa4a604b Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:15:29 -0400 Subject: [PATCH 24/48] remove package middleware --- middleware/busy.go | 38 ----------- middleware/busy_test.go | 100 ----------------------------- middleware/concurrent.go | 38 ----------- middleware/concurrent_test.go | 115 ---------------------------------- middleware/doc.go | 4 -- middleware/mocks_test.go | 14 ----- middleware/timeout.go | 27 -------- middleware/timeout_test.go | 45 ------------- 8 files changed, 381 deletions(-) delete mode 100644 middleware/busy.go delete mode 100644 middleware/busy_test.go delete mode 100644 middleware/concurrent.go delete mode 100644 middleware/concurrent_test.go delete mode 100644 middleware/doc.go delete mode 100644 middleware/mocks_test.go delete mode 100644 middleware/timeout.go delete mode 100644 middleware/timeout_test.go diff --git a/middleware/busy.go b/middleware/busy.go deleted file mode 100644 index 3afef991..00000000 --- a/middleware/busy.go +++ /dev/null @@ -1,38 +0,0 @@ -package middleware - -import ( - "context" - "fmt" - "sync/atomic" - - "github.com/go-kit/kit/endpoint" -) - -// Busy produces a middleware that returns an error if the maximum number of -// clients is reached. If busyError is specified, that is returned. Otherwise, -// a default error is returned. -// -// If maxClients is nonpositive, this factory function panics -func Busy(maxClients int64, busyError error) endpoint.Middleware { - if maxClients < 1 { - panic("maxClients must be positive") - } - - return func(next endpoint.Endpoint) endpoint.Endpoint { - if busyError == nil { - busyError = fmt.Errorf("Exceeded maximum number of clients: %d", maxClients) - } - - var clientCounter int64 - - return func(ctx context.Context, value interface{}) (interface{}, error) { - defer atomic.AddInt64(&clientCounter, -1) - - if atomic.AddInt64(&clientCounter, 1) > maxClients { - return nil, busyError - } - - return next(ctx, value) - } - } -} diff --git a/middleware/busy_test.go b/middleware/busy_test.go deleted file mode 100644 index 6993c9c7..00000000 --- a/middleware/busy_test.go +++ /dev/null @@ -1,100 +0,0 @@ -package middleware - -import ( - "context" - "errors" - "fmt" - "sync" - "testing" - - "github.com/stretchr/testify/assert" -) - -func testBusyBadMaxClients(t *testing.T, maxClients int64) { - assert := assert.New(t) - - assert.Panics(func() { - Busy(maxClients, nil) - }) - - assert.Panics(func() { - Busy(maxClients, errors.New("custom busy error")) - }) -} - -func testBusyClientCounter(t *testing.T, maxClients int64, busyError error) { - var ( - assert = assert.New(t) - expectedCtx = context.WithValue(context.Background(), "foo", "bar") - - endpointGate = make(chan struct{}) - endpointsWaiting = new(sync.WaitGroup) - endpointsExiting = make(chan struct{}, maxClients) - - busyEndpoint = Busy(maxClients, busyError)(func(ctx context.Context, value interface{}) (interface{}, error) { - assert.Equal(expectedCtx, ctx) - if value == "blocking" { - endpointsWaiting.Done() - <-endpointGate - } - - return "done", nil - }) - ) - - // exhaust the Busy max number of clients - endpointsWaiting.Add(int(maxClients)) - for r := int64(0); r < maxClients; r++ { - go func() { - defer func() { - endpointsExiting <- struct{}{} - }() - - actual, err := busyEndpoint(expectedCtx, "blocking") - assert.Equal("done", actual) - assert.NoError(err) - }() - } - - // while we have a known number of clients blocking, attempt to make another call - endpointsWaiting.Wait() - actual, err := busyEndpoint(expectedCtx, "rejected") - assert.Nil(actual) - assert.Error(err) - - if busyError != nil { - assert.Equal(busyError, err) - } - - // now wait until any blocked endpoint is done, and try to execute an endpoint - close(endpointGate) - <-endpointsExiting - actual, err = busyEndpoint(expectedCtx, "succeed") - assert.Equal("done", actual) - assert.NoError(err) -} - -func TestBusy(t *testing.T) { - t.Run("BadMaxClients", func(t *testing.T) { - testBusyBadMaxClients(t, 0) - testBusyBadMaxClients(t, -1) - }) - - t.Run("ClientCounter", func(t *testing.T) { - t.Run("NilBusyError", func(t *testing.T) { - for _, c := range []int64{1, 10, 100} { - t.Run(fmt.Sprintf("MaxClients=%d", c), func(t *testing.T) { - testBusyClientCounter(t, c, nil) - }) - } - }) - - t.Run("CustomBusyError", func(t *testing.T) { - for _, c := range []int64{1, 10, 100} { - t.Run(fmt.Sprintf("MaxClients=%d", c), func(t *testing.T) { - testBusyClientCounter(t, c, errors.New("custom busy error")) - }) - } - }) - }) -} diff --git a/middleware/concurrent.go b/middleware/concurrent.go deleted file mode 100644 index 94173618..00000000 --- a/middleware/concurrent.go +++ /dev/null @@ -1,38 +0,0 @@ -package middleware - -import ( - "context" - - "github.com/go-kit/kit/endpoint" -) - -// Concurrent produces a middleware that allows only a set number of concurrent calls via -// a semaphore implemented as a buffered channel. The context is used for cancellation, -// and if the context is cancelled then timeoutError is returned if it is not nil, ctx.Err() otherwise. -func Concurrent(concurrency int, timeoutError error) endpoint.Middleware { - return func(next endpoint.Endpoint) endpoint.Endpoint { - semaphore := make(chan struct{}, concurrency) - for r := 0; r < concurrency; r++ { - semaphore <- struct{}{} - } - - return func(ctx context.Context, value interface{}) (interface{}, error) { - select { - case <-ctx.Done(): - if timeoutError != nil { - return nil, timeoutError - } else { - return nil, ctx.Err() - } - - case <-semaphore: - } - - defer func() { - semaphore <- struct{}{} - }() - - return next(ctx, value) - } - } -} diff --git a/middleware/concurrent_test.go b/middleware/concurrent_test.go deleted file mode 100644 index f9f90a93..00000000 --- a/middleware/concurrent_test.go +++ /dev/null @@ -1,115 +0,0 @@ -package middleware - -import ( - "context" - "errors" - "fmt" - "sync" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func testConcurrentNoCancellation(t *testing.T, concurrency int) { - var ( - require = require.New(t) - assert = assert.New(t) - expectedRequest = "expected request" - expectedResponse = "expected response" - - nextCalled = false - next = func(ctx context.Context, value interface{}) (interface{}, error) { - nextCalled = true - assert.Equal(expectedRequest, value) - return expectedResponse, nil - } - - concurrent = Concurrent(concurrency, nil) - ) - - require.NotNil(concurrent) - actualResponse, err := concurrent(next)(context.Background(), expectedRequest) - assert.Equal(expectedResponse, actualResponse) - assert.NoError(err) - assert.True(nextCalled) -} - -func testConcurrentCancel(t *testing.T, concurrency int, timeoutError error) { - var ( - require = require.New(t) - assert = assert.New(t) - expectedCtx, cancel = context.WithCancel(context.Background()) - expectedResponse = "expected response" - - nextWaiting = new(sync.WaitGroup) - nextBarrier = make(chan struct{}) - next = func(ctx context.Context, value interface{}) (interface{}, error) { - wait, ok := value.(func()) - if ok { - wait() - } - - return expectedResponse, nil - } - - concurrent = Concurrent(concurrency, timeoutError) - ) - - require.NotNil(concurrent) - endpoint := concurrent(next) - - // spawn enough goroutines to exhaust the semaphore - nextWaiting.Add(concurrency) - for r := 0; r < concurrency; r++ { - go endpoint(expectedCtx, func() { - nextWaiting.Done() - <-nextBarrier - }) - } - - // wait until we know the semaphore is exhausted, then cancel - nextWaiting.Wait() - cancel() - - // because the context is cancelled, subsequent calls should complete immediately - actualResponse, err := endpoint(expectedCtx, "request") - assert.Nil(actualResponse) - assert.NotNil(err) - - if timeoutError != nil { - assert.Equal(timeoutError, err) - } else { - assert.Equal(context.Canceled, err) - } - - close(nextBarrier) -} - -func TestConcurrent(t *testing.T) { - t.Run("NoCancellation", func(t *testing.T) { - for _, c := range []int{1, 10, 15, 100} { - t.Run(fmt.Sprintf("Concurrency=%d", c), func(t *testing.T) { - testConcurrentNoCancellation(t, c) - }) - } - }) - - t.Run("Cancel", func(t *testing.T) { - t.Run("NilTimeoutError", func(t *testing.T) { - for _, c := range []int{1, 10, 15, 100} { - t.Run(fmt.Sprintf("Concurrency=%d", c), func(t *testing.T) { - testConcurrentCancel(t, c, nil) - }) - } - }) - - t.Run("WithTimeoutError", func(t *testing.T) { - for _, c := range []int{1, 10, 15, 100} { - t.Run(fmt.Sprintf("Concurrency=%d", c), func(t *testing.T) { - testConcurrentCancel(t, c, errors.New("expected timeout error")) - }) - } - }) - }) -} diff --git a/middleware/doc.go b/middleware/doc.go deleted file mode 100644 index e615b9a5..00000000 --- a/middleware/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -/* -Package middleware provides common middleware and decorators for WebPA and XMiDT servers -*/ -package middleware diff --git a/middleware/mocks_test.go b/middleware/mocks_test.go deleted file mode 100644 index 524e210a..00000000 --- a/middleware/mocks_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package middleware - -import ( - "github.com/stretchr/testify/mock" - "go.uber.org/zap" -) - -type mockLoggable struct { - mock.Mock -} - -func (m *mockLoggable) Logger() *zap.Logger { - return m.Called().Get(0).(*zap.Logger) -} diff --git a/middleware/timeout.go b/middleware/timeout.go deleted file mode 100644 index 4ed48819..00000000 --- a/middleware/timeout.go +++ /dev/null @@ -1,27 +0,0 @@ -package middleware - -import ( - "context" - "time" - - "github.com/go-kit/kit/endpoint" -) - -const DefaultTimeout = 30 * time.Second - -// Timeout applies the given timeout to all WRP Requests. The context's cancellation -// function is always called. -func Timeout(timeout time.Duration) endpoint.Middleware { - if timeout < 1 { - timeout = DefaultTimeout - } - - return func(next endpoint.Endpoint) endpoint.Endpoint { - return func(ctx context.Context, value interface{}) (interface{}, error) { - timeoutCtx, cancel := context.WithTimeout(ctx, timeout) - defer cancel() - - return next(timeoutCtx, value) - } - } -} diff --git a/middleware/timeout_test.go b/middleware/timeout_test.go deleted file mode 100644 index e6211817..00000000 --- a/middleware/timeout_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package middleware - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func testTimeout(t *testing.T, timeout time.Duration) { - var ( - assert = assert.New(t) - - expectedRequest = "expected request" - expectedResponse = "expected response" - - nextCalled = false - next = func(ctx context.Context, value interface{}) (interface{}, error) { - nextCalled = true - - deadline, ok := ctx.Deadline() - assert.False(deadline.IsZero()) - assert.True(ok) - assert.NotNil(ctx.Done()) - - return expectedResponse, nil - } - - middleware = Timeout(timeout) - ) - - actualResponse, err := middleware(next)(context.Background(), expectedRequest) - assert.Equal(expectedResponse, actualResponse) - assert.NoError(err) - assert.True(nextCalled) -} - -func TestTimeout(t *testing.T) { - for _, timeout := range []time.Duration{-1, 0, 15 * time.Second, 120 * time.Hour} { - t.Run(timeout.String(), func(t *testing.T) { - testTimeout(t, timeout) - }) - } -} From 93f90d916591b4e55162ddf6fea2e0a519832578 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:15:48 -0400 Subject: [PATCH 25/48] remove package resource --- resource/doc.go | 8 -- resource/factory.go | 167 ---------------------------- resource/factory_test.go | 177 ------------------------------ resource/loader.go | 160 --------------------------- resource/loader_test.go | 221 -------------------------------------- resource/setup_test.go | 92 ---------------- resource/template.go | 72 ------------- resource/template_test.go | 113 ------------------- resource/testfile.txt | 1 - 9 files changed, 1011 deletions(-) delete mode 100644 resource/doc.go delete mode 100644 resource/factory.go delete mode 100644 resource/factory_test.go delete mode 100644 resource/loader.go delete mode 100644 resource/loader_test.go delete mode 100644 resource/setup_test.go delete mode 100644 resource/template.go delete mode 100644 resource/template_test.go delete mode 100644 resource/testfile.txt diff --git a/resource/doc.go b/resource/doc.go deleted file mode 100644 index 73607ab4..00000000 --- a/resource/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -/* -Package resource provides common resource-handling functionality. - -This package is heavily inspired by frameworks like Spring. The concept -is that external resources, such as files or HTTP content, can be configured -via JSON and then consumed via a common interface. -*/ -package resource diff --git a/resource/factory.go b/resource/factory.go deleted file mode 100644 index cab574d7..00000000 --- a/resource/factory.go +++ /dev/null @@ -1,167 +0,0 @@ -package resource - -import ( - "errors" - "fmt" - "github.com/jtacoma/uritemplates" - "net/http" - "net/url" - "sort" -) - -const ( - // NoScheme indicates the value of a URI without a scheme prefix, e.g. "/etc/appname/config.json" - NoScheme = "" - - // FileScheme indicates a file URI according to https://en.wikipedia.org/wiki/File_URI_scheme. - // When a URL is parsed that has no scheme, url.URL.Scheme is set to this value. - FileScheme = "file" - - // HttpScheme is plain old HTTP - HttpScheme = "http" - - // HttpsScheme is secure HTTP - HttpsScheme = "https" -) - -var ( - // supportedSchemes provides a quick, map-based way to test for a valid scheme - supportedSchemes = map[string]bool{ - FileScheme: true, - HttpScheme: true, - HttpsScheme: true, - } - - ErrorAmbiguousResource = errors.New("Either URI or Data must be supplied, but not both") - ErrorNoResource = errors.New("URI or Data are required") - ErrorURIRequired = errors.New("A URI is required") -) - -// Factory provides a common way to configure all types of resources -// supported by this package. This type allows client code to use JSON configuration -// to specify resources in an abstract way. -// -// The primary purpose for this type is to allow external configuration of application -// resources in a file or other source of JSON. For code which does not require this -// level of abstraction, the other resources types in this package (e.g. HTTP, Data, Template, etc) -// can be used directly. -type Factory struct { - // URI specifies the external resource's location. This can be a filesystem - // path, which is a valid URI. file:// resources are also supported. - URI string `json:"uri"` - - // Data specfies the actual data of the resource. Either this or URI - // must be set, but not both. - Data string `json:"data"` - - // Header supplies any HTTP headers to use when obtaining the resource. - // Ignored if URI is not an HTTP or HTTPS URI. - Header http.Header `json:"header"` - - // Method is the HTTP method to use when obtaining the resource. - // Ignored if URI is not an HTTP or HTTPS URI. - Method string `json:"method"` - - // HTTPClient is any object that supplies a method with the signature func(*http.Request) (*http.Response, error). - // It is omitted from all JSON operations, so it must be supplied after a Factory is unmarshalled. - // If not supplied, http.DefaultClient is used. Any *http.Client value can be used here so that - // all resources share a common Client configuration. - // - // Ignored if URI is not an HTTP or HTTPS URI. - HTTPClient httpClient `json:"-"` -} - -// URL returns the url.URL that should be used to obtain the resource. If this factory -// represents an in-memory resource, a nil url.URL pointer is returned. -// -// This method also does basic validation on the state of the factory. If the returned -// error is non-nil, the url will always be nil. -func (f *Factory) URL() (*url.URL, error) { - if len(f.URI) > 0 { - if len(f.Data) > 0 { - return nil, ErrorAmbiguousResource - } - - resourceURL, err := url.Parse(f.URI) - if err != nil { - return nil, err - } else if len(resourceURL.Scheme) == 0 { - // supports URIs like "/etc/foobar.txt" as files - resourceURL.Scheme = FileScheme - } else if !supportedSchemes[resourceURL.Scheme] { - return nil, fmt.Errorf("Unsupported scheme: %s", resourceURL.Scheme) - } - - return resourceURL, nil - } else if len(f.Data) == 0 { - return nil, ErrorNoResource - } - - return nil, nil -} - -// NewLoader creates a Loader which loads from the literal URI. -// The URI must be a valid URL with the file, http, or https schemes. -func (f *Factory) NewLoader() (Loader, error) { - resourceURL, err := f.URL() - if err != nil { - return nil, err - } - - switch { - case resourceURL == nil: - return &Data{Source: []byte(f.Data)}, nil - - case resourceURL.Scheme == FileScheme: - return &File{Path: resourceURL.Path}, nil - - default: - return &HTTP{ - URL: resourceURL.String(), - Header: f.Header, - Method: f.Method, - HTTPClient: f.HTTPClient, - }, nil - } -} - -// NewExpander treats URI as a URI template and produces an Expander object -// which can be used to expand the URI template into Loader instances. -// -// If any requiredNames are supplied, an error will be returned if the URI template -// does not contain only those names. -func (f *Factory) NewExpander(requiredNames ...string) (Expander, error) { - if len(f.URI) == 0 { - return nil, ErrorURIRequired - } else if len(f.Data) > 0 { - return nil, ErrorAmbiguousResource - } - - uriTemplate, err := uritemplates.Parse(f.URI) - if err != nil { - return nil, err - } - - if len(requiredNames) > 0 { - missingNames := make([]string, 0, len(requiredNames)) - actualNames := sort.StringSlice(uriTemplate.Names()) - actualNames.Sort() - - for _, requiredName := range requiredNames { - if position := actualNames.Search(requiredName); position >= actualNames.Len() || actualNames[position] != requiredName { - missingNames = append(missingNames, requiredName) - } - } - - if len(missingNames) > 0 { - return nil, fmt.Errorf("URI template %s does not contain names %s", uriTemplate, missingNames) - } - } - - return &Template{ - URITemplate: uriTemplate, - Header: f.Header, - Method: f.Method, - HTTPClient: f.HTTPClient, - }, nil -} diff --git a/resource/factory_test.go b/resource/factory_test.go deleted file mode 100644 index 5e17b5ab..00000000 --- a/resource/factory_test.go +++ /dev/null @@ -1,177 +0,0 @@ -package resource - -import ( - "github.com/stretchr/testify/assert" - "testing" -) - -func TestFactoryAmbiguousResource(t *testing.T) { - assert := assert.New(t) - - factory := &Factory{ - URI: "http://someplace.com/foobar.txt", - Data: "here is some content", - } - - url, err := factory.URL() - assert.Nil(url) - assert.Equal(ErrorAmbiguousResource, err) - - loader, err := factory.NewLoader() - assert.Nil(loader) - assert.Equal(ErrorAmbiguousResource, err) - - template, err := factory.NewExpander() - assert.Nil(template) - assert.Equal(ErrorAmbiguousResource, err) -} - -func TestFactoryNoResource(t *testing.T) { - assert := assert.New(t) - - factory := &Factory{} - - url, err := factory.URL() - assert.Nil(url) - assert.Equal(ErrorNoResource, err) - - loader, err := factory.NewLoader() - assert.Nil(loader) - assert.Equal(ErrorNoResource, err) - - template, err := factory.NewExpander() - assert.Nil(template) - assert.Equal(ErrorURIRequired, err) -} - -func TestFactoryUnsupportedScheme(t *testing.T) { - assert := assert.New(t) - - factory := &Factory{ - URI: "whatisthis://foo/bar.txt", - } - - url, err := factory.URL() - assert.Nil(url) - assert.NotNil(err) - - loader, err := factory.NewLoader() - assert.Nil(loader) - assert.NotNil(err) -} - -func TestFactoryBadURI(t *testing.T) { - assert := assert.New(t) - - factory := &Factory{ - URI: "http:// /what/\t", - } - - url, err := factory.URL() - assert.Nil(url) - assert.NotNil(err) - - loader, err := factory.NewLoader() - assert.Nil(loader) - assert.NotNil(err) -} - -func TestFactoryBadTemplate(t *testing.T) { - assert := assert.New(t) - - factory := &Factory{ - URI: "http://example.com/{bad", - } - - url, err := factory.URL() - assert.NotNil(url) - assert.Nil(err) - - template, err := factory.NewExpander() - assert.Nil(template) - assert.NotNil(err) -} - -func TestFactoryData(t *testing.T) { - assert := assert.New(t) - - message := "here is some lovely content" - factory := &Factory{ - Data: message, - } - - url, err := factory.URL() - assert.Nil(url) - assert.Nil(err) - - if loader, err := factory.NewLoader(); assert.NotNil(loader) && assert.Nil(err) { - assert.Equal(message, loader.Location()) - data, err := ReadAll(loader) - assert.Equal(message, string(data)) - assert.Nil(err) - } - - template, err := factory.NewExpander() - assert.Nil(template) - assert.Equal(ErrorURIRequired, err) -} - -func TestFactoryFileLoader(t *testing.T) { - assert := assert.New(t) - - for _, fileURI := range []string{testFilePath, testFileURI} { - t.Logf("fileURI: %s", fileURI) - factory := &Factory{ - URI: fileURI, - } - - if url, err := factory.URL(); assert.NotNil(url) && assert.Nil(err) { - assert.Equal(FileScheme, url.Scheme) - - if loader, err := factory.NewLoader(); assert.NotNil(loader) && assert.Nil(err) { - assert.Equal(url.Path, loader.Location()) - data, err := ReadAll(loader) - assert.Equal(testContents, string(data)) - assert.Nil(err) - } - - if expander, err := factory.NewExpander(); assert.NotNil(expander) && assert.Nil(err) { - if template, ok := expander.(*Template); assert.True(ok) { - assert.Len(template.URITemplate.Names(), 0) - } - } - - expander, err := factory.NewExpander("key") - assert.Nil(expander) - assert.NotNil(err) - } - } -} - -func TestFactoryHTTPLoader(t *testing.T) { - assert := assert.New(t) - factory := &Factory{ - URI: testFileURL, - } - - if url, err := factory.URL(); assert.NotNil(url) && assert.Nil(err) { - assert.Equal(HttpScheme, url.Scheme) - } - - if loader, err := factory.NewLoader(); assert.NotNil(loader) && assert.Nil(err) { - assert.Equal(testFileURL, loader.Location()) - data, err := ReadAll(loader) - assert.Equal(testContents, string(data)) - assert.Nil(err) - } - - if expander, err := factory.NewExpander(); assert.NotNil(expander) && assert.Nil(err) { - if template, ok := expander.(*Template); assert.True(ok) { - assert.Len(template.URITemplate.Names(), 0) - } - } - - expander, err := factory.NewExpander("key") - assert.Nil(expander) - assert.NotNil(err) -} diff --git a/resource/loader.go b/resource/loader.go deleted file mode 100644 index 5d578f88..00000000 --- a/resource/loader.go +++ /dev/null @@ -1,160 +0,0 @@ -package resource - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" -) - -const ( - // DefaultMethod is the default HTTP method used when none is supplied - DefaultMethod = "GET" -) - -// httpClient is an internal strategy interface for objects which -// can handle HTTP transactions. *http.Client implements this interface. -type httpClient interface { - Do(*http.Request) (*http.Response, error) -} - -// Loader represents a type that can load data, -// potentially from outside the running process. -type Loader interface { - // Location returns a string identifying where this Loader - // gets its data from - Location() string - - // Open returns a ReadCloser that reads this resource's data. - Open() (io.ReadCloser, error) -} - -// UseClient will change the HTTP client object used by the given resource. If loader -// is not an HTTP Loader, this function does nothing. A nil client will cause the -// loader to use http.DefaultClient. -func UseClient(loader Loader, HTTPClient httpClient) { - if httpLoader, ok := loader.(*HTTP); ok { - httpLoader.HTTPClient = HTTPClient - } -} - -// ReadAll is an analog to ioutil.ReadAll: it reads the entire -// resource into a single byte slice, returning any error that occurred. -func ReadAll(loader Loader) ([]byte, error) { - reader, err := loader.Open() - if err != nil { - return nil, err - } - - defer reader.Close() - return ioutil.ReadAll(reader) -} - -// HTTP is a Loader which obtains resources via HTTP. -type HTTP struct { - URL string - Header http.Header - Method string - HTTPClient httpClient -} - -func (loader *HTTP) String() string { - return loader.URL -} - -func (loader *HTTP) Location() string { - return loader.URL -} - -func (loader *HTTP) Open() (reader io.ReadCloser, err error) { - method := loader.Method - if len(method) == 0 { - method = DefaultMethod - } - - var ( - request *http.Request - response *http.Response - ) - - request, err = http.NewRequest(method, loader.URL, nil) - if err != nil { - return - } - - for key, values := range loader.Header { - for _, value := range values { - request.Header.Add(key, value) - } - } - - HTTPClient := loader.HTTPClient - if HTTPClient == nil { - HTTPClient = http.DefaultClient - } - - response, err = HTTPClient.Do(request) - defer func() { - if err != nil && response != nil && response.Body != nil { - response.Body.Close() - } - }() - - if err != nil { - return - } else if response.StatusCode < 200 || response.StatusCode > 299 { - err = fmt.Errorf( - "Unable to access [%s]: server returned %s", - loader.URL, - response.Status, - ) - - return - } - - reader = response.Body - return -} - -// File is a Loader which obtains resources from the filesystem -type File struct { - Path string -} - -func (loader *File) String() string { - return loader.Path -} - -func (loader *File) Location() string { - return loader.Path -} - -func (loader *File) Open() (reader io.ReadCloser, err error) { - reader, err = os.Open(loader.Path) - if err != nil && reader != nil { - reader.Close() - reader = nil - } - - return -} - -// Data is an in-memory resource. It is a Loader which simple reads from -// a byte slice. -type Data struct { - Source []byte -} - -func (loader *Data) String() string { - return string(loader.Source) -} - -func (loader *Data) Location() string { - return string(loader.Source) -} - -func (loader *Data) Open() (io.ReadCloser, error) { - return ioutil.NopCloser(bytes.NewReader(loader.Source)), nil -} diff --git a/resource/loader_test.go b/resource/loader_test.go deleted file mode 100644 index eb7959d0..00000000 --- a/resource/loader_test.go +++ /dev/null @@ -1,221 +0,0 @@ -package resource - -import ( - "bytes" - "errors" - "fmt" - "github.com/stretchr/testify/assert" - "net/http" - "sort" - "testing" -) - -func TestData(t *testing.T) { - assert := assert.New(t) - - message := "here are some resource bytes" - var loader Loader = &Data{ - Source: []byte(message), - } - - assert.Equal(message, loader.Location()) - assert.Equal(message, fmt.Sprintf("%s", loader)) - - if read, err := ReadAll(loader); assert.Nil(err) { - assert.Equal(message, string(read)) - } - - // UseClient should have no effect - UseClient(loader, &http.Client{}) - - assert.Equal(message, loader.Location()) - assert.Equal(message, fmt.Sprintf("%s", loader)) - - if read, err := ReadAll(loader); assert.Nil(err) { - assert.Equal(message, string(read)) - } -} - -func TestFile(t *testing.T) { - assert := assert.New(t) - - var loader Loader = &File{ - Path: testFilePath, - } - - assert.Equal(testFilePath, loader.Location()) - assert.Equal(testFilePath, fmt.Sprintf("%s", loader)) - - if read, err := ReadAll(loader); assert.Nil(err) { - assert.Equal(testContents, string(read)) - } - - // UseClient should have no effect - UseClient(loader, &http.Client{}) - - assert.Equal(testFilePath, loader.Location()) - assert.Equal(testFilePath, fmt.Sprintf("%s", loader)) - - if read, err := ReadAll(loader); assert.Nil(err) { - assert.Equal(testContents, string(read)) - } -} - -func TestFileMissing(t *testing.T) { - assert := assert.New(t) - missingFile := "/this/file/does/not/exist.txt" - var loader Loader = &File{ - Path: missingFile, - } - - assert.Equal(missingFile, loader.Location()) - assert.Equal(missingFile, fmt.Sprintf("%s", loader)) - - read, err := ReadAll(loader) - assert.Empty(read) - assert.NotNil(err) - - // UseClient should have no effect - UseClient(loader, &http.Client{}) - - assert.Equal(missingFile, loader.Location()) - assert.Equal(missingFile, fmt.Sprintf("%s", loader)) - - read, err = ReadAll(loader) - assert.Empty(read) - assert.NotNil(err) -} - -func TestHTTPSimple(t *testing.T) { - assert := assert.New(t) - - var loader Loader = &HTTP{ - URL: testFileURL, - } - - assert.Equal(testFileURL, loader.Location()) - assert.Equal(testFileURL, fmt.Sprintf("%s", loader)) - - if read, err := ReadAll(loader); assert.Nil(err) { - assert.Equal(testContents, string(read)) - } - - newClientUsed := false - newClient := &testHTTPClient{ - transport: func(request *http.Request) (*http.Response, error) { - newClientUsed = true - return http.DefaultClient.Do(request) - }, - } - - UseClient(loader, newClient) - - assert.Equal(testFileURL, loader.Location()) - assert.Equal(testFileURL, fmt.Sprintf("%s", loader)) - - if read, err := ReadAll(loader); assert.Nil(err) { - assert.Equal(testContents, string(read)) - } - - assert.True(newClientUsed) -} - -func TestHTTPInvalidRequest(t *testing.T) { - assert := assert.New(t) - - var loader Loader = &HTTP{ - URL: testFileURL, - Method: "INVALID METHOD", - } - - data, err := ReadAll(loader) - assert.Len(data, 0) - assert.NotNil(err) -} - -func TestHTTP(t *testing.T) { - assert := assert.New(t) - - var testData = []struct { - statusCode int - header http.Header - method string - clientError error - expectError bool - }{ - { - statusCode: 200, - }, - { - statusCode: 204, - header: http.Header{ - "Accept": []string{"text/plain"}, - }, - }, - { - statusCode: 404, - expectError: true, - }, - { - clientError: errors.New("here is a nasty little error!"), - expectError: true, - }, - } - - for _, record := range testData { - t.Logf("%#v", record) - var body *readCloser - - client := &testHTTPClient{ - transport: func(request *http.Request) (*http.Response, error) { - if len(record.method) == 0 { - assert.Equal(DefaultMethod, request.Method) - } else { - assert.Equal(record.method, request.Method) - } - - if assert.Len(request.Header, len(record.header)) { - for key, actualValues := range request.Header { - expectedValues := record.header[key] - if assert.Len(actualValues, len(expectedValues)) && len(expectedValues) > 0 { - sort.Strings(actualValues) - sort.Strings(expectedValues) - assert.Equal(expectedValues, actualValues) - } - } - } - - if record.clientError != nil { - return nil, record.clientError - } - - body := &readCloser{ - reader: bytes.NewReader([]byte(testContents)), - } - - return &http.Response{ - StatusCode: record.statusCode, - Body: body, - }, nil - }, - } - - var loader Loader = &HTTP{ - URL: testFileURL, - Header: record.header, - Method: record.method, - HTTPClient: client, - } - - read, err := ReadAll(loader) - if record.expectError { - assert.Len(read, 0) - assert.NotNil(err) - } else { - assert.Equal(testContents, string(read)) - assert.Nil(err) - } - - assert.True(body == nil || body.closed) - } -} diff --git a/resource/setup_test.go b/resource/setup_test.go deleted file mode 100644 index e96dfd24..00000000 --- a/resource/setup_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package resource - -import ( - "errors" - "fmt" - "io" - "net/http" - "net/http/httptest" - "os" - "testing" -) - -const ( - fileNameParameter = "filename" - testFile = "testfile.txt" - testContents = "here is a lovely little test file" -) - -var ( - currentDirectory string - httpServer *httptest.Server - - testFilePath string - testFilePathTemplate string - - testFileURI string - testFileURITemplate string - - testFileURL string - testFileURLTemplate string -) - -type readCloser struct { - reader io.Reader - closed bool -} - -func (r *readCloser) Read(buffer []byte) (int, error) { - if r.closed { - return 0, errors.New("ReadCloser has been closed") - } - - return r.reader.Read(buffer) -} - -func (r *readCloser) Close() error { - if r.closed { - return errors.New("ReadCloser already closed") - } - - r.closed = true - return nil -} - -type testHTTPClient struct { - transport func(*http.Request) (*http.Response, error) -} - -func (c *testHTTPClient) Do(request *http.Request) (*http.Response, error) { - return c.transport(request) -} - -func TestMain(m *testing.M) { - os.Exit(func() int { - var err error - currentDirectory, err = os.Getwd() - if err != nil { - fmt.Fprintf(os.Stderr, "Could not get current directory: %v\n", err) - return 1 - } - - httpServer = httptest.NewServer( - http.FileServer( - http.Dir(currentDirectory), - ), - ) - - defer httpServer.Close() - - testFilePath = fmt.Sprintf("%s/%s", currentDirectory, testFile) - testFilePathTemplate = fmt.Sprintf("%s/{%s}", currentDirectory, fileNameParameter) - - testFileURI = fmt.Sprintf("file://%s/%s", currentDirectory, testFile) - testFileURITemplate = fmt.Sprintf("file://%s/{%s}", currentDirectory, fileNameParameter) - - testFileURL = fmt.Sprintf("%s/%s", httpServer.URL, testFile) - testFileURLTemplate = fmt.Sprintf("%s/{%s}", httpServer.URL, fileNameParameter) - - fmt.Printf("Running test HTTP server at: %s\n", httpServer.URL) - return m.Run() - }()) -} diff --git a/resource/template.go b/resource/template.go deleted file mode 100644 index b9cfe024..00000000 --- a/resource/template.go +++ /dev/null @@ -1,72 +0,0 @@ -package resource - -import ( - "github.com/jtacoma/uritemplates" - "net/http" -) - -// MustParse parses the given URI template and panics if there is an error. -// Useful for initializing global variables or struct literals. -func MustParse(uriTemplate string) *uritemplates.UriTemplate { - template, err := uritemplates.Parse(uriTemplate) - if err != nil { - panic(err) - } - - return template -} - -// Expander is a strategy for expanding URI templates into resource Loaders. -type Expander interface { - // Names returns a slice containing the parameter names in the URI template. - // This can be the empty slice for templates which do not contain any parameters. - // Templates without parameters will simply return Loader instances from Expand - // that refer to the same location. - Names() []string - - // Expand uses the supplied object as a source for name/value pairs to use - // when expanding the URI template. Typically, this method is called with - // a map[string]interface{} or a struct whose exported members supply the name/value - // pairs. - // - // Names which are not present in the internal URI template are ignored. Also, - // template parameters which are not supplied in the values are emitted as is, e.g. "{name}", - // in the internal URI used by the Loader. - Expand(interface{}) (Loader, error) -} - -// Template is an Expander implementation which uses a uritemplates.UriTemplate -// to generate URIs. The URIs are then supplied to a Factory which is used to -// produce the Loaders. -// -// Typically, a Factory will be used to create instances of this type, which are -// used through the Expander interface. However, this type is exported for simple -// use cases which do not require the full configuration logic of a Factory. -type Template struct { - URITemplate *uritemplates.UriTemplate - Header http.Header - Method string - HTTPClient httpClient -} - -func (t *Template) String() string { - return t.URITemplate.String() -} - -func (t *Template) Names() []string { - return t.URITemplate.Names() -} - -func (t *Template) Expand(value interface{}) (Loader, error) { - uri, err := t.URITemplate.Expand(value) - if err != nil { - return nil, err - } - - return (&Factory{ - URI: uri, - Header: t.Header, - Method: t.Method, - HTTPClient: t.HTTPClient, - }).NewLoader() -} diff --git a/resource/template_test.go b/resource/template_test.go deleted file mode 100644 index f092805b..00000000 --- a/resource/template_test.go +++ /dev/null @@ -1,113 +0,0 @@ -package resource - -import ( - "fmt" - "github.com/stretchr/testify/assert" - "testing" -) - -func TestMustParseValidTemplate(t *testing.T) { - assert := assert.New(t) - - if template := MustParse("/etc/{key}.txt"); assert.NotNil(template) { - result, err := template.Expand(map[string]interface{}{"key": "value"}) - assert.Equal(result, "/etc/value.txt") - assert.Nil(err) - } -} - -func TestMustParseInvalidTemplate(t *testing.T) { - assert := assert.New(t) - defer func() { - r := recover() - assert.NotNil(r) - }() - - MustParse("/invalid/{bad") -} - -func TestTemplateFile(t *testing.T) { - assert := assert.New(t) - - for _, fileTemplate := range []string{testFilePathTemplate, testFileURITemplate} { - t.Logf("fileTemplate: %s", fileTemplate) - factory := &Factory{ - URI: fileTemplate, - } - - expanders := make([]Expander, 0, 2) - if expander, err := factory.NewExpander(); assert.NotNil(expander) && assert.Nil(err) { - assert.Equal(fileTemplate, fmt.Sprintf("%s", expander)) - expanders = append(expanders, expander) - } - - if expander, err := factory.NewExpander(fileNameParameter); assert.NotNil(expander) && assert.Nil(err) { - assert.Equal(fileTemplate, fmt.Sprintf("%s", expander)) - expanders = append(expanders, expander) - } - - for _, expander := range expanders { - names := expander.Names() - assert.Len(names, 1) - assert.Equal(fileNameParameter, names[0]) - - values := map[string]interface{}{ - fileNameParameter: testFile, - } - - if loader, err := expander.Expand(values); assert.NotNil(loader) && assert.Nil(err) { - data, err := ReadAll(loader) - assert.Equal(testContents, string(data)) - assert.Nil(err) - } - - loader, err := expander.Expand(123) - assert.Nil(loader) - assert.NotNil(err) - } - - expander, err := factory.NewExpander("nosuch") - assert.Nil(expander) - assert.NotNil(err) - } -} - -func TestTemplateHTTP(t *testing.T) { - assert := assert.New(t) - factory := &Factory{ - URI: testFileURLTemplate, - } - - expanders := make([]Expander, 0, 2) - if expander, err := factory.NewExpander(); assert.NotNil(expander) && assert.Nil(err) { - expanders = append(expanders, expander) - } - - if expander, err := factory.NewExpander(fileNameParameter); assert.NotNil(expander) && assert.Nil(err) { - expanders = append(expanders, expander) - } - - for _, expander := range expanders { - names := expander.Names() - assert.Len(names, 1) - assert.Equal(fileNameParameter, names[0]) - - values := map[string]interface{}{ - fileNameParameter: testFile, - } - - if loader, err := expander.Expand(values); assert.NotNil(loader) && assert.Nil(err) { - data, err := ReadAll(loader) - assert.Equal(testContents, string(data)) - assert.Nil(err) - } - - loader, err := expander.Expand(123) - assert.Nil(loader) - assert.NotNil(err) - } - - expander, err := factory.NewExpander("nosuch") - assert.Nil(expander) - assert.NotNil(err) -} diff --git a/resource/testfile.txt b/resource/testfile.txt deleted file mode 100644 index 1ba1f931..00000000 --- a/resource/testfile.txt +++ /dev/null @@ -1 +0,0 @@ -here is a lovely little test file \ No newline at end of file From d3bb22612a46b3a665033c8935accaf184daa36b Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:16:50 -0400 Subject: [PATCH 26/48] remove package and subpackages secure --- secure/doc.go | 8 - secure/handler/authorizationHandler.go | 179 ----- secure/handler/authorizationHandler_test.go | 276 -------- secure/handler/context.go | 26 - secure/handler/context_test.go | 45 -- secure/jws.go | 30 - secure/jws_test.go | 33 - secure/jwt-key | 51 -- secure/jwt-key.pub | 14 - secure/key/cache.go | 220 ------ secure/key/cache_test.go | 454 ------------- secure/key/doc.go | 4 - secure/key/mocks.go | 80 --- secure/key/pair.go | 49 -- secure/key/parser.go | 94 --- secure/key/parser_test.go | 88 --- secure/key/purpose.go | 84 --- secure/key/purpose_test.go | 114 ---- secure/key/resolver.go | 83 --- secure/key/resolverFactory.go | 106 --- secure/key/resolverFactory_test.go | 179 ----- secure/key/resolver_test.go | 153 ----- secure/key/setup_test.go | 55 -- secure/key/testkey | 9 - secure/key/testkey.pub | 9 - secure/metrics.go | 54 -- secure/metrics_test.go | 17 - secure/mockValidator.go | 16 - secure/mocks_test.go | 106 --- secure/setup_test.go | 90 --- secure/token.go | 115 ---- secure/token_test.go | 108 --- secure/tools/cmd/jwt/main.go | 81 --- secure/tools/cmd/keyserver/basicHandler.go | 17 - secure/tools/cmd/keyserver/configuration.go | 95 --- secure/tools/cmd/keyserver/issueHandler.go | 315 --------- secure/tools/cmd/keyserver/keyHandler.go | 48 -- secure/tools/cmd/keyserver/keyStore.go | 142 ---- secure/tools/cmd/keyserver/main.go | 104 --- secure/tools/cmd/keyserver/sample.json | 11 - secure/tools/cmd/keyserver/sample.key | 51 -- secure/validator.go | 287 -------- secure/validator_test.go | 715 -------------------- server/log.go | 33 - server/log_test.go | 68 -- 45 files changed, 4916 deletions(-) delete mode 100644 secure/doc.go delete mode 100644 secure/handler/authorizationHandler.go delete mode 100644 secure/handler/authorizationHandler_test.go delete mode 100644 secure/handler/context.go delete mode 100644 secure/handler/context_test.go delete mode 100644 secure/jws.go delete mode 100644 secure/jws_test.go delete mode 100644 secure/jwt-key delete mode 100644 secure/jwt-key.pub delete mode 100644 secure/key/cache.go delete mode 100644 secure/key/cache_test.go delete mode 100644 secure/key/doc.go delete mode 100644 secure/key/mocks.go delete mode 100644 secure/key/pair.go delete mode 100644 secure/key/parser.go delete mode 100644 secure/key/parser_test.go delete mode 100644 secure/key/purpose.go delete mode 100644 secure/key/purpose_test.go delete mode 100644 secure/key/resolver.go delete mode 100644 secure/key/resolverFactory.go delete mode 100644 secure/key/resolverFactory_test.go delete mode 100644 secure/key/resolver_test.go delete mode 100644 secure/key/setup_test.go delete mode 100644 secure/key/testkey delete mode 100644 secure/key/testkey.pub delete mode 100644 secure/metrics.go delete mode 100644 secure/metrics_test.go delete mode 100644 secure/mockValidator.go delete mode 100644 secure/mocks_test.go delete mode 100644 secure/setup_test.go delete mode 100644 secure/token.go delete mode 100644 secure/token_test.go delete mode 100644 secure/tools/cmd/jwt/main.go delete mode 100644 secure/tools/cmd/keyserver/basicHandler.go delete mode 100644 secure/tools/cmd/keyserver/configuration.go delete mode 100644 secure/tools/cmd/keyserver/issueHandler.go delete mode 100644 secure/tools/cmd/keyserver/keyHandler.go delete mode 100644 secure/tools/cmd/keyserver/keyStore.go delete mode 100644 secure/tools/cmd/keyserver/main.go delete mode 100644 secure/tools/cmd/keyserver/sample.json delete mode 100644 secure/tools/cmd/keyserver/sample.key delete mode 100644 secure/validator.go delete mode 100644 secure/validator_test.go delete mode 100644 server/log.go delete mode 100644 server/log_test.go diff --git a/secure/doc.go b/secure/doc.go deleted file mode 100644 index a90ca5c4..00000000 --- a/secure/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -/* -Package secure contains the security types common to WebPA applications - -Deprecated: secure is no longer planned to be used by future WebPA/XMiDT services. - -This package is frozen and no new functionality will be added. -*/ -package secure diff --git a/secure/handler/authorizationHandler.go b/secure/handler/authorizationHandler.go deleted file mode 100644 index 4cf9d2a0..00000000 --- a/secure/handler/authorizationHandler.go +++ /dev/null @@ -1,179 +0,0 @@ -package handler - -import ( - "errors" - "net/http" - - "github.com/SermoDigital/jose/jws" - "github.com/xmidt-org/sallust" - "github.com/xmidt-org/webpa-common/v2/secure" - "github.com/xmidt-org/webpa-common/v2/xhttp" - "go.uber.org/zap" -) - -const ( - // The Content-Type value for JSON - JsonContentType string = "application/json; charset=UTF-8" - - // The Content-Type header - ContentTypeHeader string = "Content-Type" - - // The X-Content-Type-Options header - ContentTypeOptionsHeader string = "X-Content-Type-Options" - - // NoSniff is the value used for content options for errors written by this package - NoSniff string = "nosniff" -) - -// AuthorizationHandler provides decoration for http.Handler instances and will -// ensure that requests pass the validator. Note that secure.Validators is a Validator -// implementation that allows chaining validators together via logical OR. -type AuthorizationHandler struct { - HeaderName string - ForbiddenStatusCode int - Validator secure.Validator - Logger *zap.Logger - measures *secure.JWTValidationMeasures -} - -// headerName returns the authorization header to use, either a.HeaderName -// or secure.AuthorizationHeader if no header is supplied -func (a AuthorizationHandler) headerName() string { - if len(a.HeaderName) > 0 { - return a.HeaderName - } - - return secure.AuthorizationHeader -} - -// forbiddenStatusCode returns a.ForbiddenStatusCode if supplied, otherwise -// http.StatusForbidden is returned -func (a AuthorizationHandler) forbiddenStatusCode() int { - if a.ForbiddenStatusCode > 0 { - return a.ForbiddenStatusCode - } - - return http.StatusForbidden -} - -func (a AuthorizationHandler) logger() *zap.Logger { - if a.Logger != nil { - return a.Logger - } - - return sallust.Default() -} - -// Decorate provides an Alice-compatible constructor that validates requests -// using the configuration specified. -func (a AuthorizationHandler) Decorate(delegate http.Handler) http.Handler { - // if there is no validator, there's no point in decorating anything - if a.Validator == nil { - return delegate - } - - var ( - headerName = a.headerName() - forbiddenStatusCode = a.forbiddenStatusCode() - logger = a.logger() - ) - - return http.HandlerFunc(func(response http.ResponseWriter, request *http.Request) { - headerValue := request.Header.Get(headerName) - if len(headerValue) == 0 { - logger.Info("missing header", zap.String("name", headerName)) - xhttp.WriteErrorf(response, forbiddenStatusCode, "missing header: %s", headerName) - - if a.measures != nil { - a.measures.ValidationReason.With("reason", "missing_header").Add(1) - } - return - } - - token, err := secure.ParseAuthorization(headerValue) - if err != nil { - logger.Error("invalid authorization header", zap.String("name", headerName), zap.Error(err)) - xhttp.WriteErrorf(response, forbiddenStatusCode, "Invalid authorization header [%s]: %s", headerName, err.Error()) - - if a.measures != nil { - a.measures.ValidationReason.With("reason", "invalid_header").Add(1) - } - return - } - - contextValues := &ContextValues{ - Method: request.Method, - Path: request.URL.Path, - Trust: secure.Untrusted, // trust isn't set on the token until validation (ugh) - } - - sharedContext := NewContextWithValue(request.Context(), contextValues) - - valid, err := a.Validator.Validate(sharedContext, token) - if err == nil && valid { - if err := populateContextValues(token, contextValues); err != nil { - logger.Error("unable to populate context", zap.Error(err)) - } - - // this is absolutely horrible, but it's the only way we can do it for now. - // TODO: address this in a redesign - contextValues.Trust = token.Trust() - delegate.ServeHTTP(response, request.WithContext(sharedContext)) - return - } - - logger.Info( - "request denied", - zap.Bool("validator-response", valid), - zap.NamedError("validator-error", err), - zap.String("sat-client-id", contextValues.SatClientID), - zap.String("method", request.Method), - zap.Any("url", request.URL), - zap.String("user-agent", request.Header.Get("User-Agent")), - zap.Int64("content-length", request.ContentLength), - zap.String("remoteAddress", request.RemoteAddr), - ) - - xhttp.WriteError(response, forbiddenStatusCode, "request denied") - }) -} - -// DefineMeasures facilitates clients to define authHandler metrics tools -func (a *AuthorizationHandler) DefineMeasures(m *secure.JWTValidationMeasures) { - a.measures = m -} - -func populateContextValues(token *secure.Token, values *ContextValues) error { - values.SatClientID = "N/A" - - if token.Type() != secure.Bearer { - return nil - } - - jwsToken, err := secure.DefaultJWSParser.ParseJWS(token) - if err != nil { - return err - } - - claims, ok := jwsToken.Payload().(jws.Claims) - if !ok { - return errors.New("no claims") - } - - if sub, ok := claims.Get("sub").(string); ok { - values.SatClientID = sub - } - - if allowedResources, ok := claims.Get("allowedResources").(map[string]interface{}); ok { - if allowedPartners, ok := allowedResources["allowedPartners"].([]interface{}); ok { - values.PartnerIDs = make([]string, 0, len(allowedPartners)) - for i := 0; i < len(allowedPartners); i++ { - if value, ok := allowedPartners[i].(string); ok { - values.PartnerIDs = append(values.PartnerIDs, value) - } - } - } - } - - return nil -} diff --git a/secure/handler/authorizationHandler_test.go b/secure/handler/authorizationHandler_test.go deleted file mode 100644 index 63f1fa0c..00000000 --- a/secure/handler/authorizationHandler_test.go +++ /dev/null @@ -1,276 +0,0 @@ -package handler - -import ( - "context" - "net/http" - "net/http/httptest" - "strconv" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" - "github.com/xmidt-org/webpa-common/v2/secure" -) - -const ( - authorizationValue = "Basic dGVzdDp0ZXN0Cg==" - tokenValue = "dGVzdDp0ZXN0Cg==" -) - -func testAuthorizationHandlerNoDecoration(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - - nextCalled = false - next = http.HandlerFunc(func(http.ResponseWriter, *http.Request) { - nextCalled = true - }) - - handler = AuthorizationHandler{ - Logger: logging.NewTestLogger(nil, t), - } - - decorated = handler.Decorate(next) - ) - - require.NotNil(decorated) - decorated.ServeHTTP(httptest.NewRecorder(), httptest.NewRequest("GET", "/", nil)) - assert.True(nextCalled) -} - -func testAuthorizationHandlerNoAuthorization(t *testing.T, expectedStatusCode, configuredStatusCode int) { - var ( - assert = assert.New(t) - require = require.New(t) - - nextCalled = false - next = http.HandlerFunc(func(http.ResponseWriter, *http.Request) { - nextCalled = true - }) - - validator = new(secure.MockValidator) - handler = AuthorizationHandler{ - Logger: logging.NewTestLogger(nil, t), - ForbiddenStatusCode: configuredStatusCode, - Validator: validator, - } - - response = httptest.NewRecorder() - request = httptest.NewRequest("GET", "/", nil) - decorated = handler.Decorate(next) - ) - - require.NotNil(decorated) - decorated.ServeHTTP(response, request) - assert.Equal(expectedStatusCode, response.Code) - assert.False(nextCalled) - validator.AssertExpectations(t) -} - -func testAuthorizationHandlerMalformedAuthorization(t *testing.T, expectedStatusCode, configuredStatusCode int, expectedHeader, configuredHeader string) { - var ( - assert = assert.New(t) - require = require.New(t) - - nextCalled = false - next = http.HandlerFunc(func(http.ResponseWriter, *http.Request) { - nextCalled = true - }) - - validator = new(secure.MockValidator) - handler = AuthorizationHandler{ - Logger: logging.NewTestLogger(nil, t), - HeaderName: configuredHeader, - ForbiddenStatusCode: configuredStatusCode, - Validator: validator, - } - - response = httptest.NewRecorder() - request = httptest.NewRequest("GET", "/", nil) - decorated = handler.Decorate(next) - ) - - require.NotNil(decorated) - request.Header.Set(expectedHeader, "there is no way this is a valid authorization header") - decorated.ServeHTTP(response, request) - assert.Equal(expectedStatusCode, response.Code) - assert.False(nextCalled) - validator.AssertExpectations(t) -} - -func testAuthorizationHandlerValid(t *testing.T, expectedHeader, configuredHeader string) { - var ( - assert = assert.New(t) - require = require.New(t) - - nextCalled = false - next = http.HandlerFunc(func(_ http.ResponseWriter, request *http.Request) { - nextCalled = true - values, ok := FromContext(request.Context()) - require.True(ok) - require.NotNil(values) - - assert.Equal("x1:webpa-internal:5f0183", values.SatClientID) - assert.Equal([]string{"comcast"}, values.PartnerIDs) - }) - - validator = new(secure.MockValidator) - handler = AuthorizationHandler{ - Logger: logging.NewTestLogger(nil, t), - HeaderName: configuredHeader, - Validator: validator, - } - - response = httptest.NewRecorder() - request = httptest.NewRequest("GET", "/", nil) - decorated = handler.Decorate(next) - ) - - require.NotNil(decorated) - request.Header.Set(expectedHeader, "Bearer eyJhbGciOiJub25lIiwia2lkIjoidGhlbWlzLTIwMTcwMSIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI4ZjA0MmIyOS03ZDE2LTRjMWYtYjBmOS1mNTJhMGFhZDI5YmMiLCJpc3MiOiJzYXRzLXByb2R1Y3Rpb24iLCJzdWIiOiJ4MTp3ZWJwYS1pbnRlcm5hbDo1ZjAxODMiLCJpYXQiOjE1Mjc3MzAwOTYsIm5iZiI6MTUyNzczMDA5NiwiZXhwIjoxNTI3NzczMjk5LCJ2ZXJzaW9uIjoiMS4wIiwiYWxsb3dlZFJlc291cmNlcyI6eyJhbGxvd2VkUGFydG5lcnMiOlsiY29tY2FzdCJdfSwiY2FwYWJpbGl0aWVzIjpbIngxOndlYnBhOmFwaTouKjphbGwiXSwiYXVkIjpbXX0.") - - validator.On("Validate", mock.MatchedBy(func(context.Context) bool { return true }), mock.MatchedBy(func(*secure.Token) bool { return true })).Return(true, error(nil)).Once() - decorated.ServeHTTP(response, request) - assert.Equal(200, response.Code) - assert.True(nextCalled) - validator.AssertExpectations(t) -} - -func testAuthorizationHandlerInvalid(t *testing.T, expectedStatusCode, configuredStatusCode int, expectedHeader, configuredHeader string) { - var ( - assert = assert.New(t) - require = require.New(t) - - nextCalled = false - next = http.HandlerFunc(func(_ http.ResponseWriter, request *http.Request) { - nextCalled = true - }) - - validator = new(secure.MockValidator) - handler = AuthorizationHandler{ - Logger: logging.NewTestLogger(nil, t), - HeaderName: configuredHeader, - ForbiddenStatusCode: configuredStatusCode, - Validator: validator, - } - - response = httptest.NewRecorder() - request = httptest.NewRequest("GET", "/", nil) - decorated = handler.Decorate(next) - ) - - require.NotNil(decorated) - request.Header.Set(expectedHeader, "Basic YWxsYWRpbjpvcGVuc2VzYW1l") - - validator.On("Validate", mock.MatchedBy(func(context.Context) bool { return true }), mock.MatchedBy(func(*secure.Token) bool { return true })).Return(false, error(nil)).Once() - decorated.ServeHTTP(response, request) - assert.Equal(expectedStatusCode, response.Code) - assert.False(nextCalled) - validator.AssertExpectations(t) -} - -func TestAuthorizationHandler(t *testing.T) { - t.Run("NoDecoration", testAuthorizationHandlerNoDecoration) - - t.Run("NoAuthorization", func(t *testing.T) { - testData := []struct { - expectedStatusCode int - configuredStatusCode int - }{ - {http.StatusForbidden, 0}, - {http.StatusForbidden, http.StatusForbidden}, - {599, 599}, - } - - for i, record := range testData { - t.Run(strconv.Itoa(i), func(t *testing.T) { - testAuthorizationHandlerNoAuthorization(t, record.expectedStatusCode, record.configuredStatusCode) - }) - } - }) - - t.Run("MalformedAuthorization", func(t *testing.T) { - testData := []struct { - expectedStatusCode int - configuredStatusCode int - expectedHeader string - configuredHeader string - }{ - {http.StatusForbidden, 0, "Authorization", ""}, - {http.StatusForbidden, http.StatusForbidden, "Authorization", "Authorization"}, - {599, 599, "X-Custom", "X-Custom"}, - } - - for i, record := range testData { - t.Run(strconv.Itoa(i), func(t *testing.T) { - testAuthorizationHandlerMalformedAuthorization(t, record.expectedStatusCode, record.configuredStatusCode, record.expectedHeader, record.configuredHeader) - }) - } - }) - - t.Run("Valid", func(t *testing.T) { - testData := []struct { - expectedHeader string - configuredHeader string - }{ - {"Authorization", ""}, - {"Authorization", "Authorization"}, - {"X-Custom", "X-Custom"}, - } - - for i, record := range testData { - t.Run(strconv.Itoa(i), func(t *testing.T) { - testAuthorizationHandlerValid(t, record.expectedHeader, record.configuredHeader) - }) - } - }) - - t.Run("Invalid", func(t *testing.T) { - testData := []struct { - expectedStatusCode int - configuredStatusCode int - expectedHeader string - configuredHeader string - }{ - {http.StatusForbidden, 0, "Authorization", ""}, - {http.StatusForbidden, http.StatusForbidden, "Authorization", "Authorization"}, - {599, 599, "X-Custom", "X-Custom"}, - } - - for i, record := range testData { - t.Run(strconv.Itoa(i), func(t *testing.T) { - testAuthorizationHandlerInvalid(t, record.expectedStatusCode, record.configuredStatusCode, record.expectedHeader, record.configuredHeader) - }) - } - }) -} - -func testPopulateContextValuesNoJWT(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - - token, err = secure.ParseAuthorization("Basic abcd==") - ) - - require.NoError(err) - require.NotNil(token) - - values := new(ContextValues) - assert.NoError(populateContextValues(token, values)) -} - -func TestPopulateContextValues(t *testing.T) { - t.Run("NoJWT", testPopulateContextValuesNoJWT) -} - -//A simple verification that a pointer function signature is used -func TestDefineMeasures(t *testing.T) { - assert := assert.New(t) - a, m := AuthorizationHandler{}, &secure.JWTValidationMeasures{} - a.DefineMeasures(m) - assert.Equal(m, a.measures) -} diff --git a/secure/handler/context.go b/secure/handler/context.go deleted file mode 100644 index d591fbaa..00000000 --- a/secure/handler/context.go +++ /dev/null @@ -1,26 +0,0 @@ -package handler - -import "context" - -type contextKey struct{} - -//ContextValues contains the values shared under the satClientIDKey from this package -type ContextValues struct { - SatClientID string - Method string - Path string - PartnerIDs []string - Trust string -} - -//NewContextWithValue returns a context with the specified context values -func NewContextWithValue(ctx context.Context, vals *ContextValues) context.Context { - return context.WithValue(ctx, contextKey{}, vals) -} - -//FromContext returns ContextValues type (if any) along with a boolean that indicates whether -//the returned value is of the required/correct type for this package. -func FromContext(ctx context.Context) (*ContextValues, bool) { - vals, ofType := ctx.Value(contextKey{}).(*ContextValues) - return vals, ofType -} diff --git a/secure/handler/context_test.go b/secure/handler/context_test.go deleted file mode 100644 index c1fadccd..00000000 --- a/secure/handler/context_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package handler - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestFromContextSatID(t *testing.T) { - t.Run("NoSatID", func(t *testing.T) { - assert := assert.New(t) - val, ofType := FromContext(context.Background()) - - assert.False(ofType) - assert.Nil(val) - }) - - t.Run("PresentSatID", func(t *testing.T) { - assert := assert.New(t) - inputCtxValues := &ContextValues{ - SatClientID: "test", - Path: "foo", - Method: "GET", - } - inputContext := context.WithValue(context.Background(), contextKey{}, inputCtxValues) - val, ofType := FromContext(inputContext) - - assert.True(ofType) - assert.Equal(inputCtxValues, val) - }) -} - -func TestNewContext(t *testing.T) { - assert := assert.New(t) - inputCtxValues := &ContextValues{ - SatClientID: "test", - Path: "foo", - Method: "GET", - } - expectedContext := context.WithValue(context.Background(), contextKey{}, inputCtxValues) - actualContext := NewContextWithValue(context.Background(), inputCtxValues) - - assert.EqualValues(expectedContext, actualContext) -} diff --git a/secure/jws.go b/secure/jws.go deleted file mode 100644 index 0295c64c..00000000 --- a/secure/jws.go +++ /dev/null @@ -1,30 +0,0 @@ -package secure - -import ( - "github.com/SermoDigital/jose/jws" -) - -// JWSParser parses raw Tokens into JWS objects -type JWSParser interface { - ParseJWS(*Token) (jws.JWS, error) -} - -type defaultJWSParser int - -func (parser defaultJWSParser) ParseJWS(token *Token) (jws.JWS, error) { - if jwtToken, err := jws.ParseJWT(token.Bytes()); err == nil { - if trust, ok := jwtToken.Claims().Get("trust").(string); ok { - if len(trust) > 0 { - token.trust = trust - } - } - - return jwtToken.(jws.JWS), nil - } else { - return nil, err - } -} - -// DefaultJWSParser is the parser implementation that simply delegates to -// the SermoDigital library's jws.ParseJWT function. -var DefaultJWSParser JWSParser = defaultJWSParser(0) diff --git a/secure/jws_test.go b/secure/jws_test.go deleted file mode 100644 index 69568590..00000000 --- a/secure/jws_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package secure - -import ( - "github.com/SermoDigital/jose/jwt" - "github.com/stretchr/testify/assert" - "testing" -) - -func TestDefaultJWSParserInvalidJWS(t *testing.T) { - assert := assert.New(t) - - token := &Token{ - tokenType: Bearer, - value: "", - } - - jwsToken, err := DefaultJWSParser.ParseJWS(token) - assert.Nil(jwsToken) - assert.NotNil(err) -} - -func TestDefaultJWSParser(t *testing.T) { - assert := assert.New(t) - - token := &Token{ - tokenType: Bearer, - value: string(testSerializedJWT), - } - - jwsToken, err := DefaultJWSParser.ParseJWS(token) - assert.Equal(testJWT.Claims(), jwsToken.(jwt.JWT).Claims()) - assert.Nil(err) -} diff --git a/secure/jwt-key b/secure/jwt-key deleted file mode 100644 index 5d51f8af..00000000 --- a/secure/jwt-key +++ /dev/null @@ -1,51 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIJKgIBAAKCAgEAq8FHmkjXoZ6MJef5ShWOvo1v1OL5SWDsI9wFzWazHqIqRjFs -9hn21DF7ShIWnVStEqHW3iPgJWpmWmPVtt+2lMJD1zoKOraX4r2JZm9haoD1mub/ -hTF3zg3fSatSgDUkZq75y3O7qWgGYTkfvULzk1t2hbqhBQlJiP4ovfwQCzifsRyp -ojc11apFGphQUKsYuabZms0w+YySTSFhbGZ9W4nttqUHUo5QXcaJR5BkSuBKEnsT -DefgXQylRIIofuUOT4nLM0tMyUBzBo7qQoHi+m6AsUGL4SGsyBKPP841y7qm+7QN -ABroGT33m4R+hO6TYtKmI81fw2l0Hy/MiU+I+gVlq94V3zfk9IwuCmEVM4H0qbLt -cswSjGWd6CkEwKLvLGIMgVchgyhVbd2FJ3bRv+hCg/+LKNbd3257dSBEHiCWHHz2 -FqoeqagTshnoruv/6Z+vOJxid3aUKunYQH9zfclR+Al3SdgSiGrZmMd0n2Nu2JwK -tjoAc2JX2ovlIDnofj4KchjMOn7VK7T3lTYd0vUzQpfsize+RLONICN/5ix3JH4H -kR3+XZMNqfh4BC34KhbHKWhj4BNyfPb1vGYeo59Tf+aeNTeNV8GlRh3UNZwaTLbo -GvJMtv+7eB53qkGv4CzpDYZ+8Z7+QwQ+rHKyMCwsqB+DChGoE5M22Km1DWcCAwEA -AQKCAgBqXXYEXBv94PwV9YTylksiQuEAy9dp0/Ypdva472L6E59ufOlnt0ievE4H -3w/WOzw7j7JLO5hyU2QzkiQl7oFZurzcqvruxWlmZ86Re2Su2lI/rdKMH8h7+SdQ -riKXd1GlrbLQhkmvbdaVmxTG1pGVrkzGIH/baJb7mbqNfW5KJLTwsDl1Vg+m1J2b -DLygWHUlc+jK70vnH2DzFzsIMKhtagum0qioPa4ThQI7KXaS0DfPHhz8vZ66wTwQ -IzME8sFcDI+kontZHuqdIyB8M4fnY0ubemYv8/TWqnfAIeo60srakfSDHiaiizeu -Pe1EUaNAzgdJoMQvdj0Nm0JlvrWqbA9JgbQe4r/x8/iNCxGL6XgMTG/3JyYD/CP/ -diKgo4quDH7NiV7PpeAwNY0wyrPzPLXZGHtWSJi+ssN3Z0hj6kALR34PmHZPrVvV -zDStR73vrY9TYkpBfFzF1am+KxpROOFqMfV1jMFRX99mekXoT6S3yIOl9LCfH8PY -abYpAXLf80MqsALfvP+A8/QwoK1qeQTs7lRuQbHcO1N8LngwdhjXmFpiqcdY5EoB -tda3zh8Xf/+HPl66qN0U2Czb+i6CpVPABkvlYnUqcZqBmk5Gldok8V3ov4chhj4t -VhydGFxeLtFvUrbTxC4znxycn9mr5my/VBdBzL/vLUIy8GlYYQKCAQEA4T5adt0j -Go9QEANX/Egj/8Yun0zLwwJ+La3N3elrel6ofRqKqouQRdANlE5X2ZgvrvUGYXUv -eYWQu+YWyHCnwFWs5+79tsObjdWOYq9uzTLv1YBcyxR6jYnVHhyONrqfCDwD0+4n -qftAlGZ7XmFpyHugZYmh+sQWyRDUxtgfo3Tl7otwuZiUnEKVILP5qvmb1Bq+pv15 -kt/K8Ky8BUlNTCxJFv548WQYw8gByyf+5pKHgUkBR/iuYHl+1MBI6kg0QHQf5B8u -pKjJiDJyPouOE/GoEZ5lnE5dFnaPPA+cgMU5Il1R2sLZYa3UJT7l8BzFmKth9X/V -fhSQUw5Br7CcbwKCAQEAwzUsFMvcrnePcYQx+TpDmlPJDE8fhBqYPYOQa9FAWt2V -f2mrO/e/dgTQb8hTNC+l8Wodo5vKiZewyKV6IS2nR/FHTgVf+8ILauULNEMrU+2d -aXTA4vfaVAP50NUXg/9zNv7zHZTk2zQksmc3cAlD007pDrT2X0MZchaq2tih0ytQ -UJYqyvAu/NrV76DxlhQccganEQfqydfqi9AiGmA76bujhbQC3bt+Mszd1JMcRWXt -eTP79iU5S8gy8gu+jNb/XILSTZURARu0FyEWElNb7aF3ZedihVBbHRTmIelghAON -LC4qVJAXAm08HKXoEEaMOGTdwWqTLX7s2EbDl7sKiQKCAQEAx4yjPr0pVWV0C8u6 -jnInGnmsYkr6FllGChf508jxBCeKY9M42GDuvzrUXPiPUeJHFFxVe9AC8ElJcX4l -3wwXQgllNtF/iwR+8kgpbfp4Umj3G5IuI2iQLobW/WdVAt2Q+Q2aYo6SK0DB9Pda -AsKQoiIMdwhZLb29ZgJ4T3W3ieuNrSlyA6tOtaUzUxa/cR7UVDQhhfX4WAvWUiTm -KlTHm118n1dxNIJ2gjTWifJ0HDfivsI71VRWwHfCyp9TueOgDx4SBtstSomSigwP -NKQUikzEll9bLAAs7jK5MP+vqlGQDYbZdtK7HZOP6DNyKKiE0n27OnE3Zgy31C1E -Om9gFwKCAQEAk1X5vISWPxS8rshBU8QXLE9a6rB5sCLGj39SrR4V/b9LTAy8kpmO -6AwAKq6/ph7kmA8o6cj3mNxmMTs8r/geT12cHRZPeNzf80GHMF4WQNWSvvrBb031 -ev45OtbrVdSj6HmLk+NCzPRRUlo3bJeBmubvXwtU/VfOx961/FIP6ivCBeEh0WRx -gqXFXYVTcpwhUCsXQ/J+0vPl8rsYUmIaNnNKm+rfUu5l9P/N2tliODsTfyyuWv2D -fmBPm4Mjwnev6+pNwwLk/7oiNmbhmtlSBEyfqsl3AfpBmvSgMi5Mi7eGgTci+gp7 -Y3iBK3pJaqdkxFfVTFwdU/R93Uuj60zgSQKCAQEAxu3ZitYjnhGRoS0r5TgNtgor -CnxdRoP1+SXANzf5hlvGXvFtBk1WJpTtLlJZ1sJ42nhPWrBrgYVBqJHV/dCF8w84 -HB83961xvoDmDCVE5aekMowXMjUCeI7d3SbjJhXpzXBZmxrD377F4dWDVTwQSUmg -cAwyI4Pdqn2r+WisIsfrkRp4rjjK6VIcFoG79+TxC72MfgV5kTt2ksmevB6lG6MV -HBry+25LqosS3Aey5S0EDtmNMescyYFfLq67g6NlJxczCSLPZ8gp8LefMzTxSQF6 -grz9rPxHW9YDK6TXZnk7gaH4pEoedKdwj05kwyl47oNG9krJT2W4C9bbE49g2Q== ------END RSA PRIVATE KEY----- diff --git a/secure/jwt-key.pub b/secure/jwt-key.pub deleted file mode 100644 index 98eda01a..00000000 --- a/secure/jwt-key.pub +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAq8FHmkjXoZ6MJef5ShWO -vo1v1OL5SWDsI9wFzWazHqIqRjFs9hn21DF7ShIWnVStEqHW3iPgJWpmWmPVtt+2 -lMJD1zoKOraX4r2JZm9haoD1mub/hTF3zg3fSatSgDUkZq75y3O7qWgGYTkfvULz -k1t2hbqhBQlJiP4ovfwQCzifsRypojc11apFGphQUKsYuabZms0w+YySTSFhbGZ9 -W4nttqUHUo5QXcaJR5BkSuBKEnsTDefgXQylRIIofuUOT4nLM0tMyUBzBo7qQoHi -+m6AsUGL4SGsyBKPP841y7qm+7QNABroGT33m4R+hO6TYtKmI81fw2l0Hy/MiU+I -+gVlq94V3zfk9IwuCmEVM4H0qbLtcswSjGWd6CkEwKLvLGIMgVchgyhVbd2FJ3bR -v+hCg/+LKNbd3257dSBEHiCWHHz2FqoeqagTshnoruv/6Z+vOJxid3aUKunYQH9z -fclR+Al3SdgSiGrZmMd0n2Nu2JwKtjoAc2JX2ovlIDnofj4KchjMOn7VK7T3lTYd -0vUzQpfsize+RLONICN/5ix3JH4HkR3+XZMNqfh4BC34KhbHKWhj4BNyfPb1vGYe -o59Tf+aeNTeNV8GlRh3UNZwaTLboGvJMtv+7eB53qkGv4CzpDYZ+8Z7+QwQ+rHKy -MCwsqB+DChGoE5M22Km1DWcCAwEAAQ== ------END PUBLIC KEY----- diff --git a/secure/key/cache.go b/secure/key/cache.go deleted file mode 100644 index 72f116bd..00000000 --- a/secure/key/cache.go +++ /dev/null @@ -1,220 +0,0 @@ -package key - -import ( - "sync" - "sync/atomic" - "time" - - "github.com/xmidt-org/webpa-common/v2/concurrent" -) - -const ( - // dummyKeyId is used when no actual keyID is necessary. - dummyKeyId = "" -) - -// Cache is a Resolver type which provides caching for keys based on keyID. -// -// All implementations will block the first time a particular key is accessed -// and will initialize the value for that key. Thereafter, all updates happen -// in a separate goroutine. This allows HTTP transactions to avoid paying -// the cost of loading a key after the initial fetch. -type Cache interface { - Resolver - - // UpdateKeys updates all keys known to this cache. This method makes - // a best-effort to avoid blocking other goroutines which use ResolveKey, - // which may mean copy-on-write semantics. - // - // The first return value is the count of keys for which attempts were - // made to update. - // - // UpdateKeys may run multiple I/O operations. The second return value is a slice of - // errors that occurred while it attempted to update each key. Exactly one (1) - // attempt will be made to update each key present in the cache, regardless - // of any update errors for each individual key. This slice may be nil if no - // errors occurred. - UpdateKeys() (int, []error) -} - -// basicCache contains the internal members common to all cache implementations -type basicCache struct { - delegate Resolver - value atomic.Value - updateLock sync.Mutex -} - -func (b *basicCache) load() interface{} { - return b.value.Load() -} - -func (b *basicCache) store(newValue interface{}) { - b.value.Store(newValue) -} - -// update provides a critical section for an update operation -func (b *basicCache) update(operation func()) { - b.updateLock.Lock() - defer b.updateLock.Unlock() - operation() -} - -// singleCache assumes that the delegate Resolver -// only returns (1) key. -type singleCache struct { - basicCache -} - -func (cache *singleCache) ResolveKey(keyID string) (pair Pair, err error) { - var ok bool - pair, ok = cache.load().(Pair) - if !ok { - cache.update(func() { - pair, ok = cache.load().(Pair) - if !ok { - pair, err = cache.delegate.ResolveKey(keyID) - if err == nil { - cache.store(pair) - } - } - }) - } - - return -} - -func (cache *singleCache) UpdateKeys() (count int, errors []error) { - count = 1 - cache.update(func() { - // this type of cache is specifically for resolvers which don't use the keyID, - // so just pass an empty string in - if pair, err := cache.delegate.ResolveKey(dummyKeyId); err == nil { - cache.store(pair) - } else { - errors = []error{err} - } - }) - - return -} - -// multiCache uses an atomic map reference to store keys. -// Once created, each internal map instance will never be written -// to again, thus removing the need to lock for reads. This approach -// does consume more memory, however. The updateLock ensures that only -// (1) goroutine will ever be updating the map at anytime. -type multiCache struct { - basicCache -} - -// fetchPair uses the atomic reference to the keys map and attempts -// to fetch the key from the cache. -func (cache *multiCache) fetchPair(keyID string) (pair Pair, ok bool) { - pairs, ok := cache.load().(map[string]Pair) - if ok { - pair, ok = pairs[keyID] - } - - return -} - -// copyPairs creates a copy of the current key cache. If no keys are present -// yet, this method returns a non-nil empty map. -func (cache *multiCache) copyPairs() map[string]Pair { - pairs, _ := cache.load().(map[string]Pair) - - // make the capacity 1 larger, since this method is almost always - // going to be invoked prior to doing a copy-on-write update. - newPairs := make(map[string]Pair, len(pairs)+1) - - for keyID, pair := range pairs { - newPairs[keyID] = pair - } - - return newPairs -} - -func (cache *multiCache) ResolveKey(keyID string) (pair Pair, err error) { - var ok bool - pair, ok = cache.fetchPair(keyID) - if !ok { - cache.update(func() { - pair, ok = cache.fetchPair(keyID) - if !ok { - pair, err = cache.delegate.ResolveKey(keyID) - if err == nil { - newPairs := cache.copyPairs() - newPairs[keyID] = pair - cache.store(newPairs) - } - } - }) - } - - return -} - -func (cache *multiCache) UpdateKeys() (count int, errors []error) { - if existingPairs, ok := cache.load().(map[string]Pair); ok { - count = len(existingPairs) - cache.update(func() { - newCount := 0 - newPairs := make(map[string]Pair, len(existingPairs)) - for keyID, oldPair := range existingPairs { - if newPair, err := cache.delegate.ResolveKey(keyID); err == nil { - newCount++ - newPairs[keyID] = newPair - } else { - // keep the old key in the event of an error - newPairs[keyID] = oldPair - errors = append(errors, err) - } - } - - // small optimization: don't bother doing the atomic swap - // if every key operation failed - if newCount > 0 { - cache.store(newPairs) - } - }) - } - - return -} - -// NewUpdater conditionally creates a Runnable which will update the keys in -// the given resolver on the configured updateInterval. If both (1) the -// updateInterval is positive, and (2) resolver implements Cache, then this -// method returns a non-nil function that will spawn a goroutine to update -// the cache in the background. Otherwise, this method returns nil. -func NewUpdater(updateInterval time.Duration, resolver Resolver) (updater concurrent.Runnable) { - if updateInterval < 1 { - return - } - - if keyCache, ok := resolver.(Cache); ok { - updater = concurrent.RunnableFunc(func(waitGroup *sync.WaitGroup, shutdown <-chan struct{}) error { - waitGroup.Add(1) - - go func() { - defer waitGroup.Done() - - ticker := time.NewTicker(updateInterval) - defer ticker.Stop() - - for { - select { - case <-shutdown: - return - case <-ticker.C: - keyCache.UpdateKeys() - } - } - }() - - return nil - }) - } - - return -} diff --git a/secure/key/cache_test.go b/secure/key/cache_test.go deleted file mode 100644 index 315f2454..00000000 --- a/secure/key/cache_test.go +++ /dev/null @@ -1,454 +0,0 @@ -package key - -import ( - "errors" - "fmt" - "sync" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" -) - -func makeExpectedPairs(count int) (expectedKeyIDs []string, expectedPairs map[string]Pair) { - expectedPairs = make(map[string]Pair, count) - for index := 0; index < count; index++ { - keyID := fmt.Sprintf("key#%d", index) - expectedKeyIDs = append(expectedKeyIDs, keyID) - expectedPairs[keyID] = &MockPair{} - } - - return -} - -func assertExpectationsForPairs(t *testing.T, pairs map[string]Pair) { - for _, pair := range pairs { - if mockPair, ok := pair.(*MockPair); ok { - mock.AssertExpectationsForObjects(t, mockPair) - } - } -} - -func TestBasicCacheStoreAndLoad(t *testing.T) { - assert := assert.New(t) - - cache := basicCache{} - assert.Nil(cache.load()) - cache.store(123) - assert.Equal(123, cache.load()) -} - -func TestSingleCacheResolveKey(t *testing.T) { - assert := assert.New(t) - - const keyID = "TestSingleCacheResolveKey" - expectedPair := &MockPair{} - resolver := &MockResolver{} - resolver.On("ResolveKey", keyID).Return(expectedPair, nil).Once() - - cache := singleCache{ - basicCache{ - delegate: resolver, - }, - } - - waitGroup := &sync.WaitGroup{} - waitGroup.Add(2) - barrier := make(chan struct{}) - - for repeat := 0; repeat < 2; repeat++ { - go func() { - defer waitGroup.Done() - <-barrier - actualPair, err := cache.ResolveKey(keyID) - assert.Equal(expectedPair, actualPair) - assert.Nil(err) - }() - } - - close(barrier) - waitGroup.Wait() - - mock.AssertExpectationsForObjects(t, expectedPair) - mock.AssertExpectationsForObjects(t, resolver) - assert.Equal(expectedPair, cache.load()) -} - -func TestSingleCacheResolveKeyError(t *testing.T) { - assert := assert.New(t) - - const keyID = "TestSingleCacheResolveKeyError" - expectedError := errors.New("TestSingleCacheResolveKeyError") - resolver := &MockResolver{} - resolver.On("ResolveKey", keyID).Return(nil, expectedError).Twice() - - cache := singleCache{ - basicCache{ - delegate: resolver, - }, - } - - waitGroup := &sync.WaitGroup{} - waitGroup.Add(2) - barrier := make(chan struct{}) - - for repeat := 0; repeat < 2; repeat++ { - go func() { - defer waitGroup.Done() - <-barrier - pair, err := cache.ResolveKey(keyID) - assert.Nil(pair) - assert.Equal(expectedError, err) - }() - } - - close(barrier) - waitGroup.Wait() - - mock.AssertExpectationsForObjects(t, resolver) - assert.Nil(cache.load()) -} - -func TestSingleCacheUpdateKeys(t *testing.T) { - assert := assert.New(t) - - expectedPair := &MockPair{} - resolver := &MockResolver{} - resolver.On("ResolveKey", dummyKeyId).Return(expectedPair, nil).Once() - - cache := singleCache{ - basicCache{ - delegate: resolver, - }, - } - - count, errors := cache.UpdateKeys() - mock.AssertExpectationsForObjects(t, expectedPair) - mock.AssertExpectationsForObjects(t, resolver) - assert.Equal(1, count) - assert.Nil(errors) -} - -func TestSingleCacheUpdateKeysError(t *testing.T) { - assert := assert.New(t) - - expectedError := errors.New("TestSingleCacheUpdateKeysError") - resolver := &MockResolver{} - resolver.On("ResolveKey", dummyKeyId).Return(nil, expectedError).Once() - - cache := singleCache{ - basicCache{ - delegate: resolver, - }, - } - - count, errors := cache.UpdateKeys() - mock.AssertExpectationsForObjects(t, resolver) - assert.Equal(1, count) - assert.Equal([]error{expectedError}, errors) - - mock.AssertExpectationsForObjects(t, resolver) -} - -func TestSingleCacheUpdateKeysSequence(t *testing.T) { - assert := assert.New(t) - - const keyID = "TestSingleCacheUpdateKeysSequence" - expectedError := errors.New("TestSingleCacheUpdateKeysSequence") - oldPair := &MockPair{} - newPair := &MockPair{} - resolver := &MockResolver{} - resolver.On("ResolveKey", keyID).Return(oldPair, nil).Once() - resolver.On("ResolveKey", dummyKeyId).Return(nil, expectedError).Once() - resolver.On("ResolveKey", dummyKeyId).Return(newPair, nil).Once() - - cache := singleCache{ - basicCache{ - delegate: resolver, - }, - } - - firstPair, err := cache.ResolveKey(keyID) - assert.Equal(oldPair, firstPair) - assert.Nil(err) - - count, errors := cache.UpdateKeys() - assert.Equal(1, count) - assert.Equal([]error{expectedError}, errors) - - // resolving should pull the key from the cache - firstPair, err = cache.ResolveKey(keyID) - assert.Equal(oldPair, firstPair) - assert.Nil(err) - - // this time, the mock will succeed - count, errors = cache.UpdateKeys() - assert.Equal(1, count) - assert.Len(errors, 0) - - // resolving should pull the *new* key from the cache - secondPair, err := cache.ResolveKey(keyID) - assert.Equal(newPair, secondPair) - assert.Nil(err) - - mock.AssertExpectationsForObjects(t, resolver) -} - -func TestMultiCacheResolveKey(t *testing.T) { - assert := assert.New(t) - - expectedKeyIDs, expectedPairs := makeExpectedPairs(2) - resolver := &MockResolver{} - for _, keyID := range expectedKeyIDs { - resolver.On("ResolveKey", keyID).Return(expectedPairs[keyID], nil).Once() - } - - cache := multiCache{ - basicCache{ - delegate: resolver, - }, - } - - // spawn twice the number of routines as keys so - // that we test concurrently resolving keys from the cache - // and from the delegate - waitGroup := &sync.WaitGroup{} - waitGroup.Add(5 * len(expectedKeyIDs)) - barrier := make(chan struct{}) - - for repeat := 0; repeat < 5; repeat++ { - for _, keyID := range expectedKeyIDs { - go func(keyID string, expectedPair Pair) { - t.Logf("keyID=%s", keyID) - defer waitGroup.Done() - <-barrier - pair, err := cache.ResolveKey(keyID) - assert.Equal(expectedPair, pair) - assert.Nil(err) - }(keyID, expectedPairs[keyID]) - } - } - - close(barrier) - waitGroup.Wait() - - mock.AssertExpectationsForObjects(t, resolver) - assertExpectationsForPairs(t, expectedPairs) -} - -func TestMultiCacheResolveKeyError(t *testing.T) { - assert := assert.New(t) - - expectedError := errors.New("TestMultiCacheResolveKeyError") - expectedKeyIDs, _ := makeExpectedPairs(2) - resolver := &MockResolver{} - for _, keyID := range expectedKeyIDs { - resolver.On("ResolveKey", keyID).Return(nil, expectedError).Twice() - } - - cache := multiCache{ - basicCache{ - delegate: resolver, - }, - } - - // spawn twice the number of routines as keys so - // that we test concurrently resolving keys from the cache - // and from the delegate - waitGroup := &sync.WaitGroup{} - waitGroup.Add(2 * len(expectedKeyIDs)) - barrier := make(chan struct{}) - - for repeat := 0; repeat < 2; repeat++ { - for _, keyID := range expectedKeyIDs { - go func(keyID string) { - defer waitGroup.Done() - <-barrier - key, err := cache.ResolveKey(keyID) - assert.Nil(key) - assert.Equal(expectedError, err) - }(keyID) - } - } - - close(barrier) - waitGroup.Wait() - - mock.AssertExpectationsForObjects(t, resolver) -} - -func TestMultiCacheUpdateKeys(t *testing.T) { - assert := assert.New(t) - - resolver := &MockResolver{} - expectedKeyIDs, expectedPairs := makeExpectedPairs(2) - t.Logf("expectedKeyIDs: %s", expectedKeyIDs) - - for _, keyID := range expectedKeyIDs { - resolver.On("ResolveKey", keyID).Return(expectedPairs[keyID], nil).Twice() - } - - cache := multiCache{ - basicCache{ - delegate: resolver, - }, - } - - count, errors := cache.UpdateKeys() - assert.Equal(0, count) - assert.Len(errors, 0) - - for _, keyID := range expectedKeyIDs { - pair, err := cache.ResolveKey(keyID) - assert.Equal(expectedPairs[keyID], pair) - assert.Nil(err) - } - - count, errors = cache.UpdateKeys() - assert.Equal(len(expectedKeyIDs), count) - assert.Len(errors, 0) - - mock.AssertExpectationsForObjects(t, resolver) - assertExpectationsForPairs(t, expectedPairs) -} - -func TestMultiCacheUpdateKeysError(t *testing.T) { - assert := assert.New(t) - - expectedError := errors.New("TestMultiCacheUpdateKeysError") - expectedKeyIDs, _ := makeExpectedPairs(2) - resolver := &MockResolver{} - for _, keyID := range expectedKeyIDs { - resolver.On("ResolveKey", keyID).Return(nil, expectedError).Once() - } - - cache := multiCache{ - basicCache{ - delegate: resolver, - }, - } - - count, errors := cache.UpdateKeys() - assert.Equal(0, count) - assert.Len(errors, 0) - - for _, keyID := range expectedKeyIDs { - key, err := cache.ResolveKey(keyID) - assert.Nil(key) - assert.Equal(expectedError, err) - } - - // UpdateKeys should still not do anything, because - // nothing should be in the cache due to errors - count, errors = cache.UpdateKeys() - assert.Equal(0, count) - assert.Len(errors, 0) - - mock.AssertExpectationsForObjects(t, resolver) -} - -func TestMultiCacheUpdateKeysSequence(t *testing.T) { - assert := assert.New(t) - - const keyID = "TestMultiCacheUpdateKeysSequence" - expectedError := errors.New("TestMultiCacheUpdateKeysSequence") - oldPair := &MockPair{} - newPair := &MockPair{} - - resolver := &MockResolver{} - resolver.On("ResolveKey", keyID).Return(oldPair, nil).Once() - resolver.On("ResolveKey", keyID).Return(nil, expectedError).Once() - resolver.On("ResolveKey", keyID).Return(newPair, nil).Once() - - cache := multiCache{ - basicCache{ - delegate: resolver, - }, - } - - pair, err := cache.ResolveKey(keyID) - assert.Equal(oldPair, pair) - assert.Nil(err) - - // an error should leave the existing key alone - count, errors := cache.UpdateKeys() - assert.Equal(1, count) - assert.Equal([]error{expectedError}, errors) - - // the key should resolve to the old key from the cache - pair, err = cache.ResolveKey(keyID) - assert.Equal(oldPair, pair) - assert.Nil(err) - - // again, this time the mock will succeed - count, errors = cache.UpdateKeys() - assert.Equal(1, count) - assert.Len(errors, 0) - - // resolving a key should show the new value now - pair, err = cache.ResolveKey(keyID) - assert.Equal(newPair, pair) - assert.Nil(err) - - mock.AssertExpectationsForObjects(t, resolver, oldPair, newPair) -} - -func TestNewUpdaterNoRunnable(t *testing.T) { - assert := assert.New(t) - - keyCache := &MockCache{} - - var testData = []struct { - updateInterval time.Duration - keyCache Cache - }{ - { - updateInterval: -1, - keyCache: keyCache, - }, - { - updateInterval: 0, - keyCache: keyCache, - }, - { - updateInterval: 1232354, - keyCache: nil, - }, - } - - for _, record := range testData { - t.Log(record) - updater := NewUpdater(record.updateInterval, record.keyCache) - assert.Nil(updater) - } - - mock.AssertExpectationsForObjects(t, keyCache) -} - -func TestNewUpdater(t *testing.T) { - assert := assert.New(t) - - updateKeysCalled := make(chan struct{}) - runner := func(mock.Arguments) { - defer func() { - recover() // ignore panics from multiple closes - }() - - close(updateKeysCalled) - } - - keyCache := &MockCache{} - keyCache.On("UpdateKeys").Return(0, nil).Run(runner) - - if updater := NewUpdater(100*time.Millisecond, keyCache); assert.NotNil(updater) { - waitGroup := &sync.WaitGroup{} - shutdown := make(chan struct{}) - updater.Run(waitGroup, shutdown) - - // we only care that the updater called UpdateKeys() at least once - <-updateKeysCalled - close(shutdown) - waitGroup.Wait() - } -} diff --git a/secure/key/doc.go b/secure/key/doc.go deleted file mode 100644 index 655a490f..00000000 --- a/secure/key/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -/* -Package key provides a simple API for loading public and private keys from resources. -*/ -package key diff --git a/secure/key/mocks.go b/secure/key/mocks.go deleted file mode 100644 index 3d7e7e32..00000000 --- a/secure/key/mocks.go +++ /dev/null @@ -1,80 +0,0 @@ -package key - -import ( - "github.com/stretchr/testify/mock" -) - -// MockResolver is a stretchr mock for Resolver. It's exposed for other package tests. -type MockResolver struct { - mock.Mock -} - -func (resolver *MockResolver) ResolveKey(keyId string) (Pair, error) { - arguments := resolver.Called(keyId) - if pair, ok := arguments.Get(0).(Pair); ok { - return pair, arguments.Error(1) - } else { - return nil, arguments.Error(1) - } -} - -// MockCache is a stretchr mock for Cache. It's exposed for other package tests. -type MockCache struct { - mock.Mock -} - -func (cache *MockCache) ResolveKey(keyId string) (Pair, error) { - arguments := cache.Called(keyId) - if pair, ok := arguments.Get(0).(Pair); ok { - return pair, arguments.Error(1) - } else { - return nil, arguments.Error(1) - } -} - -func (cache *MockCache) UpdateKeys() (int, []error) { - arguments := cache.Called() - if errors, ok := arguments.Get(1).([]error); ok { - return arguments.Int(0), errors - } else { - return arguments.Int(0), nil - } -} - -// MockPair is a stretchr mock for Pair. It's exposed for other package tests. -type MockPair struct { - mock.Mock -} - -func (pair *MockPair) Purpose() Purpose { - arguments := pair.Called() - return arguments.Get(0).(Purpose) -} - -func (pair *MockPair) Public() interface{} { - arguments := pair.Called() - return arguments.Get(0) -} - -func (pair *MockPair) HasPrivate() bool { - arguments := pair.Called() - return arguments.Bool(0) -} - -func (pair *MockPair) Private() interface{} { - arguments := pair.Called() - return arguments.Get(0) -} - -type MockParser struct { - mock.Mock -} - -func (parser *MockParser) ParseKey(purpose Purpose, data []byte) (Pair, error) { - arguments := parser.Called(purpose, data) - if pair, ok := arguments.Get(0).(Pair); ok { - return pair, arguments.Error(1) - } - - return nil, arguments.Error(1) -} diff --git a/secure/key/pair.go b/secure/key/pair.go deleted file mode 100644 index 560fbba9..00000000 --- a/secure/key/pair.go +++ /dev/null @@ -1,49 +0,0 @@ -package key - -import ( - "crypto/rsa" -) - -// Pair represents a resolved key pair. For all Pair instances, the private key is optional, -// while the public key will always be present. -type Pair interface { - // Purpose returns the configured intended usage of this key pair - Purpose() Purpose - - // Public returns the public key associated with this pair. It will never be nil - Public() interface{} - - // HasPrivate tests whether this key Pair has a private key - HasPrivate() bool - - // Private returns the optional private key associated with this Pair. If there - // is no private key, this method returns nil. - Private() interface{} -} - -// rsaPair is an RSA key Pair implementation -type rsaPair struct { - purpose Purpose - public interface{} - private *rsa.PrivateKey -} - -func (rp *rsaPair) Purpose() Purpose { - return rp.purpose -} - -func (rp *rsaPair) Public() interface{} { - return rp.public -} - -func (rp *rsaPair) HasPrivate() bool { - return rp.private != nil -} - -func (rp *rsaPair) Private() interface{} { - if rp.private != nil { - return rp.private - } - - return nil -} diff --git a/secure/key/parser.go b/secure/key/parser.go deleted file mode 100644 index bfc15b55..00000000 --- a/secure/key/parser.go +++ /dev/null @@ -1,94 +0,0 @@ -package key - -import ( - "crypto/rsa" - "crypto/x509" - "encoding/pem" - "errors" -) - -var ( - ErrorPEMRequired = errors.New("Keys must be PEM-encoded") - ErrorUnsupportedPrivateKeyFormat = errors.New("Private keys must be in PKCS1 or PKCS8 format") - ErrorNotRSAPrivateKey = errors.New("Only RSA private keys are supported") - ErrorNotRSAPublicKey = errors.New("Only RSA public keys or certificates are suppored") -) - -// Parser parses a chunk of bytes into a Pair. Parser implementations must -// always be safe for concurrent access. -type Parser interface { - // Parse examines data to produce a Pair. If the returned error is not nil, - // the Pair will always be nil. This method is responsible for dealing with - // any required decoding, such as PEM or DER. - ParseKey(Purpose, []byte) (Pair, error) -} - -// defaultParser is the internal default Parser implementation -type defaultParser int - -func (p defaultParser) String() string { - return "defaultParser" -} - -func (p defaultParser) parseRSAPrivateKey(purpose Purpose, decoded []byte) (Pair, error) { - var ( - parsedKey interface{} - err error - ) - - if parsedKey, err = x509.ParsePKCS1PrivateKey(decoded); err != nil { - if parsedKey, err = x509.ParsePKCS8PrivateKey(decoded); err != nil { - return nil, ErrorUnsupportedPrivateKeyFormat - } - } - - privateKey, ok := parsedKey.(*rsa.PrivateKey) - if !ok { - return nil, ErrorNotRSAPrivateKey - } - - return &rsaPair{ - purpose: purpose, - public: privateKey.Public(), - private: privateKey, - }, nil -} - -func (p defaultParser) parseRSAPublicKey(purpose Purpose, decoded []byte) (Pair, error) { - var ( - parsedKey interface{} - err error - ) - - if parsedKey, err = x509.ParsePKIXPublicKey(decoded); err != nil { - return nil, err - } - - publicKey, ok := parsedKey.(*rsa.PublicKey) - if !ok { - return nil, ErrorNotRSAPublicKey - } - - return &rsaPair{ - purpose: purpose, - public: publicKey, - private: nil, - }, nil -} - -func (p defaultParser) ParseKey(purpose Purpose, data []byte) (Pair, error) { - block, _ := pem.Decode(data) - if block == nil { - return nil, ErrorPEMRequired - } - - if purpose.RequiresPrivateKey() { - return p.parseRSAPrivateKey(purpose, block.Bytes) - } else { - return p.parseRSAPublicKey(purpose, block.Bytes) - } -} - -// DefaultParser is the global, singleton default parser. All keys submitted to -// this parser must be PEM-encoded. -var DefaultParser Parser = defaultParser(0) diff --git a/secure/key/parser_test.go b/secure/key/parser_test.go deleted file mode 100644 index 661b3e06..00000000 --- a/secure/key/parser_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package key - -import ( - "encoding/pem" - "fmt" - "github.com/stretchr/testify/assert" - "io/ioutil" - "testing" -) - -func makeNonKeyPEMBlock() []byte { - block := pem.Block{ - Type: "NOT A KEY", - Bytes: []byte{1, 2, 3, 4, 5}, - } - - return pem.EncodeToMemory(&block) -} - -func TestDefaultParser(t *testing.T) { - assert := assert.New(t) - - var testData = []struct { - keyFilePath string - purpose Purpose - expectPrivate bool - }{ - {publicKeyFilePath, PurposeVerify, false}, - {privateKeyFilePath, PurposeEncrypt, true}, - {privateKeyFilePath, PurposeSign, true}, - {publicKeyFilePath, PurposeDecrypt, false}, - } - - for _, record := range testData { - t.Logf("%v", record) - - data, err := ioutil.ReadFile(record.keyFilePath) - if !assert.Nil(err) { - continue - } - - pair, err := DefaultParser.ParseKey(record.purpose, data) - if !assert.Nil(err) && !assert.NotNil(pair) { - continue - } - - assert.NotNil(pair.Public()) - assert.Equal(record.expectPrivate, pair.HasPrivate()) - assert.Equal(record.expectPrivate, pair.Private() != nil) - assert.Equal(record.purpose, pair.Purpose()) - } -} - -func TestDefaultParserString(t *testing.T) { - assert := assert.New(t) - assert.NotEmpty(fmt.Sprintf("%s", DefaultParser)) -} - -func TestDefaultParserNoPEM(t *testing.T) { - assert := assert.New(t) - - notPEM := []byte{9, 9, 9} - pair, err := DefaultParser.ParseKey(PurposeVerify, notPEM) - assert.Nil(pair) - assert.Equal(ErrorPEMRequired, err) -} - -func TestDefaultParserInvalidPublicKey(t *testing.T) { - assert := assert.New(t) - - for _, purpose := range []Purpose{PurposeVerify, PurposeDecrypt} { - t.Logf("%s", purpose) - pair, err := DefaultParser.ParseKey(purpose, makeNonKeyPEMBlock()) - assert.Nil(pair) - assert.NotNil(err) - } -} - -func TestDefaultParserInvalidPrivateKey(t *testing.T) { - assert := assert.New(t) - - for _, purpose := range []Purpose{PurposeSign, PurposeEncrypt} { - t.Logf("%s", purpose) - pair, err := DefaultParser.ParseKey(purpose, makeNonKeyPEMBlock()) - assert.Nil(pair) - assert.Equal(ErrorUnsupportedPrivateKeyFormat, err) - } -} diff --git a/secure/key/purpose.go b/secure/key/purpose.go deleted file mode 100644 index 4561339b..00000000 --- a/secure/key/purpose.go +++ /dev/null @@ -1,84 +0,0 @@ -package key - -import ( - "bytes" - "fmt" -) - -// Purpose is an enumerated type describing the reason a given -// key is being used. This type implements Parser. -// -// All Purpose values assume PEM-encoded keys. For other formats, -// a custom Parser decorator can be used. Purpose.RequiresPrivateKey() -// determines whether to parse the key as a private key. -type Purpose int - -const ( - // PurposeVerify refers to a key used to verify a signature. This is the zero-value - // for Purpose. These keys must be public keys encoded as PEM blocks. - PurposeVerify Purpose = Purpose(iota) - - // PurposeSign refers to a key used to create a signature. These keys must be private, - // PEM-encoded keys. - PurposeSign - - // PurposeEncrypt refers to a key used to encrypt data. These keys must be private, - // PEM-encoded keys. - PurposeEncrypt - - // PurposeDecrypt refers to a key used to decrypt data. These keys must be public, - // PEM-encoded keys. - PurposeDecrypt -) - -var ( - purposeMarshal = map[Purpose]string{ - PurposeSign: "sign", - PurposeVerify: "verify", - PurposeEncrypt: "encrypt", - PurposeDecrypt: "decrypt", - } - - purposeUnmarshal = map[string]Purpose{ - "sign": PurposeSign, - "verify": PurposeVerify, - "encrypt": PurposeEncrypt, - "decrypt": PurposeDecrypt, - } -) - -// String returns a human-readable, string representation for a Purpose. -// Unrecognized purpose values are assumed to be PurposeVerify. -func (p Purpose) String() string { - if value, ok := purposeMarshal[p]; ok { - return value - } - - return purposeMarshal[PurposeVerify] -} - -func (p *Purpose) UnmarshalJSON(data []byte) error { - if data[0] == '"' { - if unmarshalValue, ok := purposeUnmarshal[string(data[1:len(data)-1])]; ok { - *p = unmarshalValue - return nil - } - } - - return fmt.Errorf("Invalid key purpose: %s", data) -} - -func (p Purpose) MarshalJSON() ([]byte, error) { - var buffer bytes.Buffer - buffer.WriteString("\"") - buffer.WriteString(p.String()) - buffer.WriteString("\"") - - return buffer.Bytes(), nil -} - -// RequiresPrivateKey returns true if this purpose requires a private key, -// false if it requires a public key. -func (p Purpose) RequiresPrivateKey() bool { - return p == PurposeSign || p == PurposeEncrypt -} diff --git a/secure/key/purpose_test.go b/secure/key/purpose_test.go deleted file mode 100644 index f916b1f7..00000000 --- a/secure/key/purpose_test.go +++ /dev/null @@ -1,114 +0,0 @@ -package key - -import ( - "encoding/json" - "github.com/stretchr/testify/assert" - "testing" -) - -func TestPurposeString(t *testing.T) { - var testData = []struct { - purpose Purpose - expectedString string - }{ - {PurposeSign, "sign"}, - {PurposeVerify, "verify"}, - {PurposeEncrypt, "encrypt"}, - {PurposeDecrypt, "decrypt"}, - {Purpose(45), "verify"}, - {Purpose(-1), "verify"}, - } - - for _, test := range testData { - actualString := test.purpose.String() - if actualString != test.expectedString { - t.Errorf("Expected String() [%s] but got [%s]", test.expectedString, actualString) - } - } -} - -func TestPurposeMarshalJSON(t *testing.T) { - var testData = []struct { - purpose Purpose - expectedJSON string - }{ - {PurposeSign, `"sign"`}, - {PurposeVerify, `"verify"`}, - {PurposeEncrypt, `"encrypt"`}, - {PurposeDecrypt, `"decrypt"`}, - {Purpose(45), `"verify"`}, - {Purpose(-1), `"verify"`}, - } - - for _, test := range testData { - actualJSON, err := json.Marshal(test.purpose) - if err != nil { - t.Fatalf("Failed to marshal JSON: %v", err) - } - - if string(actualJSON) != test.expectedJSON { - t.Errorf("Expected JSON [%s] but got [%s]", test.expectedJSON, actualJSON) - } - } -} - -func TestPurposeUnmarshalJSON(t *testing.T) { - var validRecords = []struct { - JSON string - expectedPurpose Purpose - }{ - {`"sign"`, PurposeSign}, - {`"verify"`, PurposeVerify}, - {`"encrypt"`, PurposeEncrypt}, - {`"decrypt"`, PurposeDecrypt}, - } - - var invalidRecords = []string{ - "", - "0", - "123", - `""`, - `"invalid"`, - `"SIGN"`, - `"vERifY"`, - } - - for _, test := range validRecords { - var actualPurpose Purpose - err := json.Unmarshal([]byte(test.JSON), &actualPurpose) - if err != nil { - t.Fatalf("Failed to unmarshal JSON: %v", err) - } - - if actualPurpose != test.expectedPurpose { - t.Errorf("Expected purpose [%d] but got [%d]", test.expectedPurpose, actualPurpose) - } - } - - for _, invalidJSON := range invalidRecords { - var actualPurpose Purpose - err := json.Unmarshal([]byte(invalidJSON), &actualPurpose) - if err == nil { - t.Errorf("Should have failed to marshal JSON [%s]", invalidJSON) - } - } -} - -func TestPurposeRequiresPrivateKey(t *testing.T) { - assert := assert.New(t) - - var testData = []struct { - purpose Purpose - expectedRequiresPrivateKey bool - }{ - {PurposeVerify, false}, - {PurposeSign, true}, - {PurposeEncrypt, true}, - {PurposeDecrypt, false}, - } - - for _, record := range testData { - t.Logf("%#v", record) - assert.Equal(record.expectedRequiresPrivateKey, record.purpose.RequiresPrivateKey()) - } -} diff --git a/secure/key/resolver.go b/secure/key/resolver.go deleted file mode 100644 index effa8b86..00000000 --- a/secure/key/resolver.go +++ /dev/null @@ -1,83 +0,0 @@ -package key - -import ( - "fmt" - - "github.com/xmidt-org/webpa-common/v2/resource" -) - -// Resolver loads and parses keys associated with key identifiers. -type Resolver interface { - // ResolveKey returns a key Pair associated with the given identifier. The exact mechanics of resolving - // a keyId into a Pair are implementation-specific. Implementations are free - // to ignore the keyId parameter altogether. - ResolveKey(keyId string) (Pair, error) -} - -// basicResolver contains common items for all resolvers. -type basicResolver struct { - parser Parser - purpose Purpose -} - -func (b *basicResolver) parseKey(data []byte) (Pair, error) { - return b.parser.ParseKey(b.purpose, data) -} - -// singleResolver is a Resolver which expects only (1) key for all key ids. -type singleResolver struct { - basicResolver - loader resource.Loader -} - -func (r *singleResolver) String() string { - return fmt.Sprintf( - "singleResolver{parser: %v, purpose: %v, loader: %v}", - r.parser, - r.purpose, - r.loader, - ) -} - -func (r *singleResolver) ResolveKey(keyId string) (Pair, error) { - data, err := resource.ReadAll(r.loader) - if err != nil { - return nil, err - } - - return r.parseKey(data) -} - -// multiResolver is a Resolver which uses the key id and will most likely return -// different keys for each key id value. -type multiResolver struct { - basicResolver - expander resource.Expander -} - -func (r *multiResolver) String() string { - return fmt.Sprintf( - "multiResolver{parser: %v, purpose: %v, expander: %v}", - r.parser, - r.purpose, - r.expander, - ) -} - -func (r *multiResolver) ResolveKey(keyId string) (Pair, error) { - values := map[string]interface{}{ - KeyIdParameterName: keyId, - } - - loader, err := r.expander.Expand(values) - if err != nil { - return nil, err - } - - data, err := resource.ReadAll(loader) - if err != nil { - return nil, err - } - - return r.parseKey(data) -} diff --git a/secure/key/resolverFactory.go b/secure/key/resolverFactory.go deleted file mode 100644 index 3c3eff74..00000000 --- a/secure/key/resolverFactory.go +++ /dev/null @@ -1,106 +0,0 @@ -package key - -import ( - "fmt" - "time" - - "github.com/xmidt-org/webpa-common/v2/concurrent" - "github.com/xmidt-org/webpa-common/v2/resource" -) - -const ( - // KeyIdParameterName is the template parameter that must be present in URI templates - // if there are any parameters. URI templates accepted by this package have either no parameters - // or exactly one (1) parameter with this name. - KeyIdParameterName = "keyId" -) - -var ( - // ErrorInvalidTemplate is the error returned when a URI template is invalid for a key resource - ErrorInvalidTemplate = fmt.Errorf( - "Key resource template must support either no parameters are the %s parameter", - KeyIdParameterName, - ) -) - -// ResolverFactory provides a JSON representation of a collection of keys together -// with a factory interface for creating distinct Resolver instances. -// -// This factory uses resource.NewExpander() to create a resource template used in resolving keys. -// This template can have no parameters, in which case the same resource is used regardless -// of the key id. If the template has any parameters, it must have exactly (1) parameter -// and that parameter's name must be equal to KeyIdParameterName. -type ResolverFactory struct { - resource.Factory - - // All keys resolved by this factory will have this purpose, which affects - // how keys are parsed. - Purpose Purpose `json:"purpose"` - - // UpdateInterval specifies how often keys should be refreshed. - // If negative or zero, keys are never refreshed and are cached forever. - UpdateInterval time.Duration `json:"updateInterval"` - - // Parser is a custom key parser. If omitted, DefaultParser is used. - Parser Parser `json:"-"` -} - -func (factory *ResolverFactory) parser() Parser { - if factory.Parser != nil { - return factory.Parser - } - - return DefaultParser -} - -// NewResolver() creates a Resolver using this factory's configuration. The -// returned Resolver always caches keys forever once they have been loaded. -func (factory *ResolverFactory) NewResolver() (Resolver, error) { - expander, err := factory.NewExpander() - if err != nil { - return nil, err - } - - names := expander.Names() - nameCount := len(names) - if nameCount == 0 { - // the template had no parameters, so we can create a simpler object - loader, err := factory.NewLoader() - if err != nil { - return nil, err - } - - return &singleCache{ - basicCache{ - delegate: &singleResolver{ - basicResolver: basicResolver{ - parser: factory.parser(), - purpose: factory.Purpose, - }, - loader: loader, - }, - }, - }, nil - } else if nameCount == 1 && names[0] == KeyIdParameterName { - return &multiCache{ - basicCache{ - delegate: &multiResolver{ - basicResolver: basicResolver{ - parser: factory.parser(), - purpose: factory.Purpose, - }, - expander: expander, - }, - }, - }, nil - } - - return nil, ErrorInvalidTemplate -} - -// NewUpdater uses this factory's configuration to conditionally create a Runnable updater -// for the given resolver. This method delegates to the NewUpdater function, and may -// return a nil Runnable if no updates are necessary. -func (factory *ResolverFactory) NewUpdater(resolver Resolver) concurrent.Runnable { - return NewUpdater(time.Duration(factory.UpdateInterval), resolver) -} diff --git a/secure/key/resolverFactory_test.go b/secure/key/resolverFactory_test.go deleted file mode 100644 index 72b9be9e..00000000 --- a/secure/key/resolverFactory_test.go +++ /dev/null @@ -1,179 +0,0 @@ -package key - -import ( - "crypto/rsa" - "encoding/json" - "fmt" - "sync" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xmidt-org/webpa-common/v2/resource" -) - -func ExampleSingleKeyConfiguration() { - jsonConfiguration := fmt.Sprintf(`{ - "uri": "%s", - "purpose": "verify", - "header": { - "Accept": ["text/plain"] - } - }`, publicKeyURL) - - var factory ResolverFactory - if err := json.Unmarshal([]byte(jsonConfiguration), &factory); err != nil { - fmt.Println(err) - return - } - - resolver, err := factory.NewResolver() - if err != nil { - fmt.Println(err) - return - } - - // althrough we pass a keyId, it doesn't matter - // the keyId would normally come from a JWT or other source, but - // this configuration maps all key identifiers onto the same resource - key, err := resolver.ResolveKey(keyId) - if err != nil { - fmt.Println(err) - return - } - - publicKey, ok := key.Public().(*rsa.PublicKey) - if !ok { - fmt.Println("Expected a public key") - } - - fmt.Printf("%#v", publicKey) - - // Output: - // &rsa.PublicKey{N:27943075365309976493653163303797959212418241538912650140443307384472696765226993413692820781465849081859025776428168351053450151991381458393395627926945090025279037554792902370352660829719944448435879538779506598037701785142079839040587119599241554109043386957121126327267661933261531301157240649436180239359321477795441956911062536999488590278721548425004681839069551715529565117581358421070795577996947939534909344145027536788621293233751031126681790089555592380957432236272148722403554429033227913702251021698422165616430378445527162280875770582636410571931829939754369601100687471071175959731316949515587341982201, E:65537} -} - -func ExampleURITemplateConfiguration() { - jsonConfiguration := fmt.Sprintf(`{ - "uri": "%s", - "purpose": "verify", - "header": { - "Accept": ["text/plain"] - } - }`, publicKeyURLTemplate) - - var factory ResolverFactory - if err := json.Unmarshal([]byte(jsonConfiguration), &factory); err != nil { - fmt.Println(err) - return - } - - resolver, err := factory.NewResolver() - if err != nil { - fmt.Println(err) - return - } - - key, err := resolver.ResolveKey(keyId) - if err != nil { - fmt.Println(err) - return - } - - publicKey, ok := key.Public().(*rsa.PublicKey) - if !ok { - fmt.Println("Expected a public key") - } - - fmt.Printf("%#v", publicKey) - - // Output: - // &rsa.PublicKey{N:27943075365309976493653163303797959212418241538912650140443307384472696765226993413692820781465849081859025776428168351053450151991381458393395627926945090025279037554792902370352660829719944448435879538779506598037701785142079839040587119599241554109043386957121126327267661933261531301157240649436180239359321477795441956911062536999488590278721548425004681839069551715529565117581358421070795577996947939534909344145027536788621293233751031126681790089555592380957432236272148722403554429033227913702251021698422165616430378445527162280875770582636410571931829939754369601100687471071175959731316949515587341982201, E:65537} -} - -func TestBadURITemplates(t *testing.T) { - assert := assert.New(t) - - badURITemplates := []string{ - "", - "badscheme://foo/bar.pem", - "http://badtemplate.com/{bad", - "file:///etc/{too}/{many}/{parameters}", - "http://missing.keyId.com/{someOtherName}", - } - - for _, badURITemplate := range badURITemplates { - t.Logf("badURITemplate: %s", badURITemplate) - - factory := ResolverFactory{ - Factory: resource.Factory{ - URI: badURITemplate, - }, - } - - resolver, err := factory.NewResolver() - assert.Nil(resolver) - assert.NotNil(err) - } -} - -func TestResolverFactoryNewUpdater(t *testing.T) { - assert := assert.New(t) - - updateKeysCalled := make(chan struct{}) - runner := func(mock.Arguments) { - defer func() { - recover() // ignore panics from multiple closes - }() - - close(updateKeysCalled) - } - - keyCache := &MockCache{} - keyCache.On("UpdateKeys").Return(0, nil).Run(runner) - - resolverFactory := ResolverFactory{ - UpdateInterval: time.Duration(100 * time.Millisecond), - } - - if updater := resolverFactory.NewUpdater(keyCache); assert.NotNil(updater) { - waitGroup := &sync.WaitGroup{} - shutdown := make(chan struct{}) - updater.Run(waitGroup, shutdown) - - // we only care that the updater called UpdateKeys() at least once - <-updateKeysCalled - close(shutdown) - waitGroup.Wait() - } -} - -func TestResolverFactoryDefaultParser(t *testing.T) { - assert := assert.New(t) - - parser := &MockParser{} - resolverFactory := ResolverFactory{ - Factory: resource.Factory{ - URI: publicKeyFilePath, - }, - } - - assert.Equal(DefaultParser, resolverFactory.parser()) - mock.AssertExpectationsForObjects(t, parser) -} - -func TestResolverFactoryCustomParser(t *testing.T) { - assert := assert.New(t) - - parser := &MockParser{} - resolverFactory := ResolverFactory{ - Factory: resource.Factory{ - URI: publicKeyFilePath, - }, - Parser: parser, - } - - assert.Equal(parser, resolverFactory.parser()) - mock.AssertExpectationsForObjects(t, parser) -} diff --git a/secure/key/resolver_test.go b/secure/key/resolver_test.go deleted file mode 100644 index 0beec8dd..00000000 --- a/secure/key/resolver_test.go +++ /dev/null @@ -1,153 +0,0 @@ -package key - -import ( - "errors" - "fmt" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xmidt-org/webpa-common/v2/resource" -) - -func TestSingleResolver(t *testing.T) { - assert := assert.New(t) - - loader, err := (&resource.Factory{ - URI: publicKeyFilePath, - }).NewLoader() - - if !assert.Nil(err) { - return - } - - expectedData, err := resource.ReadAll(loader) - assert.NotEmpty(expectedData) - assert.Nil(err) - - for _, purpose := range []Purpose{PurposeVerify, PurposeDecrypt, PurposeSign, PurposeEncrypt} { - t.Logf("purpose: %s", purpose) - - expectedPair := &MockPair{} - parser := &MockParser{} - parser.On("ParseKey", purpose, expectedData).Return(expectedPair, nil).Once() - - var resolver Resolver = &singleResolver{ - basicResolver: basicResolver{ - parser: parser, - purpose: purpose, - }, - - loader: loader, - } - - assert.Contains(fmt.Sprintf("%s", resolver), publicKeyFilePath) - - pair, err := resolver.ResolveKey("does not matter") - assert.Equal(expectedPair, pair) - assert.Nil(err) - - mock.AssertExpectationsForObjects(t, expectedPair, parser) - } -} - -func TestSingleResolverBadResource(t *testing.T) { - assert := assert.New(t) - - var resolver Resolver = &singleResolver{ - basicResolver: basicResolver{ - parser: DefaultParser, - purpose: PurposeVerify, - }, - loader: &resource.File{ - Path: "does not exist", - }, - } - - key, err := resolver.ResolveKey("does not matter") - assert.Nil(key) - assert.NotNil(err) -} - -func TestMultiResolver(t *testing.T) { - assert := assert.New(t) - - expander, err := (&resource.Factory{ - URI: publicKeyFilePathTemplate, - }).NewExpander() - - if !assert.Nil(err) { - return - } - - loader, err := expander.Expand( - map[string]interface{}{KeyIdParameterName: keyId}, - ) - - expectedData, err := resource.ReadAll(loader) - assert.NotEmpty(expectedData) - assert.Nil(err) - - for _, purpose := range []Purpose{PurposeVerify, PurposeDecrypt, PurposeSign, PurposeEncrypt} { - t.Logf("purpose: %s", purpose) - - expectedPair := &MockPair{} - parser := &MockParser{} - parser.On("ParseKey", purpose, expectedData).Return(expectedPair, nil).Once() - - var resolver Resolver = &multiResolver{ - basicResolver: basicResolver{ - parser: parser, - purpose: purpose, - }, - expander: expander, - } - - assert.Contains(fmt.Sprintf("%s", resolver), publicKeyFilePathTemplate) - - pair, err := resolver.ResolveKey(keyId) - assert.Equal(expectedPair, pair) - assert.Nil(err) - - mock.AssertExpectationsForObjects(t, expectedPair, parser) - } -} - -func TestMultiResolverBadResource(t *testing.T) { - assert := assert.New(t) - - var resolver Resolver = &multiResolver{ - expander: &resource.Template{ - URITemplate: resource.MustParse("/this/does/not/exist/{key}"), - }, - } - - key, err := resolver.ResolveKey("this isn't valid") - assert.Nil(key) - assert.NotNil(err) -} - -type badExpander struct { - err error -} - -func (bad *badExpander) Names() []string { - return []string{} -} - -func (bad *badExpander) Expand(interface{}) (resource.Loader, error) { - return nil, bad.err -} - -func TestMultiResolverBadExpander(t *testing.T) { - assert := assert.New(t) - - expectedError := errors.New("The roof! The roof! The roof is on fire!") - var resolver Resolver = &multiResolver{ - expander: &badExpander{expectedError}, - } - - key, err := resolver.ResolveKey("does not matter") - assert.Nil(key) - assert.Equal(expectedError, err) -} diff --git a/secure/key/setup_test.go b/secure/key/setup_test.go deleted file mode 100644 index 43bef9bc..00000000 --- a/secure/key/setup_test.go +++ /dev/null @@ -1,55 +0,0 @@ -package key - -import ( - "fmt" - "net/http" - "net/http/httptest" - "os" - "testing" -) - -const ( - keyId = "testkey" -) - -var ( - httpServer *httptest.Server - - publicKeyFilePath string - publicKeyFilePathTemplate string - - publicKeyURL string - publicKeyURLTemplate string - - privateKeyFilePath string - privateKeyFilePathTemplate string - - privateKeyURL string - privateKeyURLTemplate string -) - -func TestMain(m *testing.M) { - currentDirectory, err := os.Getwd() - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to obtain current working directory: %v\n", err) - os.Exit(1) - } - - httpServer = httptest.NewServer(http.FileServer(http.Dir(currentDirectory))) - defer httpServer.Close() - fmt.Printf("started test server at %s\n", httpServer.URL) - - publicKeyFilePath = fmt.Sprintf("%s/%s.pub", currentDirectory, keyId) - publicKeyFilePathTemplate = fmt.Sprintf("%s/{%s}.pub", currentDirectory, KeyIdParameterName) - - publicKeyURL = fmt.Sprintf("%s/%s.pub", httpServer.URL, keyId) - publicKeyURLTemplate = fmt.Sprintf("%s/{%s}.pub", httpServer.URL, KeyIdParameterName) - - privateKeyFilePath = fmt.Sprintf("%s/%s", currentDirectory, keyId) - privateKeyFilePathTemplate = fmt.Sprintf("%s/{%s}", currentDirectory, KeyIdParameterName) - - privateKeyURL = fmt.Sprintf("%s/%s", httpServer.URL, keyId) - privateKeyURLTemplate = fmt.Sprintf("%s/{%s}", httpServer.URL, KeyIdParameterName) - - os.Exit(m.Run()) -} diff --git a/secure/key/testkey b/secure/key/testkey deleted file mode 100644 index 23a64082..00000000 --- a/secure/key/testkey +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIBOgIBAAJBALKZD0nEffqM1ACuak0bijtqE2QrI/KLADv7l3kK3ppMyCuLKoF0 -fd7Ai2KW5ToIwzFofvJcS/STa6HA5gQenRUCAwEAAQJBAIq9amn00aS0h/CrjXqu -/ThglAXJmZhOMPVn4eiu7/ROixi9sex436MaVeMqSNf7Ex9a8fRNfWss7Sqd9eWu -RTUCIQDasvGASLqmjeffBNLTXV2A5g4t+kLVCpsEIZAycV5GswIhANEPLmax0ME/ -EO+ZJ79TJKN5yiGBRsv5yvx5UiHxajEXAiAhAol5N4EUyq6I9w1rYdhPMGpLfk7A -IU2snfRJ6Nq2CQIgFrPsWRCkV+gOYcajD17rEqmuLrdIRexpg8N1DOSXoJ8CIGlS -tAboUGBxTDq3ZroNism3DaMIbKPyYrAqhKov1h5V ------END RSA PRIVATE KEY----- diff --git a/secure/key/testkey.pub b/secure/key/testkey.pub deleted file mode 100644 index 66f024c7..00000000 --- a/secure/key/testkey.pub +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3VoPN9PKUjKFLMwOge6+ -wnDi8sbETGIx2FKXGgqtAKpzmem53kRGEQg8WeqRmp12wgp74TGpkEXsGae7RS1k -enJCnma4fii+noGH7R0qKgHvPrI2Bwa9hzsH8tHxpyM3qrXslOmD45EH9SxIDUBJ -FehNdaPbLP1gFyahKMsdfxFJLUvbUycuZSJ2ZnIgeVxwm4qbSvZInL9Iu4FzuPtg -fINKcbbovy1qq4KvPIrXzhbY3PWDc6btxCf3SE0JdE1MCPThntB62/bLMSQ7xdDR -FF53oIpvxe/SCOymfWq/LW849Ytv3Xwod0+wzAP8STXG4HSELS4UedPYeHJJJYcZ -+QIDAQAB ------END PUBLIC KEY----- diff --git a/secure/metrics.go b/secure/metrics.go deleted file mode 100644 index 6a3e8a2b..00000000 --- a/secure/metrics.go +++ /dev/null @@ -1,54 +0,0 @@ -package secure - -import ( - "github.com/go-kit/kit/metrics" - gokitprometheus "github.com/go-kit/kit/metrics/prometheus" - "github.com/xmidt-org/webpa-common/v2/xmetrics" -) - -//Names for our metrics -const ( - JWTValidationReasonCounter = "jwt_validation_reason" - NBFHistogram = "jwt_from_nbf_seconds" - EXPHistogram = "jwt_from_exp_seconds" -) - -//Metrics returns the Metrics relevant to this package -func Metrics() []xmetrics.Metric { - return []xmetrics.Metric{ - xmetrics.Metric{ - Name: JWTValidationReasonCounter, - Type: xmetrics.CounterType, - Help: "Counter for validation resolutions per reason", - LabelNames: []string{"reason"}, - }, - xmetrics.Metric{ - Name: NBFHistogram, - Type: xmetrics.HistogramType, - Help: "Difference (in seconds) between time of JWT validation and nbf (including leeway)", - Buckets: []float64{-61, -11, -2, -1, 0, 9, 60}, // defines the upper inclusive (<=) bounds - }, - xmetrics.Metric{ - Name: EXPHistogram, - Type: xmetrics.HistogramType, - Help: "Difference (in seconds) between time of JWT validation and exp (including leeway)", - Buckets: []float64{-61, -11, -2, -1, 0, 9, 60}, - }, - } -} - -//JWTValidationMeasures describes the defined metrics that will be used by clients -type JWTValidationMeasures struct { - NBFHistogram *gokitprometheus.Histogram - ExpHistogram *gokitprometheus.Histogram - ValidationReason metrics.Counter -} - -//NewJWTValidationMeasures realizes desired metrics -func NewJWTValidationMeasures(r xmetrics.Registry) *JWTValidationMeasures { - return &JWTValidationMeasures{ - NBFHistogram: gokitprometheus.NewHistogram(r.NewHistogramVec(NBFHistogram)), - ExpHistogram: gokitprometheus.NewHistogram(r.NewHistogramVec(EXPHistogram)), - ValidationReason: r.NewCounter(JWTValidationReasonCounter), - } -} diff --git a/secure/metrics_test.go b/secure/metrics_test.go deleted file mode 100644 index af519827..00000000 --- a/secure/metrics_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package secure - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/xmidt-org/webpa-common/v2/xmetrics" -) - -func newTestJWTValidationMeasure() *JWTValidationMeasures { - return NewJWTValidationMeasures(xmetrics.MustNewRegistry(nil, Metrics)) -} - -func TestSimpleRun(t *testing.T) { - assert := assert.New(t) - assert.NotNil(newTestJWTValidationMeasure()) -} diff --git a/secure/mockValidator.go b/secure/mockValidator.go deleted file mode 100644 index 6150c236..00000000 --- a/secure/mockValidator.go +++ /dev/null @@ -1,16 +0,0 @@ -package secure - -import ( - "context" - "github.com/stretchr/testify/mock" -) - -// MockValidator is a stretchr mock, exposed for use by other packages -type MockValidator struct { - mock.Mock -} - -func (v *MockValidator) Validate(ctx context.Context, token *Token) (bool, error) { - arguments := v.Called(ctx, token) - return arguments.Bool(0), arguments.Error(1) -} diff --git a/secure/mocks_test.go b/secure/mocks_test.go deleted file mode 100644 index 0411dae7..00000000 --- a/secure/mocks_test.go +++ /dev/null @@ -1,106 +0,0 @@ -package secure - -import ( - "github.com/SermoDigital/jose" - "github.com/SermoDigital/jose/crypto" - "github.com/SermoDigital/jose/jws" - "github.com/SermoDigital/jose/jwt" - "github.com/stretchr/testify/mock" -) - -type mockJWSParser struct { - mock.Mock -} - -func (parser *mockJWSParser) ParseJWS(token *Token) (jws.JWS, error) { - arguments := parser.Called(token) - jwsToken, _ := arguments.Get(0).(jws.JWS) - return jwsToken, arguments.Error(1) -} - -type mockJWS struct { - mock.Mock -} - -var _ jwt.JWT = (*mockJWS)(nil) -var _ jws.JWS = (*mockJWS)(nil) - -func (j *mockJWS) Claims() jwt.Claims { - arguments := j.Called() - return arguments.Get(0).(jwt.Claims) -} - -func (j *mockJWS) Validate(key interface{}, method crypto.SigningMethod, v ...*jwt.Validator) error { - arguments := j.Called(key, method, v) - return arguments.Error(0) -} - -func (j *mockJWS) Serialize(key interface{}) ([]byte, error) { - arguments := j.Called(key) - return arguments.Get(0).([]byte), arguments.Error(1) -} - -func (j *mockJWS) Payload() interface{} { - arguments := j.Called() - return arguments.Get(0) -} - -func (j *mockJWS) SetPayload(p interface{}) { - j.Called(p) -} - -func (j *mockJWS) Protected() jose.Protected { - arguments := j.Called() - protected, _ := arguments.Get(0).(jose.Protected) - return protected -} - -func (j *mockJWS) ProtectedAt(i int) jose.Protected { - arguments := j.Called(i) - return arguments.Get(0).(jose.Protected) -} - -func (j *mockJWS) Header() jose.Header { - arguments := j.Called() - return arguments.Get(0).(jose.Header) -} - -func (j *mockJWS) HeaderAt(i int) jose.Header { - arguments := j.Called(i) - return arguments.Get(0).(jose.Header) -} - -func (j *mockJWS) Verify(key interface{}, method crypto.SigningMethod) error { - arguments := j.Called(key, method) - return arguments.Error(0) -} - -func (j *mockJWS) VerifyMulti(keys []interface{}, methods []crypto.SigningMethod, o *jws.SigningOpts) error { - arguments := j.Called(keys, methods, o) - return arguments.Error(0) -} - -func (j *mockJWS) VerifyCallback(fn jws.VerifyCallback, methods []crypto.SigningMethod, o *jws.SigningOpts) error { - arguments := j.Called(fn, methods, o) - return arguments.Error(0) -} - -func (j *mockJWS) General(keys ...interface{}) ([]byte, error) { - arguments := j.Called(keys) - return arguments.Get(0).([]byte), arguments.Error(1) -} - -func (j *mockJWS) Flat(key interface{}) ([]byte, error) { - arguments := j.Called(key) - return arguments.Get(0).([]byte), arguments.Error(1) -} - -func (j *mockJWS) Compact(key interface{}) ([]byte, error) { - arguments := j.Called(key) - return arguments.Get(0).([]byte), arguments.Error(1) -} - -func (j *mockJWS) IsJWT() bool { - arguments := j.Called() - return arguments.Bool(0) -} diff --git a/secure/setup_test.go b/secure/setup_test.go deleted file mode 100644 index f7fed722..00000000 --- a/secure/setup_test.go +++ /dev/null @@ -1,90 +0,0 @@ -package secure - -import ( - "fmt" - "os" - "testing" - - "github.com/SermoDigital/jose/crypto" - "github.com/SermoDigital/jose/jws" - "github.com/SermoDigital/jose/jwt" - "github.com/xmidt-org/webpa-common/v2/resource" - "github.com/xmidt-org/webpa-common/v2/secure/key" -) - -const ( - publicKeyFileName = "jwt-key.pub" - privateKeyFileName = "jwt-key" -) - -var ( - publicKeyFileURI string - publicKeyResolver key.Resolver - - privateKeyFileURI string - privateKeyResolver key.Resolver - - // ripped these test claims from the SATS swagger example - testClaims = jws.Claims{ - "valid": true, - "capabilities": []interface{}{"x1:webpa:api:.*:post"}, - "allowedResources": map[string]interface{}{ - "allowedDeviceIds": []interface{}{"1641529834193109183"}, - "allowedPartners": []interface{}{"comcast, cox"}, - "allowedServiceAccountIds": []interface{}{"4924346887352567847"}, - }, - } - - testJWT jwt.JWT - testSerializedJWT []byte -) - -func TestMain(m *testing.M) { - os.Exit(func() int { - currentDirectory, err := os.Getwd() - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to obtain current working directory: %s\n", err) - return 1 - } - - publicKeyFileURI = fmt.Sprintf("%s/%s", currentDirectory, publicKeyFileName) - privateKeyFileURI = fmt.Sprintf("%s/%s", currentDirectory, privateKeyFileName) - - privateKeyResolver, err = (&key.ResolverFactory{ - Factory: resource.Factory{URI: privateKeyFileURI}, - Purpose: key.PurposeSign, - }).NewResolver() - - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to create private key resolver: %s\n", err) - return 1 - } - - publicKeyResolver, err = (&key.ResolverFactory{ - Factory: resource.Factory{URI: publicKeyFileURI}, - Purpose: key.PurposeVerify, - }).NewResolver() - - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to create public key resolver: %s\n", err) - return 1 - } - - pair, err := privateKeyResolver.ResolveKey("") - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to resolve private key: %s\n", err) - return 1 - } - - // generate a unique JWT for each run of the tests - // this also exercises our secure/key infrastructure - testJWT = jws.NewJWT(testClaims, crypto.SigningMethodRS256) - testSerializedJWT, err = testJWT.Serialize(pair.Private()) - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to serialize test JWT: %s\n", err) - return 1 - } - - return m.Run() - }()) -} diff --git a/secure/token.go b/secure/token.go deleted file mode 100644 index f630f9c1..00000000 --- a/secure/token.go +++ /dev/null @@ -1,115 +0,0 @@ -package secure - -import ( - "fmt" - "net/http" - "regexp" - "strings" -) - -// TokenType is a discriminator for the contents of a secure token. -type TokenType string - -const ( - AuthorizationHeader string = "Authorization" - Invalid TokenType = "!! INVALID !!" - Basic TokenType = "Basic" - Bearer TokenType = "Bearer" - Digest TokenType = "Digest" - - Untrusted = "0" -) - -// ParseTokenType returns the TokenType corresponding to a string. -// This function is case-insensitive. -func ParseTokenType(value string) (TokenType, error) { - switch { - case strings.EqualFold(string(Basic), value): - return Basic, nil - case strings.EqualFold(string(Bearer), value): - return Bearer, nil - case strings.EqualFold(string(Digest), value): - return Digest, nil - default: - return Invalid, fmt.Errorf("Invalid token type: %s", value) - } -} - -// Token is the result of parsing an authorization string -type Token struct { - tokenType TokenType - value string - trust string -} - -// String returns an on-the-wire representation of this token, suitable -// for placing into an Authorization header. -func (t *Token) String() string { - return strings.Join( - []string{string(t.tokenType), t.value}, - " ", - ) -} - -// Type returns the type discriminator for this token. Note that -// the functions in this package will never create a Token with an Invalid type. -func (t *Token) Type() TokenType { - return t.tokenType -} - -func (t *Token) Value() string { - return t.value -} - -func (t *Token) Trust() string { - return t.trust -} - -func (t *Token) Bytes() []byte { - return []byte(t.value) -} - -// authorizationPattern is the regular expression that all Authorization -// strings must match to be supported by WebPA. -var authorizationPattern = regexp.MustCompile( - fmt.Sprintf( - `(?P(?i)%s|%s|%s)\s+(?P.*)`, - Basic, - Bearer, - Digest, - ), -) - -// ParseAuthorization parses the raw Authorization string and returns a Token. -func ParseAuthorization(value string) (*Token, error) { - matches := authorizationPattern.FindStringSubmatch(value) - if matches == nil { - return nil, fmt.Errorf("Invalid authorization: %s", value) - } - - tokenType, err := ParseTokenType(matches[1]) - if err != nil { - // There's no case where the value matches the authorizationPattern - // will result in ParseTokenType returning an error in the current codebase. - // This is just being very defensive ... - return nil, err - } - - return &Token{ - tokenType: tokenType, - value: matches[2], - trust: Untrusted, - }, nil -} - -// NewToken extracts the Authorization from the request and returns -// the Token that results from parsing that header's value. If no -// Authorization header exists, this function returns nil with no error. -func NewToken(request *http.Request) (*Token, error) { - value := request.Header.Get(AuthorizationHeader) - if len(value) == 0 { - return nil, nil - } - - return ParseAuthorization(value) -} diff --git a/secure/token_test.go b/secure/token_test.go deleted file mode 100644 index da2b8ea1..00000000 --- a/secure/token_test.go +++ /dev/null @@ -1,108 +0,0 @@ -package secure - -import ( - "net/http" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestParseTokenType(t *testing.T) { - assert := assert.New(t) - var testData = []struct { - value string - expected TokenType - }{ - {"Basic", Basic}, - {"BASIC", Basic}, - {"BasIC", Basic}, - {"Bearer", Bearer}, - {"bearer", Bearer}, - {"bEARer", Bearer}, - {"Digest", Digest}, - {"DIGEst", Digest}, - {"DigeSt", Digest}, - {"asdfasdf", Invalid}, - {"", Invalid}, - {" ", Invalid}, - } - - for _, record := range testData { - tokenType, err := ParseTokenType(record.value) - assert.Equal(record.expected, tokenType) - assert.Equal(err == nil, tokenType != Invalid) - } -} - -func TestValidTokens(t *testing.T) { - assert := assert.New(t) - var testData = []struct { - token Token - expectString string - expectType TokenType - expectValue string - }{ - { - Token{Basic, "dXNlcjpwYXNzd29yZA==", Untrusted}, - "Basic dXNlcjpwYXNzd29yZA==", - Basic, - "dXNlcjpwYXNzd29yZA==", - }, - { - Token{Bearer, "eyJraWQiOiJzYXQtc3RnLWsxLTEwMjQiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI4ZDIwYzY4Zi04NjM5LTQyNDEtYTY2Yi00OTllYmFlYTQ0ZDMiLCJpc3MiOiJzYXRzLXN0YWdpbmciLCJzdWIiOiJ4MTpzdGc6bXNvOmNpc2NvOnNlcnZpY2VncmlkOmNveDoxN2ZkNTciLCJpYXQiOjE0NTgzMDg1OTEsIm5iZiI6MTQ1ODMwODU5MSwiZXhwIjoxNDU4Mzk0OTk0LCJ2ZXJzaW9uIjoiMS4wIiwiYWxsb3dlZFJlc291cmNlcyI6eyJhbGxvd2VkUGFydG5lcnMiOlsiY294Il19LCJjYXBhYmlsaXRpZXMiOltdLCJhdWQiOltdfQ.ieHnWWjO-CbvUJ_x9RJaMpOdAKqad0b8Rdd322dlxulqJud_O3fbSYqcSX3Sl1X8KySqgr7sHvBJAET43c_Agumj8d8vK3eCaCV-8d2W3SkBB4ePB4b1D6qpg02kqF5eXst1CdMUixYa0fw1PBvCHZe2s_M-qjW7qv5DF73wgsg", Untrusted}, - "Bearer eyJraWQiOiJzYXQtc3RnLWsxLTEwMjQiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI4ZDIwYzY4Zi04NjM5LTQyNDEtYTY2Yi00OTllYmFlYTQ0ZDMiLCJpc3MiOiJzYXRzLXN0YWdpbmciLCJzdWIiOiJ4MTpzdGc6bXNvOmNpc2NvOnNlcnZpY2VncmlkOmNveDoxN2ZkNTciLCJpYXQiOjE0NTgzMDg1OTEsIm5iZiI6MTQ1ODMwODU5MSwiZXhwIjoxNDU4Mzk0OTk0LCJ2ZXJzaW9uIjoiMS4wIiwiYWxsb3dlZFJlc291cmNlcyI6eyJhbGxvd2VkUGFydG5lcnMiOlsiY294Il19LCJjYXBhYmlsaXRpZXMiOltdLCJhdWQiOltdfQ.ieHnWWjO-CbvUJ_x9RJaMpOdAKqad0b8Rdd322dlxulqJud_O3fbSYqcSX3Sl1X8KySqgr7sHvBJAET43c_Agumj8d8vK3eCaCV-8d2W3SkBB4ePB4b1D6qpg02kqF5eXst1CdMUixYa0fw1PBvCHZe2s_M-qjW7qv5DF73wgsg", - Bearer, - "eyJraWQiOiJzYXQtc3RnLWsxLTEwMjQiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI4ZDIwYzY4Zi04NjM5LTQyNDEtYTY2Yi00OTllYmFlYTQ0ZDMiLCJpc3MiOiJzYXRzLXN0YWdpbmciLCJzdWIiOiJ4MTpzdGc6bXNvOmNpc2NvOnNlcnZpY2VncmlkOmNveDoxN2ZkNTciLCJpYXQiOjE0NTgzMDg1OTEsIm5iZiI6MTQ1ODMwODU5MSwiZXhwIjoxNDU4Mzk0OTk0LCJ2ZXJzaW9uIjoiMS4wIiwiYWxsb3dlZFJlc291cmNlcyI6eyJhbGxvd2VkUGFydG5lcnMiOlsiY294Il19LCJjYXBhYmlsaXRpZXMiOltdLCJhdWQiOltdfQ.ieHnWWjO-CbvUJ_x9RJaMpOdAKqad0b8Rdd322dlxulqJud_O3fbSYqcSX3Sl1X8KySqgr7sHvBJAET43c_Agumj8d8vK3eCaCV-8d2W3SkBB4ePB4b1D6qpg02kqF5eXst1CdMUixYa0fw1PBvCHZe2s_M-qjW7qv5DF73wgsg", - }, - } - - for _, record := range testData { - assert.Equal(record.token.String(), record.expectString) - assert.Equal(record.token.Type(), record.expectType) - assert.Equal(record.token.Value(), record.expectValue) - assert.Equal(record.token.Bytes(), []byte(record.expectValue)) - - if parsedToken, err := ParseAuthorization(record.expectString); assert.Nil(err) { - assert.Equal(record.token, *parsedToken) - } - - if request, err := http.NewRequest("GET", "", nil); assert.Nil(err) { - request.Header.Add(AuthorizationHeader, record.expectString) - if fromRequest, err := NewToken(request); assert.Nil(err) { - assert.Equal(record.token, *fromRequest) - } - } - } -} - -func TestInvalidTokens(t *testing.T) { - assert := assert.New(t) - var invalidTokens = []string{ - "SomePRefix dXNlcjpwYXNzd29yZA==", - "dXNlcjpwYXNzd29yZA==", - "eyJraWQiOiJzYXQtc3RnLWsxLTEwMjQiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI4ZDIwYzY4Zi04NjM5LTQyNDEtYTY2Yi00OTllYmFlYTQ0ZDMiLCJpc3MiOiJzYXRzLXN0YWdpbmciLCJzdWIiOiJ4MTpzdGc6bXNvOmNpc2NvOnNlcnZpY2VncmlkOmNveDoxN2ZkNTciLCJpYXQiOjE0NTgzMDg1OTEsIm5iZiI6MTQ1ODMwODU5MSwiZXhwIjoxNDU4Mzk0OTk0LCJ2ZXJzaW9uIjoiMS4wIiwiYWxsb3dlZFJlc291cmNlcyI6eyJhbGxvd2VkUGFydG5lcnMiOlsiY294Il19LCJjYXBhYmlsaXRpZXMiOltdLCJhdWQiOltdfQ.ieHnWWjO-CbvUJ_x9RJaMpOdAKqad0b8Rdd322dlxulqJud_O3fbSYqcSX3Sl1X8KySqgr7sHvBJAET43c_Agumj8d8vK3eCaCV-8d2W3SkBB4ePB4b1D6qpg02kqF5eXst1CdMUixYa0fw1PBvCHZe2s_M-qjW7qv5DF73wgsg", - } - - for _, invalidToken := range invalidTokens { - t.Logf("Testing invalid token: %s", invalidToken) - parsedToken, err := ParseAuthorization(invalidToken) - assert.Nil(parsedToken) - assert.NotNil(err) - - if request, err := http.NewRequest("GET", "", nil); assert.Nil(err) { - request.Header.Add(AuthorizationHeader, invalidToken) - fromRequest, err := NewToken(request) - assert.Nil(fromRequest) - assert.NotNil(err) - } - } -} - -func TestNoAuthorization(t *testing.T) { - assert := assert.New(t) - if request, err := http.NewRequest("GET", "", nil); assert.Nil(err) { - fromRequest, err := NewToken(request) - assert.Nil(fromRequest) - assert.Nil(err) - } -} diff --git a/secure/tools/cmd/jwt/main.go b/secure/tools/cmd/jwt/main.go deleted file mode 100644 index 1a77aa7a..00000000 --- a/secure/tools/cmd/jwt/main.go +++ /dev/null @@ -1,81 +0,0 @@ -package main - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "errors" - "flag" - "fmt" - "io/ioutil" - "os" -) - -var ( - ErrorMalformedToken = errors.New("That token is not valid") -) - -type Arguments struct { - Token string - KeyURI string -} - -func decodeAndUnmarshal(encoding *base64.Encoding, encoded []byte) (map[string]interface{}, error) { - decoder := base64.NewDecoder(encoding, bytes.NewReader(encoded)) - decoded, err := ioutil.ReadAll(decoder) - if err != nil { - return nil, err - } - - unmarshalled := make(map[string]interface{}) - err = json.Unmarshal(decoded, &unmarshalled) - return unmarshalled, err -} - -func displayToken(token []byte) error { - parts := bytes.Split(token, []byte{'.'}) - if len(parts) < 2 { - return ErrorMalformedToken - } - - header, err := decodeAndUnmarshal(base64.StdEncoding, parts[0]) - if err != nil { - return err - } - - fmt.Println(header) - - payload, err := decodeAndUnmarshal(base64.StdEncoding, parts[1]) - if err != nil { - return err - } - - fmt.Println(payload) - return nil -} - -func main() { - var arguments Arguments - flag.StringVar(&arguments.Token, "t", "", "The JWT token. If not supplied, a token is expected from stdin.") - flag.StringVar(&arguments.KeyURI, "k", "", "the URI of a public key for verification (optional)") - flag.Parse() - - var ( - token []byte - err error - ) - - if len(arguments.Token) == 0 { - token, err = ioutil.ReadAll(os.Stdin) - if err != nil { - fmt.Fprintf(os.Stdout, "Unable to read token from stdin: %s\n", err) - return - } - } else { - token = []byte(arguments.Token) - } - - if err = displayToken(token); err != nil { - fmt.Fprintf(os.Stdout, "%s\n", err) - } -} diff --git a/secure/tools/cmd/keyserver/basicHandler.go b/secure/tools/cmd/keyserver/basicHandler.go deleted file mode 100644 index 3d334f0f..00000000 --- a/secure/tools/cmd/keyserver/basicHandler.go +++ /dev/null @@ -1,17 +0,0 @@ -package main - -import ( - "log" - "net/http" -) - -// BasicHandler provides the common behaviors needed by all keyserver handlers -type BasicHandler struct { - keyStore *KeyStore - logger *log.Logger -} - -func (handler *BasicHandler) httpError(response http.ResponseWriter, statusCode int, message string) { - handler.logger.Println(message) - response.WriteHeader(statusCode) -} diff --git a/secure/tools/cmd/keyserver/configuration.go b/secure/tools/cmd/keyserver/configuration.go deleted file mode 100644 index 70b87aad..00000000 --- a/secure/tools/cmd/keyserver/configuration.go +++ /dev/null @@ -1,95 +0,0 @@ -package main - -import ( - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "strings" - - "github.com/xmidt-org/webpa-common/v2/resource" -) - -const ( - DefaultIssuer = "test" - DefaultBits = 4096 - DefaultBindAddress = ":8080" -) - -var ( - ErrorNoKeys = errors.New("No keys found in configuration") - ErrorBlankKeyId = errors.New("Blank key identifiers are not allowed") - ErrorInvalidKeyId = errors.New("Key identifiers cannot have leading or trailing whitespace") - ErrorNoConfiguration = errors.New("A configuration file is required") -) - -// Configuration provides the basic, JSON-marshallable configuration for -// the keyserver. -type Configuration struct { - // Issuer is the string used for the iss field for any JWTs issued - // by this server. If not supplied, DefaultIssuer is used. - Issuer string `json:"issuer"` - - // BindAddress is the local address on which the server listens - BindAddress string `json:"bindAddress"` - - // Keys stores information about all the keys known to this server. - Keys map[string]*resource.Factory `json:"keys"` - - // Bits is the bit length of any keys generated by the server. - // If this value is non-positive, DefaultBits is used - Bits int `json:"bits"` - - // Generate is a list of key identifiers which will be generated - // each time this server starts. - Generate []string `json:"generate"` -} - -func (c *Configuration) Validate() error { - if len(c.Keys) == 0 && len(c.Generate) == 0 { - return ErrorNoKeys - } - - for keyID := range c.Keys { - trimmedKeyId := strings.TrimSpace(keyID) - if len(trimmedKeyId) == 0 { - return ErrorBlankKeyId - } else if trimmedKeyId != keyID { - return ErrorInvalidKeyId - } - } - - for _, keyID := range c.Generate { - trimmedKeyId := strings.TrimSpace(keyID) - if len(trimmedKeyId) == 0 { - return ErrorBlankKeyId - } else if trimmedKeyId != keyID { - return ErrorInvalidKeyId - } - - if _, ok := c.Keys[keyID]; ok { - return fmt.Errorf("Key %s is ambiguous: it occurs in keys and generate", keyID) - } - } - - return nil -} - -func ParseConfiguration(configurationFileName string) (*Configuration, error) { - if len(configurationFileName) == 0 { - return nil, ErrorNoConfiguration - } - - contents, err := ioutil.ReadFile(configurationFileName) - if err != nil { - return nil, err - } - - var configuration Configuration - err = json.Unmarshal(contents, &configuration) - if err != nil { - return nil, err - } - - return &configuration, nil -} diff --git a/secure/tools/cmd/keyserver/issueHandler.go b/secure/tools/cmd/keyserver/issueHandler.go deleted file mode 100644 index bc64ccb7..00000000 --- a/secure/tools/cmd/keyserver/issueHandler.go +++ /dev/null @@ -1,315 +0,0 @@ -package main - -import ( - "crypto/rand" - "encoding/json" - "errors" - "fmt" - "github.com/SermoDigital/jose/crypto" - "github.com/SermoDigital/jose/jws" - "github.com/SermoDigital/jose/jwt" - "github.com/gorilla/schema" - "io/ioutil" - "net/http" - "strconv" - "time" -) - -const ( - KeyIDVariableName = "kid" - DefaultExpireDuration = time.Duration(24 * time.Hour) - DefaultNotBeforeDuration = time.Duration(1 * time.Hour) -) - -var ( - ErrorMissingKeyID = errors.New("A kid parameter is required") - - zeroTime = time.Time{} - defaultSigningMethod crypto.SigningMethod = crypto.SigningMethodRS256 - - supportedSigningMethods = map[string]crypto.SigningMethod{ - defaultSigningMethod.Alg(): defaultSigningMethod, - crypto.SigningMethodRS384.Alg(): crypto.SigningMethodRS384, - crypto.SigningMethodRS512.Alg(): crypto.SigningMethodRS512, - } - - supportedNumericDateLayouts = []string{ - time.RFC3339, - time.RFC822, - time.RFC822Z, - } - - // zeroNumericDate is a singleton value indicating a blank value - zeroNumericDate = NumericDate{} -) - -// NumericDate represents a JWT NumericDate as specified in: -// https://tools.ietf.org/html/rfc7519#section-2 -// -// A number of formats for numeric dates are allowed, and each -// is converted appropriately: -// -// (1) An int64 value, which is interpreted as the exact value to use -// (2) A valid time.Duration, which is added to time.Now() to compute the value -// (3) An absolute date specified in RFC33399 or RFC822 formates. See the time package for details. -type NumericDate struct { - duration time.Duration - absolute time.Time -} - -func (nd *NumericDate) UnmarshalText(raw []byte) error { - if len(raw) == 0 { - *nd = zeroNumericDate - return nil - } - - text := string(raw) - - if value, err := strconv.ParseInt(text, 10, 64); err == nil { - *nd = NumericDate{duration: 0, absolute: time.Unix(value, 0)} - return nil - } - - if duration, err := time.ParseDuration(text); err == nil { - *nd = NumericDate{duration: duration, absolute: zeroTime} - return nil - } - - for _, layout := range supportedNumericDateLayouts { - if value, err := time.Parse(layout, text); err == nil { - *nd = NumericDate{duration: 0, absolute: value} - return nil - } - } - - return fmt.Errorf("Unparseable datetime: %s", text) -} - -// IsZero tests whether this NumericDate is blank, as would be the case when -// the original request assigns a value to the empty string. This is useful to -// have the server generate a default value appropriate for the field. -func (nd *NumericDate) IsZero() bool { - return nd.duration == 0 && nd.absolute.IsZero() -} - -// Compute calculates the time.Time value given a point in time -// assumed to be "now". Use of this level of indirection allows a -// single time value to be used in all calculations when issuing JWTs. -func (nd *NumericDate) Compute(now time.Time) time.Time { - if nd.duration != 0 { - return now.Add(nd.duration) - } - - return nd.absolute -} - -// SigningMethod is a custom type which holds the alg value. -type SigningMethod struct { - crypto.SigningMethod -} - -func (s *SigningMethod) UnmarshalText(raw []byte) error { - if len(raw) == 0 { - *s = SigningMethod{defaultSigningMethod} - return nil - } - - text := string(raw) - value, ok := supportedSigningMethods[text] - if ok { - *s = SigningMethod{value} - return nil - } - - return fmt.Errorf("Unsupported algorithm: %s", text) -} - -// IssueRequest contains the information necessary for issuing a JWS. -// Any custom claims must be transmitted separately. -type IssueRequest struct { - Now time.Time `schema:"-"` - - KeyID string `schema:"kid"` - Algorithm *SigningMethod `schema:"alg"` - - Expires *NumericDate `schema:"exp"` - NotBefore *NumericDate `schema:"nbf"` - - JWTID *string `schema:"jti"` - Subject string `schema:"sub"` - Audience *[]string `schema:"aud"` -} - -func (ir *IssueRequest) SigningMethod() crypto.SigningMethod { - if ir.Algorithm != nil { - return ir.Algorithm.SigningMethod - } - - return defaultSigningMethod -} - -// AddToHeader adds the appropriate header information from this issue request -func (ir *IssueRequest) AddToHeader(header map[string]interface{}) error { - // right now, we just add the kid - header[KeyIDVariableName] = ir.KeyID - return nil -} - -// AddToClaims takes the various parts of this issue request and formats them -// appropriately into a supplied jwt.Claims object. -func (ir *IssueRequest) AddToClaims(claims jwt.Claims) error { - claims.SetIssuedAt(ir.Now) - - if ir.Expires != nil { - if ir.Expires.IsZero() { - claims.SetExpiration(ir.Now.Add(DefaultExpireDuration)) - } else { - claims.SetExpiration(ir.Expires.Compute(ir.Now)) - } - } - - if ir.NotBefore != nil { - if ir.NotBefore.IsZero() { - claims.SetNotBefore(ir.Now.Add(DefaultNotBeforeDuration)) - } else { - claims.SetNotBefore(ir.NotBefore.Compute(ir.Now)) - } - } - - if ir.JWTID != nil { - jti := *ir.JWTID - if len(jti) == 0 { - // generate a type 4 UUID - buffer := make([]byte, 16) - if _, err := rand.Read(buffer); err != nil { - return err - } - - buffer[6] = (buffer[6] | 0x40) & 0x4F - buffer[8] = (buffer[8] | 0x80) & 0x8F - - // dashes are just noise! - jti = fmt.Sprintf("%X", buffer) - } - - claims.SetJWTID(jti) - } - - if len(ir.Subject) > 0 { - claims.SetSubject(ir.Subject) - } - - if ir.Audience != nil { - claims.SetAudience((*ir.Audience)...) - } - - return nil -} - -func NewIssueRequest(decoder *schema.Decoder, source map[string][]string) (*IssueRequest, error) { - issueRequest := &IssueRequest{} - if err := decoder.Decode(issueRequest, source); err != nil { - return nil, err - } - - if len(issueRequest.KeyID) == 0 { - return nil, ErrorMissingKeyID - } - - issueRequest.Now = time.Now() - return issueRequest, nil -} - -// IssueHandler issues JWS tokens -type IssueHandler struct { - BasicHandler - issuer string - decoder *schema.Decoder -} - -// issue handles all the common logic for issuing a JWS token -func (handler *IssueHandler) issue(response http.ResponseWriter, issueRequest *IssueRequest, claims jwt.Claims) { - issueKey, ok := handler.keyStore.PrivateKey(issueRequest.KeyID) - if !ok { - handler.httpError(response, http.StatusBadRequest, fmt.Sprintf("No such key: %s", issueRequest.KeyID)) - return - } - - if claims == nil { - claims = make(jwt.Claims) - } - - issuedJWT := jws.NewJWT(jws.Claims(claims), issueRequest.SigningMethod()) - if err := issueRequest.AddToClaims(issuedJWT.Claims()); err != nil { - handler.httpError(response, http.StatusInternalServerError, err.Error()) - return - } - - issuedJWT.Claims().SetIssuer(handler.issuer) - issuedJWS := issuedJWT.(jws.JWS) - if err := issueRequest.AddToHeader(issuedJWS.Protected()); err != nil { - handler.httpError(response, http.StatusInternalServerError, err.Error()) - return - } - - compact, err := issuedJWS.Compact(issueKey) - if err != nil { - handler.httpError(response, http.StatusInternalServerError, err.Error()) - return - } - - response.Header().Set("Content-Type", "application/jwt") - response.Write(compact) -} - -// SimpleIssue handles requests with no body, appropriate for simple use cases. -func (handler *IssueHandler) SimpleIssue(response http.ResponseWriter, request *http.Request) { - if err := request.ParseForm(); err != nil { - handler.httpError(response, http.StatusBadRequest, err.Error()) - return - } - - issueRequest, err := NewIssueRequest(handler.decoder, request.Form) - if err != nil { - handler.httpError(response, http.StatusBadRequest, err.Error()) - return - } - - handler.issue(response, issueRequest, nil) -} - -// IssueUsingBody accepts a JSON claims document, to which it then adds all the standard -// claims mentioned in request parameters, e.g. exp. It then uses the merged claims -// in an issued JWS. -func (handler *IssueHandler) IssueUsingBody(response http.ResponseWriter, request *http.Request) { - if err := request.ParseForm(); err != nil { - handler.httpError(response, http.StatusBadRequest, err.Error()) - return - } - - issueRequest, err := NewIssueRequest(handler.decoder, request.Form) - if err != nil { - handler.httpError(response, http.StatusBadRequest, err.Error()) - return - } - - // this variant reads the claims directly from the request body - claims := make(jwt.Claims) - if request.Body != nil { - body, err := ioutil.ReadAll(request.Body) - if err != nil { - handler.httpError(response, http.StatusBadRequest, fmt.Sprintf("Unable to read request body: %s", err)) - return - } - - if len(body) > 0 { - // we don't want to uses the Claims unmarshalling logic, as that assumes base64 - if err := json.Unmarshal(body, (*map[string]interface{})(&claims)); err != nil { - handler.httpError(response, http.StatusBadRequest, fmt.Sprintf("Unable to parse JSON in request body: %s", err)) - return - } - } - } - - handler.issue(response, issueRequest, claims) -} diff --git a/secure/tools/cmd/keyserver/keyHandler.go b/secure/tools/cmd/keyserver/keyHandler.go deleted file mode 100644 index 1e9c9cbe..00000000 --- a/secure/tools/cmd/keyserver/keyHandler.go +++ /dev/null @@ -1,48 +0,0 @@ -package main - -import ( - "fmt" - "net/http" - "strings" - - "github.com/gorilla/mux" -) - -// KeyHandler handles key-related requests -type KeyHandler struct { - BasicHandler -} - -func (handler *KeyHandler) GetKey(response http.ResponseWriter, request *http.Request) { - variables := mux.Vars(request) - keyID := variables[KeyIDVariableName] - if len(keyID) == 0 { - handler.httpError(response, http.StatusBadRequest, "No key identifier supplied") - return - } - - key, ok := handler.keyStore.PublicKey(keyID) - if ok { - // Should we use application/x-pem-file instead? - response.Header().Set("Content-Type", "text/plain;charset=UTF-8") - response.Write(key) - } else { - message := fmt.Sprintf("No such key: %s", keyID) - handler.logger.Println(message) - - response.Header().Set("Content-Type", "application/json;charset=UTF-8") - response.WriteHeader(http.StatusNotFound) - - response.Write( - []byte(fmt.Sprintf(`{"message": "%s"}`, message)), - ) - } -} - -func (handler *KeyHandler) ListKeys(response http.ResponseWriter, request *http.Request) { - keyIDs := handler.keyStore.KeyIDs() - response.Header().Set("Content-Type", "application/json;charset=UTF-8") - response.Write( - []byte(fmt.Sprintf(`{"keyIds": [%s]}`, strings.Join(keyIDs, ","))), - ) -} diff --git a/secure/tools/cmd/keyserver/keyStore.go b/secure/tools/cmd/keyserver/keyStore.go deleted file mode 100644 index deb6ab82..00000000 --- a/secure/tools/cmd/keyserver/keyStore.go +++ /dev/null @@ -1,142 +0,0 @@ -package main - -import ( - "bytes" - "crypto/rand" - "crypto/rsa" - "crypto/x509" - "encoding/pem" - "fmt" - "log" - - "github.com/xmidt-org/webpa-common/v2/secure/key" -) - -// KeyStore provides a single access point for a set of keys, keyed by their key identifiers -// or kid values in JWTs. -type KeyStore struct { - keyIDs []string - privateKeys map[string]*rsa.PrivateKey - publicKeys map[string][]byte -} - -func (ks *KeyStore) Len() int { - return len(ks.keyIDs) -} - -func (ks *KeyStore) KeyIDs() []string { - return ks.keyIDs -} - -func (ks *KeyStore) PrivateKey(keyID string) (privateKey *rsa.PrivateKey, ok bool) { - privateKey, ok = ks.privateKeys[keyID] - return -} - -func (ks *KeyStore) PublicKey(keyID string) (data []byte, ok bool) { - data, ok = ks.publicKeys[keyID] - return -} - -// NewKeyStore exchanges a Configuration for a KeyStore. -func NewKeyStore(logger *log.Logger, c *Configuration) (*KeyStore, error) { - if err := c.Validate(); err != nil { - return nil, err - } - - privateKeys := make(map[string]*rsa.PrivateKey, len(c.Keys)+len(c.Generate)) - if err := resolveKeys(logger, c, privateKeys); err != nil { - return nil, err - } - - if err := generateKeys(logger, c, privateKeys); err != nil { - return nil, err - } - - publicKeys := make(map[string][]byte, len(privateKeys)) - if err := marshalPublicKeys(publicKeys, privateKeys); err != nil { - return nil, err - } - - keyIDs := make([]string, 0, len(privateKeys)) - for keyID := range privateKeys { - keyIDs = append(keyIDs, keyID) - } - - return &KeyStore{ - keyIDs: keyIDs, - privateKeys: privateKeys, - publicKeys: publicKeys, - }, nil -} - -func resolveKeys(logger *log.Logger, c *Configuration, privateKeys map[string]*rsa.PrivateKey) error { - for keyID, resourceFactory := range c.Keys { - logger.Printf("Key [%s]: loading from resource %#v\n", keyID, resourceFactory) - - keyResolver, err := (&key.ResolverFactory{ - Factory: *resourceFactory, - Purpose: key.PurposeSign, - }).NewResolver() - - if err != nil { - return err - } - - resolvedPair, err := keyResolver.ResolveKey(keyID) - if err != nil { - return err - } - - if resolvedPair.HasPrivate() { - privateKeys[keyID] = resolvedPair.Private().(*rsa.PrivateKey) - } else { - return fmt.Errorf("The key %s did not resolve to an RSA private key", keyID) - } - } - - return nil -} - -func generateKeys(logger *log.Logger, c *Configuration, privateKeys map[string]*rsa.PrivateKey) error { - bits := c.Bits - if bits < 1 { - bits = DefaultBits - } - - for _, keyID := range c.Generate { - logger.Printf("Key [%s]: generating ...", keyID) - - if generatedKey, err := rsa.GenerateKey(rand.Reader, bits); err == nil { - privateKeys[keyID] = generatedKey - } else { - return err - } - } - - return nil -} - -func marshalPublicKeys(publicKeys map[string][]byte, privateKeys map[string]*rsa.PrivateKey) error { - for keyID, privateKey := range privateKeys { - derBytes, err := x509.MarshalPKIXPublicKey(privateKey.Public()) - if err != nil { - return err - } - - block := pem.Block{ - Type: "PUBLIC KEY", - Bytes: derBytes, - } - - var buffer bytes.Buffer - err = pem.Encode(&buffer, &block) - if err != nil { - return err - } - - publicKeys[keyID] = buffer.Bytes() - } - - return nil -} diff --git a/secure/tools/cmd/keyserver/main.go b/secure/tools/cmd/keyserver/main.go deleted file mode 100644 index 2dc22887..00000000 --- a/secure/tools/cmd/keyserver/main.go +++ /dev/null @@ -1,104 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "log" - "net/http" - "os" - - "github.com/gorilla/mux" - "github.com/gorilla/schema" -) - -type RouteBuilder struct { - Issuer string - Logger *log.Logger - KeyStore *KeyStore -} - -func (rb RouteBuilder) Build(router *mux.Router) { - keyHandler := KeyHandler{ - BasicHandler{ - keyStore: rb.KeyStore, - logger: rb.Logger, - }, - } - - keysRouter := router.Methods("GET").Subrouter() - - keysRouter.HandleFunc("/keys", keyHandler.ListKeys) - rb.Logger.Println("GET /keys returns a list of the identifiers of available keys") - - keysRouter.HandleFunc(fmt.Sprintf("/keys/{%s}", KeyIDVariableName), keyHandler.GetKey) - rb.Logger.Println("GET /keys/{kid} returns the public key associated with the given key identifier. There is no way to look up the associated private key.") - - issueHandler := IssueHandler{ - BasicHandler: BasicHandler{ - keyStore: rb.KeyStore, - logger: rb.Logger, - }, - decoder: schema.NewDecoder(), - issuer: rb.Issuer, - } - - issueRouter := router. - Path("/jws"). - Queries(KeyIDVariableName, ""). - Subrouter() - - issueRouter.Methods("GET"). - HandlerFunc(issueHandler.SimpleIssue) - rb.Logger.Println("GET /jws?kid={kid} generates a JWT signed with the associated private key. Additional URL parameters are interpreted as reserved claims, e.g. exp") - - issueRouter.Methods("PUT", "POST"). - Headers("Content-Type", "application/json"). - HandlerFunc(issueHandler.IssueUsingBody) - rb.Logger.Println("PUT/POST /jws generates a JWT signed with the associated private key. Additional URL parmaeters are interpreted as reserved claims, e.g. exp") -} - -func main() { - logger := log.New(os.Stdout, "[INFO] ", log.LstdFlags|log.LUTC) - - var configurationFileName string - flag.StringVar(&configurationFileName, "f", "", "the required configuration file") - flag.Parse() - - configuration, err := ParseConfiguration(configurationFileName) - if err != nil { - logger.Fatalf("Unable to parse configuration file: %s\n", err) - } - - keyStore, err := NewKeyStore(logger, configuration) - if err != nil { - logger.Fatalf("Unable to initialize key store: %s\n", err) - } - - logger.Printf("Initialized key store with %d keys: %s\n", keyStore.Len(), keyStore.KeyIDs()) - - issuer := configuration.Issuer - if len(issuer) == 0 { - issuer = DefaultIssuer - } - - router := mux.NewRouter() - RouteBuilder{ - Issuer: issuer, - Logger: logger, - KeyStore: keyStore, - }.Build(router) - - bindAddress := configuration.BindAddress - if len(bindAddress) == 0 { - bindAddress = DefaultBindAddress - } - - server := &http.Server{ - Addr: bindAddress, - Handler: router, - ErrorLog: logger, - } - - logger.Printf("Listening on %s\n", bindAddress) - log.Fatalln(server.ListenAndServe()) -} diff --git a/secure/tools/cmd/keyserver/sample.json b/secure/tools/cmd/keyserver/sample.json deleted file mode 100644 index 69264caf..00000000 --- a/secure/tools/cmd/keyserver/sample.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "keys": { - "sample": { - "uri": "./sample.key" - } - }, - "generate": [ - "generated" - ] -} - diff --git a/secure/tools/cmd/keyserver/sample.key b/secure/tools/cmd/keyserver/sample.key deleted file mode 100644 index 57282977..00000000 --- a/secure/tools/cmd/keyserver/sample.key +++ /dev/null @@ -1,51 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIJKQIBAAKCAgEApbBJtlFGo9k24tJDET04+4tnUWt/Nm/3XRYdGvBGGLDI6N2K -/Si7P6Z9ZUmip3jvpxjhsm25yqYny/zCeVPK72YzCifZ33kiynkXJdGJ5rFSZQa0 -lSWLWMRG4zSgD1lk9uK8KbEUhd5V9b+cHIgln+aoON1lafGhTN/6qe2IkH2FAn3P -nT5KujLW6QWEP1LOoEGyX4kgPoP83Uz5EEdhB4/ptHcwNLiZGKynmTzeScZKBm4M -mRyeXPBISBboKrBX7laIutmx2QoxkdeByd/h5x50wU6N+n/w1OtE5ZX4eXxmE+RK -Ub+cPhbZfd6fP+RimlaH13aJus07zNnNdobqkEL92vVNnCbKZja4gkW2ukVMV8N1 -fIuhHfa+9eVQPFf6naRmDEP8i+WQvHx1Y/rXnIuynLfRx/ZHf48jgS1ZxstwYQNE -/U8HswdIMO8nOHDyiPBmc3Fx3f9fyzUT3tkOVMVUCkHFUrj3QkCAtucqe41Cc6bI -RzRdSBRXjMP28nbPxAQRiSjqCPKAhRK2y4mYBmcYoVtL9MTksFAHIe2I0vWPpvZ5 -Cbyj7DKL5sShUUWoQsLnV3gtYp619Mjw8yPTCtXYo4Q0zh4YKV+5l16Iq4+BcuYt -/5dRAKyBbIH9uuBk1OIVoifEPR9ZGq4dnc0epS42jCS9ZXpIW3KaV641IgECAwEA -AQKCAgEAkARkfgG1ehQDXjLPMvvZPORWIPJkN+goxhPDpre05h878xUmi5hM8i2A -D3tq01EOVlsNSu+PL7MvImMIkzcfTOmzcZ9kBJghgoawdSHmUMxOxxuF+aIRtk2d -JD6I5e6ZEPPSBBc0tIumgh5TzoUU1yFBlXPzg5wQzWZeVjfunVFNPPYocRBFGgW4 -wgEWi4gprCiOp/XkPhKxx5XxY5H3qAASbteu4hSWllj0sQC0YsHldCNR9gBnMnd1 -DJxEn156f+Ndo7Q3n2T54z/EQ7nDfQX/DEuAo31z007QqxKpUMetXprvcpEveNSZ -pYvNNlcI0ghmuQUDAIkF8rBapCzvUqGoEFvFCquVg/RtRUKqNQtUwZVQBeUg2M3X -5DlJCA1hsJmsaadiGLaF6AM84wgzElkTdUZVdUojk5l/zp0/E9zsyI6NSuc1gFEo -/2W8iiS6r8f4ucfEnPgc+OfZ9iwyDHfLjxJfvsSxUZqurCGaCF3tCgFEG9CODR/N -rKYKFWLvaxR+tBnsCMgNnW3CW01Bp08khma//oTCUwZSDpQ+kTp/EDjTtJqXljv0 -gQLwz6M9VW/sHGotKw0cUfrzc9pKBMtl23eH/jin48Mn4KVMoXQmD8DTTziGWezw -vT0Ys1CWY91YfTOZnUf0TkFpSpfnXNzYPS/XMVwwouKanY6KAsECggEBANCacSmh -8qMAf+B9XcQRHya1Ck2EjJB/4u5UN1eOjBLBP0b7X4gF7ycq8+P8XHgdWOMSNVxi -FklyzB7Xi7eKNrFjT7UlhGeBEewxBYXyP+3FU/XI4h6kzrAW/H/7w+W1AIAQvYJh -ZuRgu17+2PD4Qv45/dfSu1B7WL50Ck9YYNQVQ79FbgYgPsM8DEqi1pZRkfX5VDwF -WJDcpJYpLfQT95Zunorjrcnp61m3VWVGe8tmGu3pxnZrpz29aRKNF6sR4uoJoaKp -GoizAStuW+BL/03Kl6N/gfslyG2s4p5JdP2c9oiJMsedoJEnxHQEmEfUQe0gPT6q -ayZu2COyIkMxTikCggEBAMtVrx7e1U5PM9X+e/I8toxicLBTBtmmmC+GZ5AVVWi7 -dMZYxOv6bDlPUyBpbxnmfwO+OELYrgX4Prvkiuzs4ZUNljRQjJA3Au/chmgLEueG -CrN5MKDrET0lnW1YACy5AffnPI+B+MxQbabRrlwzMRgqTgIgkAIXfJh9kghyIooq -TpDM8ryTjZ1Bi0bxtl5nMOXuRPgGB8W+xI+UBdvxnMUjAcvuLAJrMWpjJO45Vm2F -yFaN3xDuKt+VM4VvY8etslRfLfhFDXlQ80Bcok5GoxzHxtu4NgDqvhDqqo1xP3Cw -Tx03F37Jg77+qoo39UmaBIm8imhic/78NxSDsgbQgBkCggEANfySZuTrx7W8Ypvv -ZWvM9RaLiQ5R1p/SWj3faMCSjdQHjVZHHgvzHd7m6c0JHWjy9SlkN/mGrRGRtDWy -ihiyGOyL12TTRHpJ6iextz2/v8h+9zA7HRUoDLiWNoUw6MUUURCECzcsCtTiCS7J -dGu74tGdWXrHUYfqqrebZ3eG77xlIR5V4C3+MEbdI3/LK3IG5XLWkwYLKsp/qgEU -TIPSYtNUIrvT4VqxtzFUX3aDWVuego4q98DasobPp6ZuRq7FXC6L7232WQSCu/u+ -uWjRtQ9GeWDpgdcAbSn+KFr4dR5nS2S+iJzJzmdNV31M7+IGAdmDIDG4s2SieXKD -nYIoKQKCAQBxTbq6ogMMkvfYi+k3T3uNeKFAr9NGXx24hdWZpTmllad5iyeYM0Ax -IzG4Auhk71rhlBK3tRQrwWv7uVtssIb3Ts3fMu9QwUbCsAi5W0padwfpgGOHl9VQ -VHCH6JyYTzN4l4LYmN0xxLOFXJwjRmdaBuDXMJvufnXwZzCDwk3a3b5P09SDHlmw -QkDA9JnhuvC1f3MxHfMgzq+rLhmhuN3ZwCsVHw+o/WBY3wxKLuspNn4vNPkS7xQ2 -6GYAOdTJBNI1T6BHEvtyGZiiyburkJL9y5jVAK4fDq+Ar7MABBYMzkIXjoZqIRJn -0HLpeEsXi1pyAfzCM/JdKN/sb4I5Z9+pAoIBAQC/kS41zenlxcX57ZMWbXvmCpqO -rqJ6HOfj8AN19L1ioKtKI/ZBkIR56n+A+XqNNJwOa7FW/h9lYBVT+Dk94kpma52v -5dJ3lxN79Rwq+MDzxJT2EKwJ0jPG5/UGt9f8sir2L3E0pg4ZyHHAI4JraP7Uyi9b -YwV95mGuQmLCipA3qy7xCbBwOQ1qYC8AQ1/k/fknkZRWGOBYS6F7xkviHE+pfO+g -VA+PkAyAfKheXsRctYeKfrYJ4miYYazn+jwkUFGUbQMQc8mwoEED+PvO9orGQmhC -0PiBBoK+GaUz2BlhOdolss6xCLGNDYOc4OzApulw1b+IWY4VPMRb3ZGOv7WJ ------END RSA PRIVATE KEY----- diff --git a/secure/validator.go b/secure/validator.go deleted file mode 100644 index fb24dd0e..00000000 --- a/secure/validator.go +++ /dev/null @@ -1,287 +0,0 @@ -package secure - -import ( - "context" - "errors" - "fmt" - "regexp" - "strings" - "time" - - "github.com/SermoDigital/jose/jws" - "github.com/SermoDigital/jose/jwt" - "github.com/xmidt-org/webpa-common/v2/secure/key" -) - -var ( - ErrorNoProtectedHeader = errors.New("Missing protected header") - ErrorNoSigningMethod = errors.New("Signing method (alg) is missing or unrecognized") -) - -// Validator describes the behavior of a type which can validate tokens -type Validator interface { - // Validate asserts that the given token is valid, most often verifying - // the credentials in the token. A separate error is returned to indicate - // any problems during validation, such as the inability to access a network resource. - // In general, the contract of this method is that a Token passes validation - // if and only if it returns BOTH true and a nil error. - Validate(context.Context, *Token) (bool, error) -} - -// ValidatorFunc is a function type that implements Validator -type ValidatorFunc func(context.Context, *Token) (bool, error) - -func (v ValidatorFunc) Validate(ctx context.Context, token *Token) (bool, error) { - return v(ctx, token) -} - -// Validators is an aggregate Validator. A Validators instance considers a token -// valid if any of its validators considers it valid. An empty Validators rejects -// all tokens. -type Validators []Validator - -func (v Validators) Validate(ctx context.Context, token *Token) (valid bool, err error) { - for _, validator := range v { - if valid, err = validator.Validate(ctx, token); valid && err == nil { - return - } - } - - return -} - -// ExactMatchValidator simply matches a token's value (exluding the prefix, such as "Basic"), -// to a string. -type ExactMatchValidator string - -func (v ExactMatchValidator) Validate(ctx context.Context, token *Token) (bool, error) { - for _, value := range strings.Split(string(v), ",") { - if value == token.value { - return true, nil - } - } - - return false, nil -} - -// JWSValidator provides validation for JWT tokens encoded as JWS. -type JWSValidator struct { - DefaultKeyId string - Resolver key.Resolver - Parser JWSParser - JWTValidators []*jwt.Validator - measures *JWTValidationMeasures -} - -// capabilityValidation determines if a claim's capability is valid -func capabilityValidation(ctx context.Context, capability string) (valid_capabilities bool) { - pieces := strings.Split(capability, ":") - - if len(pieces) == 5 && - pieces[0] == "x1" && - pieces[1] == "webpa" { - - method_value, ok := ctx.Value("method").(string) - if ok && (pieces[4] == "all" || strings.EqualFold(pieces[4], method_value)) { - claimPath := fmt.Sprintf("/%s/[^/]+/%s", pieces[2], pieces[3]) - valid_capabilities, _ = regexp.MatchString(claimPath, ctx.Value("path").(string)) - } - } - - return -} - -func (v JWSValidator) Validate(ctx context.Context, token *Token) (valid bool, err error) { - if token.Type() != Bearer { - return - } - - parser := v.Parser - if parser == nil { - parser = DefaultJWSParser - } - - jwsToken, err := parser.ParseJWS(token) - if err != nil { - return - } - - protected := jwsToken.Protected() - if len(protected) == 0 { - err = ErrorNoProtectedHeader - return - } - - alg, _ := protected.Get("alg").(string) - signingMethod := jws.GetSigningMethod(alg) - if signingMethod == nil { - err = ErrorNoSigningMethod - return - } - - keyId, _ := protected.Get("kid").(string) - if len(keyId) == 0 { - keyId = v.DefaultKeyId - } - - pair, err := v.Resolver.ResolveKey(keyId) - if err != nil { - return - } - - // validate the signature - if len(v.JWTValidators) > 0 { - // all JWS implementations also implement jwt.JWT - err = jwsToken.(jwt.JWT).Validate(pair.Public(), signingMethod, v.JWTValidators...) - } else { - err = jwsToken.Verify(pair.Public(), signingMethod) - } - - if nil != err { - if v.measures != nil { - - //capture specific cases of interest, default to global (invalid_signature) reason - switch err { - case jwt.ErrTokenIsExpired: - v.measures.ValidationReason.With("reason", "expired_token").Add(1) - break - case jwt.ErrTokenNotYetValid: - v.measures.ValidationReason.With("reason", "premature_token").Add(1) - break - - default: - v.measures.ValidationReason.With("reason", "invalid_signature").Add(1) - } - } - return - } - - // validate jwt token claims capabilities - if caps, capOkay := jwsToken.Payload().(jws.Claims).Get("capabilities").([]interface{}); capOkay && len(caps) > 0 { - - /* commenting out for now - 1. remove code in use below - 2. make sure to bring a back tests for this as well. - - TestJWSValidatorCapabilities() - - for c := 0; c < len(caps); c++ { - if cap_value, ok := caps[c].(string); ok { - if valid = capabilityValidation(ctx, cap_value); valid { - return - } - } - } - */ - // ***** REMOVE THIS CODE AFTER BRING BACK THE COMMENTED CODE ABOVE ***** - // ***** vvvvvvvvvvvvvvv ***** - - // successful validation - if v.measures != nil { - v.measures.ValidationReason.With("reason", "ok").Add(1) - } - - return true, nil - // ***** ^^^^^^^^^^^^^^^ ***** - - } - - // This fail - return -} - -//DefineMeasures defines the metrics tool used by JWSValidator -func (v *JWSValidator) DefineMeasures(m *JWTValidationMeasures) { - v.measures = m -} - -// JWTValidatorFactory is a configurable factory for *jwt.Validator instances -type JWTValidatorFactory struct { - Expected jwt.Claims `json:"expected"` - ExpLeeway int `json:"expLeeway"` - NbfLeeway int `json:"nbfLeeway"` - measures *JWTValidationMeasures -} - -func (f *JWTValidatorFactory) expLeeway() time.Duration { - if f.ExpLeeway > 0 { - return time.Duration(f.ExpLeeway) * time.Second - } - - return 0 -} - -func (f *JWTValidatorFactory) nbfLeeway() time.Duration { - if f.NbfLeeway > 0 { - return time.Duration(f.NbfLeeway) * time.Second - } - - return 0 -} - -//DefineMeasures helps establish the metrics tools -func (f *JWTValidatorFactory) DefineMeasures(m *JWTValidationMeasures) { - f.measures = m -} - -// New returns a jwt.Validator using the configuration expected claims (if any) -// and a validator function that checks the exp and nbf claims. -// -// The SermoDigital library doesn't appear to do anything with the EXP and NBF -// members of jwt.Validator, but this Factory Method populates them anyway. -func (f *JWTValidatorFactory) New(custom ...jwt.ValidateFunc) *jwt.Validator { - expLeeway := f.expLeeway() - nbfLeeway := f.nbfLeeway() - - var validateFunc jwt.ValidateFunc - customCount := len(custom) - if customCount > 0 { - validateFunc = func(claims jwt.Claims) (err error) { - now := time.Now() - err = claims.Validate(now, expLeeway, nbfLeeway) - for index := 0; index < customCount && err == nil; index++ { - err = custom[index](claims) - } - - f.observeMeasures(claims, now, expLeeway, nbfLeeway, err) - - return - } - } else { - // if no custom validate functions were passed, use a simpler function - validateFunc = func(claims jwt.Claims) (err error) { - now := time.Now() - err = claims.Validate(now, expLeeway, nbfLeeway) - - f.observeMeasures(claims, now, expLeeway, nbfLeeway, err) - - return - } - } - - return &jwt.Validator{ - Expected: f.Expected, - EXP: expLeeway, - NBF: nbfLeeway, - Fn: validateFunc, - } -} - -func (f *JWTValidatorFactory) observeMeasures(claims jwt.Claims, now time.Time, expLeeway, nbfLeeway time.Duration, err error) { - if f.measures == nil { - return // measure tools are not defined, skip - } - - //how far did we land from the NBF (in seconds): ie. -1 means 1 sec before, 1 means 1 sec after - if nbf, nbfPresent := claims.NotBefore(); nbfPresent { - nbf = nbf.Add(-nbfLeeway) - offsetToNBF := now.Sub(nbf).Seconds() - f.measures.NBFHistogram.Observe(offsetToNBF) - } - - //how far did we land from the EXP (in seconds): ie. -1 means 1 sec before, 1 means 1 sec after - if exp, expPresent := claims.Expiration(); expPresent { - exp = exp.Add(expLeeway) - offsetToEXP := now.Sub(exp).Seconds() - f.measures.ExpHistogram.Observe(offsetToEXP) - } -} diff --git a/secure/validator_test.go b/secure/validator_test.go deleted file mode 100644 index 7c8499e2..00000000 --- a/secure/validator_test.go +++ /dev/null @@ -1,715 +0,0 @@ -package secure - -import ( - "context" - "errors" - "fmt" - "testing" - "time" - - "github.com/SermoDigital/jose" - "github.com/SermoDigital/jose/jws" - "github.com/SermoDigital/jose/jwt" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xmidt-org/webpa-common/v2/secure/key" -) - -func ExampleSimpleJWSValidator(t *testing.T) { - // A basic validator with useful defaults - // We need to use the publicKeyResolver, as that's what validates - // the JWS signed with the private key - - assert := assert.New(t) - - validator := JWSValidator{ - Resolver: publicKeyResolver, - } - - token := &Token{ - tokenType: Bearer, - value: string(testSerializedJWT), - } - - ctx := context.Background() - ctx = context.WithValue(ctx, "method", "post") - ctx = context.WithValue(ctx, "path", "/api/foo/path") - - valid, err := validator.Validate(ctx, token) - - assert.True(valid) - assert.Nil(err) -} - -func TestValidatorFunc(t *testing.T) { - assert := assert.New(t) - expectedError := errors.New("expected") - var validator Validator = ValidatorFunc(func(ctx context.Context, token *Token) (bool, error) { return false, expectedError }) - - valid, err := validator.Validate(nil, nil) - assert.False(valid) - assert.Equal(expectedError, err) -} - -func TestValidators(t *testing.T) { - assert := assert.New(t) - var testData = [][]bool{ - {true}, - {false}, - {true, false}, - {false, true}, - {true, false, false}, - {false, true, false}, - {false, false, true}, - } - - for _, record := range testData { - t.Logf("%v", record) - token := &Token{} - mocks := make([]interface{}, 0, len(record)) - validators := make(Validators, 0, len(record)) - - // synthesize a chain of validators: - // one mock for each entry. until "true" is found, - // validators should be called. afterward, none - // should be called. - var ( - expectedValid bool - expectedError error - ) - - for index, success := range record { - mockValidator := &MockValidator{} - mocks = append(mocks, mockValidator) - validators = append(validators, mockValidator) - - if !expectedValid { - expectedValid = success - if success { - expectedError = nil - } else { - expectedError = fmt.Errorf("expected validator error #%d", index) - } - - mockValidator.On("Validate", nil, token).Return(expectedValid, expectedError).Once() - } - } - - valid, err := validators.Validate(nil, token) - assert.Equal(expectedValid, valid) - assert.Equal(expectedError, err) - - mock.AssertExpectationsForObjects(t, mocks...) - } -} - -func TestExactMatchValidator(t *testing.T) { - assert := assert.New(t) - - token := &Token{ - tokenType: Basic, - value: "dGVzdDp0ZXN0Cg==", - } - - successValidator := ExactMatchValidator(token.value) - assert.NotNil(successValidator) - - valid, err := successValidator.Validate(nil, token) - assert.True(valid) - assert.Nil(err) - - failureValidator := ExactMatchValidator("this should not be valid") - assert.NotNil(failureValidator) - - valid, err = failureValidator.Validate(nil, token) - assert.False(valid) - assert.Nil(err) -} - -func TestJWSValidatorInvalidTokenType(t *testing.T) { - assert := assert.New(t) - - mockJWSParser := &mockJWSParser{} - mockResolver := &key.MockResolver{} - validator := &JWSValidator{ - Parser: mockJWSParser, - Resolver: mockResolver, - } - - token := &Token{ - tokenType: Basic, - value: "does not matter", - } - - valid, err := validator.Validate(nil, token) - assert.False(valid) - assert.Nil(err) - - mockJWSParser.AssertExpectations(t) - mockResolver.AssertExpectations(t) -} - -func TestJWSValidatorInvalidJWT(t *testing.T) { - assert := assert.New(t) - - mockJWSParser := &mockJWSParser{} - mockResolver := &key.MockResolver{} - validator := &JWSValidator{ - Parser: mockJWSParser, - Resolver: mockResolver, - } - - expectedError := errors.New("expected") - token := &Token{ - tokenType: Bearer, - value: "", - } - - mockJWSParser.On("ParseJWS", token).Return(nil, expectedError).Once() - valid, err := validator.Validate(nil, token) - assert.False(valid) - assert.Equal(expectedError, err) - - mockJWSParser.AssertExpectations(t) - mockResolver.AssertExpectations(t) -} - -func TestJWSValidatorNoProtectedHeader(t *testing.T) { - assert := assert.New(t) - - for _, empty := range []jose.Protected{nil, {}} { - t.Logf("empty Protected header: %v", empty) - token := &Token{tokenType: Bearer, value: "does not matter"} - mockResolver := &key.MockResolver{} - - mockJWS := &mockJWS{} - mockJWS.On("Protected").Return(empty).Once() - - mockJWSParser := &mockJWSParser{} - mockJWSParser.On("ParseJWS", token).Return(mockJWS, nil).Once() - - validator := &JWSValidator{ - Resolver: mockResolver, - Parser: mockJWSParser, - } - - valid, err := validator.Validate(nil, token) - assert.False(valid) - assert.Equal(err, ErrorNoProtectedHeader) - - mockResolver.AssertExpectations(t) - mockJWS.AssertExpectations(t) - mockJWSParser.AssertExpectations(t) - } -} - -func TestJWSValidatorNoSigningMethod(t *testing.T) { - assert := assert.New(t) - - for _, badAlg := range []interface{}{nil, "", "this is not a valid signing method"} { - t.Logf("badAlg: %v", badAlg) - token := &Token{tokenType: Bearer, value: "does not matter"} - mockResolver := &key.MockResolver{} - - mockJWS := &mockJWS{} - mockJWS.On("Protected").Return(jose.Protected{"alg": badAlg}).Once() - - mockJWSParser := &mockJWSParser{} - mockJWSParser.On("ParseJWS", token).Return(mockJWS, nil).Once() - - validator := &JWSValidator{ - Resolver: mockResolver, - Parser: mockJWSParser, - } - - valid, err := validator.Validate(nil, token) - assert.False(valid) - assert.Equal(err, ErrorNoSigningMethod) - - mockResolver.AssertExpectations(t) - mockJWS.AssertExpectations(t) - mockJWSParser.AssertExpectations(t) - } -} - -//func TestJWSValidatorCapabilities(t *testing.T) { -// assert := assert.New(t) -// -// defaultClaims := jws.Claims{ -// "capabilities": []interface{}{ -// "x1:webpa:api:.*:all", -// "x1:webpa:api:device/.*/config/.*:all", -// "x1:webpa:api:device/.*/config/.*:get", -// "x1:webpa:api:device/.*/stat:get", -// "x1:webpa:api:hook:post", -// "x1:webpa:api:hooks:get", -// }, -// } -// -// ctxValid := context.Background() -// ctxValid = context.WithValue(ctxValid, "method", "post") -// ctxValid = context.WithValue(ctxValid, "path", "/api/foo/path") -// -// ctxInvalidMethod := context.Background() -// ctxInvalidMethod = context.WithValue(ctxInvalidMethod, "method", "get") -// ctxInvalidMethod = context.WithValue(ctxInvalidMethod, "path", "/api/foo/path") -// -// ctxInvalidPath := context.Background() -// ctxInvalidPath = context.WithValue(ctxInvalidPath, "method", "post") -// ctxInvalidPath = context.WithValue(ctxInvalidPath, "path", "/ipa/foo/path") -// -// ctxInvalidApi := context.Background() -// ctxInvalidApi = context.WithValue(ctxInvalidApi, "method", "get") -// ctxInvalidApi = context.WithValue(ctxInvalidApi, "path", "/api") -// -// ctxInvalidVersion := context.Background() -// ctxInvalidVersion = context.WithValue(ctxInvalidVersion, "method", "get") -// ctxInvalidVersion = context.WithValue(ctxInvalidVersion, "path", "/api/v2") -// -// ctxValidConfig := context.Background() -// ctxValidConfig = context.WithValue(ctxValidConfig, "method", "get") -// ctxValidConfig = context.WithValue(ctxValidConfig, "path", "/api/v2/device/mac:112233445566/config?name=foodoo") -// validConfigClaims := jws.Claims{ -// "capabilities": []interface{}{ -// "x1:webpa:api:device/.*/config/?.*:get", -// }, -// } -// -// ctxValidConfig2 := context.Background() -// ctxValidConfig2 = context.WithValue(ctxValidConfig, "method", "get") -// ctxValidConfig2 = context.WithValue(ctxValidConfig, "path", "/api/v2/device/mac:112233445566/config") -// -// ctxValidConfig3 := context.Background() -// ctxValidConfig3 = context.WithValue(ctxValidConfig, "method", "get") -// ctxValidConfig3 = context.WithValue(ctxValidConfig, "path", "/api/v2/device/mac:112233445566/config/") -// -// ctxValidConfig4 := context.Background() -// ctxValidConfig4 = context.WithValue(ctxValidConfig, "method", "get") -// ctxValidConfig4 = context.WithValue(ctxValidConfig, "path", "/api/v2/device/mac:112233445566/config/bob") -// -// validConfigClaims2 := jws.Claims{ -// "capabilities": []interface{}{ -// "x1:webpa:api:device/.*/config\\b:get", -// }, -// } -// -// ctxInvalidConfig := context.Background() -// ctxInvalidConfig = context.WithValue(ctxInvalidConfig, "method", "get") -// ctxInvalidConfig = context.WithValue(ctxInvalidConfig, "path", "/api/v2/device/mac:112233445566/config?name=foodoo") -// invalidConfigClaims := jws.Claims{ -// "capabilities": []interface{}{ -// "x1:webpa:api:device/.*/config/.*:get", -// }, -// } -// -// ctxInvalidConfig2 := context.Background() -// ctxInvalidConfig2 = context.WithValue(ctxValidConfig, "method", "get") -// ctxInvalidConfig2 = context.WithValue(ctxValidConfig, "path", "/api/v2/device/mac:112233445566/configure") -// -// ctxInvalidConfig3 := context.Background() -// ctxInvalidConfig3 = context.WithValue(ctxValidConfig, "method", "get") -// ctxInvalidConfig3 = context.WithValue(ctxValidConfig, "path", "/api/v2/device/mac:112233445566/configure/") -// -// ctxValidHook := context.Background() -// ctxValidHook = context.WithValue(ctxValidHook, "method", "post") -// ctxValidHook = context.WithValue(ctxValidHook, "path", "/api/v2/hook") -// -// ctxValidHooks := context.Background() -// ctxValidHooks = context.WithValue(ctxValidHooks, "method", "get") -// ctxValidHooks = context.WithValue(ctxValidHooks, "path", "/api/v2/hooks") -// -// ctxInvalidHealth := context.Background() -// ctxInvalidHealth = context.WithValue(ctxInvalidHealth, "method", "get") -// ctxInvalidHealth = context.WithValue(ctxInvalidHealth, "path", "/health") -// -// ctxValidEvent := context.Background() -// ctxValidEvent = context.WithValue(ctxValidEvent, "method", "post") -// ctxValidEvent = context.WithValue(ctxValidEvent, "path", "/api/v2/notify/mac:112233445566/event/device-status") -// -// ctxValidStat := context.Background() -// ctxValidStat = context.WithValue(ctxValidStat, "method", "get") -// ctxValidStat = context.WithValue(ctxValidStat, "path", "/api/v2/device/mac:112233445566/stat") -// -// validStatClaims := jws.Claims{ -// "capabilities": []interface{}{ -// "x1:webpa:api:device/.*/stat:get", -// }, -// } -// -// var testData = []struct { -// context context.Context -// claims jws.Claims -// expectedValid bool -// }{ -// {ctxValid, defaultClaims, true}, -// {context.Background(), defaultClaims, false}, -// {ctxInvalidMethod, testClaims, false}, -// {ctxInvalidPath, defaultClaims, false}, -// {ctxInvalidApi, defaultClaims, false}, -// {ctxInvalidVersion, defaultClaims, false}, -// {ctxValidConfig, validConfigClaims, true}, -// -// {ctxValidConfig2, validConfigClaims, true}, -// {ctxValidConfig3, validConfigClaims, true}, -// {ctxValidConfig4, validConfigClaims, true}, -// {ctxValidConfig, validConfigClaims2, true}, -// {ctxValidConfig2, validConfigClaims2, true}, -// {ctxValidConfig3, validConfigClaims2, true}, -// {ctxValidConfig4, validConfigClaims2, true}, -// -// {ctxInvalidConfig, invalidConfigClaims, false}, -// -// {ctxInvalidConfig2, validConfigClaims, true}, -// {ctxInvalidConfig3, validConfigClaims, true}, -// {ctxInvalidConfig2, validConfigClaims2, false}, -// {ctxInvalidConfig3, validConfigClaims2, false}, -// -// {ctxValidHook, defaultClaims, true}, -// {ctxValidHooks, defaultClaims, true}, -// {ctxInvalidHealth, defaultClaims, false}, -// {ctxValidEvent, defaultClaims, true}, -// {ctxValidStat, validStatClaims, true}, -// } -// -// for _, record := range testData { -// var ok bool -// var method, path string -// if method, ok = record.context.Value("method").(string); ok { -// method = record.context.Value("method").(string) -// } -// if path, ok = record.context.Value("path").(string); ok { -// path = record.context.Value("path").(string) -// } -// -// t.Logf("ctx method: %s, ctx path: %s, claims: %v, expectedValid: %v", method, path, record.claims, record.expectedValid) -// token := &Token{tokenType: Bearer, value: "does not matter"} -// -// mockPair := &key.MockPair{} -// expectedPublicKey := interface{}(123) -// mockPair.On("Public").Return(expectedPublicKey).Once() -// -// mockResolver := &key.MockResolver{} -// mockResolver.On("ResolveKey", mock.AnythingOfType("string")).Return(mockPair, nil).Once() -// -// expectedSigningMethod := jws.GetSigningMethod("RS256") -// assert.NotNil(expectedSigningMethod) -// -// mockJWS := &mockJWS{} -// mockJWS.On("Protected").Return(jose.Protected{"alg": "RS256"}).Once() -// mockJWS.On("Verify", expectedPublicKey, expectedSigningMethod).Return(nil).Once() -// mockJWS.On("Payload").Return(record.claims).Once() -// -// mockJWSParser := &mockJWSParser{} -// mockJWSParser.On("ParseJWS", token).Return(mockJWS, nil).Once() -// -// validator := &JWSValidator{ -// Resolver: mockResolver, -// Parser: mockJWSParser, -// } -// -// valid, err := validator.Validate(record.context, token) -// assert.Equal(record.expectedValid, valid) -// assert.Nil(err) -// -// mockPair.AssertExpectations(t) -// mockResolver.AssertExpectations(t) -// mockJWS.AssertExpectations(t) -// mockJWSParser.AssertExpectations(t) -// } -//} -// -// TestJWSValidatorResolverError also tests the correct key id determination -// when the header has a "kid" field vs the JWSValidator.DefaultKeyId member being set. -func TestJWSValidatorResolverError(t *testing.T) { - assert := assert.New(t) - - var testData = []struct { - headerKeyId string - defaultKeyId string - expectedKeyId string - }{ - {"", "", ""}, - {"", "current", "current"}, - {"akey", "", "akey"}, - {"akey", "current", "akey"}, - } - - for _, record := range testData { - t.Logf("%#v", record) - token := &Token{tokenType: Bearer, value: "does not matter"} - - expectedResolverError := errors.New("expected resolver error") - mockResolver := &key.MockResolver{} - mockResolver.On("ResolveKey", record.expectedKeyId).Return(nil, expectedResolverError).Once() - - mockJWS := &mockJWS{} - mockJWS.On("Protected").Return(jose.Protected{"alg": "RS256", "kid": record.headerKeyId}).Once() - - mockJWSParser := &mockJWSParser{} - mockJWSParser.On("ParseJWS", token).Return(mockJWS, nil).Once() - - validator := &JWSValidator{ - Resolver: mockResolver, - Parser: mockJWSParser, - DefaultKeyId: record.defaultKeyId, - } - - valid, err := validator.Validate(nil, token) - assert.False(valid) - assert.Equal(err, expectedResolverError) - - mockResolver.AssertExpectations(t) - mockJWS.AssertExpectations(t) - mockJWSParser.AssertExpectations(t) - } -} - -func TestJWSValidatorVerify(t *testing.T) { - assert := assert.New(t) - - var testData = []struct { - expectedValid bool - expectedVerifyError error - }{ - {true, nil}, - {false, errors.New("expected Verify error")}, - } - - for _, record := range testData { - t.Logf("%v", record) - token := &Token{tokenType: Bearer, value: "does not matter"} - - mockPair := &key.MockPair{} - expectedPublicKey := interface{}(123) - mockPair.On("Public").Return(expectedPublicKey).Once() - - mockResolver := &key.MockResolver{} - mockResolver.On("ResolveKey", mock.AnythingOfType("string")).Return(mockPair, nil).Once() - - expectedSigningMethod := jws.GetSigningMethod("RS256") - assert.NotNil(expectedSigningMethod) - - mockJWS := &mockJWS{} - mockJWS.On("Protected").Return(jose.Protected{"alg": "RS256"}).Once() - mockJWS.On("Verify", expectedPublicKey, expectedSigningMethod).Return(record.expectedVerifyError).Once() - if record.expectedVerifyError == nil { - mockJWS.On("Payload").Return(testClaims).Once() - } - - mockJWSParser := &mockJWSParser{} - mockJWSParser.On("ParseJWS", token).Return(mockJWS, nil).Once() - - validator := &JWSValidator{ - Resolver: mockResolver, - Parser: mockJWSParser, - } - - ctx := context.Background() - ctx = context.WithValue(ctx, "method", "post") - ctx = context.WithValue(ctx, "path", "/api/foo/path") - - valid, err := validator.Validate(ctx, token) - assert.Equal(record.expectedValid, valid) - assert.Equal(record.expectedVerifyError, err) - - mockPair.AssertExpectations(t) - mockResolver.AssertExpectations(t) - mockJWS.AssertExpectations(t) - mockJWSParser.AssertExpectations(t) - } -} - -func TestJWSValidatorValidate(t *testing.T) { - assert := assert.New(t) - - var testData = []struct { - expectedValid bool - expectedValidateError error - expectedJWTValidators []*jwt.Validator - }{ - {true, nil, []*jwt.Validator{{}}}, - {true, nil, []*jwt.Validator{{}, {}}}, - {false, errors.New("expected Validate error 1"), []*jwt.Validator{{}}}, - {false, errors.New("expected Validate error 2"), []*jwt.Validator{{}, {}}}, - } - - for _, record := range testData { - t.Logf("%v", record) - token := &Token{tokenType: Bearer, value: "does not matter"} - - mockPair := &key.MockPair{} - expectedPublicKey := interface{}(123) - mockPair.On("Public").Return(expectedPublicKey).Once() - - mockResolver := &key.MockResolver{} - mockResolver.On("ResolveKey", mock.AnythingOfType("string")).Return(mockPair, nil).Once() - - expectedSigningMethod := jws.GetSigningMethod("RS256") - assert.NotNil(expectedSigningMethod) - - mockJWS := &mockJWS{} - mockJWS.On("Protected").Return(jose.Protected{"alg": "RS256"}).Once() - mockJWS.On("Validate", expectedPublicKey, expectedSigningMethod, record.expectedJWTValidators). - Return(record.expectedValidateError). - Once() - if record.expectedValidateError == nil { - mockJWS.On("Payload").Return(testClaims).Once() - } - - mockJWSParser := &mockJWSParser{} - mockJWSParser.On("ParseJWS", token).Return(mockJWS, nil).Once() - - validator := &JWSValidator{ - Resolver: mockResolver, - Parser: mockJWSParser, - JWTValidators: record.expectedJWTValidators, - } - - ctx := context.Background() - ctx = context.WithValue(ctx, "method", "post") - ctx = context.WithValue(ctx, "path", "/api/foo/path") - - valid, err := validator.Validate(ctx, token) - assert.Equal(record.expectedValid, valid) - assert.Equal(record.expectedValidateError, err) - - mockPair.AssertExpectations(t) - mockResolver.AssertExpectations(t) - mockJWS.AssertExpectations(t) - mockJWSParser.AssertExpectations(t) - } -} -func TestJWTValidatorFactory(t *testing.T) { - assert := assert.New(t) - now := time.Now().Unix() - - var testData = []struct { - claims jwt.Claims - factory JWTValidatorFactory - expectValid bool - }{ - { - claims: jwt.Claims{}, - factory: JWTValidatorFactory{}, - expectValid: true, - }, - { - claims: jwt.Claims{ - "exp": now + 3600, - }, - factory: JWTValidatorFactory{}, - expectValid: true, - }, - { - claims: jwt.Claims{ - "exp": now - 3600, - }, - factory: JWTValidatorFactory{}, - expectValid: false, - }, - { - claims: jwt.Claims{ - "exp": now - 200, - }, - factory: JWTValidatorFactory{ - ExpLeeway: 300, - }, - expectValid: true, - }, - { - claims: jwt.Claims{ - "nbf": now + 3600, - }, - factory: JWTValidatorFactory{}, - expectValid: false, - }, - { - claims: jwt.Claims{ - "nbf": now - 3600, - }, - factory: JWTValidatorFactory{}, - expectValid: true, - }, - { - claims: jwt.Claims{ - "nbf": now + 200, - }, - factory: JWTValidatorFactory{ - NbfLeeway: 300, - }, - expectValid: true, - }, - } - - for _, record := range testData { - t.Logf("%#v", record) - - { - t.Log("Simple case: no custom validate functions") - validator := record.factory.New() - assert.NotNil(validator) - mockJWS := &mockJWS{} - mockJWS.On("Claims").Return(record.claims).Once() - - err := validator.Validate(mockJWS) - assert.Equal(record.expectValid, err == nil) - - mockJWS.AssertExpectations(t) - } - - { - for _, firstResult := range []error{nil, errors.New("first error")} { - first := func(jwt.Claims) error { - return firstResult - } - - { - t.Logf("One custom validate function returning: %v", firstResult) - validator := record.factory.New(first) - assert.NotNil(validator) - mockJWS := &mockJWS{} - mockJWS.On("Claims").Return(record.claims).Once() - - err := validator.Validate(mockJWS) - assert.Equal(record.expectValid && firstResult == nil, err == nil) - - mockJWS.AssertExpectations(t) - } - - for _, secondResult := range []error{nil, errors.New("second error")} { - second := func(jwt.Claims) error { - return secondResult - } - - { - t.Logf("Two custom validate functions returning: %v, %v", firstResult, secondResult) - validator := record.factory.New(first, second) - assert.NotNil(validator) - mockJWS := &mockJWS{} - mockJWS.On("Claims").Return(record.claims).Once() - - err := validator.Validate(mockJWS) - assert.Equal( - record.expectValid && firstResult == nil && secondResult == nil, - err == nil, - ) - - mockJWS.AssertExpectations(t) - } - } - } - } - } -} - -//A simple verification that a pointer function signature is used -func TestDefineMeasures(t *testing.T) { - assert := assert.New(t) - a, m := JWTValidatorFactory{}, &JWTValidationMeasures{} - a.DefineMeasures(m) - assert.Equal(m, a.measures) - - b := JWSValidator{} - b.DefineMeasures(m) - assert.Equal(m, b.measures) -} diff --git a/server/log.go b/server/log.go deleted file mode 100644 index 7c53c93c..00000000 --- a/server/log.go +++ /dev/null @@ -1,33 +0,0 @@ -package server - -import ( - stdlibLog "log" - "net" - "net/http" - - "github.com/go-kit/kit/log" - "github.com/xmidt-org/webpa-common/v2/logging" - "go.uber.org/zap" -) - -// NewErrorLog creates a new logging.Logger appropriate for http.Server.ErrorLog -func NewErrorLog(serverName string, logger *zap.Logger) *stdlibLog.Logger { - return stdlibLog.New( - zap.NewStdLog(logger).Writer(), - serverName, - stdlibLog.LstdFlags|stdlibLog.LUTC, - ) -} - -// NewConnectionStateLogger produces a function appropriate for http.Server.ConnState. -// The returned function will log debug statements for each state change. -func NewConnectionStateLogger(serverName string, logger log.Logger) func(net.Conn, http.ConnState) { - logger = logging.Debug(logger) - return func(connection net.Conn, connectionState http.ConnState) { - logger.Log( - "serverName", serverName, - "localAddress", connection.LocalAddr().String(), - "state", connectionState, - ) - } -} diff --git a/server/log_test.go b/server/log_test.go deleted file mode 100644 index c541e1dd..00000000 --- a/server/log_test.go +++ /dev/null @@ -1,68 +0,0 @@ -package server - -import ( - "bytes" - stdlibLog "log" - "net" - "net/http" - "testing" - - "github.com/go-kit/kit/log" - "github.com/stretchr/testify/assert" - "go.uber.org/zap/internal/bufferpool" -) - -const ( - serverName = "serverName" -) - -func newTestLogger() (verify *bytes.Buffer, logger log.Logger) { - verify = (*bytes.Buffer)(bufferpool.Get()) - logger = log.NewLogfmtLogger(log.NewSyncWriter(verify)) - return -} - -func assertBufferContains(assert *assert.Assertions, verify *bytes.Buffer, values ...string) { - text := verify.String() - for _, value := range values { - assert.Contains(text, value) - } -} - -func assertErrorLog(assert *assert.Assertions, verify *bytes.Buffer, serverName string, errorLog *stdlibLog.Logger) { - if assert.NotNil(errorLog) { - errorLog.Print("howdy!") - assertBufferContains(assert, verify, serverName, "howdy!") - } -} - -func assertConnState(assert *assert.Assertions, verify *bytes.Buffer, connState func(net.Conn, http.ConnState)) { - if assert.NotNil(connState) { - conn1, conn2 := net.Pipe() - defer conn1.Close() - defer conn2.Close() - - connState(conn1, http.StateNew) - assertBufferContains(assert, verify, conn1.LocalAddr().String(), http.StateNew.String()) - } -} - -func TestNewErrorLog(t *testing.T) { - var ( - assert = assert.New(t) - verify, logger = newTestLogger() - errorLog = NewErrorLog(serverName, logger) - ) - - assertErrorLog(assert, verify, serverName, errorLog) -} - -func TestNewConnectionStateLogger(t *testing.T) { - var ( - assert = assert.New(t) - verify, logger = newTestLogger() - connectionLogFunc = NewConnectionStateLogger(serverName, logger) - ) - - assertConnState(assert, verify, connectionLogFunc) -} From 74658cf02a60974027017d22c0fbb8cce5681e17 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:17:23 -0400 Subject: [PATCH 27/48] remove portions of monitor package --- service/monitor/delayedListener.go | 16 -------------- service/monitor/delayedListener_test.go | 28 ------------------------- 2 files changed, 44 deletions(-) delete mode 100644 service/monitor/delayedListener.go delete mode 100644 service/monitor/delayedListener_test.go diff --git a/service/monitor/delayedListener.go b/service/monitor/delayedListener.go deleted file mode 100644 index 923c3716..00000000 --- a/service/monitor/delayedListener.go +++ /dev/null @@ -1,16 +0,0 @@ -package monitor - -import "github.com/xmidt-org/webpa-common/v2/capacitor" - -// DelayedListener is a decorator for Listener that uses a capacitor to implement a grace period -// between service discovery events. -type DelayedListener struct { - Listener Listener - Capacitor capacitor.Interface -} - -func (dl DelayedListener) MonitorEvent(e Event) { - dl.Capacitor.Submit(func() { - dl.Listener.MonitorEvent(e) - }) -} diff --git a/service/monitor/delayedListener_test.go b/service/monitor/delayedListener_test.go deleted file mode 100644 index a4b2386f..00000000 --- a/service/monitor/delayedListener_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package monitor - -import ( - "testing" - - "github.com/stretchr/testify/mock" - "github.com/xmidt-org/webpa-common/v2/capacitor/capacitortest" -) - -func TestDelayedListener(t *testing.T) { - var ( - expectedEvent = Event{Key: "this is a test key"} - - c = new(capacitortest.Mock) - l = new(mockListener) - dl = DelayedListener{l, c} - ) - - l.On("MonitorEvent", expectedEvent).Once() - c.On("Submit", mock.MatchedBy(func(func()) bool { return true })).Once().Run(func(arguments mock.Arguments) { - arguments.Get(0).(func())() - }) - - dl.MonitorEvent(expectedEvent) - - c.AssertExpectations(t) - l.AssertExpectations(t) -} From 032f08b58ae0bc256644e4ca920ce04b6b623e85 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:17:41 -0400 Subject: [PATCH 28/48] remove portions of transporthttp package --- transport/transporthttp/extraHeaders.go | 32 --------- transport/transporthttp/extraHeaders_test.go | 54 --------------- transport/transporthttp/getBody.go | 24 ------- transport/transporthttp/getBody_test.go | 73 -------------------- 4 files changed, 183 deletions(-) delete mode 100644 transport/transporthttp/extraHeaders.go delete mode 100644 transport/transporthttp/extraHeaders_test.go delete mode 100644 transport/transporthttp/getBody.go delete mode 100644 transport/transporthttp/getBody_test.go diff --git a/transport/transporthttp/extraHeaders.go b/transport/transporthttp/extraHeaders.go deleted file mode 100644 index 4d72e6a8..00000000 --- a/transport/transporthttp/extraHeaders.go +++ /dev/null @@ -1,32 +0,0 @@ -package transporthttp - -import ( - "context" - "net/http" - "net/textproto" - - gokithttp "github.com/go-kit/kit/transport/http" -) - -// ExtraHeaders is a RequestFunc for setting extra headers for each request. This -// RequestFunc only makes sense for a client, as it modifies requests. -// -// The returned function has some performance advantages over go-kit's SetRequestHeader, -// particularly when more than one header is supplied. -// -// The header names are preprocessed using textproto.CanonicalMIMEHeaderKey just once. -func ExtraHeaders(extra http.Header) gokithttp.RequestFunc { - normalizedExtra := make(http.Header, len(extra)) - for name, values := range extra { - normalizedExtra[textproto.CanonicalMIMEHeaderKey(name)] = values - } - - extra = normalizedExtra - return func(ctx context.Context, r *http.Request) context.Context { - for name, values := range extra { - r.Header[name] = values - } - - return ctx - } -} diff --git a/transport/transporthttp/extraHeaders_test.go b/transport/transporthttp/extraHeaders_test.go deleted file mode 100644 index 01813370..00000000 --- a/transport/transporthttp/extraHeaders_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package transporthttp - -import ( - "context" - "net/http" - "net/http/httptest" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestExtraHeaders(t *testing.T) { - var ( - assert = assert.New(t) - testData = []struct { - actual http.Header - expected http.Header - }{ - {nil, nil}, - {http.Header{}, http.Header{}}, - { - http.Header{"Content-Type": []string{"application/json"}}, - http.Header{"Content-Type": []string{"application/json"}}, - }, - { - http.Header{"content-type": []string{"application/json"}}, - http.Header{"Content-Type": []string{"application/json"}}, - }, - { - http.Header{"content-type": []string{"application/json"}, "x-something": []string{"abc", "def"}}, - http.Header{"Content-Type": []string{"application/json"}, "X-Something": []string{"abc", "def"}}, - }, - } - ) - - for _, record := range testData { - t.Logf("%#v", record) - - var ( - rf = ExtraHeaders(record.actual) - ctx = context.WithValue(context.Background(), "foo", "bar") - request = httptest.NewRequest("GET", "/", nil) - ) - - for name, _ := range record.expected { - request.Header[name] = []string{"SHOULD BE OVERWRITTEN"} - } - - assert.Equal(ctx, rf(ctx, request)) - for name, values := range record.expected { - assert.Equal(values, request.Header[name]) - } - } -} diff --git a/transport/transporthttp/getBody.go b/transport/transporthttp/getBody.go deleted file mode 100644 index ba626d53..00000000 --- a/transport/transporthttp/getBody.go +++ /dev/null @@ -1,24 +0,0 @@ -package transporthttp - -import ( - "context" - "net/http" - - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" - "github.com/xmidt-org/webpa-common/v2/logging" - "github.com/xmidt-org/webpa-common/v2/xhttp" -) - -// GetBody returns a go-kit RequestFunc that sets the request's GetBody function. This ensures -// that redirects are properly followed automatically. -func GetBody(logger log.Logger) func(context.Context, *http.Request) context.Context { - return func(ctx context.Context, request *http.Request) context.Context { - err := xhttp.EnsureRewindable(request) - if err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "Unable to setup request for rewind", logging.ErrorKey(), err) - } - - return ctx - } -} diff --git a/transport/transporthttp/getBody_test.go b/transport/transporthttp/getBody_test.go deleted file mode 100644 index d58ba9f5..00000000 --- a/transport/transporthttp/getBody_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package transporthttp - -import ( - "bytes" - "context" - "io/ioutil" - "net/http" - "net/http/httptest" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" -) - -func testGetBody(t *testing.T, expected []byte) { - var ( - assert = assert.New(t) - require = require.New(t) - - ctx = context.WithValue(context.Background(), "foo", "bar") - getBody = GetBody(logging.NewTestLogger(nil, t)) - request = httptest.NewRequest("GET", "/", bytes.NewReader(expected)) - ) - - require.NotNil(getBody) - assert.Equal(ctx, getBody(ctx, request)) - - require.NotNil(request.Body) - reread, err := ioutil.ReadAll(request.Body) - require.NoError(err) - assert.Equal(expected, reread) - reread, err = ioutil.ReadAll(request.Body) - require.NoError(err) - assert.Empty(reread) - - require.NotNil(request.GetBody) - for repeat := 0; repeat < 2; repeat++ { - reader, err := request.GetBody() - require.NotNil(reader) - require.NoError(err) - data, err := ioutil.ReadAll(reader) - require.NoError(err) - assert.Equal(expected, data) - } -} - -func testGetBodyNilRequest(t *testing.T) { - assert := assert.New(t) - assert.Panics(func() { - GetBody(logging.NewTestLogger(nil, t))(context.Background(), nil) - }) -} - -func testGetBodyNilRequestBody(t *testing.T) { - assert := assert.New(t) - assert.NotPanics(func() { - GetBody(logging.NewTestLogger(nil, t))(context.Background(), new(http.Request)) - }) -} - -func TestGetBody(t *testing.T) { - t.Run("EmptyBody", func(t *testing.T) { - testGetBody(t, []byte{}) - }) - - t.Run("NonemptyBody", func(t *testing.T) { - testGetBody(t, []byte(`a;slkdfjas;dkjfqweo84yu6tphdfkahsep5t837546987ydfjkghsdkfj`)) - }) - - t.Run("NilRequest", testGetBodyNilRequest) - t.Run("NilRequestBody", testGetBodyNilRequestBody) -} From 61b86e96dc8bbd2b3fdf3162dd99541f61f4cca6 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:18:05 -0400 Subject: [PATCH 29/48] Update server package --- server/signalWait.go | 7 +++--- server/signalWait_test.go | 6 ++--- server/webpa.go | 45 +++++++++++++++++++------------------- server/webpa_test.go | 46 ++++++++++++++++++++++++++++++++++----- 4 files changed, 68 insertions(+), 36 deletions(-) diff --git a/server/signalWait.go b/server/signalWait.go index bbcc1ab3..e2db640c 100644 --- a/server/signalWait.go +++ b/server/signalWait.go @@ -3,8 +3,7 @@ package server import ( "os" - "github.com/go-kit/kit/log" - "github.com/xmidt-org/webpa-common/v2/logging" + "go.uber.org/zap" ) // SignalWait blocks until any of a set of signals is encountered. The signal which caused this function @@ -13,7 +12,7 @@ import ( // If no waitOn signals are supplied, this function will never return until the signals channel is closed. // // In all cases, the supplied logger is used to log information about signals that are ignored. -func SignalWait(logger log.Logger, signals <-chan os.Signal, waitOn ...os.Signal) os.Signal { +func SignalWait(logger *zap.Logger, signals <-chan os.Signal, waitOn ...os.Signal) os.Signal { filter := make(map[os.Signal]bool) for _, s := range waitOn { filter[s] = true @@ -24,7 +23,7 @@ func SignalWait(logger log.Logger, signals <-chan os.Signal, waitOn ...os.Signal return s } - logger.Log(logging.MessageKey(), "ignoring signal", "signal", s.String()) + logger.Info("ignoring signal", zap.String("signal", s.String())) } return nil diff --git a/server/signalWait_test.go b/server/signalWait_test.go index b1c64cb9..ba8e1068 100644 --- a/server/signalWait_test.go +++ b/server/signalWait_test.go @@ -7,13 +7,13 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func testSignalWaitBasic(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() signals = make(chan os.Signal) started = new(sync.WaitGroup) @@ -49,7 +49,7 @@ func testSignalWaitBasic(t *testing.T) { func testSignalWaitForever(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() signals = make(chan os.Signal) started = new(sync.WaitGroup) diff --git a/server/webpa.go b/server/webpa.go index 62befc7a..6d388719 100644 --- a/server/webpa.go +++ b/server/webpa.go @@ -13,15 +13,14 @@ import ( "sync" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/metrics" "github.com/justinas/alice" stdprometheus "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/xmidt-org/sallust" + "github.com/xmidt-org/sallust/sallusthttp" "github.com/xmidt-org/webpa-common/v2/concurrent" "github.com/xmidt-org/webpa-common/v2/health" - "github.com/xmidt-org/webpa-common/v2/logging" "github.com/xmidt-org/webpa-common/v2/xhttp" "github.com/xmidt-org/webpa-common/v2/xlistener" "github.com/xmidt-org/webpa-common/v2/xmetrics" @@ -211,7 +210,7 @@ func (b *Basic) SetPeerVerifyCallback(vp PeerVerifyCallback) { } // NewListener creates a decorated TCPListener appropriate for this server's configuration. -func (b *Basic) NewListener(logger log.Logger, activeConnections metrics.Gauge, rejectedCounter xmetrics.Adder, config *tls.Config) (net.Listener, error) { +func (b *Basic) NewListener(logger *zap.Logger, activeConnections metrics.Gauge, rejectedCounter xmetrics.Adder, config *tls.Config) (net.Listener, error) { return xlistener.New(xlistener.Options{ Logger: logger, Address: b.Address, @@ -245,7 +244,7 @@ func loadCerts(certificateFiles, keyFiles []string) (certs []tls.Certificate, er for i := 0; i < len(certificateFiles); i++ { certs[i], err = tls.LoadX509KeyPair(certificateFiles[i], keyFiles[i]) if err != nil { - logging.Error(logging.DefaultLogger()).Log(logging.MessageKey(), "Failed to LoadX509KeyPair", "cert", certificateFiles[i], "key", keyFiles[i], logging.ErrorKey(), err) + sallust.Default().Error("Failed to LoadX509KeyPair", zap.String("cert", certificateFiles[i]), zap.String("key", keyFiles[i]), zap.Error(err)) return []tls.Certificate{}, err } } @@ -259,7 +258,7 @@ func loadCerts(certificateFiles, keyFiles []string) (certs []tls.Certificate, er // // This method returns nil if the configured address is empty or if any config errors occur, effectively disabling // this server from startup. -func (b *Basic) New(logger log.Logger, handler http.Handler) *http.Server { +func (b *Basic) New(logger *zap.Logger, handler http.Handler) *http.Server { if len(b.Address) == 0 { return nil } @@ -268,7 +267,7 @@ func (b *Basic) New(logger log.Logger, handler http.Handler) *http.Server { if len(b.CertificateFile) > 0 && len(b.KeyFile) > 0 { certs, err := loadCerts(b.CertificateFile, b.KeyFile) if err != nil { - logging.Error(logger).Log(logging.MessageKey(), "Error loading cert and key file to configure TLS", logging.ErrorKey(), err) + logger.Error("Error loading cert and key file to configure TLS", zap.Error(err)) return nil } @@ -285,7 +284,7 @@ func (b *Basic) New(logger log.Logger, handler http.Handler) *http.Server { caCert, err := ioutil.ReadFile(b.ClientCACertFile) if err != nil { - logging.Error(logger).Log(logging.MessageKey(), "Error loading clientCACert file to configure mTLS", logging.ErrorKey(), err) + logger.Error("Error loading clientCACert file to configure mTLS", zap.Error(err)) return nil } @@ -304,13 +303,13 @@ func (b *Basic) New(logger log.Logger, handler http.Handler) *http.Server { WriteTimeout: b.writeTimeout(), IdleTimeout: b.idleTimeout(), MaxHeaderBytes: b.maxHeaderBytes(), - ErrorLog: NewErrorLog(b.Name, logger), + ErrorLog: sallust.NewServerLogger(b.Name, logger), TLSConfig: tlsConfig, TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){}, // disable HTTP/2 } if b.LogConnectionState { - server.ConnState = NewConnectionStateLogger(b.Name, logger) + server.ConnState = sallusthttp.NewConnStateLogger(logger, zap.DebugLevel, zap.String("serverName", b.Name)) } if b.DisableKeepAlives { @@ -337,7 +336,7 @@ func (m *Metric) NewRegistry(modules ...xmetrics.Module) (xmetrics.Registry, err return xmetrics.NewRegistry(&m.MetricsOptions, modules...) } -func (m *Metric) New(logger log.Logger, chain alice.Chain, gatherer stdprometheus.Gatherer) *http.Server { +func (m *Metric) New(logger *zap.Logger, chain alice.Chain, gatherer stdprometheus.Gatherer) *http.Server { if len(m.Address) == 0 { return nil } @@ -355,11 +354,11 @@ func (m *Metric) New(logger log.Logger, chain alice.Chain, gatherer stdprometheu WriteTimeout: DefaultWriteTimeout, IdleTimeout: DefaultIdleTimeout, MaxHeaderBytes: DefaultMaxHeaderBytes, - ErrorLog: NewErrorLog(m.Name, logger), + ErrorLog: sallust.NewServerLogger(m.Name, logger), } if m.LogConnectionState { - server.ConnState = NewConnectionStateLogger(m.Name, logger) + server.ConnState = sallusthttp.NewConnStateLogger(logger, zap.DebugLevel, zap.String("serverName", m.Name)) } server.SetKeepAlivesEnabled(false) @@ -429,11 +428,11 @@ func (h *Health) New(logger *zap.Logger, chain alice.Chain, health *health.Healt WriteTimeout: DefaultWriteTimeout, IdleTimeout: DefaultIdleTimeout, MaxHeaderBytes: DefaultMaxHeaderBytes, - ErrorLog: NewErrorLog(h.Name, logger), + ErrorLog: sallust.NewServerLogger(h.Name, logger), } if h.LogConnectionState { - server.ConnState = NewConnectionStateLogger(h.Name, logger) + server.ConnState = sallusthttp.NewConnStateLogger(logger, zap.DebugLevel, zap.String("serverName", h.Name)) } server.SetKeepAlivesEnabled(false) @@ -479,7 +478,7 @@ type WebPA struct { Flavor string // Log is the logging configuration for this application. - Log *logging.Options + Log *[]zap.Field } // build returns the injected build string if available, DefaultBuild otherwise @@ -532,7 +531,7 @@ func (w *WebPA) flavor() string { // it will also be used for that server. The health server uses an internally create handler, while pprof and metrics // servers use http.DefaultServeMux. The health Monitor created from configuration is returned so that other // infrastructure can make use of it. -func (w *WebPA) Prepare(logger log.Logger, health *health.Health, registry xmetrics.Registry, primaryHandler http.Handler) (health.Monitor, concurrent.Runnable, <-chan struct{}) { +func (w *WebPA) Prepare(logger *zap.Logger, health *health.Health, registry xmetrics.Registry, primaryHandler http.Handler) (health.Monitor, concurrent.Runnable, <-chan struct{}) { // allow the health instance to be non-nil, in which case it will be used in favor of // the WebPA-configured instance. var ( @@ -557,7 +556,7 @@ func (w *WebPA) Prepare(logger log.Logger, health *health.Health, registry xmetr finalizeOnce.Do(func() { defer close(done) for _, s := range servers { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "finalizing server", logging.ErrorKey(), s.Close()) + logger.Error("finalizing server", zap.Error(s.Close())) } }) } @@ -596,7 +595,7 @@ func (w *WebPA) Prepare(logger log.Logger, health *health.Health, registry xmetr // create any necessary listeners first, so that we return early if errors occur - primaryLogger := log.With(logger, "serverName", w.Primary.Name, "bindAddress", w.Primary.Address) + primaryLogger := logger.With(zap.String("serverName", w.Primary.Name), zap.String("bindAddress", w.Primary.Address)) primaryListener, err := w.Primary.NewListener( primaryLogger, activeConnections.With("server", "primary"), @@ -613,7 +612,7 @@ func (w *WebPA) Prepare(logger log.Logger, health *health.Health, registry xmetr // start the alternate server first, so we can short-circuit in the case of errors if alternateServer != nil { - alternateLogger := log.With(logger, "serverName", w.Alternate.Name, "bindAddress", w.Alternate.Address) + alternateLogger := logger.With(zap.String("serverName", w.Alternate.Name), zap.String("bindAddress", w.Alternate.Address)) alternateListener, err := w.Alternate.NewListener( alternateLogger, activeConnections.With("server", "alternate"), @@ -632,13 +631,13 @@ func (w *WebPA) Prepare(logger log.Logger, health *health.Health, registry xmetr Serve(primaryLogger, primaryListener, primaryServer, finalizer) if healthHandler != nil && healthServer != nil { - ListenAndServe(log.With(logger, "serverName", w.Health.Name, "bindAddress", w.Health.Address), healthServer, finalizer) + ListenAndServe(logger.With(zap.String("serverName", w.Health.Name), zap.String("bindAddress", w.Health.Address)), healthServer, finalizer) healthHandler.Run(waitGroup, shutdown) } if pprofServer != nil { ListenAndServe( - log.With(logger, "serverName", w.Pprof.Name, "bindAddress", w.Pprof.Address), + logger.With(zap.String("serverName", w.Pprof.Name), zap.String("bindAddress", w.Pprof.Address)), pprofServer, finalizer, ) @@ -646,7 +645,7 @@ func (w *WebPA) Prepare(logger log.Logger, health *health.Health, registry xmetr if metricsServer != nil { ListenAndServe( - log.With(logger, "serverName", w.Metric.Name, "bindAddress", w.Metric.Address), + logger.With(zap.String("serverName", w.Metric.Name), zap.String("bindAddress", w.Metric.Address)), metricsServer, finalizer, ) diff --git a/server/webpa_test.go b/server/webpa_test.go index 168a83ba..2a60c477 100644 --- a/server/webpa_test.go +++ b/server/webpa_test.go @@ -1,8 +1,11 @@ package server import ( + "bytes" "crypto/tls" "errors" + "log" + "net" "net/http" "sync" "testing" @@ -12,9 +15,40 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/xmetrics" + "go.uber.org/zap/zapcore" ) +func assertBufferContains(assert *assert.Assertions, verify *bytes.Buffer, values ...string) { + text := verify.String() + for _, value := range values { + assert.Contains(text, value) + } +} + +func assertErrorLog(assert *assert.Assertions, verify *bytes.Buffer, serverName string, errorLog *log.Logger) { + if assert.NotNil(errorLog) { + errorLog.Print("howdy!") + assertBufferContains(assert, verify, serverName, "howdy!") + } +} + +func assertConnState(assert *assert.Assertions, verify *bytes.Buffer, connState func(net.Conn, http.ConnState)) { + if assert.NotNil(connState) { + conn1, conn2 := net.Pipe() + defer conn1.Close() + defer conn2.Close() + + assert.NotPanics(func() { + connState(conn1, http.StateNew) + }) + if verify != nil { + assertBufferContains(assert, verify, conn1.LocalAddr().String(), http.StateNew.String()) + } + } +} + func TestListenAndServeNonSecure(t *testing.T) { var ( simpleError = errors.New("expected") @@ -37,7 +71,7 @@ func TestListenAndServeNonSecure(t *testing.T) { var ( assert = assert.New(t) - _, logger = newTestLogger() + _, logger = sallust.NewTestLogger(zapcore.InfoLevel) executorCalled = make(chan struct{}, 1) mockExecutor = new(mockExecutor) @@ -88,7 +122,7 @@ func TestListenAndServeSecure(t *testing.T) { var ( assert = assert.New(t) - _, logger = newTestLogger() + _, logger = sallust.NewTestLogger(zapcore.InfoLevel) executorCalled = make(chan struct{}, 1) mockExecutor = new(mockExecutor) @@ -230,7 +264,7 @@ func TestBasicNew(t *testing.T) { for _, record := range testData { t.Run(record.description, func(t *testing.T) { var ( - verify, logger = newTestLogger() + verify, logger = sallust.NewTestLogger(zapcore.DebugLevel) basic = Basic{ Name: expectedName, Address: record.address, @@ -324,7 +358,7 @@ func TestHealthNew(t *testing.T) { t.Logf("%#v", record) var ( - verify, logger = newTestLogger() + verify, logger = sallust.NewTestLogger(zapcore.DebugLevel) health = Health{ Name: expectedName, Address: record.address, @@ -369,7 +403,7 @@ func TestWebPANoPrimaryAddress(t *testing.T) { handler = new(mockHandler) webPA = WebPA{} - _, logger = newTestLogger() + _, logger = sallust.NewTestLogger(zapcore.InfoLevel) monitor, runnable, done = webPA.Prepare(logger, nil, xmetrics.MustNewRegistry(nil), handler) ) @@ -428,7 +462,7 @@ func TestWebPA(t *testing.T) { }, } - _, logger = newTestLogger() + _, logger = sallust.NewTestLogger(zapcore.InfoLevel) monitor, runnable, done = webPA.Prepare(logger, nil, xmetrics.MustNewRegistry(nil), handler) ) From 24e8044ad3627bbf04754aec81c84ca63e373592 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:18:24 -0400 Subject: [PATCH 30/48] Update consul package --- service/consul/datacenterWatch.go | 33 ++++++++++------------- service/consul/datacenterWatch_test.go | 11 ++++---- service/consul/environment.go | 33 ++++++++++++----------- service/consul/environment_test.go | 4 +-- service/consul/instancer.go | 19 +++++++------- service/consul/registrar.go | 36 ++++++++++++-------------- service/consul/registrar_test.go | 16 ++++++------ 7 files changed, 71 insertions(+), 81 deletions(-) diff --git a/service/consul/datacenterWatch.go b/service/consul/datacenterWatch.go index 3cd44812..5556abc6 100644 --- a/service/consul/datacenterWatch.go +++ b/service/consul/datacenterWatch.go @@ -7,18 +7,17 @@ import ( "sync" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/mitchellh/mapstructure" "github.com/xmidt-org/argus/chrysom" "github.com/xmidt-org/argus/model" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service" + "go.uber.org/zap" ) // datacenterWatcher checks if datacenters have been updated, based on an interval. type datacenterWatcher struct { - logger log.Logger + logger *zap.Logger environment Environment options Options inactiveDatacenters map[string]bool @@ -33,14 +32,13 @@ type datacenterFilter struct { } var ( - defaultLogger = log.NewNopLogger() defaultWatchInterval = 5 * time.Minute ) -func newDatacenterWatcher(logger log.Logger, environment Environment, options Options) (*datacenterWatcher, error) { +func newDatacenterWatcher(logger *zap.Logger, environment Environment, options Options) (*datacenterWatcher, error) { if logger == nil { - logger = defaultLogger + logger = sallust.Default() } if options.DatacenterWatchInterval <= 0 { @@ -76,11 +74,11 @@ func newDatacenterWatcher(logger log.Logger, environment Environment, options Op m := &chrysom.Measures{ Polls: environment.Provider().NewCounterVec(chrysom.PollCounter), } - basic, err := chrysom.NewBasicClient(options.Chrysom.BasicClientConfig, getLogger) + basic, err := chrysom.NewBasicClient(options.Chrysom.BasicClientConfig, sallust.Get) if err != nil { return nil, fmt.Errorf("failed to create chrysom basic client: %v", err) } - listener, err := chrysom.NewListenerClient(options.Chrysom.Listen, logging.WithLogger, m, basic) + listener, err := chrysom.NewListenerClient(options.Chrysom.Listen, sallust.With, m, basic) if err != nil { return nil, fmt.Errorf("failed to create chrysom listener client: %v", err) } @@ -88,13 +86,13 @@ func newDatacenterWatcher(logger log.Logger, environment Environment, options Op //create chrysom client and start it datacenterWatcher.stopListener = listener.Stop listener.Start(context.Background()) - logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "started chrysom, argus client") + logger.Debug("started chrysom, argus client") } //start consul watch ticker := time.NewTicker(datacenterWatcher.consulWatchInterval) go datacenterWatcher.watchDatacenters(ticker) - logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "started consul datacenter watch") + logger.Debug("started consul datacenter watch") return datacenterWatcher, nil @@ -147,7 +145,7 @@ func (d *datacenterWatcher) updateInstancers(datacenters []string) { } -func updateInactiveDatacenters(items []model.Item, inactiveDatacenters map[string]bool, lock *sync.RWMutex, logger log.Logger) { +func updateInactiveDatacenters(items []model.Item, inactiveDatacenters map[string]bool, lock *sync.RWMutex, logger *zap.Logger) { chrysomMap := make(map[string]bool) for _, item := range items { @@ -157,7 +155,7 @@ func updateInactiveDatacenters(items []model.Item, inactiveDatacenters map[strin err := mapstructure.Decode(item.Data, &df) if err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "failed to decode database results into datacenter filter struct") + logger.Error("failed to decode database results into datacenter filter struct") continue } @@ -189,7 +187,7 @@ func createNewInstancer(keys map[string]bool, instancersToAdd service.Instancers dw.lock.RUnlock() if found { - dw.logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "datacenter set as inactive", "datacenter name: ", datacenter) + dw.logger.Info("datacenter set as inactive", zap.String("datacenter name: ", datacenter)) return } @@ -206,15 +204,10 @@ func createNewInstancer(keys map[string]bool, instancersToAdd service.Instancers // don't create new instancer if it was already created and added to the new instancers map if instancersToAdd.Has(key) { - dw.logger.Log(level.Key(), level.WarnValue(), logging.MessageKey(), "skipping duplicate watch", "service", w.Service, "tags", w.Tags, "passingOnly", w.PassingOnly, "datacenter", w.QueryOptions.Datacenter) + dw.logger.Warn("skipping duplicate watch", zap.String("service", w.Service), zap.Strings("tags", w.Tags), zap.Bool("passingOnly", w.PassingOnly), zap.String("datacenter", w.QueryOptions.Datacenter)) return } // create new instancer and add it to the map of instancers to add instancersToAdd.Set(key, newInstancer(dw.logger, dw.environment.Client(), w)) } - -func getLogger(ctx context.Context) log.Logger { - logger := log.With(logging.GetLogger(ctx), "ts", log.DefaultTimestampUTC, "caller", log.DefaultCaller) - return logger -} diff --git a/service/consul/datacenterWatch_test.go b/service/consul/datacenterWatch_test.go index aa5b8e2a..64fc7d91 100644 --- a/service/consul/datacenterWatch_test.go +++ b/service/consul/datacenterWatch_test.go @@ -7,17 +7,18 @@ import ( "testing" "time" - "github.com/go-kit/kit/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xmidt-org/argus/chrysom" "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service" "github.com/xmidt-org/webpa-common/v2/xmetrics" + "go.uber.org/zap" ) func TestNewDatacenterWatcher(t *testing.T) { - logger := log.NewNopLogger() + logger := sallust.Default() r, err := xmetrics.NewRegistry(nil, Metrics) require.Nil(t, err) envShutdownChan := make(<-chan struct{}) @@ -47,7 +48,7 @@ func TestNewDatacenterWatcher(t *testing.T) { tests := []struct { description string - logger log.Logger + logger *zap.Logger environment Environment options Options ctx context.Context @@ -157,7 +158,7 @@ func TestNewDatacenterWatcher(t *testing.T) { DatacenterWatchInterval: 10 * time.Second, }, expectedWatcher: &datacenterWatcher{ - logger: defaultLogger, + logger: sallust.Default(), environment: environment{ mockServiceEnvironment, new(mockClient), }, @@ -249,7 +250,7 @@ func TestNewDatacenterWatcher(t *testing.T) { } func TestUpdateInactiveDatacenters(t *testing.T) { - logger := log.NewNopLogger() + logger := sallust.Default() tests := []struct { description string diff --git a/service/consul/environment.go b/service/consul/environment.go index 31e24741..5a84e5e5 100644 --- a/service/consul/environment.go +++ b/service/consul/environment.go @@ -7,18 +7,17 @@ import ( "fmt" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/sd" gokitconsul "github.com/go-kit/kit/sd/consul" "github.com/go-kit/kit/util/conn" "github.com/hashicorp/consul/api" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service" + "go.uber.org/zap" ) var ( - errNoDatacenters = errors.New("Could not acquire datacenters") + errNoDatacenters = errors.New("could not acquire datacenters") ) // Environment is a consul-specific interface for the service discovery environment. @@ -83,13 +82,13 @@ func defaultClientFactory(client *api.Client) (Client, ttlUpdater) { var clientFactory = defaultClientFactory -func getDatacenters(l log.Logger, c Client, co Options) ([]string, error) { +func getDatacenters(l *zap.Logger, c Client, co Options) ([]string, error) { datacenters, err := c.Datacenters() if err == nil { return datacenters, nil } - l.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "Could not acquire datacenters on initial attempt", logging.ErrorKey(), err) + l.Error("Could not acquire datacenters on initial attempt", zap.Error(err)) d := 30 * time.Millisecond for retry := 0; retry < co.datacenterRetries(); retry++ { @@ -101,13 +100,13 @@ func getDatacenters(l log.Logger, c Client, co Options) ([]string, error) { return datacenters, nil } - l.Log(level.Key(), level.ErrorValue(), "retryCount", retry, logging.MessageKey(), "Could not acquire datacenters", logging.ErrorKey(), err) + l.Error("Could not acquire datacenters", zap.Int("retryCount", retry), zap.Error(err)) } return nil, errNoDatacenters } -func newInstancer(l log.Logger, c Client, w Watch) sd.Instancer { +func newInstancer(l *zap.Logger, c Client, w Watch) sd.Instancer { return service.NewContextualInstancer( NewInstancer(InstancerOptions{ Client: c, @@ -126,7 +125,7 @@ func newInstancer(l log.Logger, c Client, w Watch) sd.Instancer { ) } -func newInstancers(l log.Logger, c Client, co Options) (i service.Instancers, err error) { +func newInstancers(l *zap.Logger, c Client, co Options) (i service.Instancers, err error) { var datacenters []string for _, w := range co.watches() { if w.CrossDatacenter { @@ -141,7 +140,7 @@ func newInstancers(l log.Logger, c Client, co Options) (i service.Instancers, er w.QueryOptions.Datacenter = datacenter key := newInstancerKey(w) if i.Has(key) { - l.Log(level.Key(), level.WarnValue(), logging.MessageKey(), "skipping duplicate watch", "service", w.Service, "tags", w.Tags, "passingOnly", w.PassingOnly, "datacenter", w.QueryOptions.Datacenter) + l.Warn("skipping duplicate watch", zap.String("service", w.Service), zap.Strings("tags", w.Tags), zap.Bool("passingOnly", w.PassingOnly), zap.String("datacenter", w.QueryOptions.Datacenter)) continue } i.Set(key, newInstancer(l, c, w)) @@ -149,7 +148,7 @@ func newInstancers(l log.Logger, c Client, co Options) (i service.Instancers, er } else { key := newInstancerKey(w) if i.Has(key) { - l.Log(level.Key(), level.WarnValue(), logging.MessageKey(), "skipping duplicate watch", "service", w.Service, "tags", w.Tags, "passingOnly", w.PassingOnly, "datacenter", w.QueryOptions.Datacenter) + l.Warn("skipping duplicate watch", zap.String("service", w.Service), zap.Strings("tags", w.Tags), zap.Bool("passingOnly", w.PassingOnly), zap.String("datacenter", w.QueryOptions.Datacenter)) continue } i.Set(key, newInstancer(l, c, w)) @@ -159,12 +158,12 @@ func newInstancers(l log.Logger, c Client, co Options) (i service.Instancers, er return } -func newRegistrars(l log.Logger, registrationScheme string, c gokitconsul.Client, u ttlUpdater, co Options) (r service.Registrars, closer func() error, err error) { +func newRegistrars(l *zap.Logger, registrationScheme string, c gokitconsul.Client, u ttlUpdater, co Options) (r service.Registrars, closer func() error, err error) { var consulRegistrar sd.Registrar for _, registration := range co.registrations() { instance := service.FormatInstance(registrationScheme, registration.Address, registration.Port) if r.Has(instance) { - l.Log(level.Key(), level.WarnValue(), logging.MessageKey(), "skipping duplicate registration", "instance", instance) + l.Warn("skipping duplicate registration", zap.String("instance", instance)) continue } @@ -172,7 +171,7 @@ func newRegistrars(l log.Logger, registrationScheme string, c gokitconsul.Client ensureIDs(®istration) } - consulRegistrar, err = NewRegistrar(c, u, ®istration, log.With(l, "id", registration.ID, "instance", instance)) + consulRegistrar, err = NewRegistrar(c, u, ®istration, l.With(zap.String("id", registration.ID), zap.String("instance", instance))) if err != nil { return } @@ -183,9 +182,9 @@ func newRegistrars(l log.Logger, registrationScheme string, c gokitconsul.Client return } -func NewEnvironment(l log.Logger, registrationScheme string, co Options, eo ...service.Option) (service.Environment, error) { +func NewEnvironment(l *zap.Logger, registrationScheme string, co Options, eo ...service.Option) (service.Environment, error) { if l == nil { - l = logging.DefaultLogger() + l = sallust.Default() } if len(co.Watches) == 0 && len(co.Registrations) == 0 { @@ -220,7 +219,7 @@ func NewEnvironment(l log.Logger, registrationScheme string, co Options, eo ...s if co.DatacenterWatchInterval > 0 || (len(co.Chrysom.Bucket) > 0 && co.Chrysom.Listen.PullInterval > 0) { _, err := newDatacenterWatcher(l, newServiceEnvironment, co) if err != nil { - l.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "Could not create datacenter watcher", logging.ErrorKey(), err) + l.Error("Could not create datacenter watcher", zap.Error(err)) } } diff --git a/service/consul/environment_test.go b/service/consul/environment_test.go index e5166e47..08260914 100644 --- a/service/consul/environment_test.go +++ b/service/consul/environment_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service" ) @@ -61,7 +61,7 @@ func testNewEnvironmentFull(t *testing.T) { assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() clientFactory = prepareMockClientFactory() client = new(mockClient) ttlUpdater = new(mockTTLUpdater) diff --git a/service/consul/instancer.go b/service/consul/instancer.go index d6c061b1..eddf9d75 100644 --- a/service/consul/instancer.go +++ b/service/consul/instancer.go @@ -8,12 +8,11 @@ import ( "sync" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/sd" "github.com/go-kit/kit/util/conn" "github.com/hashicorp/consul/api" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" + "go.uber.org/zap" ) var ( @@ -24,7 +23,7 @@ var ( type InstancerOptions struct { Client Client - Logger log.Logger + Logger *zap.Logger Service string Tags []string PassingOnly bool @@ -33,12 +32,12 @@ type InstancerOptions struct { func NewInstancer(o InstancerOptions) sd.Instancer { if o.Logger == nil { - o.Logger = logging.DefaultLogger() + o.Logger = sallust.Default() } i := &instancer{ client: o.Client, - logger: log.With(o.Logger, "service", o.Service, "tags", fmt.Sprint(o.Tags), "passingOnly", o.PassingOnly, "datacenter", o.QueryOptions.Datacenter), + logger: o.Logger.With(zap.String("service", o.Service), zap.Strings("tags", o.Tags), zap.Bool("passingOnly", o.PassingOnly), zap.String("datacenter", o.QueryOptions.Datacenter)), service: o.Service, passingOnly: o.PassingOnly, queryOptions: o.QueryOptions, @@ -56,9 +55,9 @@ func NewInstancer(o InstancerOptions) sd.Instancer { // grab the initial set of instances instances, index, err := i.getInstances(0, nil) if err == nil { - i.logger.Log(level.Key(), level.InfoValue(), "instances", len(instances)) + i.logger.Info("instances", zap.Int("instances", len(instances))) } else { - i.logger.Log(level.Key(), level.ErrorValue(), logging.ErrorKey(), err) + i.logger.Error(err.Error(), zap.Error(err)) } i.update(sd.Event{Instances: instances, Err: err}) @@ -69,7 +68,7 @@ func NewInstancer(o InstancerOptions) sd.Instancer { type instancer struct { client Client - logger log.Logger + logger *zap.Logger service string tag string @@ -114,7 +113,7 @@ func (i *instancer) loop(lastIndex uint64) { return case err != nil: - i.logger.Log(logging.ErrorKey(), err) + i.logger.Error(err.Error(), zap.Error(err)) // TODO: this is not recommended, but it was a port of go-kit // Put in a token bucket here with a wait, instead of time.Sleep diff --git a/service/consul/registrar.go b/service/consul/registrar.go index 28a83f8d..063a49e5 100644 --- a/service/consul/registrar.go +++ b/service/consul/registrar.go @@ -5,12 +5,11 @@ import ( "sync" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/sd" gokitconsul "github.com/go-kit/kit/sd/consul" "github.com/hashicorp/consul/api" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust/sallustkit" + "go.uber.org/zap" ) // passFormat returns a closure that produces the output for a passing TTL, given the current system time @@ -44,7 +43,7 @@ type ttlUpdater interface { type ttlCheck struct { checkID string interval time.Duration - logger log.Logger + logger *zap.Logger passFormat func(time.Time) string failFormat func(time.Time) string } @@ -54,11 +53,11 @@ func (tc ttlCheck) updatePeriodically(updater ttlUpdater, shutdown <-chan struct defer stop() defer func() { if err := updater.UpdateTTL(tc.checkID, tc.failFormat(time.Now()), "fail"); err != nil { - tc.logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "error while updating TTL to critical", logging.ErrorKey(), err) + tc.logger.Error("error while updating TTL to critical", zap.Error(err)) } }() - tc.logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "starting TTL updater") + tc.logger.Info("starting TTL updater") // we log an error only on the first error, and then an info message if and when the update recovers. // this avoids filling up the server's logs with what are almost certainly just duplicate errors over and over. @@ -70,15 +69,15 @@ func (tc ttlCheck) updatePeriodically(updater ttlUpdater, shutdown <-chan struct if err := updater.UpdateTTL(tc.checkID, tc.passFormat(t), "pass"); err != nil { successiveErrorCount++ if successiveErrorCount == 1 { - tc.logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "error while updating TTL to passing", logging.ErrorKey(), err) + tc.logger.Error("error while updating TTL to passing", zap.Error(err)) } } else if successiveErrorCount > 0 { - tc.logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "update TTL success", "previousErrorCount", successiveErrorCount) + tc.logger.Info("update TTL success", zap.Int("previousErrorCount", successiveErrorCount)) successiveErrorCount = 0 } case <-shutdown: - tc.logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "TTL updater shutdown") + tc.logger.Error("TTL updater shutdown") return } } @@ -86,7 +85,7 @@ func (tc ttlCheck) updatePeriodically(updater ttlUpdater, shutdown <-chan struct // appendTTLCheck conditionally creates a ttlCheck for the given agent check if and only if the agent check is configured with a TTL. // If the agent check is nil or has no TTL, this function returns ttlChecks unmodified with no error. -func appendTTLCheck(logger log.Logger, serviceID string, agentCheck *api.AgentServiceCheck, ttlChecks []ttlCheck) ([]ttlCheck, error) { +func appendTTLCheck(logger *zap.Logger, serviceID string, agentCheck *api.AgentServiceCheck, ttlChecks []ttlCheck) ([]ttlCheck, error) { if agentCheck == nil || len(agentCheck.TTL) == 0 { return ttlChecks, nil } @@ -106,12 +105,11 @@ func appendTTLCheck(logger log.Logger, serviceID string, agentCheck *api.AgentSe ttlCheck{ checkID: agentCheck.CheckID, interval: interval, - logger: log.With( - logger, - "serviceID", serviceID, - "checkID", agentCheck.CheckID, - "ttl", agentCheck.TTL, - "interval", interval.String(), + logger: logger.With( + zap.String("serviceID", serviceID), + zap.String("checkID", agentCheck.CheckID), + zap.String("ttl", agentCheck.TTL), + zap.String("interval", interval.String()), ), passFormat: passFormat(serviceID), failFormat: failFormat(serviceID), @@ -125,7 +123,7 @@ func appendTTLCheck(logger log.Logger, serviceID string, agentCheck *api.AgentSe // When Register is called, a goroutine is spawned for each TTL check that invokes UpdateTTL on an interval. // When Dereigster is called, any goroutines spawned are stopped and each check is set to fail (critical). type ttlRegistrar struct { - logger log.Logger + logger *zap.Logger serviceID string registrar sd.Registrar updater ttlUpdater @@ -136,7 +134,7 @@ type ttlRegistrar struct { } // NewRegistrar creates an sd.Registrar, binding any TTL checks to the Register/Deregister lifecycle as needed. -func NewRegistrar(c gokitconsul.Client, u ttlUpdater, r *api.AgentServiceRegistration, logger log.Logger) (sd.Registrar, error) { +func NewRegistrar(c gokitconsul.Client, u ttlUpdater, r *api.AgentServiceRegistration, logger *zap.Logger) (sd.Registrar, error) { var ( ttlChecks []ttlCheck err error @@ -154,7 +152,7 @@ func NewRegistrar(c gokitconsul.Client, u ttlUpdater, r *api.AgentServiceRegistr } } - var registrar sd.Registrar = gokitconsul.NewRegistrar(c, r, logger) + var registrar sd.Registrar = gokitconsul.NewRegistrar(c, r, sallustkit.Logger{Zap: logger}) // decorate the given registrar if we have any TTL checks if len(ttlChecks) > 0 { diff --git a/service/consul/registrar_test.go b/service/consul/registrar_test.go index 29d8e8b4..0ffa0a7b 100644 --- a/service/consul/registrar_test.go +++ b/service/consul/registrar_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func TestDefaultTickerFactory(t *testing.T) { @@ -34,7 +34,7 @@ func testNewRegistrarNoChecks(t *testing.T) { var ( require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() client = new(mockClient) ttlUpdater = new(mockTTLUpdater) tickerFactory = prepareMockTickerFactory() @@ -76,7 +76,7 @@ func testNewRegistrarNoTTL(t *testing.T) { var ( require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() client = new(mockClient) ttlUpdater = new(mockTTLUpdater) tickerFactory = prepareMockTickerFactory() @@ -128,7 +128,7 @@ func testNewRegistrarCheckMalformedTTL(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() client = new(mockClient) ttlUpdater = new(mockTTLUpdater) tickerFactory = prepareMockTickerFactory() @@ -159,7 +159,7 @@ func testNewRegistrarCheckTTLTooSmall(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() client = new(mockClient) ttlUpdater = new(mockTTLUpdater) tickerFactory = prepareMockTickerFactory() @@ -190,7 +190,7 @@ func testNewRegistrarChecksMalformedTTL(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() client = new(mockClient) ttlUpdater = new(mockTTLUpdater) tickerFactory = prepareMockTickerFactory() @@ -223,7 +223,7 @@ func testNewRegistrarChecksTTLTooSmall(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() client = new(mockClient) ttlUpdater = new(mockTTLUpdater) tickerFactory = prepareMockTickerFactory() @@ -257,7 +257,7 @@ func testNewRegistrarTTL(t *testing.T) { assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() client = new(mockClient) ttlUpdater = new(mockTTLUpdater) tickerFactory = prepareMockTickerFactory() From b7fb9a69bd796e74eb419a032368ca9580fe032f Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:18:57 -0400 Subject: [PATCH 31/48] Update service package --- service/instancers_test.go | 48 -------------------------------------- 1 file changed, 48 deletions(-) diff --git a/service/instancers_test.go b/service/instancers_test.go index 2e6622d8..c6cb03eb 100644 --- a/service/instancers_test.go +++ b/service/instancers_test.go @@ -5,56 +5,8 @@ import ( "github.com/go-kit/kit/sd" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" ) -func testNewContextualInstancerEmpty(t *testing.T, m map[string]interface{}) { - var ( - assert = assert.New(t) - next = new(MockInstancer) - ) - - i := NewContextualInstancer(next, m) - assert.Equal(next, i) - _, ok := i.(logging.Contextual) - assert.False(ok) - - next.AssertExpectations(t) -} - -func testNewContextualInstancerWithMetadata(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - - next = new(MockInstancer) - m = map[string]interface{}{"key": "value"} - ) - - i := NewContextualInstancer(next, m) - require.NotNil(i) - assert.NotEqual(next, i) - - c, ok := i.(logging.Contextual) - require.True(ok) - require.NotNil(c) - - assert.Equal(m, c.Metadata()) -} - -func TestNewContextualInstancer(t *testing.T) { - t.Run("Empty", func(t *testing.T) { - testNewContextualInstancerEmpty(t, map[string]interface{}{}) - }) - - t.Run("Nil", func(t *testing.T) { - testNewContextualInstancerEmpty(t, nil) - }) - - t.Run("WithMetadata", testNewContextualInstancerWithMetadata) -} - func testInstancers(t *testing.T, is Instancers) { assert := assert.New(t) From 344cd127695839c8e233d85fd8e6b31fef23bb85 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:19:12 -0400 Subject: [PATCH 32/48] Update monitor package --- service/monitor/listener.go | 21 ++++++++++----------- service/monitor/listener_test.go | 14 +++++++------- service/monitor/monitor_test.go | 6 +++--- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/service/monitor/listener.go b/service/monitor/listener.go index 0de87eb4..8219a143 100644 --- a/service/monitor/listener.go +++ b/service/monitor/listener.go @@ -4,12 +4,11 @@ import ( "sync/atomic" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/metrics/provider" "github.com/go-kit/kit/sd" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service" + "go.uber.org/zap" ) // Event carries the same information as go-kit's sd.Event, but with the extra Key that identifies @@ -24,8 +23,7 @@ type Event struct { // This value is used by listeners to update metric labels. Service string - // Instancer is the go-kit sd.Instancer which sent this event. This instance can be used to enrich - // logging via logging.Enrich. + // Instancer is the go-kit sd.Instancer which sent this event. This instance can be used to enrich logging Instancer sd.Instancer // EventCount is the postive, ascending integer identifying this event's sequence, e.g. 1 refers to the first @@ -92,8 +90,9 @@ func NewMetricsListener(p provider.Provider) Listener { // If the AccessorFactory is nil, DefaultAccessorFactory is used. If the next closure is nil, this function panics. // // An UpdatableAccessor may directly be used to receive events by passing Update as the next closure: -// ua := new(UpdatableAccessor) -// l := NewAccessorListener(f, ua.Update) +// +// ua := new(UpdatableAccessor) +// l := NewAccessorListener(f, ua.Update) func NewAccessorListener(f service.AccessorFactory, next func(service.Accessor, error)) Listener { if next == nil { panic("A next closure is required to receive Accessors") @@ -149,9 +148,9 @@ const ( // Upon the first successful update, or on any successful update following one or more errors, the given // registrar is registered. Any error that follows a successful update, or on the first error, results // in deregistration. -func NewRegistrarListener(logger log.Logger, r sd.Registrar, initiallyRegistered bool) Listener { +func NewRegistrarListener(logger *zap.Logger, r sd.Registrar, initiallyRegistered bool) Listener { if logger == nil { - logger = logging.DefaultLogger() + logger = sallust.Default() } if r == nil { @@ -171,7 +170,7 @@ func NewRegistrarListener(logger log.Logger, r sd.Registrar, initiallyRegistered message = "deregistering due to monitor being stopped" } else { if atomic.CompareAndSwapUint32(&state, stateDeregistered, stateRegistered) { - logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "registering on service discovery update") + logger.Info("registering on service discovery update") r.Register() } @@ -179,7 +178,7 @@ func NewRegistrarListener(logger log.Logger, r sd.Registrar, initiallyRegistered } if atomic.CompareAndSwapUint32(&state, stateRegistered, stateDeregistered) { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), message, logging.ErrorKey(), e.Err, "stopped", e.Stopped) + logger.Error(message, zap.Error(e.Err), zap.Bool("stopped", e.Stopped)) r.Deregister() } }) diff --git a/service/monitor/listener_test.go b/service/monitor/listener_test.go index b217b18e..c65f74ea 100644 --- a/service/monitor/listener_test.go +++ b/service/monitor/listener_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" - "github.com/go-kit/kit/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service" "github.com/xmidt-org/webpa-common/v2/xmetrics/xmetricstest" + "go.uber.org/zap" ) func TestListenerFunc(t *testing.T) { @@ -222,7 +222,7 @@ func TestNewAccessorListener(t *testing.T) { func testNewRegistrarListenerNilRegistrar(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() ) assert.Panics(func() { @@ -234,7 +234,7 @@ func testNewRegistrarListenerNilRegistrar(t *testing.T) { }) } -func testNewRegistrarListenerInitiallyDeregistered(t *testing.T, logger log.Logger) { +func testNewRegistrarListenerInitiallyDeregistered(t *testing.T, logger *zap.Logger) { var ( require = require.New(t) registrar = new(service.MockRegistrar) @@ -285,7 +285,7 @@ func testNewRegistrarListenerInitiallyDeregistered(t *testing.T, logger log.Logg registrar.AssertExpectations(t) } -func testNewRegistrarListenerInitiallyRegistered(t *testing.T, logger log.Logger) { +func testNewRegistrarListenerInitiallyRegistered(t *testing.T, logger *zap.Logger) { var ( require = require.New(t) registrar = new(service.MockRegistrar) @@ -341,7 +341,7 @@ func TestNewRegistrarListener(t *testing.T) { }) t.Run("WithLogger", func(t *testing.T) { - testNewRegistrarListenerInitiallyDeregistered(t, logging.NewTestLogger(nil, t)) + testNewRegistrarListenerInitiallyDeregistered(t, sallust.Default()) }) }) @@ -351,7 +351,7 @@ func TestNewRegistrarListener(t *testing.T) { }) t.Run("WithLogger", func(t *testing.T) { - testNewRegistrarListenerInitiallyRegistered(t, logging.NewTestLogger(nil, t)) + testNewRegistrarListenerInitiallyRegistered(t, sallust.Default()) }) }) } diff --git a/service/monitor/monitor_test.go b/service/monitor/monitor_test.go index a4fedd71..dd9d07d5 100644 --- a/service/monitor/monitor_test.go +++ b/service/monitor/monitor_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service" ) @@ -33,7 +33,7 @@ func testNewStop(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() instancer = new(service.MockInstancer) listener = new(mockListener) @@ -150,7 +150,7 @@ func testNewWithEnvironment(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() instancer = new(service.MockInstancer) listener = new(mockListener) From d211d0c66f3f3da00ef4496200af334cbe89249f Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:19:38 -0400 Subject: [PATCH 33/48] Update servicecfg package --- service/servicecfg/environment_test.go | 14 +++++++------- service/servicehttp/hashFilter.go | 6 +++--- service/servicehttp/hashFilter_test.go | 6 +++--- service/servicehttp/redirect.go | 8 ++++---- service/servicehttp/redirectHandler.go | 12 ++++++------ service/servicehttp/redirect_test.go | 6 +++--- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/service/servicecfg/environment_test.go b/service/servicecfg/environment_test.go index 443c1f77..b18345a9 100644 --- a/service/servicecfg/environment_test.go +++ b/service/servicecfg/environment_test.go @@ -6,16 +6,16 @@ import ( "testing" "time" - "github.com/go-kit/kit/log" "github.com/hashicorp/consul/api" "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service" "github.com/xmidt-org/webpa-common/v2/service/consul" "github.com/xmidt-org/webpa-common/v2/service/zk" "github.com/xmidt-org/webpa-common/v2/xviper" + "go.uber.org/zap" ) func testNewEnvironmentEmpty(t *testing.T) { @@ -46,7 +46,7 @@ func testNewEnvironmentFixed(t *testing.T) { assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() v = viper.New() configuration = strings.NewReader(` @@ -77,7 +77,7 @@ func testNewEnvironmentZookeeper(t *testing.T) { assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() v = viper.New() expectedEnvironment = service.NewEnvironment() @@ -99,7 +99,7 @@ func testNewEnvironmentZookeeper(t *testing.T) { v.SetConfigType("json") require.NoError(v.ReadConfig(configuration)) - zookeeperEnvironmentFactory = func(l log.Logger, zo zk.Options, eo ...service.Option) (service.Environment, error) { + zookeeperEnvironmentFactory = func(l *zap.Logger, zo zk.Options, eo ...service.Option) (service.Environment, error) { assert.Equal(logger, l) assert.Equal( zk.Options{ @@ -131,7 +131,7 @@ func testNewEnvironmentConsul(t *testing.T) { assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() v = viper.New() expectedEnvironment = service.NewEnvironment() @@ -175,7 +175,7 @@ func testNewEnvironmentConsul(t *testing.T) { v.SetConfigType("json") require.NoError(v.ReadConfig(configuration)) - consulEnvironmentFactory = func(l log.Logger, registrationScheme string, co consul.Options, eo ...service.Option) (service.Environment, error) { + consulEnvironmentFactory = func(l *zap.Logger, registrationScheme string, co consul.Options, eo ...service.Option) (service.Environment, error) { assert.Equal(logger, l) assert.Equal( consul.Options{ diff --git a/service/servicehttp/hashFilter.go b/service/servicehttp/hashFilter.go index 241ca0d6..1c3801db 100644 --- a/service/servicehttp/hashFilter.go +++ b/service/servicehttp/hashFilter.go @@ -3,11 +3,11 @@ package servicehttp import ( "net/http" - "github.com/go-kit/kit/log/level" + "github.com/xmidt-org/sallust/sallusthttp" "github.com/xmidt-org/webpa-common/v2/device" - "github.com/xmidt-org/webpa-common/v2/logging" "github.com/xmidt-org/webpa-common/v2/service" "github.com/xmidt-org/webpa-common/v2/xhttp/xfilter" + "go.uber.org/zap" ) // NewHashFilter constructs an xfilter that enforces device hashing to an instance that represents this server process. @@ -39,7 +39,7 @@ func NewHashFilter(a service.Accessor, reject error, self func(string) bool) xfi } if !self(i) { - logging.GetLogger(r.Context()).Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "device does not hash to this instance", "hashKey", string(key), logging.ErrorKey(), reject, "instance", i) + sallusthttp.Get(r).Error("device does not hash to this instance", zap.String("hashKey", string(key)), zap.Error(reject), zap.String("instance", i)) return reject } diff --git a/service/servicehttp/hashFilter_test.go b/service/servicehttp/hashFilter_test.go index 72f90a35..f368a7b8 100644 --- a/service/servicehttp/hashFilter_test.go +++ b/service/servicehttp/hashFilter_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/device" - "github.com/xmidt-org/webpa-common/v2/logging" "github.com/xmidt-org/webpa-common/v2/service" ) @@ -129,7 +129,7 @@ func testNewHashFilterAllow(t *testing.T) { id = device.IntToMAC(47283) expectedInstance = "instance" - ctx = logging.WithLogger(context.Background(), logging.NewTestLogger(nil, t)) + ctx = sallust.With(context.Background(), sallust.Default()) selfCalled = false self = func(actualInstance string) bool { @@ -160,7 +160,7 @@ func testNewHashFilterReject(t *testing.T) { id = device.IntToMAC(93723) expectedInstance = "instance" - ctx = logging.WithLogger(context.Background(), logging.NewTestLogger(nil, t)) + ctx = sallust.With(context.Background(), sallust.Default()) selfCalled = false self = func(actualInstance string) bool { diff --git a/service/servicehttp/redirect.go b/service/servicehttp/redirect.go index 2952375b..7261f3ee 100644 --- a/service/servicehttp/redirect.go +++ b/service/servicehttp/redirect.go @@ -5,9 +5,9 @@ import ( "net/http" "strings" - "github.com/go-kit/kit/log/level" gokithttp "github.com/go-kit/kit/transport/http" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" + "go.uber.org/zap" ) // Redirect returns a go-kit EncodeResponseFunc that redirects to the instance hashed by the accessor. @@ -20,7 +20,7 @@ func Redirect(redirectCode int) gokithttp.EncodeResponseFunc { return func(ctx context.Context, rw http.ResponseWriter, response interface{}) error { var ( - logger = logging.GetLogger(ctx) + logger = sallust.Get(ctx) instance = response.(string) requestURI, _ = ctx.Value(gokithttp.ContextKeyRequestURI).(string) ) @@ -29,7 +29,7 @@ func Redirect(redirectCode int) gokithttp.EncodeResponseFunc { instance = instance + strings.TrimRight(requestURI, "/") } - logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "redirecting", "instance", instance) + logger.Debug("redirecting", zap.String("instance", instance)) rw.Header().Set("Location", instance) rw.WriteHeader(redirectCode) return nil diff --git a/service/servicehttp/redirectHandler.go b/service/servicehttp/redirectHandler.go index 9da4d3fd..6daab34d 100644 --- a/service/servicehttp/redirectHandler.go +++ b/service/servicehttp/redirectHandler.go @@ -4,9 +4,9 @@ import ( "net/http" "strings" - "github.com/go-kit/kit/log/level" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust/sallusthttp" "github.com/xmidt-org/webpa-common/v2/service" + "go.uber.org/zap" ) // KeyFunc examines an HTTP request and produces the service key to use when finding @@ -30,22 +30,22 @@ type RedirectHandler struct { func (rh *RedirectHandler) ServeHTTP(response http.ResponseWriter, request *http.Request) { key, err := rh.KeyFunc(request) - ctxLogger := logging.GetLogger(request.Context()) + ctxLogger := sallusthttp.Get(request) if err != nil { - ctxLogger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "unable to obtain service key from request", logging.ErrorKey(), err) + ctxLogger.Error("unable to obtain service key from request", zap.Error(err)) http.Error(response, err.Error(), http.StatusBadRequest) return } instance, err := rh.Accessor.Get(key) if err != nil && instance == "" { - ctxLogger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "accessor failed to return an instance", logging.ErrorKey(), err) + ctxLogger.Error("accessor failed to return an instance", zap.Error(err)) http.Error(response, err.Error(), http.StatusInternalServerError) return } instance += strings.TrimRight(request.RequestURI, "/") - ctxLogger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "redirecting", "instance", instance) + ctxLogger.Debug("redirecting", zap.String("instance", instance)) code := rh.RedirectCode if code < 300 { diff --git a/service/servicehttp/redirect_test.go b/service/servicehttp/redirect_test.go index 08950965..5490f153 100644 --- a/service/servicehttp/redirect_test.go +++ b/service/servicehttp/redirect_test.go @@ -9,7 +9,7 @@ import ( gokithttp "github.com/go-kit/kit/transport/http" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func testRedirectNoRequestURI(t *testing.T, expectedRedirectCode, actualRedirectCode int) { @@ -24,7 +24,7 @@ func testRedirectNoRequestURI(t *testing.T, expectedRedirectCode, actualRedirect require.NotNil(encoder) err := encoder( - logging.WithLogger(context.Background(), logging.NewTestLogger(nil, t)), + sallust.With(context.Background(), sallust.Default()), httpResponse, "http://somewhere.com:8080", ) @@ -47,7 +47,7 @@ func testRedirectWithRequestURI(t *testing.T, expectedRedirectCode, actualRedire err := encoder( context.WithValue( - logging.WithLogger(context.Background(), logging.NewTestLogger(nil, t)), + sallust.With(context.Background(), sallust.Default()), gokithttp.ContextKeyRequestURI, "/api/v2/device", ), From 8543ae59326a5956492d937e674d72ddde7cabcd Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:19:49 -0400 Subject: [PATCH 34/48] Update zk package --- service/zk/environment.go | 28 ++++++++++++++-------------- service/zk/environment_test.go | 9 +++++---- service/zk/mocks_test.go | 2 +- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/service/zk/environment.go b/service/zk/environment.go index c95c5a65..36ea7e60 100644 --- a/service/zk/environment.go +++ b/service/zk/environment.go @@ -1,12 +1,12 @@ package zk import ( - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/sd" gokitzk "github.com/go-kit/kit/sd/zk" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" + "github.com/xmidt-org/sallust/sallustkit" "github.com/xmidt-org/webpa-common/v2/service" + "go.uber.org/zap" ) func newService(r Registration) (string, gokitzk.Service) { @@ -27,18 +27,18 @@ func newService(r Registration) (string, gokitzk.Service) { // Tests can change this for mocked behavior. var clientFactory = gokitzk.NewClient -func newClient(l log.Logger, zo Options) (gokitzk.Client, error) { +func newClient(l *zap.Logger, zo Options) (gokitzk.Client, error) { client := zo.client() return clientFactory( client.servers(), - l, + sallustkit.Logger{Zap: l}, gokitzk.ConnectTimeout(client.connectTimeout()), gokitzk.SessionTimeout(client.sessionTimeout()), ) } -func newInstancer(l log.Logger, c gokitzk.Client, path string) (i sd.Instancer, err error) { - i, err = gokitzk.NewInstancer(c, path, l) +func newInstancer(l *zap.Logger, c gokitzk.Client, path string) (i sd.Instancer, err error) { + i, err = gokitzk.NewInstancer(c, path, sallustkit.Logger{Zap: l}) if err == nil { i = service.NewContextualInstancer(i, map[string]interface{}{"path": path}) } @@ -46,10 +46,10 @@ func newInstancer(l log.Logger, c gokitzk.Client, path string) (i sd.Instancer, return } -func newInstancers(l log.Logger, c gokitzk.Client, zo Options) (i service.Instancers, err error) { +func newInstancers(l *zap.Logger, c gokitzk.Client, zo Options) (i service.Instancers, err error) { for _, path := range zo.watches() { if i.Has(path) { - l.Log(level.Key(), level.WarnValue(), logging.MessageKey(), "skipping duplicate watch", "path", path) + l.Warn("skipping duplicate watch", zap.String("path", path)) continue } @@ -67,15 +67,15 @@ func newInstancers(l log.Logger, c gokitzk.Client, zo Options) (i service.Instan return } -func newRegistrars(base log.Logger, c gokitzk.Client, zo Options) (r service.Registrars) { +func newRegistrars(base *zap.Logger, c gokitzk.Client, zo Options) (r service.Registrars) { for _, registration := range zo.registrations() { instance, s := newService(registration) if r.Has(instance) { - base.Log(level.Key(), level.WarnValue(), logging.MessageKey(), "skipping duplicate registration", "instance", instance) + base.Warn("skipping duplicate registration", zap.String("instance", instance)) continue } - r.Add(instance, gokitzk.NewRegistrar(c, s, log.With(base, "instance", instance))) + r.Add(instance, gokitzk.NewRegistrar(c, s, sallustkit.Logger{Zap: base.With(zap.String("instance", instance))})) } return @@ -83,9 +83,9 @@ func newRegistrars(base log.Logger, c gokitzk.Client, zo Options) (r service.Reg // NewEnvironment constructs a Zookeeper-based service.Environment using both a zookeeper Options (typically unmarshaled // from configuration) and an optional extra set of environment options. -func NewEnvironment(l log.Logger, zo Options, eo ...service.Option) (service.Environment, error) { +func NewEnvironment(l *zap.Logger, zo Options, eo ...service.Option) (service.Environment, error) { if l == nil { - l = logging.DefaultLogger() + l = sallust.Default() } if len(zo.Watches) == 0 && len(zo.Registrations) == 0 { diff --git a/service/zk/environment_test.go b/service/zk/environment_test.go index 5db712d4..9ae094cd 100644 --- a/service/zk/environment_test.go +++ b/service/zk/environment_test.go @@ -4,13 +4,14 @@ import ( "errors" "testing" - "github.com/go-kit/kit/log" gokitzk "github.com/go-kit/kit/sd/zk" + "github.com/go-kit/log" "github.com/go-zookeeper/zk" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" + "github.com/xmidt-org/sallust/sallustkit" "github.com/xmidt-org/webpa-common/v2/service" ) @@ -105,7 +106,7 @@ func testNewEnvironmentFull(t *testing.T) { assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallustkit.Logger{Zap: sallust.Default()} clientFactory = prepareMockClientFactory() client = new(mockClient) zkEvents = make(chan zk.Event, 5) @@ -159,7 +160,7 @@ func testNewEnvironmentFull(t *testing.T) { client.On("Stop").Once() - e, err := NewEnvironment(logger, zo) + e, err := NewEnvironment(logger.Zap, zo) require.NoError(err) require.NotNil(e) diff --git a/service/zk/mocks_test.go b/service/zk/mocks_test.go index 4ea428ed..b3841916 100644 --- a/service/zk/mocks_test.go +++ b/service/zk/mocks_test.go @@ -3,8 +3,8 @@ package zk import ( "fmt" - "github.com/go-kit/kit/log" gokitzk "github.com/go-kit/kit/sd/zk" + "github.com/go-kit/log" zkclient "github.com/go-zookeeper/zk" "github.com/stretchr/testify/mock" ) From b5ae033fea2243e09a69410bd37230d68ab8ca7d Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:20:03 -0400 Subject: [PATCH 35/48] Update aws package --- webhook/aws/sns.go | 31 ++++++------ webhook/aws/sns_handler.go | 84 ++++++++++++++++----------------- webhook/aws/sns_handler_test.go | 4 +- 3 files changed, 59 insertions(+), 60 deletions(-) diff --git a/webhook/aws/sns.go b/webhook/aws/sns.go index d8f371c5..4d4b0a0e 100644 --- a/webhook/aws/sns.go +++ b/webhook/aws/sns.go @@ -11,12 +11,11 @@ import ( "sync/atomic" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/gorilla/mux" "github.com/miekg/dns" "github.com/spf13/viper" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" + "go.uber.org/zap" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" @@ -51,7 +50,7 @@ type SNSServer struct { channelSize int64 channelClientTimeout time.Duration - logger log.Logger + logger *zap.Logger metrics AWSMetrics snsNotificationReceivedChan chan int waitForDns time.Duration @@ -60,7 +59,7 @@ type SNSServer struct { // Notifier interface implements the various notification server functionalities // like Subscribe, Unsubscribe, Publish, NotificationHandler type Notifier interface { - Initialize(*mux.Router, *url.URL, string, http.Handler, log.Logger, AWSMetrics, func() time.Time) + Initialize(*mux.Router, *url.URL, string, http.Handler, *zap.Logger, AWSMetrics, func() time.Time) PrepareAndStart() Subscribe() PublishMessage(string) error @@ -126,7 +125,7 @@ func NewNotifier(v *viper.Viper) (Notifier, error) { // handler is the webhook handler to update webhooks @monitor // SNS POST Notification handler will directly update webhooks list func (ss *SNSServer) Initialize(rtr *mux.Router, selfUrl *url.URL, soaProvider string, - handler http.Handler, logger log.Logger, metrics AWSMetrics, now func() time.Time) { + handler http.Handler, logger *zap.Logger, metrics AWSMetrics, now func() time.Time) { if rtr == nil { //creating new mux router @@ -164,15 +163,15 @@ func (ss *SNSServer) Initialize(rtr *mux.Router, selfUrl *url.URL, soaProvider s // set up logger if logger == nil { - logger = logging.DefaultLogger() + logger = sallust.Default() } - ss.logger = log.WithPrefix(logger, level.Key(), level.ErrorValue()) + ss.logger = logger ss.metrics = metrics ss.snsNotificationReceivedChan = ss.SNSNotificationReceivedInit() - ss.logger.Log("selfURL", ss.SelfUrl.String(), "protocol", ss.SelfUrl.Scheme) + ss.logger.Info("self url", zap.String("selfURL", ss.SelfUrl.String()), zap.String("protocol", ss.SelfUrl.Scheme)) // Set various SNS POST routes ss.SetSNSRoutes(urlPath, rtr, handler) @@ -243,8 +242,8 @@ func (ss *SNSServer) DnsReady() (e error) { } // otherwise, we keep trying ss.metrics.DnsReadyQueryCount.Add(1.0) - ss.logger.Log(logging.MessageKey(), "checking if server's DNS is ready", - "endpoint", strings.SplitN(ss.SelfUrl.Host, ":", 2)[0]+".", logging.ErrorKey(), err, "response", response) + ss.logger.Info("checking if server's DNS is ready", + zap.String("endpoint", strings.SplitN(ss.SelfUrl.Host, ":", 2)[0]+"."), zap.Error(err), zap.Any("response", response)) time.Sleep(time.Second) } }(channel) @@ -265,15 +264,15 @@ func (ss *SNSServer) DnsReady() (e error) { func (ss *SNSServer) ValidateSubscriptionArn(reqSubscriptionArn string) bool { if ss.subscriptionArn.Load() == nil { - ss.logger.Log(logging.MessageKey(), "SNS subscriptionArn is nil") + ss.logger.Info("SNS subscriptionArn is nil") return false } else if strings.EqualFold(reqSubscriptionArn, ss.subscriptionArn.Load().(string)) { return true } else { - ss.logger.Log( - logging.MessageKey(), "SNS Invalid subscription", - "reqSubscriptionArn", reqSubscriptionArn, - "cfg", ss.subscriptionArn.Load().(string), + ss.logger.Info( + "SNS Invalid subscription", + zap.String("reqSubscriptionArn", reqSubscriptionArn), + zap.String("cfg", ss.subscriptionArn.Load().(string)), ) return false } diff --git a/webhook/aws/sns_handler.go b/webhook/aws/sns_handler.go index a2ac792d..bbf207e9 100644 --- a/webhook/aws/sns_handler.go +++ b/webhook/aws/sns_handler.go @@ -12,8 +12,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sns" "github.com/gorilla/mux" - "github.com/xmidt-org/webpa-common/v2/logging" "github.com/xmidt-org/webpa-common/v2/xhttp" + "go.uber.org/zap" ) const ( @@ -96,11 +96,11 @@ func (ss *SNSServer) SetSNSRoutes(urlPath string, r *mux.Router, handler http.Ha r.HandleFunc(urlPath, ss.SubscribeConfirmHandle).Methods("POST").Headers("x-amz-sns-message-type", "SubscriptionConfirmation") if handler != nil { - ss.logger.Log(logging.MessageKey(), "handler not nil", "urlPath", urlPath) + ss.logger.Info("handler not nil", zap.String("urlPath", urlPath)) // handler is supposed to be wrapper that inturn calls NotificationHandle r.Handle(urlPath, handler).Methods("POST").Headers("x-amz-sns-message-type", "Notification") } else { - ss.logger.Log(logging.MessageKey(), "handler nil", "urlPath", urlPath) + ss.logger.Info("handler nil", zap.String("urlPath", urlPath)) // if no wrapper handler available then define anonymous handler and directly call NotificationHandle r.HandleFunc(urlPath, func(rw http.ResponseWriter, req *http.Request) { ss.NotificationHandle(rw, req) @@ -117,7 +117,7 @@ func (ss *SNSServer) Subscribe() { Endpoint: aws.String(ss.SelfUrl.String()), } - ss.logger.Log("subscribeParams", params) + ss.logger.Info("subscribe", zap.Any("subscribeParams", params)) failCounter := ss.metrics.SNSSubscribeAttempt.With("code", "failure") okayCounter := ss.metrics.SNSSubscribeAttempt.With("code", "okay") @@ -130,7 +130,7 @@ func (ss *SNSServer) Subscribe() { } else { failCounter.Add(1.0) attemptNum := 1 - ss.logger.Log(logging.MessageKey(), "SNS subscribe error", "attempt", attemptNum, logging.ErrorKey(), err) + ss.logger.Error("SNS subscribe error", zap.Int("attempt", attemptNum), zap.Error(err)) attemptNum++ // this is so tests do not timeout @@ -145,7 +145,7 @@ func (ss *SNSServer) Subscribe() { resp, err = ss.SVC.Subscribe(params) if err != nil { failCounter.Add(1.0) - ss.logger.Log(logging.MessageKey(), "SNS subscribe error", "attempt", attemptNum, logging.ErrorKey(), err) + ss.logger.Error("SNS subscribe error", zap.Int("attempt", attemptNum), zap.Error(err)) } else { okayCounter.Add(1.0) break @@ -155,7 +155,7 @@ func (ss *SNSServer) Subscribe() { } } - ss.logger.Log("subscribeResponse", resp, logging.MessageKey(), "SNS is not yet ready", "subscriptionArn", *resp.SubscriptionArn) + ss.logger.Info("SNS is not yet ready", zap.Any("subscribeResponse", resp), zap.Stringp("subscriptionArn", resp.SubscriptionArn)) } // POST handler to receive SNS Confirmation Message @@ -165,7 +165,7 @@ func (ss *SNSServer) SubscribeConfirmHandle(rw http.ResponseWriter, req *http.Re raw, err := DecodeJSONMessage(req, msg) if err != nil { - ss.logger.Log(logging.MessageKey(), "SNS read req body error", logging.ErrorKey(), err) + ss.logger.Error("SNS read req body error", zap.Error(err)) xhttp.WriteError(rw, http.StatusBadRequest, "request body error") return } @@ -173,27 +173,27 @@ func (ss *SNSServer) SubscribeConfirmHandle(rw http.ResponseWriter, req *http.Re // Verify SNS Message authenticity by verifying signature valid, v_err := ss.Validate(msg) if !valid || v_err != nil { - ss.logger.Log(logging.MessageKey(), "SNS signature validation error", logging.ErrorKey(), v_err) + ss.logger.Error("SNS signature validation error", zap.Error(v_err)) xhttp.WriteError(rw, http.StatusBadRequest, SNS_VALIDATION_ERR) return } // Validate that SubscriptionConfirmation is for the topic you desire to subscribe to if !strings.EqualFold(msg.TopicArn, ss.Config.Sns.TopicArn) { - ss.logger.Log( - logging.MessageKey(), "SNS subscription confirmation TopicArn mismatch", - "received", msg.TopicArn, - "expected", ss.Config.Sns.TopicArn) + ss.logger.Info( + "SNS subscription confirmation TopicArn mismatch", + zap.String("received", msg.TopicArn), + zap.String("expected", ss.Config.Sns.TopicArn)) xhttp.WriteError(rw, http.StatusBadRequest, "TopicArn does not match") return } // TODO: health.SendEvent(HTH.Set("TotalDataPayloadReceived", int(len(raw)) )) - ss.logger.Log( - logging.MessageKey(), "SNS confirmation payload", - "raw", string(raw), - "msg", msg, + ss.logger.Info( + "SNS confirmation payload", + zap.String("raw", string(raw)), + zap.Any("msg", msg), ) params := &sns.ConfirmSubscriptionInput{ @@ -202,15 +202,15 @@ func (ss *SNSServer) SubscribeConfirmHandle(rw http.ResponseWriter, req *http.Re } resp, err := ss.SVC.ConfirmSubscription(params) if err != nil { - ss.logger.Log(logging.MessageKey(), "SNS confirm error", logging.ErrorKey(), err) + ss.logger.Error("SNS confirm error", zap.Error(err)) // TODO return error response return } - ss.logger.Log(logging.MessageKey(), "SNS confirm response", "response", resp) + ss.logger.Info("SNS confirm response", zap.Any("response", resp)) ss.subscriptionArn.Store(*resp.SubscriptionArn) - ss.logger.Log(logging.MessageKey(), "SNS is ready", "subscriptionArn", *resp.SubscriptionArn) + ss.logger.Info("SNS is ready", zap.String("subscriptionArn", *resp.SubscriptionArn)) ss.metrics.SNSSubscribed.Add(1.0) // start listenAndPublishMessage go routine @@ -237,7 +237,7 @@ func (ss *SNSServer) NotificationHandle(rw http.ResponseWriter, req *http.Reques raw, err := DecodeJSONMessage(req, msg) if err != nil { - ss.logger.Log(logging.MessageKey(), "SNS read req body error", logging.ErrorKey(), err) + ss.logger.Error("SNS read req body error", zap.Error(err)) xhttp.WriteError(rw, http.StatusBadRequest, "request body error") ss.SNSNotificationReceivedCounter(http.StatusBadRequest) return nil @@ -246,25 +246,25 @@ func (ss *SNSServer) NotificationHandle(rw http.ResponseWriter, req *http.Reques // Verify SNS Message authenticity by verifying signature valid, v_err := ss.Validate(msg) if !valid || v_err != nil { - ss.logger.Log(logging.MessageKey(), "SNS signature validation error", logging.ErrorKey(), v_err) + ss.logger.Error("SNS signature validation error", zap.Error(v_err)) xhttp.WriteError(rw, http.StatusBadRequest, SNS_VALIDATION_ERR) ss.SNSNotificationReceivedCounter(http.StatusBadRequest) return nil } // TODO: health.SendEvent(HTH.Set("TotalDataPayloadReceived", int(len(raw)) )) - ss.logger.Log( - logging.MessageKey(), "SNS notification payload", - "raw", string(raw), - "msg", msg, + ss.logger.Info( + "SNS notification payload", + zap.String("raw", string(raw)), + zap.Any("msg", msg), ) // Validate that SubscriptionConfirmation is for the topic you desire to subscribe to if !strings.EqualFold(msg.TopicArn, ss.Config.Sns.TopicArn) { - ss.logger.Log( - logging.MessageKey(), "SNS notification TopicArn mismatch", - "received", msg.TopicArn, - "expected", ss.Config.Sns.TopicArn) + ss.logger.Info( + "SNS notification TopicArn mismatch", + zap.String("received", msg.TopicArn), + zap.String("expected", ss.Config.Sns.TopicArn)) xhttp.WriteError(rw, http.StatusBadRequest, "TopicArn does not match") ss.SNSNotificationReceivedCounter(http.StatusBadRequest) return nil @@ -272,9 +272,9 @@ func (ss *SNSServer) NotificationHandle(rw http.ResponseWriter, req *http.Reques EnvAttr := msg.MessageAttributes[MSG_ATTR] msgEnv := EnvAttr.Value - ss.logger.Log(logging.MessageKey(), "SNS notification", "envAttr", EnvAttr, "msgEnv", msgEnv) + ss.logger.Info("SNS notification", zap.Any("envAttr", EnvAttr), zap.String("msgEnv", msgEnv)) if msgEnv != ss.Config.Env { - ss.logger.Log(logging.MessageKey(), "SNS environment mismatch", "msgEnv", msgEnv, "config", ss.Config.Env) + ss.logger.Info("SNS environment mismatch", zap.String("msgEnv", msgEnv), zap.Any("config", ss.Config.Env)) xhttp.WriteError(rw, http.StatusBadRequest, "SNS Msg config env does not match") ss.SNSNotificationReceivedCounter(http.StatusBadRequest) return nil @@ -288,7 +288,7 @@ func (ss *SNSServer) NotificationHandle(rw http.ResponseWriter, req *http.Reques // Publish Notification message to AWS SNS topic func (ss *SNSServer) PublishMessage(message string) error { - ss.logger.Log(logging.MessageKey(), "SNS PublishMessage", "called", message) + ss.logger.Info("SNS PublishMessage", zap.String("called", message)) ss.metrics.SNSNotificationSent.Add(1.0) // push Notification message onto notif data channel @@ -325,9 +325,9 @@ func (ss *SNSServer) listenAndPublishMessage() { resp, err := ss.SVC.Publish(params) if err != nil { - ss.logger.Log(logging.MessageKey(), "SNS send message error", logging.ErrorKey(), err) + ss.logger.Error("SNS send message error", zap.Error(err)) } - ss.logger.Log(logging.MessageKey(), "SNS send message", "response", resp) + ss.logger.Info("SNS send message", zap.Any("response", resp)) // TODO : health.SendEvent(HTH.Set("TotalDataPayloadSent", int(len([]byte(resp.GoString()))) )) } @@ -349,10 +349,10 @@ func (ss *SNSServer) Unsubscribe(subArn string) { resp, err := ss.SVC.Unsubscribe(params) if err != nil { - ss.logger.Log(logging.MessageKey(), "SNS Unsubscribe error", logging.ErrorKey(), err) + ss.logger.Error("SNS Unsubscribe error", zap.Error(err)) } - ss.logger.Log(logging.MessageKey(), "Successfully unsubscribed from the SNS topic", "response", resp) + ss.logger.Info("Successfully unsubscribed from the SNS topic", zap.Any("response", resp)) } func (ss *SNSServer) UnsubscribeOldSubscriptions() { @@ -381,13 +381,13 @@ func (ss *SNSServer) ListSubscriptionsByMatchingEndpoint() (*list.List, error) { timeStr = strings.TrimPrefix(timeStr, "/") currentTimestamp, err = strconv.ParseInt(timeStr, 10, 64) if nil != err { - ss.logger.Log(logging.MessageKey(), "SNS List Subscriptions timestamp parse error", - "selfUrl", ss.SelfUrl.String(), logging.ErrorKey(), err) + ss.logger.Error("SNS List Subscriptions timestamp parse error", + zap.String("selfUrl", ss.SelfUrl.String()), zap.Error(err)) return nil, err } endpoint := strings.TrimSuffix(ss.SelfUrl.String(), timeStr) endpoint = strings.TrimSuffix(endpoint, "/") - ss.logger.Log("currentEndpoint", endpoint, "timestamp", currentTimestamp) + ss.logger.Info("list subscriptions by matching endpoint", zap.String("currentEndpoint", endpoint), zap.Int64("timestamp", currentTimestamp)) params := &sns.ListSubscriptionsByTopicInput{ TopicArn: aws.String(ss.Config.Sns.TopicArn), @@ -397,7 +397,7 @@ func (ss *SNSServer) ListSubscriptionsByMatchingEndpoint() (*list.List, error) { resp, err := ss.SVC.ListSubscriptionsByTopic(params) if nil != err { - ss.logger.Log(logging.MessageKey(), "SNS ListSubscriptionsByTopic error", logging.ErrorKey(), err) + ss.logger.Error("SNS ListSubscriptionsByTopic error", zap.Error(err)) return nil, err } @@ -429,7 +429,7 @@ func (ss *SNSServer) ListSubscriptionsByMatchingEndpoint() (*list.List, error) { } if unsubscribeList != nil { - ss.logger.Log(logging.MessageKey(), "SNS Unsubscribe List", "length", unsubscribeList.Len()) + ss.logger.Info("SNS Unsubscribe List", zap.Int("length", unsubscribeList.Len())) } return unsubscribeList, nil } diff --git a/webhook/aws/sns_handler_test.go b/webhook/aws/sns_handler_test.go index 15e1a7e1..70327686 100644 --- a/webhook/aws/sns_handler_test.go +++ b/webhook/aws/sns_handler_test.go @@ -7,7 +7,7 @@ import ( "github.com/gorilla/mux" "github.com/spf13/viper" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/xmetrics" ) @@ -88,7 +88,7 @@ func SetUpTestSNSServerWithChannelSize(t *testing.T, channelSize int64) (*SNSSer } r := mux.NewRouter() - logger := logging.NewTestLogger(nil, t) + logger := sallust.Default() registry, _ := xmetrics.NewRegistry(&xmetrics.Options{}, Metrics) awsMetrics := ApplyMetricsData(registry) ss.Initialize(r, nil, "", nil, logger, awsMetrics, testNow) From 97d68cecac64cf80c29ab5414693c1a011a24272 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:20:29 -0400 Subject: [PATCH 36/48] Update xhttp package --- xhttp/busy.go | 6 ++-- xhttp/redirectPolicy.go | 13 ++++--- xhttp/redirectPolicy_test.go | 6 ++-- xhttp/retry.go | 15 ++++---- xhttp/retry_test.go | 10 +++--- xhttp/server.go | 66 ++++++++++-------------------------- xhttp/server_test.go | 57 +++---------------------------- 7 files changed, 47 insertions(+), 126 deletions(-) diff --git a/xhttp/busy.go b/xhttp/busy.go index bd820c97..8b5351f8 100644 --- a/xhttp/busy.go +++ b/xhttp/busy.go @@ -3,9 +3,9 @@ package xhttp import ( "net/http" - "github.com/go-kit/kit/log/level" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/semaphore" + "go.uber.org/zap" ) // Busy creates an Alice-style constructor that limits the number of HTTP transactions handled by decorated @@ -18,7 +18,7 @@ func Busy(maxTransactions int) func(http.Handler) http.Handler { ctx := request.Context() if err := s.AcquireCtx(ctx); err != nil { - logging.GetLogger(ctx).Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "server busy", logging.ErrorKey(), request.Context().Err()) + sallust.Get(ctx).Error("server busy", zap.Error(request.Context().Err())) response.WriteHeader(http.StatusServiceUnavailable) return } diff --git a/xhttp/redirectPolicy.go b/xhttp/redirectPolicy.go index cb2b2391..020e2321 100644 --- a/xhttp/redirectPolicy.go +++ b/xhttp/redirectPolicy.go @@ -5,9 +5,8 @@ import ( "net/http" "net/textproto" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust/sallusthttp" + "go.uber.org/zap" ) const ( @@ -17,7 +16,7 @@ const ( // RedirectPolicy is the configurable policy for handling redirects type RedirectPolicy struct { // Logger is the go-kit Logger used for logging. If unset, the request context's logger is used. - Logger log.Logger + Logger *zap.Logger // MaxRedirects is the maximum number of redirects to follow. If unset, DefaultMaxRedirects is used. MaxRedirects int @@ -63,12 +62,12 @@ func CheckRedirect(p RedirectPolicy) func(*http.Request, []*http.Request) error return func(r *http.Request, via []*http.Request) error { logger := p.Logger if logger == nil { - logger = logging.GetLogger(r.Context()) + logger = sallusthttp.Get(r) } if len(via) >= maxRedirects { err := fmt.Errorf("stopped after %d redirect(s)", maxRedirects) - logger.Log(level.Key(), level.ErrorValue(), logging.ErrorKey(), err) + logger.Error("Check", zap.Error(err)) return err } @@ -76,7 +75,7 @@ func CheckRedirect(p RedirectPolicy) func(*http.Request, []*http.Request) error if headerFilter(k) { r.Header[k] = v } else { - logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "excluding header on redirect", "header", k) + logger.Debug("excluding header on redirect", zap.String("header", k)) } } diff --git a/xhttp/redirectPolicy_test.go b/xhttp/redirectPolicy_test.go index 75ede717..348897e3 100644 --- a/xhttp/redirectPolicy_test.go +++ b/xhttp/redirectPolicy_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func testRedirectPolicyDefault(t *testing.T) { @@ -28,7 +28,7 @@ func testRedirectPolicyCustom(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - expectedLogger = logging.NewTestLogger(nil, t) + expectedLogger = sallust.Default() p = RedirectPolicy{ Logger: expectedLogger, @@ -74,7 +74,7 @@ func testCheckRedirectCopyHeaders(t *testing.T) { assert = assert.New(t) checkRedirect = CheckRedirect(RedirectPolicy{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), ExcludeHeaders: []string{"content-type", "X-Supar-Sekrit"}, }) diff --git a/xhttp/retry.go b/xhttp/retry.go index cd28b691..1710df0d 100644 --- a/xhttp/retry.go +++ b/xhttp/retry.go @@ -23,11 +23,10 @@ import ( "net/http" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/metrics" "github.com/go-kit/kit/metrics/discard" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" + "go.uber.org/zap" ) const DefaultRetryInterval = time.Second @@ -66,8 +65,8 @@ func DefaultShouldRetryStatus(status int) bool { // RetryOptions are the configuration options for a retry transactor type RetryOptions struct { - // Logger is the go-kit logger to use. Defaults to logging.DefaultLogger() if unset. - Logger log.Logger + // Logger is the go-kit logger to use. Defaults to sallust.Default() if unset. + Logger *zap.Logger // Retries is the count of retries. If not positive, then no transactor decoration is performed. Retries int @@ -102,7 +101,7 @@ func RetryTransactor(o RetryOptions, next func(*http.Request) (*http.Response, e } if o.Logger == nil { - o.Logger = logging.DefaultLogger() + o.Logger = sallust.Default() } if o.Counter == nil { @@ -145,7 +144,7 @@ func RetryTransactor(o RetryOptions, next func(*http.Request) (*http.Response, e for r := 0; r < o.Retries && ((err != nil && o.ShouldRetry(err)) || o.ShouldRetryStatus(statusCode)); r++ { o.Counter.Add(1.0) o.Sleep(o.Interval) - o.Logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "retrying HTTP transaction", "url", request.URL.String(), logging.ErrorKey(), err, "retry", r+1, "statusCode", statusCode) + o.Logger.Debug("retrying HTTP transaction", zap.String("url", request.URL.String()), zap.Error(err), zap.Int("retry", r+1), zap.Int("statusCode", statusCode)) if err := Rewind(request); err != nil { return nil, err @@ -159,7 +158,7 @@ func RetryTransactor(o RetryOptions, next func(*http.Request) (*http.Response, e } if err != nil { - o.Logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "All HTTP transaction retries failed", "url", request.URL.String(), logging.ErrorKey(), err, "retries", o.Retries) + o.Logger.Error("All HTTP transaction retries failed", zap.String("url", request.URL.String()), zap.Error(err), zap.Int("retries", o.Retries)) } return response, err diff --git a/xhttp/retry_test.go b/xhttp/retry_test.go index 9708f926..4bfb4c53 100644 --- a/xhttp/retry_test.go +++ b/xhttp/retry_test.go @@ -33,7 +33,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func testShouldRetry(t *testing.T, shouldRetry ShouldRetryFunc, candidate error, expected bool) { @@ -144,7 +144,7 @@ func testRetryTransactorAllRetriesFail(t *testing.T, expectedInterval, configure slept = 0 retry = RetryTransactor( RetryOptions{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Retries: retryCount, Counter: counter, Interval: configuredInterval, @@ -191,7 +191,7 @@ func testRetryTransactorFirstSucceeds(t *testing.T, retryCount int) { retry = RetryTransactor( RetryOptions{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Retries: retryCount, Counter: counter, Sleep: func(d time.Duration) { @@ -219,7 +219,7 @@ func testRetryTransactorNotRewindable(t *testing.T) { retry = RetryTransactor( RetryOptions{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Retries: 2, }, func(*http.Request) (*http.Response, error) { @@ -246,7 +246,7 @@ func testRetryTransactorRewindError(t *testing.T) { retry = RetryTransactor( RetryOptions{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Retries: 2, Sleep: func(time.Duration) {}, }, diff --git a/xhttp/server.go b/xhttp/server.go index 4024374a..9fddea3b 100644 --- a/xhttp/server.go +++ b/xhttp/server.go @@ -1,60 +1,30 @@ package xhttp import ( - stdlog "log" "net" "net/http" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" + "github.com/xmidt-org/sallust/sallusthttp" + "go.uber.org/zap" ) var ( - serverKey interface{} = "server" + serverKey = "server" ) // ServerKey returns the contextual logging key for the server name -func ServerKey() interface{} { +func ServerKey() string { return serverKey } -// NewServerLogger adapts a go-kit Logger onto a golang Logger in a way that is appropriate -// for http.Server.ErrorLog. -func NewServerLogger(logger log.Logger) *stdlog.Logger { - if logger == nil { - logger = logging.DefaultLogger() - } - - return stdlog.New( - log.NewStdlibAdapter(logger), - "", // having a prefix gives the adapter trouble - stdlog.LstdFlags|stdlog.LUTC, - ) -} - -// NewServerConnStateLogger adapts a go-kit Logger onto a connection state handler appropriate -// for http.Server.ConnState. -func NewServerConnStateLogger(logger log.Logger) func(net.Conn, http.ConnState) { - if logger == nil { - logger = logging.DefaultLogger() - } - - return func(c net.Conn, cs http.ConnState) { - logger.Log( - "remoteAddress", c.RemoteAddr(), - "state", cs, - ) - } -} - // StartOptions represents the subset of server options that have to do with how // an HTTP server is started. type StartOptions struct { // Logger is the go-kit Logger to use for server startup and error logging. If not - // supplied, logging.DefaultLogger() is used instead. - Logger log.Logger `json:"-"` + // supplied, sallust.Default() is used instead. + Logger *zap.Logger `json:"-"` // Listener is the optional net.Listener to use. If not supplied, the http.Server default // listener is used. @@ -83,7 +53,7 @@ type StartOptions struct { // Note: tlsConfig is expected to already be set func NewStarter(o StartOptions, s httpServer) func() error { if o.Logger == nil { - o.Logger = logging.DefaultLogger() + o.Logger = sallust.Default() } s.SetKeepAlivesEnabled(!o.DisableKeepAlives) @@ -101,12 +71,12 @@ func NewStarter(o StartOptions, s httpServer) func() error { } return func() error { - o.Logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "starting server") + o.Logger.Info("starting server") err := starter() if err == http.ErrServerClosed { - o.Logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "server closed") + o.Logger.Error("server closed", zap.Error(http.ErrServerClosed)) } else { - o.Logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "server exited", logging.ErrorKey(), err) + o.Logger.Error("server exited", zap.Error(err)) } return err @@ -128,8 +98,8 @@ type httpServer interface { // starting it. type ServerOptions struct { // Logger is the go-kit Logger to use for server startup and error logging. If not - // supplied, logging.DefaultLogger() is used instead. - Logger log.Logger `json:"-"` + // supplied, sallust.Default() is used instead. + Logger *zap.Logger `json:"-"` // Address is the bind address of the server. If not supplied, defaults to the internal net/http default. Address string `json:"address,omitempty"` @@ -174,12 +144,12 @@ type ServerOptions struct { func (so *ServerOptions) StartOptions() StartOptions { logger := so.Logger if logger == nil { - logger = logging.DefaultLogger() + logger = sallust.Default() } return StartOptions{ - Logger: log.With(logger, - "address", so.Address, + Logger: logger.With( + zap.String("address", so.Address), ), Listener: so.Listener, DisableKeepAlives: so.DisableKeepAlives, @@ -197,7 +167,7 @@ func NewServer(o ServerOptions) *http.Server { WriteTimeout: o.WriteTimeout, IdleTimeout: o.IdleTimeout, MaxHeaderBytes: o.MaxHeaderBytes, - ErrorLog: NewServerLogger(o.Logger), - ConnState: NewServerConnStateLogger(o.Logger), + ErrorLog: sallust.NewServerLogger("xhttp.Server", o.Logger), + ConnState: sallusthttp.NewConnStateLogger(o.Logger, zap.DebugLevel), } } diff --git a/xhttp/server_test.go b/xhttp/server_test.go index 0d2f3c2a..c1edaa83 100644 --- a/xhttp/server_test.go +++ b/xhttp/server_test.go @@ -3,63 +3,16 @@ package xhttp import ( "crypto/tls" "errors" - "net" "net/http" "testing" "time" - "github.com/go-kit/kit/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" + "go.uber.org/zap" ) -func testNewServerLogger(t *testing.T, logger log.Logger) { - var ( - assert = assert.New(t) - require = require.New(t) - serverLogger = NewServerLogger(logger) - ) - - require.NotNil(serverLogger) - assert.NotPanics(func() { - serverLogger.Println("this is a message") - }) -} - -func TestNewServerLogger(t *testing.T) { - t.Run("NilLogger", func(t *testing.T) { - testNewServerLogger(t, nil) - }) - - t.Run("CustomLogger", func(t *testing.T) { - testNewServerLogger(t, log.With(logging.NewTestLogger(nil, t), ServerKey(), "test")) - }) -} - -func testNewServerConnStateLogger(t *testing.T, logger log.Logger) { - var ( - assert = assert.New(t) - require = require.New(t) - connState = NewServerConnStateLogger(logger) - ) - - require.NotNil(connState) - assert.NotPanics(func() { - connState(new(net.IPConn), http.StateNew) - }) -} - -func TestNewServerConnStateLogger(t *testing.T) { - t.Run("NilLogger", func(t *testing.T) { - testNewServerConnStateLogger(t, nil) - }) - - t.Run("CustomLogger", func(t *testing.T) { - testNewServerConnStateLogger(t, log.With(logging.NewTestLogger(nil, t), ServerKey(), "test")) - }) -} - const ( expectedCertificateFile = "certificateFile" expectedKeyFile = "keyFile" @@ -70,7 +23,7 @@ const ( func startOptions(t *testing.T) []StartOptions { var o []StartOptions - for _, logger := range []log.Logger{nil, logging.NewTestLogger(nil, t)} { + for _, logger := range []*zap.Logger{nil, sallust.Default()} { for _, disableKeepAlives := range []bool{false, true} { o = append(o, StartOptions{ Logger: logger, @@ -240,7 +193,7 @@ func TestNewStarter(t *testing.T) { func TestServerOptions(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() listener = new(mockListener) o = ServerOptions{ @@ -265,7 +218,7 @@ func TestNewServer(t *testing.T) { var ( assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() listener = new(mockListener) o = ServerOptions{ From d595da948e07064d97aa17236e7ae0a9cdeee15d Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:20:45 -0400 Subject: [PATCH 37/48] Update fanout package --- xhttp/fanout/handler.go | 31 +++++++++++++++---------------- xhttp/fanout/handler_test.go | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/xhttp/fanout/handler.go b/xhttp/fanout/handler.go index b6d06474..a5e1ace8 100644 --- a/xhttp/fanout/handler.go +++ b/xhttp/fanout/handler.go @@ -8,12 +8,11 @@ import ( "net/http" "net/url" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" gokithttp "github.com/go-kit/kit/transport/http" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/tracing" "github.com/xmidt-org/webpa-common/v2/tracing/tracinghttp" + "go.uber.org/zap" ) var ( @@ -219,7 +218,7 @@ func (h *Handler) newFanoutRequests(fanoutCtx context.Context, original *http.Re // execute performs a single fanout HTTP transaction and sends the result on a channel. This method is invoked // as a goroutine. It takes care of draining the fanout's response prior to returning. -func (h *Handler) execute(logger log.Logger, spanner tracing.Spanner, results chan<- Result, request *http.Request) { +func (h *Handler) execute(logger *zap.Logger, spanner tracing.Spanner, results chan<- Result, request *http.Request) { var ( finisher = spanner.Start(request.URL.String()) result = Result{ @@ -235,11 +234,11 @@ func (h *Handler) execute(logger log.Logger, spanner tracing.Spanner, results ch var err error if result.Body, err = ioutil.ReadAll(result.Response.Body); err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "error reading fanout response body", logging.ErrorKey(), err) + logger.Error("error reading fanout response body", zap.Error(err)) } if err = result.Response.Body.Close(); err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "error closing fanout response body", logging.ErrorKey(), err) + logger.Error("error closing fanout response body", zap.Error(err)) } case result.Err != nil: @@ -271,7 +270,7 @@ func (h *Handler) execute(logger log.Logger, spanner tracing.Spanner, results ch // finish takes a terminating fanout result and writes the appropriate information to the top-level response. This method // is only invoked when a particular fanout response terminates the fanout, i.e. is considered successful. -func (h *Handler) finish(logger log.Logger, response http.ResponseWriter, result Result, after []FanoutResponseFunc) { +func (h *Handler) finish(logger *zap.Logger, response http.ResponseWriter, result Result, after []FanoutResponseFunc) { ctx := result.Request.Context() for _, rf := range after { // NOTE: we don't use the context for anything here, @@ -289,12 +288,12 @@ func (h *Handler) finish(logger log.Logger, response http.ResponseWriter, result response.WriteHeader(result.StatusCode) count, err := response.Write(result.Body) if err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "wrote fanout response", "bytes", count, logging.ErrorKey(), err) + logger.Error("wrote fanout response", zap.Int("bytes", count), zap.Error(err)) } else { - logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "wrote fanout response", "bytes", count) + logger.Debug("wrote fanout response", zap.Int("bytes", count)) } } else { - logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "wrote fanout response", "statusCode", result.StatusCode) + logger.Debug("wrote fanout response", zap.Int("statusCode", result.StatusCode)) response.WriteHeader(result.StatusCode) } } @@ -302,12 +301,12 @@ func (h *Handler) finish(logger log.Logger, response http.ResponseWriter, result func (h *Handler) ServeHTTP(response http.ResponseWriter, original *http.Request) { var ( fanoutCtx = original.Context() - logger = logging.GetLogger(fanoutCtx) + logger = sallust.Get(fanoutCtx) requests, err = h.newFanoutRequests(fanoutCtx, original) ) if err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "unable to create fanout", logging.ErrorKey(), err) + logger.Error("unable to create fanout", zap.Error(err)) h.errorEncoder(fanoutCtx, err, response) return } @@ -326,16 +325,16 @@ func (h *Handler) ServeHTTP(response http.ResponseWriter, original *http.Request for i := 0; i < len(requests); i++ { select { case <-fanoutCtx.Done(): - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "fanout operation canceled or timed out", "statusCode", http.StatusGatewayTimeout, "url", original.URL, logging.ErrorKey(), fanoutCtx.Err()) + logger.Error("fanout operation canceled or timed out", zap.Int("statusCode", http.StatusGatewayTimeout), zap.Any("url", original.URL), zap.Error(fanoutCtx.Err())) response.WriteHeader(http.StatusGatewayTimeout) return case r := <-results: tracinghttp.HeadersForSpans("", response.Header(), r.Span) if r.Err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "fanout request complete", "statusCode", r.StatusCode, "url", r.Request.URL, logging.ErrorKey(), r.Err) + logger.Error("fanout request complete", zap.Int("statusCode", r.StatusCode), zap.Any("url", r.Request.URL), zap.Error(r.Err)) } else { - logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "fanout request complete", "statusCode", r.StatusCode, "url", r.Request.URL) + logger.Debug("fanout request complete", zap.Int("statusCode", r.StatusCode), zap.Any("url", r.Request.URL)) } if h.shouldTerminate(r) { @@ -351,6 +350,6 @@ func (h *Handler) ServeHTTP(response http.ResponseWriter, original *http.Request } } - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "all fanout requests failed", "statusCode", statusCode, "url", original.URL) + logger.Error("all fanout requests failed", zap.Int("statusCode", statusCode), zap.Any("url", original.URL)) h.finish(logger, response, latestResponse, h.failure) } diff --git a/xhttp/fanout/handler_test.go b/xhttp/fanout/handler_test.go index 513ca264..e5941830 100644 --- a/xhttp/fanout/handler_test.go +++ b/xhttp/fanout/handler_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/xhttp" "github.com/xmidt-org/webpa-common/v2/xhttp/xhttptest" ) @@ -27,8 +27,8 @@ func testHandlerBodyError(t *testing.T) { expectedError = &xhttp.Error{Code: 599, Text: "body read error"} body = new(xhttptest.MockBody) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) original = httptest.NewRequest("POST", "/something", body).WithContext(ctx) response = httptest.NewRecorder() @@ -50,8 +50,8 @@ func testHandlerNoEndpoints(t *testing.T) { require = require.New(t) body = new(xhttptest.MockBody) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) original = httptest.NewRequest("POST", "/something", body).WithContext(ctx) response = httptest.NewRecorder() @@ -78,8 +78,8 @@ func testHandlerEndpointsError(t *testing.T) { body = new(xhttptest.MockBody) endpoints = new(mockEndpoints) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) original = httptest.NewRequest("POST", "/something", body).WithContext(ctx) response = httptest.NewRecorder() @@ -103,8 +103,8 @@ func testHandlerBadTransactor(t *testing.T) { assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) original = httptest.NewRequest("GET", "/api/v2/something", nil).WithContext(ctx) response = httptest.NewRecorder() @@ -138,8 +138,8 @@ func testHandlerGet(t *testing.T, expectedResponses []xhttptest.ExpectedResponse assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) original = httptest.NewRequest("GET", "/api/v3/something", nil).WithContext(ctx) response = httptest.NewRecorder() @@ -220,8 +220,8 @@ func testHandlerPost(t *testing.T, expectedResponses []xhttptest.ExpectedRespons assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) expectedRequestBody = "posted body" original = httptest.NewRequest("POST", "/api/v3/something", strings.NewReader(expectedRequestBody)).WithContext(ctx) response = httptest.NewRecorder() @@ -303,8 +303,8 @@ func testHandlerTimeout(t *testing.T, endpointCount int) { assert = assert.New(t) require = require.New(t) - logger = logging.NewTestLogger(nil, t) - ctx, cancel = context.WithCancel(logging.WithLogger(context.Background(), logger)) + logger = sallust.Default() + ctx, cancel = context.WithCancel(sallust.With(context.Background(), logger)) original = httptest.NewRequest("GET", "/api/v2/something", nil).WithContext(ctx) response = httptest.NewRecorder() From b76e0d56c59ec1b313a5632e1f5ece4984bfd3ed Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:20:57 -0400 Subject: [PATCH 38/48] Update gate package --- xhttp/gate/lever.go | 14 +++++++------- xhttp/gate/lever_test.go | 22 +++++++++++----------- xhttp/gate/status_test.go | 6 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/xhttp/gate/lever.go b/xhttp/gate/lever.go index b462e6f3..41baf197 100644 --- a/xhttp/gate/lever.go +++ b/xhttp/gate/lever.go @@ -4,9 +4,9 @@ import ( "net/http" "strconv" - "github.com/go-kit/kit/log/level" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust/sallusthttp" "github.com/xmidt-org/webpa-common/v2/xhttp" + "go.uber.org/zap" ) // Lever is an http.Handler which controls the state of a gate. @@ -19,24 +19,24 @@ type Lever struct { } func (l *Lever) ServeHTTP(response http.ResponseWriter, request *http.Request) { - logger := logging.GetLogger(request.Context()) + logger := sallusthttp.Get(request) if err := request.ParseForm(); err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "bad form request", logging.ErrorKey(), err) + logger.Error("bad form request", zap.Error(err)) xhttp.WriteError(response, http.StatusBadRequest, err) return } v := request.FormValue(l.Parameter) if len(v) == 0 { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "no parameter found", "parameter", l.Parameter) + logger.Error("no parameter found", zap.String("parameter", l.Parameter)) xhttp.WriteErrorf(response, http.StatusBadRequest, "missing %s parameter", l.Parameter) return } f, err := strconv.ParseBool(v) if err != nil { - logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "parameter is not a bool", "parameter", l.Parameter, logging.ErrorKey(), err) + logger.Error("parameter is not a bool", zap.String("parameter", l.Parameter), zap.Error(err)) xhttp.WriteErrorf(response, http.StatusBadRequest, "the %s parameter must be a bool", l.Parameter) return } @@ -48,7 +48,7 @@ func (l *Lever) ServeHTTP(response http.ResponseWriter, request *http.Request) { changed = l.Gate.Lower() } - logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "gate update", "open", f, "changed", changed) + logger.Info("gate update", zap.Bool("open", f), zap.Bool("changed", changed)) if changed { response.WriteHeader(http.StatusCreated) diff --git a/xhttp/gate/lever_test.go b/xhttp/gate/lever_test.go index ace75a90..15c2d518 100644 --- a/xhttp/gate/lever_test.go +++ b/xhttp/gate/lever_test.go @@ -8,14 +8,14 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func testLeverServeHTTPBadForm(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) response = httptest.NewRecorder() request = &http.Request{ @@ -34,8 +34,8 @@ func testLeverServeHTTPBadForm(t *testing.T) { func testLeverServeHTTPNoParameter(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) response = httptest.NewRecorder() request = httptest.NewRequest("POST", "/", nil) @@ -50,8 +50,8 @@ func testLeverServeHTTPNoParameter(t *testing.T) { func testLeverServeHTTPBadParameter(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) response = httptest.NewRecorder() request = httptest.NewRequest("POST", "/foo?open=thisisnotabool", nil) @@ -66,8 +66,8 @@ func testLeverServeHTTPBadParameter(t *testing.T) { func testLeverServeHTTPRaise(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) gate = New(true) lever = Lever{Gate: gate, Parameter: "open"} @@ -121,8 +121,8 @@ func testLeverServeHTTPRaise(t *testing.T) { func testLeverServeHTTPLower(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) gate = New(false) lever = Lever{Gate: gate, Parameter: "open"} diff --git a/xhttp/gate/status_test.go b/xhttp/gate/status_test.go index b62ca480..d735ef43 100644 --- a/xhttp/gate/status_test.go +++ b/xhttp/gate/status_test.go @@ -9,14 +9,14 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func testStatusServeHTTP(t *testing.T, state bool) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) - ctx = logging.WithLogger(context.Background(), logger) + logger = sallust.Default() + ctx = sallust.With(context.Background(), logger) expectedTimestamp = time.Now() expectedStatus = fmt.Sprintf(`{"open": %t, "timestamp": "%s"}`, state, expectedTimestamp.UTC().Format(time.RFC3339)) From fc1992140b9cad4095745dc47b8a30c7d038908f Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:21:09 -0400 Subject: [PATCH 39/48] Update xcontext package --- xhttp/xcontext/contextaware_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xhttp/xcontext/contextaware_test.go b/xhttp/xcontext/contextaware_test.go index 67464e01..68e10cd0 100644 --- a/xhttp/xcontext/contextaware_test.go +++ b/xhttp/xcontext/contextaware_test.go @@ -9,7 +9,7 @@ import ( "github.com/justinas/alice" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func TestSetContext(t *testing.T) { @@ -31,7 +31,7 @@ func TestSetContext(t *testing.T) { r, err := http.NewRequest("GET", server.URL, nil) assert.NoError(err) - r = r.WithContext(logging.WithLogger(r.Context(), logging.New(nil))) + r = r.WithContext(sallust.With(r.Context(), sallust.Default())) response, err := (&http.Client{}).Do(r) assert.NoError(err) assert.NotNil(response) @@ -54,7 +54,7 @@ func TestSingleHandler(t *testing.T) { r, err := http.NewRequest("GET", server.URL, nil) assert.NoError(err) - r = r.WithContext(logging.WithLogger(r.Context(), logging.New(nil))) + r = r.WithContext(sallust.With(r.Context(), sallust.Default())) response, err := (&http.Client{}).Do(r) assert.NoError(err) assert.NotNil(response) @@ -100,7 +100,7 @@ func TestChain(t *testing.T) { r, err := http.NewRequest("GET", server.URL, nil) assert.NoError(err) - r = r.WithContext(logging.WithLogger(r.Context(), logging.New(nil))) + r = r.WithContext(sallust.With(r.Context(), sallust.Default())) response, err := (&http.Client{}).Do(r) assert.NoError(err) assert.NotNil(response) From 49e2d2de0bfa71bc9d92fbe10fb8fe6665129142 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:23:10 -0400 Subject: [PATCH 40/48] Update xlistener package --- xlistener/listener.go | 23 +++++++++++------------ xlistener/listener_test.go | 12 ++++++------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/xlistener/listener.go b/xlistener/listener.go index 509a4760..79931f81 100644 --- a/xlistener/listener.go +++ b/xlistener/listener.go @@ -7,11 +7,10 @@ import ( "sync" "syscall" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/metrics/discard" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/xmetrics" + "go.uber.org/zap" ) var ( @@ -24,8 +23,8 @@ var ( // Options defines the available options for configuring a listener type Options struct { - // Logger is the go-kit logger to use for output. If unset, logging.DefaultLogger() is used. - Logger log.Logger + // Logger is the go-kit logger to use for output. If unset, sallust.Default() is used. + Logger *zap.Logger // MaxConnections is the maximum number of active connections the listener will permit. If this // value is not positive, there is no limit to the number of connections. @@ -57,7 +56,7 @@ type Options struct { // up via Close() if higher level errors occur. func New(o Options) (net.Listener, error) { if o.Logger == nil { - o.Logger = logging.DefaultLogger() + o.Logger = sallust.Default() } var semaphore chan struct{} @@ -96,7 +95,7 @@ func New(o Options) (net.Listener, error) { return &listener{ Listener: next, - logger: log.With(o.Logger, "listenNetwork", next.Addr().Network(), "listenAddress", next.Addr().String()), + logger: o.Logger.With(zap.String("listenNetwork", next.Addr().Network()), zap.String("listenAddress", next.Addr().String())), semaphore: semaphore, rejected: xmetrics.NewIncrementer(o.Rejected), active: o.Active, @@ -106,7 +105,7 @@ func New(o Options) (net.Listener, error) { // listener decorates a net.Listener with metrics and optional maximum connection enforcement type listener struct { net.Listener - logger log.Logger + logger *zap.Logger semaphore chan struct{} rejected xmetrics.Incrementer active xmetrics.Adder @@ -149,9 +148,9 @@ func (l *listener) Accept() (net.Conn, error) { sysValue = "0x" + strconv.FormatInt(int64(errno), 16) } - l.logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "failed to accept connection", logging.ErrorKey(), err, "sysValue", sysValue) + l.logger.Error("failed to accept connection", zap.Error(err), zap.String("sysValue", sysValue)) if err == syscall.ENFILE { - l.logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "ENFILE received. translating to EMFILE") + l.logger.Error("ENFILE received. translating to EMFILE") return nil, syscall.EMFILE } @@ -159,13 +158,13 @@ func (l *listener) Accept() (net.Conn, error) { } if !l.acquire() { - l.logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "rejected connection", "remoteAddress", c.RemoteAddr().String()) + l.logger.Error("rejected connection", zap.String("remoteAddress", c.RemoteAddr().String())) l.rejected.Inc() c.Close() continue } - l.logger.Log(level.Key(), level.DebugValue(), logging.MessageKey(), "accepted connection", "remoteAddress", c.RemoteAddr().String()) + l.logger.Debug("accepted connection", zap.String("remoteAddress", c.RemoteAddr().String())) return &conn{Conn: c, release: l.release}, nil } } diff --git a/xlistener/listener_test.go b/xlistener/listener_test.go index 00bc2728..0ea590a4 100644 --- a/xlistener/listener_test.go +++ b/xlistener/listener_test.go @@ -9,7 +9,7 @@ import ( "github.com/go-kit/kit/metrics/generic" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func testNewDefault(t *testing.T) { @@ -63,7 +63,7 @@ func testNewCustom(t *testing.T) { } l, err := New(Options{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Rejected: expectedRejected, Active: expectedActive, Network: "tcp4", @@ -111,7 +111,7 @@ func testNewTLSCustom(t *testing.T) { } l, err := New(Options{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Rejected: expectedRejected, Active: expectedActive, Network: "tcp4", @@ -183,7 +183,7 @@ func testListenerAcceptError(t *testing.T, maxConnections int) { expectedNext.On("Accept").Return(nil, expectedError).Once() l, err := New(Options{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), MaxConnections: maxConnections, Rejected: expectedRejected, Active: expectedActive, @@ -231,7 +231,7 @@ func testListenerAcceptUnlimitedConnections(t *testing.T) { expectedConn2.On("Close").Return(expectedConnCloseError).Once() l, err := New(Options{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), Rejected: expectedRejected, Active: expectedActive, Next: expectedNext, @@ -311,7 +311,7 @@ func testListenerAcceptMaxConnections(t *testing.T) { expectedConn2.On("Close").Return(expectedConnCloseError).Once() l, err := New(Options{ - Logger: logging.NewTestLogger(nil, t), + Logger: sallust.Default(), MaxConnections: 1, Rejected: expectedRejected, Active: expectedActive, From d7844ac6fc2a0e752a08dae625ec04a71aa69584 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:23:19 -0400 Subject: [PATCH 41/48] Update xmetrics package --- xmetrics/metric.go | 43 +++++++++++++++++++--------------------- xmetrics/metric_test.go | 4 ++-- xmetrics/options.go | 2 +- xmetrics/options_test.go | 4 ++-- xmetrics/registry.go | 34 +++++++++++-------------------- 5 files changed, 37 insertions(+), 50 deletions(-) diff --git a/xmetrics/metric.go b/xmetrics/metric.go index f4c27fa3..a9d93ee5 100644 --- a/xmetrics/metric.go +++ b/xmetrics/metric.go @@ -5,10 +5,9 @@ import ( "fmt" "time" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/prometheus/client_golang/prometheus" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" + "go.uber.org/zap" ) const ( @@ -145,7 +144,7 @@ func NewCollector(m Metric) (prometheus.Collector, error) { // namespace and subsystem to each metric. This type implements a Fluent Interface which tracks the first // error encountered. type Merger struct { - logger log.Logger + logger *zap.Logger defaultNamespace string defaultSubsystem string namer func(string, string, string) string @@ -156,7 +155,7 @@ type Merger struct { // NewMerger creates a merging strategy with useful defaults. func NewMerger() *Merger { return &Merger{ - logger: logging.DefaultLogger(), + logger: sallust.Default(), defaultNamespace: DefaultNamespace, defaultSubsystem: DefaultSubsystem, namer: prometheus.BuildFQName, @@ -165,11 +164,11 @@ func NewMerger() *Merger { } // Logger sets a go-kit logger to use for merging output -func (mr *Merger) Logger(logger log.Logger) *Merger { +func (mr *Merger) Logger(logger *zap.Logger) *Merger { if logger != nil { mr.logger = logger } else { - mr.logger = logging.DefaultLogger() + mr.logger = sallust.Default() } return mr @@ -232,14 +231,13 @@ func (mr *Merger) tryAdd(allowOverride bool, m Metric) bool { defer func() { if mr.err != nil { - mr.logger.Log( - level.Key(), level.ErrorValue(), - logging.MessageKey(), "failed to merge metrics", - logging.ErrorKey(), mr.err, - "name", m.Name, - "namespace", m.Namespace, - "subsystem", m.Subsystem, - "type", m.Type, + mr.logger.Error( + "failed to merge metrics", + zap.Error(mr.err), + zap.String("name", m.Name), + zap.String("namespace", m.Namespace), + zap.String("subsystem", m.Subsystem), + zap.String("type", m.Type), ) } }() @@ -258,14 +256,13 @@ func (mr *Merger) tryAdd(allowOverride bool, m Metric) bool { } fqn := mr.namer(m.Namespace, m.Subsystem, m.Name) - mr.logger.Log( - level.Key(), level.DebugValue(), - logging.MessageKey(), "merging metric", - "name", m.Name, - "namespace", m.Namespace, - "subsystem", m.Subsystem, - "fqn", fqn, - "type", m.Type, + mr.logger.Debug( + "merging metric", + zap.String("name", m.Name), + zap.String("namespace", m.Namespace), + zap.String("subsystem", m.Subsystem), + zap.String("fqn", fqn), + zap.String("type", m.Type), ) if existing, ok := mr.merged[fqn]; ok { diff --git a/xmetrics/metric_test.go b/xmetrics/metric_test.go index 840722ea..179599c9 100644 --- a/xmetrics/metric_test.go +++ b/xmetrics/metric_test.go @@ -6,7 +6,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func testNewCollectorMissingName(t *testing.T) { @@ -93,7 +93,7 @@ func TestMerger(t *testing.T) { var ( assert = assert.New(t) merger = NewMerger(). - Logger(logging.NewTestLogger(nil, t)). + Logger(sallust.Default()). AddMetrics(false, []Metric{{Name: "counter", Type: "counter"}}). AddModules(true, func() []Metric { return []Metric{{Name: "counter", Type: "counter"}} }) ) diff --git a/xmetrics/options.go b/xmetrics/options.go index 55aa7d99..7f79c5c2 100644 --- a/xmetrics/options.go +++ b/xmetrics/options.go @@ -12,7 +12,7 @@ const ( // Options is the configurable options for creating a Prometheus registry type Options struct { - // Logger is the go-kit logger to use for metrics output. If unset, logging.DefaultLogger() is used. + // Logger is the go-kit logger to use for metrics output. If unset, sallust.Default() is used. Logger *zap.Logger // Namespace is the global default namespace for metrics which don't define a namespace (or for ad hoc metrics). diff --git a/xmetrics/options_test.go b/xmetrics/options_test.go index 60095674..7b79d0ea 100644 --- a/xmetrics/options_test.go +++ b/xmetrics/options_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func testOptionsDefault(o *Options, t *testing.T) { @@ -25,7 +25,7 @@ func testOptionsDefault(o *Options, t *testing.T) { func testOptionsCustom(t *testing.T) { var ( assert = assert.New(t) - logger = logging.NewTestLogger(nil, t) + logger = sallust.Default() o = Options{ Logger: logger, Namespace: "custom namespace", diff --git a/xmetrics/registry.go b/xmetrics/registry.go index a83e0c1a..225a8989 100644 --- a/xmetrics/registry.go +++ b/xmetrics/registry.go @@ -3,13 +3,11 @@ package xmetrics import ( "fmt" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" "github.com/go-kit/kit/metrics" gokitprometheus "github.com/go-kit/kit/metrics/prometheus" "github.com/go-kit/kit/metrics/provider" "github.com/prometheus/client_golang/prometheus" - "github.com/xmidt-org/webpa-common/v2/logging" + "go.uber.org/zap" ) // PrometheusProvider is a Prometheus-specific version of go-kit's metrics.Provider. Use this interface @@ -251,36 +249,28 @@ func NewRegistry(o *Options, modules ...Module) (Registry, error) { for name, metric := range merger.Merged() { // merged metrics will have namespace and subsystem set appropriately - metricLogger := log.With( - logger, - "name", metric.Name, - "namespace", metric.Namespace, - "subsystem", metric.Subsystem, - "type", metric.Type, - "fqn", name, + metricLogger := logger.With( + zap.String("name", metric.Name), + zap.String("namespace", metric.Namespace), + zap.String("subsystem", metric.Subsystem), + zap.String("type", metric.Type), + zap.String("fqn", name), ) - metricLogger.Log( - level.Key(), level.DebugValue(), - logging.MessageKey(), "registering merged metric", - ) + metricLogger.Debug("registering merged metric") c, err := NewCollector(metric) if err != nil { - metricLogger.Log( - level.Key(), level.ErrorValue(), - logging.MessageKey(), "unable to create collector for metric", - logging.ErrorKey(), err, + metricLogger.Error("unable to create collector for metric", + zap.Error(err), ) return nil, err } if err := pr.Register(c); err != nil { - metricLogger.Log( - level.Key(), level.ErrorValue(), - logging.MessageKey(), "unable to register collector for metric", - logging.ErrorKey(), err, + metricLogger.Error("unable to register collector for metric", + zap.Error(err), ) return nil, err From f544a227e0557b2af2374ddcc942767f76b1dff5 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:23:31 -0400 Subject: [PATCH 42/48] Update consul package --- xresolver/consul/consullistener.go | 27 ++++++++++++------------- xresolver/consul/consullistener_test.go | 4 ++-- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/xresolver/consul/consullistener.go b/xresolver/consul/consullistener.go index d84c67f9..6cf00ce8 100644 --- a/xresolver/consul/consullistener.go +++ b/xresolver/consul/consullistener.go @@ -6,11 +6,10 @@ import ( "net/url" "regexp" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service/monitor" "github.com/xmidt-org/webpa-common/v2/xresolver" + "go.uber.org/zap" ) var find = regexp.MustCompile("(.*)" + regexp.QuoteMeta("[") + "(.*)" + regexp.QuoteMeta("]") + regexp.QuoteMeta("{") + "(.*)" + regexp.QuoteMeta("}")) @@ -20,11 +19,11 @@ type Options struct { // exp. { "http://beta.google.com:8080/notify" : "caduceus" } Watch map[string]string `json:"watch"` - Logger log.Logger `json:"-"` + Logger *zap.Logger `json:"-"` } type ConsulWatcher struct { - logger log.Logger + logger *zap.Logger watch map[string]string balancers map[string]*xresolver.RoundRobin @@ -32,11 +31,11 @@ type ConsulWatcher struct { func NewConsulWatcher(o Options) *ConsulWatcher { if o.Logger == nil { - o.Logger = logging.DefaultLogger() + o.Logger = sallust.Default() } watcher := &ConsulWatcher{ - logger: log.WithPrefix(o.Logger, "component", "consulWatcher"), + logger: o.Logger.With(zap.String("component", "consulWatcher")), balancers: make(map[string]*xresolver.RoundRobin), watch: make(map[string]string), } @@ -51,7 +50,7 @@ func NewConsulWatcher(o Options) *ConsulWatcher { } func (watcher *ConsulWatcher) MonitorEvent(e monitor.Event) { - log.WithPrefix(watcher.logger, level.Key(), level.DebugValue()).Log(logging.MessageKey(), "received update route event", "event", e) + watcher.logger.Debug("received update route event", zap.Any("event", e)) // update balancers str := find.FindStringSubmatch(e.Key) @@ -66,23 +65,23 @@ func (watcher *ConsulWatcher) MonitorEvent(e monitor.Event) { // find records route, err := xresolver.CreateRoute(instance) if err != nil { - log.WithPrefix(watcher.logger, level.Key(), level.ErrorValue()).Log(logging.MessageKey(), "failed to create route", logging.MessageKey(), err, "instance", instance) + watcher.logger.Error("failed to create route", zap.Error(err), zap.String("instance", instance)) continue } routes = append(routes, route) } rr.Update(routes) - log.WithPrefix(watcher.logger, level.Key(), level.InfoValue()).Log(logging.MessageKey(), "updating routes", "service", service, "new-routes", routes) + watcher.logger.Info("updating routes", zap.String("service", service), zap.Any("new-routes", routes)) } } func (watcher *ConsulWatcher) WatchService(watchURL string, service string) { parsedURL, err := url.Parse(watchURL) if err != nil { - log.WithPrefix(watcher.logger, level.Key(), level.ErrorValue()).Log("failed to parse url", "url", watchURL, "service", service) + watcher.logger.Error("failed to parse url", zap.String("url", watchURL), zap.String("service", service)) return } - log.WithPrefix(watcher.logger, level.Key(), level.InfoValue()).Log(logging.MessageKey(), "Watching Service", "url", watchURL, "service", service, "host", parsedURL.Hostname()) + watcher.logger.Info("Watching Service", zap.String("url", watchURL), zap.String("service", service), zap.String("host", parsedURL.Hostname())) if _, found := watcher.watch[parsedURL.Hostname()]; !found { watcher.watch[parsedURL.Hostname()] = service @@ -94,10 +93,10 @@ func (watcher *ConsulWatcher) WatchService(watchURL string, service string) { func (watcher *ConsulWatcher) LookupRoutes(ctx context.Context, host string) ([]xresolver.Route, error) { if _, found := watcher.watch[host]; !found { - log.WithPrefix(watcher.logger, level.Key(), level.ErrorValue()).Log("watch not found ", "host", host) + watcher.logger.Error("watch not found ", zap.String("host", host)) return []xresolver.Route{}, errors.New(host + " is not part of the consul listener") } records, err := watcher.balancers[watcher.watch[host]].Get() - log.WithPrefix(watcher.logger, level.Key(), level.DebugValue()).Log(logging.MessageKey(), "looking up routes", "routes", records, logging.ErrorKey(), err) + watcher.logger.Debug("looking up routes", zap.Any("routes", records), zap.Error(err)) return records, err } diff --git a/xresolver/consul/consullistener_test.go b/xresolver/consul/consullistener_test.go index 780d3c0e..1a5d16bf 100644 --- a/xresolver/consul/consullistener_test.go +++ b/xresolver/consul/consullistener_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" "github.com/xmidt-org/webpa-common/v2/service/monitor" "github.com/xmidt-org/webpa-common/v2/xresolver" ) @@ -47,7 +47,7 @@ func TestConsulWatcher(t *testing.T) { client := &http.Client{ Transport: &http.Transport{ - DialContext: xresolver.NewResolver(xresolver.DefaultDialer, logging.NewTestLogger(nil, t), watcher).DialContext, + DialContext: xresolver.NewResolver(xresolver.DefaultDialer, sallust.Default(), watcher).DialContext, // note: DisableKeepAlives is required so when we do the request again we don't reuse the same connection. DisableKeepAlives: true, }, From 5a958879a713f62038988da6a0bc99e8d0aa225d Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:23:39 -0400 Subject: [PATCH 43/48] Update xresolver package --- xresolver/xresolver.go | 19 +++++++++---------- xresolver/xresolver_test.go | 6 +++--- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/xresolver/xresolver.go b/xresolver/xresolver.go index 5e26d06c..ccfce18f 100644 --- a/xresolver/xresolver.go +++ b/xresolver/xresolver.go @@ -4,9 +4,8 @@ import ( "context" "errors" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" + "go.uber.org/zap" "net" "strconv" @@ -21,17 +20,17 @@ type resolver struct { resolvers map[Lookup]bool lock sync.RWMutex dialer net.Dialer - logger log.Logger + logger *zap.Logger } -func NewResolver(dialer net.Dialer, logger log.Logger, lookups ...Lookup) Resolver { +func NewResolver(dialer net.Dialer, logger *zap.Logger, lookups ...Lookup) Resolver { if logger == nil { - logger = logging.DefaultLogger() + logger = sallust.Default() } r := &resolver{ resolvers: make(map[Lookup]bool), dialer: dialer, - logger: log.WithPrefix(logger, "component", "xresolver"), + logger: logger.With(zap.String("component", "xresolver")), } for _, lookup := range lookups { @@ -96,11 +95,11 @@ func (resolve *resolver) DialContext(ctx context.Context, network, addr string) // generate Conn or err from records con, route, err := resolve.createConnection(routes, network, port) if err == nil { - log.WithPrefix(resolve.logger, level.Key(), level.DebugValue()).Log(logging.MessageKey(), "successfully created connection using xresolver", "new-route", route.String(), "addr", addr) + resolve.logger.Debug("successfully created connection using xresolver", zap.String("new-route", route.String()), zap.String("addr", addr)) return con, err } - log.WithPrefix(resolve.logger, level.Key(), level.DebugValue()).Log(logging.MessageKey(), "failed to create connection with other routes using original address", "addr", addr, logging.ErrorKey(), err) + resolve.logger.Debug("failed to create connection with other routes using original address", zap.String("addr", addr), zap.Error(err)) // if no connection, create using the default dialer return resolve.dialer.DialContext(ctx, network, addr) } @@ -116,7 +115,7 @@ func (resolve *resolver) createConnection(routes []Route, network, port string) } else if route.Scheme == "https" { portUsed = "443" } else { - log.WithPrefix(resolve.logger, level.Key(), level.ErrorValue()).Log(logging.MessageKey(), "unknown default port", "scheme", route.Scheme, "host", route.Host) + resolve.logger.Error("unknown default port", zap.String("scheme", route.Scheme), zap.String("host", route.Host)) continue } } diff --git a/xresolver/xresolver_test.go b/xresolver/xresolver_test.go index 6bd9afbc..7b20e2b3 100644 --- a/xresolver/xresolver_test.go +++ b/xresolver/xresolver_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/xmidt-org/webpa-common/v2/logging" + "github.com/xmidt-org/sallust" ) func TestClient(t *testing.T) { @@ -23,7 +23,7 @@ func TestClient(t *testing.T) { client := &http.Client{ Transport: &http.Transport{ - DialContext: NewResolver(DefaultDialer, logging.NewTestLogger(nil, t)).DialContext, + DialContext: NewResolver(DefaultDialer, sallust.Default()).DialContext, }, } @@ -64,7 +64,7 @@ func TestClientWithResolver(t *testing.T) { fakeLookUp := new(mockLookUp) fakeLookUp.On("LookupRoutes", mock.Anything, customhost).Return([]Route{route}, nil) - r := NewResolver(DefaultDialer, logging.NewTestLogger(nil, t), fakeLookUp) + r := NewResolver(DefaultDialer, sallust.Default(), fakeLookUp) client := &http.Client{ Transport: &http.Transport{ From 3d29dbdf2444bf7e45cc47ff231c1686102fb91d Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 16:26:01 -0400 Subject: [PATCH 44/48] update dependencies --- go.mod | 27 +++---- go.sum | 250 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 242 insertions(+), 35 deletions(-) diff --git a/go.mod b/go.mod index 08f87168..b5607348 100644 --- a/go.mod +++ b/go.mod @@ -3,23 +3,20 @@ module github.com/xmidt-org/webpa-common/v2 go 1.19 require ( - github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2 - github.com/aws/aws-sdk-go v1.44.120 - github.com/armon/go-metrics v0.4.0 // indirect - github.com/aws/aws-sdk-go v1.44.127 + github.com/armon/go-metrics v0.4.1 // indirect + github.com/aws/aws-sdk-go v1.44.128 github.com/billhathaway/consistentHash v0.0.0-20140718022140-addea16d2229 github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 github.com/go-kit/kit v0.12.0 github.com/go-zookeeper/zk v1.0.3 - github.com/goph/emperror v0.17.3-0.20190703203600-60a8d9faa17b github.com/gorilla/mux v1.8.0 github.com/gorilla/schema v1.2.0 github.com/gorilla/websocket v1.5.0 github.com/hashicorp/consul/api v1.15.3 - github.com/hashicorp/go-hclog v1.2.2 // indirect - github.com/hashicorp/serf v0.10.0 // indirect + github.com/hashicorp/go-hclog v1.3.1 // indirect + github.com/hashicorp/serf v0.10.1 // indirect github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c // indirect - github.com/jtacoma/uritemplates v1.0.0 + github.com/jtacoma/uritemplates v1.0.0 // indirect github.com/justinas/alice v1.2.0 github.com/miekg/dns v1.1.50 github.com/mitchellh/mapstructure v1.5.0 @@ -31,24 +28,24 @@ require ( github.com/stretchr/testify v1.8.1 github.com/ugorji/go/codec v1.2.7 github.com/xmidt-org/argus v0.9.4 - github.com/xmidt-org/bascule v0.11.0 + github.com/xmidt-org/bascule v0.11.0 // indirect github.com/xmidt-org/candlelight v0.0.12 github.com/xmidt-org/sallust v0.1.6 - github.com/xmidt-org/themis v0.4.9 github.com/xmidt-org/themis v0.4.11 github.com/xmidt-org/wrp-go/v3 v3.1.4 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 go.uber.org/fx v1.18.2 go.uber.org/zap v1.23.0 - gopkg.in/natefinch/lumberjack.v2 v2.0.0 + gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect ) +require github.com/go-kit/log v0.2.1 + require ( emperror.dev/emperror v0.33.0 // indirect emperror.dev/errors v0.8.1 // indirect github.com/GaryBoone/GoStats v0.0.0-20130122001700-1993eafbef57 // indirect github.com/VividCortex/gohistogram v1.0.0 // indirect - github.com/armon/go-metrics v0.4.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -56,7 +53,6 @@ require ( github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.3 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -65,13 +61,10 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/google/uuid v1.3.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-hclog v1.3.1 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hashicorp/serf v0.10.1 // indirect - github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/lestrrat-go/blackmagic v1.0.1 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect @@ -82,7 +75,7 @@ require ( github.com/magiconair/properties v1.8.6 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.16 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/openzipkin/zipkin-go v0.4.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect diff --git a/go.sum b/go.sum index a250e65a..663004f8 100644 --- a/go.sum +++ b/go.sum @@ -29,31 +29,148 @@ cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= +cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= +cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= +cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= +cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= +cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= +cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= +cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= +cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= +cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= +cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= +cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= +cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= +cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= +cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= +cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= +cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= +cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= +cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= +cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= +cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= +cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= +cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= +cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= +cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= +cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= +cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= +cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= +cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= +cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= +cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= +cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= +cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= +cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= +cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= +cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= +cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= +cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= +cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= +cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= +cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= +cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= +cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= +cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= +cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= +cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= +cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= +cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= +cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= +cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= +cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= +cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= +cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= +cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= +cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= +cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= +cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= +cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= +cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= +cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= +cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= emperror.dev/emperror v0.33.0 h1:urYop6KLYxKVpZbt9ADC4eVG3WDnJFE6Ye3j07wUu/I= emperror.dev/emperror v0.33.0/go.mod h1:CeOIKPcppTE8wn+3xBNcdzdHMMIP77sLOHS0Ik56m+w= @@ -61,8 +178,9 @@ emperror.dev/errors v0.8.0/go.mod h1:YcRvLPh626Ubn2xqtoprejnA5nFha+TJ+2vew48kWuE emperror.dev/errors v0.8.1 h1:UavXZ5cSX/4u9iyvH6aDcuGkVjeexUGJ7Ij7G4VfQT0= emperror.dev/errors v0.8.1/go.mod h1:YcRvLPh626Ubn2xqtoprejnA5nFha+TJ+2vew48kWuE= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I= github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/GaryBoone/GoStats v0.0.0-20130122001700-1993eafbef57 h1:EUQH/F+mzJBs53c75r7R5zdM/kz7BHXoWBFsVXzadVw= @@ -73,12 +191,13 @@ github.com/InVisionApp/go-health v2.1.0+incompatible/go.mod h1:/+Gv1o8JUsrjC6pi6 github.com/InVisionApp/go-logger v1.0.1/go.mod h1:+cGTDSn+P8105aZkeOfIhdd7vFO5X1afUHcjvanY0L8= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2 h1:koK7z0nSsRiRiBWwa+E714Puh+DO+ZRdIyAXiXzL+lg= github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/sarama v1.30.0/go.mod h1:zujlQQx1kzHsh4jfV1USnptCQrHAEZ2Hk8fTKCulPVs= +github.com/Shopify/sarama v1.37.2/go.mod h1:Nxye/E+YPru//Bpaorfhc3JsSGYwCaDDj+R4bK52U5o= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/Shopify/toxiproxy/v2 v2.1.6-0.20210914104332-15ea381dcdae/go.mod h1:/cvHQkZ1fst0EmZnA5dFtiQdWCNCFYzb+uE2vqVgvx0= +github.com/Shopify/toxiproxy/v2 v2.5.0/go.mod h1:yhM2epWtAmel9CB8r2+L+PCmhH6yH2pITaPAo7jxJl0= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= @@ -107,9 +226,11 @@ github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/aws/aws-sdk-go v1.44.113/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.120 h1:dsOxGf17H9hCVCA4aWpFWEcJMHkX+Uw7l4pGcxb27wM= -github.com/aws/aws-sdk-go v1.44.120/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.123/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.127 h1:IoO2VfuIQg1aMXnl8l6OpNUKT4Qq5CnJMOyIWoTYXj0= +github.com/aws/aws-sdk-go v1.44.127/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.128 h1:X34pX5t0LIZXjBY11yf9JKMP3c1aZgirh+5PjtaZyJ4= +github.com/aws/aws-sdk-go v1.44.128/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= @@ -140,6 +261,7 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -171,9 +293,11 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -191,6 +315,7 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-resiliency v1.3.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= @@ -332,6 +457,7 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -357,6 +483,8 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -364,9 +492,10 @@ github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0 github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/goph/emperror v0.17.1/go.mod h1:+ZbQ+fUNO/6FNiUo0ujtMjhgad9Xa6fQL9KhH4LNHic= -github.com/goph/emperror v0.17.3-0.20190703203600-60a8d9faa17b h1:3/cwc6wu5QADzKEW2HP7+kZpKgm7OHysQ3ULVVQzQhs= github.com/goph/emperror v0.17.3-0.20190703203600-60a8d9faa17b/go.mod h1:+ZbQ+fUNO/6FNiUo0ujtMjhgad9Xa6fQL9KhH4LNHic= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -409,6 +538,7 @@ github.com/hashicorp/consul/sdk v0.11.0 h1:HRzj8YSCln2yGgCumN5CL8lYlD3gBurnervJR github.com/hashicorp/consul/sdk v0.11.0/go.mod h1:yPkX5Q6CsxTFMjQQDJwzeNmUUF5NUGGbrDsv9wTb8cw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= @@ -443,6 +573,7 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -482,8 +613,10 @@ github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= +github.com/jcmturner/gokrb5/v8 v8.4.3/go.mod h1:dqRwJGXznQrzw6cWmyo6kH+E7jksEQG/CyVWsJEsJO0= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= @@ -517,6 +650,7 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -543,6 +677,7 @@ github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbq github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI= github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= github.com/lestrrat-go/jwx v0.9.2/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/YNA/UnBk= +github.com/lestrrat-go/jwx v1.2.25 h1:tAx93jN2SdPvFn08fHNAhqFJazn5mBBOB8Zli0g0otA= github.com/lestrrat-go/jwx v1.2.25/go.mod h1:zoNuZymNl5lgdcu6P7K6ie2QRll5HVfF4xwxBBK1NxY= github.com/lestrrat-go/jwx/v2 v2.0.5/go.mod h1:Wot5JT7sGDorqS+dBi6Cfu6MzsDZP+sAOnQbOJ8rpIA= github.com/lestrrat-go/jwx/v2 v2.0.6 h1:RlyYNLV892Ed7+FTfj1ROoF6x7WxL965PGTHso/60G0= @@ -578,8 +713,8 @@ github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peK github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2 h1:hAHbPm5IJGijwng3PWk09JkG9WeqChjprR5s9bBZ+OM= -github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -682,6 +817,7 @@ github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6 github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -745,6 +881,7 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= +github.com/rabbitmq/amqp091-go v1.5.0/go.mod h1:JsV0ofX5f1nwOGafb8L5rBItt9GyhfQfcJj+oyz0dGg= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -753,9 +890,13 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rollbar/rollbar-go v1.0.2/go.mod h1:AcFs5f0I+c71bpHlXNNDbOWJiKwjFDtISeXco0L5PKQ= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= github.com/rubyist/circuitbreaker v2.2.0+incompatible/go.mod h1:Ycs3JgJADPuzJDwffe12k6BZT8hxVi6lFK+gWYJLN4A= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= @@ -825,8 +966,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= @@ -837,6 +979,7 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= @@ -844,9 +987,12 @@ github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95 github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/urfave/cli/v2 v2.11.0/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xmidt-org/arrange v0.1.9/go.mod h1:PRA8iEZ11L93NsEkDP56x1mZyfDcWxzDULgHj56TaEk= github.com/xmidt-org/arrange v0.3.0 h1:YNO+1lufCx3EeN17xuSRMC1sci9y9rzZVZ+TkWwq9QE= @@ -870,8 +1016,9 @@ github.com/xmidt-org/httpaux v0.3.2 h1:CC8FPiGVtThSRj3fEr9lk2e1bzhhw+l6Vb3BfzfaM github.com/xmidt-org/httpaux v0.3.2/go.mod h1:qmlPisXf80FTi3y4gX43eYbCVruSQyvu+FPx1jzvQG8= github.com/xmidt-org/themis v0.4.4/go.mod h1:0qRYFvKdrQhwjxH/1nAiTgBGT4cegJR76gfEYF5P7so= github.com/xmidt-org/themis v0.4.7/go.mod h1:GlsC/hO9lpZKs6mJNZtbDOf/yDT8tS6NN0k3C+YsWFc= -github.com/xmidt-org/themis v0.4.9 h1:SnQnyzGRC5H6Wpf8Z4YsdKYp5vjS5oSRKZQOlcqJaJk= github.com/xmidt-org/themis v0.4.9/go.mod h1:5cPRieMaJMiWSnDbmaVQQMsDXXO1+pdafSzihQOZltc= +github.com/xmidt-org/themis v0.4.11 h1:ZWkAfYV80pi4Y/lEDdcdxYbRkTRH+nHD/XASfp3+IMw= +github.com/xmidt-org/themis v0.4.11/go.mod h1:3rP6DWv5bnrKdbR5fBOITRpn0fZE4UcKWNJz3OVsEqo= github.com/xmidt-org/touchstone v0.0.3/go.mod h1:++4yF9lobCmQ6U5XOSFKysRtB0avwoXJ80MW+8Kl7ok= github.com/xmidt-org/touchstone v0.1.1/go.mod h1:7Rgqs44l1VndkvFUZewr8WpItzxfJSxMZuudCDop3pE= github.com/xmidt-org/touchstone v0.1.2 h1:XftgpxlRGvUd+ZSZMzFskgRHwTM7hDYwvCd6ExCNe2s= @@ -885,11 +1032,13 @@ github.com/xmidt-org/wrp-go/v3 v3.0.1/go.mod h1:08zAEevd+fM81/asCgsMJdgO8sfKLvqc github.com/xmidt-org/wrp-go/v3 v3.1.4 h1:ug5U3h4NkEtZVu49Ff5leVh+AMlNN8JA6jcOBb6lsAQ= github.com/xmidt-org/wrp-go/v3 v3.1.4/go.mod h1:ZJmcF+K7oKYivfTVlqi4njph+PxQj3WNWL1AqN2bdCw= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= @@ -913,6 +1062,7 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/contrib v0.19.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.19.0/go.mod h1:ze4w2zyQP+FvZjaahHaUVD7h4razLhDOsZD3qFKXc3c= go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.36.1/go.mod h1:XU1EB47dq4JIrePPJWy6DrqTZcMSA93K+NWaEIx0qYU= +go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.36.4/go.mod h1:f26RulijcxdgrGSYep0AykXM9ZkWoKVtInstDYUR8EU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.19.0/go.mod h1:7RDsakVbjb124lYDEjKuHTuzdqf04hLMEvPv/ufmqMs= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.1/go.mod h1:W6/Lb2w3nD2K/l+4SzaqJUr2Ibj2uHA+PdFZlO5cWus= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 h1:aUEBEdCa6iamGzg6fuYxDA8ThxvOG240mAvWDU+XLio= @@ -922,24 +1072,25 @@ go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= +go.opentelemetry.io/otel v1.11.0/go.mod h1:H2KtuEphyMvlhZ+F7tg9GRhAOe60moNx61Ex+WmiKkk= go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= go.opentelemetry.io/otel/exporters/jaeger v1.7.0/go.mod h1:PwQAOqBgqbLQRKlj466DuD2qyMjbtcPpfPfj+AqbSBs= go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs= -go.opentelemetry.io/otel/exporters/jaeger v1.10.0/go.mod h1:n9IGyx0fgyXXZ/i0foLHNxtET9CzXHzZeKCucvRBFgA= +go.opentelemetry.io/otel/exporters/jaeger v1.11.0/go.mod h1:nRgyJbgJ0hmaUdHwyDpTTfBYz61cTTeeGhVzfQc+FsI= go.opentelemetry.io/otel/exporters/jaeger v1.11.1 h1:F9Io8lqWdGyIbY3/SOGki34LX/l+7OL0gXNxjqwcbuQ= go.opentelemetry.io/otel/exporters/jaeger v1.11.1/go.mod h1:lRa2w3bQ4R4QN6zYsDgy7tEezgoKEu7Ow2g35Y75+KI= go.opentelemetry.io/otel/exporters/stdout v0.19.0/go.mod h1:UI2JnNRaSt9ChIHkk4+uqieH27qKt9isV9e2qRorCtg= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.7.0/go.mod h1:K4GDXPY6TjUiwbOh+DkKaEdCF8y+lvMoM6SeAPyfCCM= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.9.0/go.mod h1:Fl1iS5ZhWgXXXTdJMuBSVsS5nkL5XluHbg97kjOuYU4= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.10.0/go.mod h1:h3Lrh9t3Dnqp3NPwAZx7i37UFX7xrfnO1D+fuClREOA= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.0/go.mod h1:nMt8nBu01qC+8LfJu4puk/OYHovohkISNuy/MMG8yRk= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.1 h1:3Yvzs7lgOw8MmbxmLRsQGwYdCubFmUHSooKaEhQunFQ= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.1/go.mod h1:pyHDt0YlyuENkD2VwHsiRDf+5DfI3EH7pfhUYW6sQUE= go.opentelemetry.io/otel/exporters/trace/jaeger v0.19.0/go.mod h1:BliRm9d7rH44N6CzBQ0OPEPfMqSzf4WvFFvyoocOW9Y= go.opentelemetry.io/otel/exporters/trace/zipkin v0.19.0/go.mod h1:ONsRnXqWLUtdSaLOziKSCaw3r20gFBhnXr8rj6L9cZQ= go.opentelemetry.io/otel/exporters/zipkin v1.7.0/go.mod h1:9YBXeOMFLQGwNEjsxMRiWPGoJX83usGMhbCmxUbNe5I= go.opentelemetry.io/otel/exporters/zipkin v1.9.0/go.mod h1:HyIvYIu37wV4Wx5azd7e05x9k/dOz9KB4x0plw2QNvs= -go.opentelemetry.io/otel/exporters/zipkin v1.10.0/go.mod h1:HdfvgwcOoCB0+zzrTHycW6btjK0zNpkz2oTGO815SCI= +go.opentelemetry.io/otel/exporters/zipkin v1.11.0/go.mod h1:unWnsLCMYfINP8ue0aXVrB/GYHoXNn/lbTnupvLekGQ= go.opentelemetry.io/otel/exporters/zipkin v1.11.1 h1:JlJ3/oQoyqlrPDCfsSVFcHgGeHvZq+hr1VPWtiYCXTo= go.opentelemetry.io/otel/exporters/zipkin v1.11.1/go.mod h1:T4S6aVwIS1+MHA+dJHCcPROtZe6ORwnv5vMKPRapsFw= go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc= @@ -950,7 +1101,7 @@ go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoT go.opentelemetry.io/otel/sdk v0.19.0/go.mod h1:ouO7auJYMivDjywCHA6bqTI7jJMVQV1HdKR5CmH8DGo= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= -go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE= +go.opentelemetry.io/otel/sdk v1.11.0/go.mod h1:REusa8RsyKaq0OlyangWXaw97t2VogoO4SSEeKkSTAk= go.opentelemetry.io/otel/sdk v1.11.1 h1:F7KmQgoHljhUuJyA+9BiU+EkJfyX5nVVF4wyzWZpKxs= go.opentelemetry.io/otel/sdk v1.11.1/go.mod h1:/l3FE4SupHJ12TduVjUkZtlfFqDCQJlOlithYrdktys= go.opentelemetry.io/otel/sdk/export/metric v0.19.0/go.mod h1:exXalzlU6quLTXiv29J+Qpj/toOzL3H5WvpbbjouTBo= @@ -959,6 +1110,7 @@ go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bj go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= +go.opentelemetry.io/otel/trace v1.11.0/go.mod h1:nyYjis9jy0gytE9LXGU+/m1sHTKbRY0fX0hulNNDP1U= go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ= go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= @@ -986,8 +1138,9 @@ go.uber.org/fx v1.18.2/go.mod h1:g0V1KMQ66zIRk8bLu3Ea5Jt2w/cHlOIp4wdRsgh0JaY= go.uber.org/goleak v0.10.0/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= @@ -1024,13 +1177,14 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20221010152910-d6f0a8c073c2/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1072,6 +1226,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1136,7 +1291,14 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220725212005-46097bf591d3/go.mod h1:AaygXjzTFtRAg2ttMY5RMuhpJ3cNnI0XpyFJD1iQRSM= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20220927171203-f486391704dc/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221004154528-8021a29435af/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1159,6 +1321,10 @@ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1171,8 +1337,10 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 h1:ZrnxWX62AgTKOSagEqxvb3ffipvEDX2pl7E1TdqLqIc= +golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1272,18 +1440,24 @@ golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20221006211917-84dc82d7e875/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1293,6 +1467,7 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1372,6 +1547,7 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1423,8 +1599,17 @@ google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/S google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1475,6 +1660,7 @@ google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= @@ -1511,8 +1697,32 @@ google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= +google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1549,6 +1759,10 @@ google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ5 google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From 7a7c393f8c584e44f03283abe40ae06717f32743 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 17:10:31 -0400 Subject: [PATCH 45/48] update --- go.mod | 4 ---- go.sum | 5 ----- 2 files changed, 9 deletions(-) diff --git a/go.mod b/go.mod index b5607348..1a1108e7 100644 --- a/go.mod +++ b/go.mod @@ -116,7 +116,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/xmidt-org/sallust => /Users/odc/Documents/GitHub/xmidt-org/sallust - -replace github.com/xmidt-org/argus => /Users/odc/Documents/GitHub/xmidt-org/argus diff --git a/go.sum b/go.sum index 663004f8..0a2b53f1 100644 --- a/go.sum +++ b/go.sum @@ -227,8 +227,6 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.44.123/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.127 h1:IoO2VfuIQg1aMXnl8l6OpNUKT4Qq5CnJMOyIWoTYXj0= -github.com/aws/aws-sdk-go v1.44.127/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.44.128 h1:X34pX5t0LIZXjBY11yf9JKMP3c1aZgirh+5PjtaZyJ4= github.com/aws/aws-sdk-go v1.44.128/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= @@ -261,7 +259,6 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -677,7 +674,6 @@ github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbq github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI= github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= github.com/lestrrat-go/jwx v0.9.2/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/YNA/UnBk= -github.com/lestrrat-go/jwx v1.2.25 h1:tAx93jN2SdPvFn08fHNAhqFJazn5mBBOB8Zli0g0otA= github.com/lestrrat-go/jwx v1.2.25/go.mod h1:zoNuZymNl5lgdcu6P7K6ie2QRll5HVfF4xwxBBK1NxY= github.com/lestrrat-go/jwx/v2 v2.0.5/go.mod h1:Wot5JT7sGDorqS+dBi6Cfu6MzsDZP+sAOnQbOJ8rpIA= github.com/lestrrat-go/jwx/v2 v2.0.6 h1:RlyYNLV892Ed7+FTfj1ROoF6x7WxL965PGTHso/60G0= @@ -979,7 +975,6 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= From fafdf5fa5def053da255aeede07adbbd86aa2bef Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Tue, 1 Nov 2022 17:10:41 -0400 Subject: [PATCH 46/48] update --- go.mod | 1 - go.sum | 418 ++++++++++++++++++++++++--------------------------------- 2 files changed, 172 insertions(+), 247 deletions(-) diff --git a/go.mod b/go.mod index 1a1108e7..4b190475 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,6 @@ require github.com/go-kit/log v0.2.1 require ( emperror.dev/emperror v0.33.0 // indirect emperror.dev/errors v0.8.1 // indirect - github.com/GaryBoone/GoStats v0.0.0-20130122001700-1993eafbef57 // indirect github.com/VividCortex/gohistogram v1.0.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect diff --git a/go.sum b/go.sum index 0a2b53f1..9b4f74d0 100644 --- a/go.sum +++ b/go.sum @@ -29,159 +29,46 @@ cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= -cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= -cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= -cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= -cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= -cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= -cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= -cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= -cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= -cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= -cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= -cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= -cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= -cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= -cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= -cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= -cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= -cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= -cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= -cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= -cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= -cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= -cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= -cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= -cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= -cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= -cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= -cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= -cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= -cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= -cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= -cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= -cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= -cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= -cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= -cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= -cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= -cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= -cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= -cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= -cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= -cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= -cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= -cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= -cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= -cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= -cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= -cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= -cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= -cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= -cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= -cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= -cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= -cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= -cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= -cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= -cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= -cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= -cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= -cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= -cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= -cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= -cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= -cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= -cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= -cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= -cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= -cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= -cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= -cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= -cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= -cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= -cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= -cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= -cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= -cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= -cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= -cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= -cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= -cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= -cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= -cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= -cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= -cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= -cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= -cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= -cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= -cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= -cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= -cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= -cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= -cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= -cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= -cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= -cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= -cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= -cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= -cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= -cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= -cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= -cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= -cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= -cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= -cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= -cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= -cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +emperror.dev/emperror v0.30.0/go.mod h1:ZasUgT1WGMbTYZzEWmyPuc6pCxRjO6Kp8lZz4FRRIiM= emperror.dev/emperror v0.33.0 h1:urYop6KLYxKVpZbt9ADC4eVG3WDnJFE6Ye3j07wUu/I= emperror.dev/emperror v0.33.0/go.mod h1:CeOIKPcppTE8wn+3xBNcdzdHMMIP77sLOHS0Ik56m+w= +emperror.dev/errors v0.7.0/go.mod h1:X4dljzQehaz3WfBKc6c7bR+ve2ZsRzbBkFBF+HTcW0M= emperror.dev/errors v0.8.0/go.mod h1:YcRvLPh626Ubn2xqtoprejnA5nFha+TJ+2vew48kWuE= emperror.dev/errors v0.8.1 h1:UavXZ5cSX/4u9iyvH6aDcuGkVjeexUGJ7Ij7G4VfQT0= emperror.dev/errors v0.8.1/go.mod h1:YcRvLPh626Ubn2xqtoprejnA5nFha+TJ+2vew48kWuE= +github.com/Azure/azure-sdk-for-go v16.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/go-autorest v10.7.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest v10.15.3+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/GaryBoone/GoStats v0.0.0-20130122001700-1993eafbef57 h1:EUQH/F+mzJBs53c75r7R5zdM/kz7BHXoWBFsVXzadVw= github.com/GaryBoone/GoStats v0.0.0-20130122001700-1993eafbef57/go.mod h1:5zDl2HgTb/k5i9op9y6IUSiuVkZFpUrWGQbZc9tNR40= @@ -190,16 +77,18 @@ github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXY github.com/InVisionApp/go-health v2.1.0+incompatible/go.mod h1:/+Gv1o8JUsrjC6pi6MN6/CgKJo4OqZ6x77XAnImrzhg= github.com/InVisionApp/go-logger v1.0.1/go.mod h1:+cGTDSn+P8105aZkeOfIhdd7vFO5X1afUHcjvanY0L8= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Microsoft/go-winio v0.4.3/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= +github.com/NYTimes/gziphandler v1.0.1/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/sarama v1.30.0/go.mod h1:zujlQQx1kzHsh4jfV1USnptCQrHAEZ2Hk8fTKCulPVs= -github.com/Shopify/sarama v1.37.2/go.mod h1:Nxye/E+YPru//Bpaorfhc3JsSGYwCaDDj+R4bK52U5o= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/Shopify/toxiproxy/v2 v2.1.6-0.20210914104332-15ea381dcdae/go.mod h1:/cvHQkZ1fst0EmZnA5dFtiQdWCNCFYzb+uE2vqVgvx0= -github.com/Shopify/toxiproxy/v2 v2.5.0/go.mod h1:yhM2epWtAmel9CB8r2+L+PCmhH6yH2pITaPAo7jxJl0= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/airbrake/gobrake v3.6.1+incompatible/go.mod h1:wM4gu3Cn0W0K7GUuVWnlXZU11AGBXMILnrdOU8Kn00o= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -214,6 +103,7 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= github.com/armon/go-metrics v0.3.4/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= @@ -223,10 +113,11 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.8.12/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k= +github.com/aws/aws-sdk-go v1.25.41/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/aws/aws-sdk-go v1.44.123/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.44.128 h1:X34pX5t0LIZXjBY11yf9JKMP3c1aZgirh+5PjtaZyJ4= github.com/aws/aws-sdk-go v1.44.128/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= @@ -248,6 +139,7 @@ github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCS github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bugsnag/bugsnag-go v1.4.0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/panicwrap v1.2.0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/c9s/goprocinfo v0.0.0-20151025191153-19cb9f127a9c/go.mod h1:uEyr4WpAH4hio6LFriaPkL938XnrvLpNPmQHBdrmbIE= @@ -255,6 +147,7 @@ github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 h1:SjZ2GvvOononHOpK github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8/go.mod h1:uEyr4WpAH4hio6LFriaPkL938XnrvLpNPmQHBdrmbIE= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= +github.com/cenk/backoff v2.0.0+incompatible/go.mod h1:7FtoeaSnHoZnmZzz47cM35Y9nSW7tNyaidugnHTaFDE= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -282,6 +175,7 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coredns/coredns v1.1.2/go.mod h1:zASH/MVDgR6XZTbxvOnsZfffS+31vg6Ackf/wo1+AM0= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -290,11 +184,9 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -302,21 +194,27 @@ github.com/davecgh/go-spew v1.1.1-0.20171005155431-ecdeabc65495/go.mod h1:J7Y8Yc github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d/go.mod h1:tmAIfUFEirG/Y8jhZ9M+h36obRZAk/1fcSpXwAVlfqE= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= +github.com/denverdino/aliyungo v0.0.0-20170926055100-d3308649c661/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/digitalocean/godo v1.1.1/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= +github.com/digitalocean/godo v1.10.0/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= +github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= +github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-resiliency v1.3.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.8.0/go.mod h1:GSSbY9P1neVhdY7G4wu+IK1rk/dqhiCC/4ExuWJZVuk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -326,12 +224,15 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a/go.mod h1:7Ga40egUymuWXxAe151lTNnCv97MddSOVsjpPPkityA= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= @@ -353,6 +254,7 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.36.1-0.20180420150025-bda519ae5f4c/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -362,6 +264,7 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -372,22 +275,24 @@ github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= -github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.9.10/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gocql/gocql v1.2.1/go.mod h1:3gM2c4D3AnkISwBxGnMMsS8Oy4y2lhbPRsH4xnJrHG8= +github.com/gocql/gocql v0.0.0-20200505093417-effcbd8bcf0e/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -433,7 +338,9 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -454,7 +361,8 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -480,8 +388,6 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -489,11 +395,12 @@ github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0 github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/goph/emperror v0.17.1/go.mod h1:+ZbQ+fUNO/6FNiUo0ujtMjhgad9Xa6fQL9KhH4LNHic= github.com/goph/emperror v0.17.3-0.20190703203600-60a8d9faa17b/go.mod h1:+ZbQ+fUNO/6FNiUo0ujtMjhgad9Xa6fQL9KhH4LNHic= +github.com/gophercloud/gophercloud v0.0.0-20180828235145-f29afc2cceca/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= +github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -511,6 +418,7 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -520,8 +428,12 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= +github.com/hashicorp/consul v1.4.2/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= +github.com/hashicorp/consul v1.7.0 h1:Wr3ccN8CtIpIJ6iRipFt3iggVyMGspt0h3vrwTR/Lrw= +github.com/hashicorp/consul v1.7.0/go.mod h1:vKfXmSQNl6HwO/JqQ2DDLzisBDV49y+JVTkrdW1cnSU= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/api v1.4.0/go.mod h1:xc8u05kyMa3Wjr9eEAsIAo3dg8+LywT5E/Cl7cNS5nU= github.com/hashicorp/consul/api v1.7.0/go.mod h1:1NSuaUUkFaJzMasbfq/11wKYWSR67Xn6r2DXKhuDNFg= github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= @@ -529,17 +441,24 @@ github.com/hashicorp/consul/api v1.15.3 h1:WYONYL2rxTXtlekAqblR2SCdJsizMDIj/uXb5 github.com/hashicorp/consul/api v1.15.3/go.mod h1:/g/qgcoBcEXALCNZgRRisyTW0nY86++L0KbeAMXYCeY= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.4.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/consul/sdk v0.6.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/consul/sdk v0.11.0 h1:HRzj8YSCln2yGgCumN5CL8lYlD3gBurnervJRJAZyC4= github.com/hashicorp/consul/sdk v0.11.0/go.mod h1:yPkX5Q6CsxTFMjQQDJwzeNmUUF5NUGGbrDsv9wTb8cw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-bexpr v0.1.2/go.mod h1:ANbpTX1oAql27TZkKVeW8p1w8NTdnyzPe/0qqPCKohU= +github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de/go.mod h1:xIwEieBHERyEvaeKF/TcHh1Hu+lxPM+n2vT1+g9I4m4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-connlimit v0.2.0/go.mod h1:OUj9FGL1tPIhl/2RCfzYHrIiWj+VVPGNyVPnUX8AqS0= +github.com/hashicorp/go-discover v0.0.0-20191202160150-7ec2cfbda7a2/go.mod h1:NnH5X4UCBEBdTuK2L8s4e4ilJm3UmGX0bANHCz0HSs0= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= @@ -547,10 +466,12 @@ github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39E github.com/hashicorp/go-hclog v1.3.1 h1:vDwF1DFNZhntP4DAjuTpOw3uEgMUpXh1pB5fW9DqHpo= github.com/hashicorp/go-hclog v1.3.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.2.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-memdb v1.0.3/go.mod h1:LWQ8R70vPrS4OEY9k28D2z8/Zzyu34NVzeRibGAzHO0= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= @@ -558,8 +479,13 @@ github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHh github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-raftchunking v0.6.1/go.mod h1:cGlg3JtDy7qy6c/3Bu660Mic1JF+7lWqIwCFSb08fX0= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90/go.mod h1:o4zcYY1e0GEZI6eSEr+43QDYmuGglw1qSO6qdHUHCgg= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -570,7 +496,7 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= -github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -579,17 +505,26 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/hil v0.0.0-20160711231837-1e86c6b523c5/go.mod h1:KHvg/R2/dPtaePb16oW4qIyzkMxXOL38xjRN64adsts= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.1.5/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.1.6/go.mod h1:5VDNHjqFMgEcclnwmkCnC99IPwxBmIsxwY8qn+Nl0H4= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.1/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= +github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69/go.mod h1:/z+jUGRBlwVpUZfjute9jWaF6/HuhjuFQuL1YXzVD1Q= +github.com/hashicorp/raft v1.1.1/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= +github.com/hashicorp/raft v1.1.2/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= +github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= +github.com/hashicorp/serf v0.8.2-0.20180907130240-48d579458173/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.8.5/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= github.com/hashicorp/serf v0.9.3/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.4/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= @@ -597,23 +532,30 @@ github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpT github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= +github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= +github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= +github.com/hashicorp/vic v1.5.1-0.20190403131502-bbfe86ec9443/go.mod h1:bEpDU35nTu0ey1EXjwNwPjI9xErAsoOCmcMb9GKvyxo= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb v1.5.1-0.20180921190457-8d679cf0c36e/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/influxdata/influxdb1-client v0.0.0-20200515024757-02f0bf5dbca3/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c h1:qSHzRbhzK8RdXOsAdfDgO49TtqC1oZ+acxPrkfTxcCs= github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da/go.mod h1:ks+b9deReOc7jgqp+e7LuFiCBH6Rm5hL32cLcEAArb4= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= -github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= -github.com/jcmturner/gokrb5/v8 v8.4.3/go.mod h1:dqRwJGXznQrzw6cWmyo6kH+E7jksEQG/CyVWsJEsJO0= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= @@ -622,7 +564,9 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/joyent/triton-go v0.0.0-20180628001255-830d2b111e62/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -634,6 +578,7 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtacoma/uritemplates v1.0.0 h1:xwx5sBF7pPAb0Uj8lDC1Q/aBPpOFyQza7OC705ZlLCo= github.com/jtacoma/uritemplates v1.0.0/go.mod h1:IhIICdE9OcvgUnGwTtJxgBQ+VrTrti5PcbLVSJianO8= +github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -647,7 +592,6 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -661,20 +605,16 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= -github.com/lestrrat-go/blackmagic v1.0.0/go.mod h1:TNgH//0vYSs8VXDCfkZLgIrVTTXQELZffUV0tz3MtdQ= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lestrrat-go/blackmagic v1.0.1 h1:lS5Zts+5HIC/8og6cGHb0uCcNCa3OUt1ygh3Qz2Fe80= github.com/lestrrat-go/blackmagic v1.0.1/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU= github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE= github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E= github.com/lestrrat-go/httprc v1.0.4 h1:bAZymwoZQb+Oq8MEbyipag7iSq6YIga8Wj6GOiJGdI8= github.com/lestrrat-go/httprc v1.0.4/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo= -github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbqPDrJ/OJc= github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI= github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= github.com/lestrrat-go/jwx v0.9.2/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/YNA/UnBk= -github.com/lestrrat-go/jwx v1.2.25/go.mod h1:zoNuZymNl5lgdcu6P7K6ie2QRll5HVfF4xwxBBK1NxY= github.com/lestrrat-go/jwx/v2 v2.0.5/go.mod h1:Wot5JT7sGDorqS+dBi6Cfu6MzsDZP+sAOnQbOJ8rpIA= github.com/lestrrat-go/jwx/v2 v2.0.6 h1:RlyYNLV892Ed7+FTfj1ROoF6x7WxL965PGTHso/60G0= github.com/lestrrat-go/jwx/v2 v2.0.6/go.mod h1:aVrGuwEr3cp2Prw6TtQvr8sQxe+84gruID5C9TxT64Q= @@ -684,6 +624,14 @@ github.com/lestrrat/go-jwx v0.0.0-20180221005942-b7d4802280ae/go.mod h1:T+yHdCP6 github.com/lestrrat/go-pdebug v0.0.0-20180220043741-569c97477ae8/go.mod h1:VXFH11P7fHn2iPBsfSW1JacR59rttTcafJnwYcI/IdY= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/likexian/gokit v0.0.0-20190309162924-0a377eecf7aa/go.mod h1:QdfYv6y6qPA9pbBA2qXtoT8BMKha6UyNbxWGWl/9Jfk= +github.com/likexian/gokit v0.0.0-20190418170008-ace88ad0983b/go.mod h1:KKqSnk/VVSW8kEyO2vVCXoanzEutKdlBAPohmGXkxCk= +github.com/likexian/gokit v0.0.0-20190501133040-e77ea8b19cdc/go.mod h1:3kvONayqCaj+UgrRZGpgfXzHdMYCAO0KAt4/8n0L57Y= +github.com/likexian/gokit v0.20.16/go.mod h1:kn+nTv3tqh6yhor9BC4Lfiu58SmH8NmQ2PmEl+uM6nU= +github.com/likexian/simplejson-go v0.0.0-20190409170913-40473a74d76d/go.mod h1:Typ1BfnATYtZ/+/shXfFYLrovhFyuKvzwrdOnIDHlmg= +github.com/likexian/simplejson-go v0.0.0-20190419151922-c1f9f0b4f084/go.mod h1:U4O1vIJvIKwbMZKUJ62lppfdvkCdVd2nfMimHK81eec= +github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b/go.mod h1:3BWwtmKP9cXWwYCr5bkoVDEfLywacOv0s06OBEDpyt8= +github.com/linode/linodego v0.7.1/go.mod h1:ga11n3ivecUrPCHN0rANxKmfWBJVkOXfLMZinAbj2sY= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -721,13 +669,16 @@ github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.0/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -738,6 +689,8 @@ github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -759,6 +712,7 @@ github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1t github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= +github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2/go.mod h1:TLb2Sg7HQcgGdloNxkrmtgDNR9uVYF3lfdFIN4Ro6Sk= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -774,6 +728,8 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -795,6 +751,7 @@ github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa github.com/openzipkin/zipkin-go v0.4.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ= github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfPcEO5A= github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM= +github.com/packethost/packngo v0.1.1-0.20180711074735-b9cb5096f54c/go.mod h1:otzZQXgoO96RTzDB/Hycg0qZcXZsWJGJRSXbmEIJ+4M= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -810,13 +767,15 @@ github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwb github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea/go.mod h1:1VcHEd3ro4QMoHfiNl/j7Jkln9+KQuorp0PItHMJYNg= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1-0.20181008045315-2233dee583dc/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= @@ -827,6 +786,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -850,6 +810,7 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -865,6 +826,7 @@ github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+ github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -877,39 +839,41 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= -github.com/rabbitmq/amqp091-go v1.5.0/go.mod h1:JsV0ofX5f1nwOGafb8L5rBItt9GyhfQfcJj+oyz0dGg= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/renier/xmlrpc v0.0.0-20170708154548-ce4a1a486c03/go.mod h1:gRAiPF5C5Nd0eyyRdqIu9qTiFSoZzpTq727b5B8fkkU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rollbar/rollbar-go v1.0.2/go.mod h1:AcFs5f0I+c71bpHlXNNDbOWJiKwjFDtISeXco0L5PKQ= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= github.com/rubyist/circuitbreaker v2.2.0+incompatible/go.mod h1:Ycs3JgJADPuzJDwffe12k6BZT8hxVi6lFK+gWYJLN4A= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= +github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/ksuid v1.0.2/go.mod h1:BXuJDr2byAiHuQaQtSKoXh1J0YmUDurywOXgB2w+OSU= github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= +github.com/shirou/gopsutil v0.0.0-20181107111621-48177ef5f880/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smartystreets/assertions v0.0.0-20180820201707-7c9eb446e3cf/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/softlayer/softlayer-go v0.0.0-20180806151055-260589d94c7d/go.mod h1:Cw4GTlQccdRGSEf6KiMju767x0NEHE0YIVPJSaXjlsw= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -930,10 +894,13 @@ github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb6 github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= +github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= @@ -961,7 +928,6 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= @@ -970,6 +936,8 @@ github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= +github.com/tent/http-link-go v0.0.0-20130702225549-ac974c61c2f9/go.mod h1:RHkNRtSLfOK7qBTHaeSX1D6BNpI3qw7NTxsmNr4RvN8= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -982,16 +950,23 @@ github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95 github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/urfave/cli/v2 v2.11.0/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= +github.com/vmware/govmomi v0.18.0/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xmidt-org/argus v0.3.9/go.mod h1:mDFS44R704gl9Fif3gkfAyvnZa53SvMepmXjYWABPvk= +github.com/xmidt-org/argus v0.3.10-0.20201105190057-402fede05764/go.mod h1:lnMCVB/i0gOlUOOd2WbzDDgzTEqP5TipzQ8xKIw+N/I= +github.com/xmidt-org/argus v0.3.10-0.20201217204602-66f69b12c498/go.mod h1:lnMCVB/i0gOlUOOd2WbzDDgzTEqP5TipzQ8xKIw+N/I= +github.com/xmidt-org/argus v0.3.12/go.mod h1:T0oHbqQ1SAjE616Q9f1p+7nsmuvmHNoC0zAIUpUiFuE= +github.com/xmidt-org/argus v0.5.0/go.mod h1:8nMg4ywpWCNPgUzwtWhiPAxklrmVsoxwciGJ/OD4FHE= +github.com/xmidt-org/argus v0.9.4 h1:Cj2tOxO1vQFtcWJknNErRq7AteyKSibdUHfV/qBk7j8= +github.com/xmidt-org/argus v0.9.4/go.mod h1:nwqzKp1LsO/6p7GN6e+4101K216l2IorCnihE5+0v3E= github.com/xmidt-org/arrange v0.1.9/go.mod h1:PRA8iEZ11L93NsEkDP56x1mZyfDcWxzDULgHj56TaEk= github.com/xmidt-org/arrange v0.3.0 h1:YNO+1lufCx3EeN17xuSRMC1sci9y9rzZVZ+TkWwq9QE= github.com/xmidt-org/arrange v0.3.0/go.mod h1:pCHeb93OFA0QnEJ//Mmly7QqUt7y/w3xllK0VQ3Bigo= +github.com/xmidt-org/bascule v0.8.0/go.mod h1:dPxlbNT3lCwYAtOq2zbzyzTEKgM+azLSbKKcVmgSHBY= +github.com/xmidt-org/bascule v0.8.1/go.mod h1:dPxlbNT3lCwYAtOq2zbzyzTEKgM+azLSbKKcVmgSHBY= github.com/xmidt-org/bascule v0.9.0/go.mod h1:C64nSBtUTTK/f2/mCvvp/qJhav5raD0T+by68DCp/gU= github.com/xmidt-org/bascule v0.10.1/go.mod h1:unqyDUxjulfGFnx4kYWbonTGkVHGWPUjUrBkUi1sjWw= github.com/xmidt-org/bascule v0.11.0 h1:A5RoGFA3XqF7Az1FBF9uEBqhUQ3dLvyhefpS7UkNAvA= @@ -1009,9 +984,11 @@ github.com/xmidt-org/httpaux v0.1.2/go.mod h1:qZnH2uObGPwHnOz8HcPNlbcd3gKEvdmxbI github.com/xmidt-org/httpaux v0.2.1/go.mod h1:mviIlg5fHGb3lAv3l0sbiwVG/q9rqvXaudEYxVrzXdE= github.com/xmidt-org/httpaux v0.3.2 h1:CC8FPiGVtThSRj3fEr9lk2e1bzhhw+l6Vb3BfzfaMG0= github.com/xmidt-org/httpaux v0.3.2/go.mod h1:qmlPisXf80FTi3y4gX43eYbCVruSQyvu+FPx1jzvQG8= +github.com/xmidt-org/sallust v0.1.5/go.mod h1:azcKBypudADIeZ3Em8zGjVq3yQ7n4ueSvM/degHMIxo= +github.com/xmidt-org/sallust v0.1.6 h1:MZAU0rD0flrGrKs6+Nx3mpjwKV6QsWJlEBegRfKVnQ4= +github.com/xmidt-org/sallust v0.1.6/go.mod h1:c6J68AkKaSp0Nc6fSBTwkS1vgc3lVAC3AdofrD10ldA= github.com/xmidt-org/themis v0.4.4/go.mod h1:0qRYFvKdrQhwjxH/1nAiTgBGT4cegJR76gfEYF5P7so= github.com/xmidt-org/themis v0.4.7/go.mod h1:GlsC/hO9lpZKs6mJNZtbDOf/yDT8tS6NN0k3C+YsWFc= -github.com/xmidt-org/themis v0.4.9/go.mod h1:5cPRieMaJMiWSnDbmaVQQMsDXXO1+pdafSzihQOZltc= github.com/xmidt-org/themis v0.4.11 h1:ZWkAfYV80pi4Y/lEDdcdxYbRkTRH+nHD/XASfp3+IMw= github.com/xmidt-org/themis v0.4.11/go.mod h1:3rP6DWv5bnrKdbR5fBOITRpn0fZE4UcKWNJz3OVsEqo= github.com/xmidt-org/touchstone v0.0.3/go.mod h1:++4yF9lobCmQ6U5XOSFKysRtB0avwoXJ80MW+8Kl7ok= @@ -1020,20 +997,23 @@ github.com/xmidt-org/touchstone v0.1.2 h1:XftgpxlRGvUd+ZSZMzFskgRHwTM7hDYwvCd6Ex github.com/xmidt-org/touchstone v0.1.2/go.mod h1:2xVJVO8FE393Aofw/FD8Cu9wXES4n1AlJP109Nk7/gg= github.com/xmidt-org/webpa-common v1.1.0/go.mod h1:oCpKzOC+9h2vYHVzAU/06tDTQuBN4RZz+rhgIXptpOI= github.com/xmidt-org/webpa-common v1.3.2/go.mod h1:oCpKzOC+9h2vYHVzAU/06tDTQuBN4RZz+rhgIXptpOI= +github.com/xmidt-org/webpa-common v1.10.2-0.20200604164000-f07406b4eb63/go.mod h1:Fmt3wIxBzwJY0KeRHX6RaLZx2xpKTbXCLEA3Xtd6kq8= +github.com/xmidt-org/webpa-common v1.11.2/go.mod h1:BaP0q1tlorm1Egq2qeLelon4Avy9n1eKJQAYhL3Zxg0= github.com/xmidt-org/webpa-common v1.11.4/go.mod h1:ffQHH+pCRnoxtdbyIkCbOSDVhV62X47UA64fugPyu30= +github.com/xmidt-org/webpa-common v1.11.5-0.20210120003553-3d03d7329aee/go.mod h1:NtJzdNhDznwjWiRKDnj/vxdQZnPOhuQ6haemx+nDMSY= github.com/xmidt-org/webpa-common v1.11.5/go.mod h1:jMyROPQmgvNS+P0csPodDMikqesqPFzlb3v/JVw2SmY= github.com/xmidt-org/webpa-common v1.11.9/go.mod h1:lSfUaPF/LA6PCHviTQk1XuTtqvdFcHzyACwdtH94ZfU= +github.com/xmidt-org/wrp-go v1.3.4/go.mod h1:EWC9BgcYYO1hKgLzz6VFPpg3LU6ZWSDV/uNiWC7zP+o= +github.com/xmidt-org/wrp-go/v2 v2.0.1/go.mod h1:v0HK0go/7OSVDvKbnXsUn6c+M987p0yyxWEs8/Fmf60= github.com/xmidt-org/wrp-go/v3 v3.0.1/go.mod h1:08zAEevd+fM81/asCgsMJdgO8sfKLvqclqJGX1pphnE= github.com/xmidt-org/wrp-go/v3 v3.1.4 h1:ug5U3h4NkEtZVu49Ff5leVh+AMlNN8JA6jcOBb6lsAQ= github.com/xmidt-org/wrp-go/v3 v3.1.4/go.mod h1:ZJmcF+K7oKYivfTVlqi4njph+PxQj3WNWL1AqN2bdCw= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= @@ -1056,47 +1036,37 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/contrib v0.19.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.19.0/go.mod h1:ze4w2zyQP+FvZjaahHaUVD7h4razLhDOsZD3qFKXc3c= -go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.36.1/go.mod h1:XU1EB47dq4JIrePPJWy6DrqTZcMSA93K+NWaEIx0qYU= -go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.36.4/go.mod h1:f26RulijcxdgrGSYep0AykXM9ZkWoKVtInstDYUR8EU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.19.0/go.mod h1:7RDsakVbjb124lYDEjKuHTuzdqf04hLMEvPv/ufmqMs= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.1/go.mod h1:W6/Lb2w3nD2K/l+4SzaqJUr2Ibj2uHA+PdFZlO5cWus= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 h1:aUEBEdCa6iamGzg6fuYxDA8ThxvOG240mAvWDU+XLio= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4/go.mod h1:l2MdsbKTocpPS5nQZscqTR9jd8u96VYZdcpF8Sye7mA= go.opentelemetry.io/contrib/propagators v0.19.0/go.mod h1:4QOdZClXISU5S43xZxk5tYaWcpb+lehqfKtE6PK6msE= go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg= go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= -go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= -go.opentelemetry.io/otel v1.11.0/go.mod h1:H2KtuEphyMvlhZ+F7tg9GRhAOe60moNx61Ex+WmiKkk= go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= go.opentelemetry.io/otel/exporters/jaeger v1.7.0/go.mod h1:PwQAOqBgqbLQRKlj466DuD2qyMjbtcPpfPfj+AqbSBs= go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs= -go.opentelemetry.io/otel/exporters/jaeger v1.11.0/go.mod h1:nRgyJbgJ0hmaUdHwyDpTTfBYz61cTTeeGhVzfQc+FsI= go.opentelemetry.io/otel/exporters/jaeger v1.11.1 h1:F9Io8lqWdGyIbY3/SOGki34LX/l+7OL0gXNxjqwcbuQ= go.opentelemetry.io/otel/exporters/jaeger v1.11.1/go.mod h1:lRa2w3bQ4R4QN6zYsDgy7tEezgoKEu7Ow2g35Y75+KI= go.opentelemetry.io/otel/exporters/stdout v0.19.0/go.mod h1:UI2JnNRaSt9ChIHkk4+uqieH27qKt9isV9e2qRorCtg= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.7.0/go.mod h1:K4GDXPY6TjUiwbOh+DkKaEdCF8y+lvMoM6SeAPyfCCM= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.9.0/go.mod h1:Fl1iS5ZhWgXXXTdJMuBSVsS5nkL5XluHbg97kjOuYU4= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.0/go.mod h1:nMt8nBu01qC+8LfJu4puk/OYHovohkISNuy/MMG8yRk= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.1 h1:3Yvzs7lgOw8MmbxmLRsQGwYdCubFmUHSooKaEhQunFQ= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.1/go.mod h1:pyHDt0YlyuENkD2VwHsiRDf+5DfI3EH7pfhUYW6sQUE= go.opentelemetry.io/otel/exporters/trace/jaeger v0.19.0/go.mod h1:BliRm9d7rH44N6CzBQ0OPEPfMqSzf4WvFFvyoocOW9Y= go.opentelemetry.io/otel/exporters/trace/zipkin v0.19.0/go.mod h1:ONsRnXqWLUtdSaLOziKSCaw3r20gFBhnXr8rj6L9cZQ= go.opentelemetry.io/otel/exporters/zipkin v1.7.0/go.mod h1:9YBXeOMFLQGwNEjsxMRiWPGoJX83usGMhbCmxUbNe5I= go.opentelemetry.io/otel/exporters/zipkin v1.9.0/go.mod h1:HyIvYIu37wV4Wx5azd7e05x9k/dOz9KB4x0plw2QNvs= -go.opentelemetry.io/otel/exporters/zipkin v1.11.0/go.mod h1:unWnsLCMYfINP8ue0aXVrB/GYHoXNn/lbTnupvLekGQ= go.opentelemetry.io/otel/exporters/zipkin v1.11.1 h1:JlJ3/oQoyqlrPDCfsSVFcHgGeHvZq+hr1VPWtiYCXTo= go.opentelemetry.io/otel/exporters/zipkin v1.11.1/go.mod h1:T4S6aVwIS1+MHA+dJHCcPROtZe6ORwnv5vMKPRapsFw= go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc= -go.opentelemetry.io/otel/metric v0.32.1/go.mod h1:iLPP7FaKMAD5BIxJ2VX7f2KTuz//0QK2hEUyti5psqQ= go.opentelemetry.io/otel/metric v0.33.0 h1:xQAyl7uGEYvrLAiV/09iTJlp1pZnQ9Wl793qbVvED1E= go.opentelemetry.io/otel/metric v0.33.0/go.mod h1:QlTYc+EnYNq/M2mNk1qDDMRLpqCOj2f/r5c7Fd5FYaI= go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA= go.opentelemetry.io/otel/sdk v0.19.0/go.mod h1:ouO7auJYMivDjywCHA6bqTI7jJMVQV1HdKR5CmH8DGo= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= -go.opentelemetry.io/otel/sdk v1.11.0/go.mod h1:REusa8RsyKaq0OlyangWXaw97t2VogoO4SSEeKkSTAk= go.opentelemetry.io/otel/sdk v1.11.1 h1:F7KmQgoHljhUuJyA+9BiU+EkJfyX5nVVF4wyzWZpKxs= go.opentelemetry.io/otel/sdk v1.11.1/go.mod h1:/l3FE4SupHJ12TduVjUkZtlfFqDCQJlOlithYrdktys= go.opentelemetry.io/otel/sdk/export/metric v0.19.0/go.mod h1:exXalzlU6quLTXiv29J+Qpj/toOzL3H5WvpbbjouTBo= @@ -1104,8 +1074,6 @@ go.opentelemetry.io/otel/sdk/metric v0.19.0/go.mod h1:t12+Mqmj64q1vMpxHlCGXGggo0 go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= -go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= -go.opentelemetry.io/otel/trace v1.11.0/go.mod h1:nyYjis9jy0gytE9LXGU+/m1sHTKbRY0fX0hulNNDP1U= go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ= go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= @@ -1118,12 +1086,14 @@ go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/dig v1.7.0/go.mod h1:z+dSd2TP9Usi48jL8M3v63iSBVkiwtVyMKxMZYYauPg= +go.uber.org/dig v1.9.0/go.mod h1:X34SnWGr8Fyla9zQNO2GSO2D+TIuqB14OS8JhYocIyw= go.uber.org/dig v1.10.0/go.mod h1:X34SnWGr8Fyla9zQNO2GSO2D+TIuqB14OS8JhYocIyw= go.uber.org/dig v1.14.0/go.mod h1:jHAn/z1Ld1luVVyGKOAIFYz/uBFqKjjEEdIqVAqfQ2o= go.uber.org/dig v1.14.1/go.mod h1:52EKx/Vjdpz9EzeNcweC4YMsTrDdFn9mS/+Uw5ZnVTI= go.uber.org/dig v1.15.0 h1:vq3YWr8zRj1eFGC7Gvf907hE0eRjPTZ1d3xHadD6liE= go.uber.org/dig v1.15.0/go.mod h1:pKHs0wMynzL6brANhB2hLMro+zalv1osARTviTcqHLM= go.uber.org/fx v1.9.0/go.mod h1:mFdUyAUuJ3w4jAckiKSKbldsxy1ojpAMJ+dVZg5Y0Aw= +go.uber.org/fx v1.12.0/go.mod h1:egT3Kyg1JFYQkvKLZ3EsykxkNrZxgXS+gKoKo7abERY= go.uber.org/fx v1.13.0/go.mod h1:bREWhavnedxpJeTq9pQT53BbvwhUv7TcpsOqcH4a+3w= go.uber.org/fx v1.13.1/go.mod h1:bREWhavnedxpJeTq9pQT53BbvwhUv7TcpsOqcH4a+3w= go.uber.org/fx v1.17.1/go.mod h1:yO7KN5rhlARljyo4LR047AjaV6J+KFzd/Z7rnTbEn0A= @@ -1133,9 +1103,8 @@ go.uber.org/fx v1.18.2/go.mod h1:g0V1KMQ66zIRk8bLu3Ea5Jt2w/cHlOIp4wdRsgh0JaY= go.uber.org/goleak v0.10.0/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= @@ -1163,6 +1132,7 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1172,14 +1142,10 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20221010152910-d6f0a8c073c2/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1221,7 +1187,6 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1286,16 +1251,9 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220725212005-46097bf591d3/go.mod h1:AaygXjzTFtRAg2ttMY5RMuhpJ3cNnI0XpyFJD1iQRSM= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20220927171203-f486391704dc/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221004154528-8021a29435af/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/oauth2 v0.0.0-20170807180024-9a379c6b3e95/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1316,10 +1274,6 @@ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1332,10 +1286,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 h1:ZrnxWX62AgTKOSagEqxvb3ffipvEDX2pl7E1TdqLqIc= -golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1344,14 +1296,18 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1435,34 +1391,26 @@ golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1507,6 +1455,7 @@ golang.org/x/tools v0.0.0-20191210221141-98df12377212/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1542,7 +1491,6 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1556,6 +1504,7 @@ gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJ gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +google.golang.org/api v0.0.0-20180829000535-087779f1d2c9/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1594,17 +1543,8 @@ google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/S google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= -google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1615,6 +1555,7 @@ google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1655,7 +1596,6 @@ google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= @@ -1692,38 +1632,17 @@ google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= -google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= -google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= -google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -1754,10 +1673,6 @@ google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ5 google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1776,7 +1691,9 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0/go.mod h1:OdE7CF6DbADk7lN8LIKRzRJTTZXIjtWgA5THM5lhBAw= +gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1787,6 +1704,7 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -1798,6 +1716,7 @@ gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -1823,6 +1742,13 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +istio.io/gogo-genproto v0.0.0-20190124151557-6d926a6e6feb/go.mod h1:eIDJ6jNk/IeJz6ODSksHl5Aiczy5JUq6vFhJWI5OtiI= +k8s.io/api v0.0.0-20180806132203-61b11ee65332/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= +k8s.io/api v0.0.0-20190325185214-7544f9db76f6/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= +k8s.io/apimachinery v0.0.0-20180821005732-488889b0007f/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/apimachinery v0.0.0-20190223001710-c182ff3b9841/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/client-go v8.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= +launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= From 98870e7cbbfabbd376428ecf8a19a97f3540f5d0 Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Thu, 3 Nov 2022 12:02:27 -0400 Subject: [PATCH 47/48] update dependencies --- go.mod | 6 +++--- go.sum | 16 +++++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 4b190475..fafeeed1 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/armon/go-metrics v0.4.1 // indirect - github.com/aws/aws-sdk-go v1.44.128 + github.com/aws/aws-sdk-go v1.44.129 github.com/billhathaway/consistentHash v0.0.0-20140718022140-addea16d2229 github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 github.com/go-kit/kit v0.12.0 @@ -20,7 +20,7 @@ require ( github.com/justinas/alice v1.2.0 github.com/miekg/dns v1.1.50 github.com/mitchellh/mapstructure v1.5.0 - github.com/prometheus/client_golang v1.13.0 + github.com/prometheus/client_golang v1.13.1 github.com/segmentio/ksuid v1.0.4 github.com/spf13/cast v1.5.0 github.com/spf13/pflag v1.0.5 @@ -30,7 +30,7 @@ require ( github.com/xmidt-org/argus v0.9.4 github.com/xmidt-org/bascule v0.11.0 // indirect github.com/xmidt-org/candlelight v0.0.12 - github.com/xmidt-org/sallust v0.1.6 + github.com/xmidt-org/sallust v0.2.0 github.com/xmidt-org/themis v0.4.11 github.com/xmidt-org/wrp-go/v3 v3.1.4 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 diff --git a/go.sum b/go.sum index 9b4f74d0..2feeca09 100644 --- a/go.sum +++ b/go.sum @@ -65,8 +65,8 @@ emperror.dev/errors v0.8.1/go.mod h1:YcRvLPh626Ubn2xqtoprejnA5nFha+TJ+2vew48kWuE github.com/Azure/azure-sdk-for-go v16.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-autorest v10.7.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v10.15.3+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -118,8 +118,8 @@ github.com/aws/aws-sdk-go v1.25.41/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/aws/aws-sdk-go v1.44.128 h1:X34pX5t0LIZXjBY11yf9JKMP3c1aZgirh+5PjtaZyJ4= -github.com/aws/aws-sdk-go v1.44.128/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.129 h1:yld8Rc8OCahLtenY1mnve4w1jVeBu/rSiscGzodaDOs= +github.com/aws/aws-sdk-go v1.44.129/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= @@ -152,6 +152,7 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -615,6 +616,7 @@ github.com/lestrrat-go/httprc v1.0.4/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhB github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI= github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= github.com/lestrrat-go/jwx v0.9.2/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/YNA/UnBk= +github.com/lestrrat-go/jwx v1.2.25 h1:tAx93jN2SdPvFn08fHNAhqFJazn5mBBOB8Zli0g0otA= github.com/lestrrat-go/jwx/v2 v2.0.5/go.mod h1:Wot5JT7sGDorqS+dBi6Cfu6MzsDZP+sAOnQbOJ8rpIA= github.com/lestrrat-go/jwx/v2 v2.0.6 h1:RlyYNLV892Ed7+FTfj1ROoF6x7WxL965PGTHso/60G0= github.com/lestrrat-go/jwx/v2 v2.0.6/go.mod h1:aVrGuwEr3cp2Prw6TtQvr8sQxe+84gruID5C9TxT64Q= @@ -799,8 +801,9 @@ github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3e github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= +github.com/prometheus/client_golang v1.13.1 h1:3gMjIY2+/hzmqhtUC/aQNYldJA6DtH3CgQvwS+02K1c= +github.com/prometheus/client_golang v1.13.1/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -943,6 +946,7 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= @@ -985,8 +989,9 @@ github.com/xmidt-org/httpaux v0.2.1/go.mod h1:mviIlg5fHGb3lAv3l0sbiwVG/q9rqvXaud github.com/xmidt-org/httpaux v0.3.2 h1:CC8FPiGVtThSRj3fEr9lk2e1bzhhw+l6Vb3BfzfaMG0= github.com/xmidt-org/httpaux v0.3.2/go.mod h1:qmlPisXf80FTi3y4gX43eYbCVruSQyvu+FPx1jzvQG8= github.com/xmidt-org/sallust v0.1.5/go.mod h1:azcKBypudADIeZ3Em8zGjVq3yQ7n4ueSvM/degHMIxo= -github.com/xmidt-org/sallust v0.1.6 h1:MZAU0rD0flrGrKs6+Nx3mpjwKV6QsWJlEBegRfKVnQ4= github.com/xmidt-org/sallust v0.1.6/go.mod h1:c6J68AkKaSp0Nc6fSBTwkS1vgc3lVAC3AdofrD10ldA= +github.com/xmidt-org/sallust v0.2.0 h1:XyRLZKNK7cq+mU9bNKtMt8nxJu/tv92gpYAUw7ClP4c= +github.com/xmidt-org/sallust v0.2.0/go.mod h1:HCQQn7po8czynjxtNVyZ5vzWuTqJyJwnPWkQoqBX67s= github.com/xmidt-org/themis v0.4.4/go.mod h1:0qRYFvKdrQhwjxH/1nAiTgBGT4cegJR76gfEYF5P7so= github.com/xmidt-org/themis v0.4.7/go.mod h1:GlsC/hO9lpZKs6mJNZtbDOf/yDT8tS6NN0k3C+YsWFc= github.com/xmidt-org/themis v0.4.11 h1:ZWkAfYV80pi4Y/lEDdcdxYbRkTRH+nHD/XASfp3+IMw= @@ -1003,6 +1008,7 @@ github.com/xmidt-org/webpa-common v1.11.4/go.mod h1:ffQHH+pCRnoxtdbyIkCbOSDVhV62 github.com/xmidt-org/webpa-common v1.11.5-0.20210120003553-3d03d7329aee/go.mod h1:NtJzdNhDznwjWiRKDnj/vxdQZnPOhuQ6haemx+nDMSY= github.com/xmidt-org/webpa-common v1.11.5/go.mod h1:jMyROPQmgvNS+P0csPodDMikqesqPFzlb3v/JVw2SmY= github.com/xmidt-org/webpa-common v1.11.9/go.mod h1:lSfUaPF/LA6PCHviTQk1XuTtqvdFcHzyACwdtH94ZfU= +github.com/xmidt-org/wrp-go v1.3.4 h1:7kj+1VXRNNEI7G0Z3z7C58QpIXrWzTw/eI79FdAhyPA= github.com/xmidt-org/wrp-go v1.3.4/go.mod h1:EWC9BgcYYO1hKgLzz6VFPpg3LU6ZWSDV/uNiWC7zP+o= github.com/xmidt-org/wrp-go/v2 v2.0.1/go.mod h1:v0HK0go/7OSVDvKbnXsUn6c+M987p0yyxWEs8/Fmf60= github.com/xmidt-org/wrp-go/v3 v3.0.1/go.mod h1:08zAEevd+fM81/asCgsMJdgO8sfKLvqclqJGX1pphnE= From 080d719b970a8610d6a209a057f4d1276df2b25c Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Thu, 3 Nov 2022 12:03:24 -0400 Subject: [PATCH 48/48] update dependencies --- go.mod | 3 --- go.sum | 4 ---- 2 files changed, 7 deletions(-) diff --git a/go.mod b/go.mod index 307fc256..fafeeed1 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,6 @@ go 1.19 require ( github.com/armon/go-metrics v0.4.1 // indirect github.com/aws/aws-sdk-go v1.44.129 - github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2 - github.com/armon/go-metrics v0.4.0 // indirect - github.com/aws/aws-sdk-go v1.44.128 github.com/billhathaway/consistentHash v0.0.0-20140718022140-addea16d2229 github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 github.com/go-kit/kit v0.12.0 diff --git a/go.sum b/go.sum index 2feeca09..73dbe0ce 100644 --- a/go.sum +++ b/go.sum @@ -152,7 +152,6 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -616,7 +615,6 @@ github.com/lestrrat-go/httprc v1.0.4/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhB github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI= github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= github.com/lestrrat-go/jwx v0.9.2/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/YNA/UnBk= -github.com/lestrrat-go/jwx v1.2.25 h1:tAx93jN2SdPvFn08fHNAhqFJazn5mBBOB8Zli0g0otA= github.com/lestrrat-go/jwx/v2 v2.0.5/go.mod h1:Wot5JT7sGDorqS+dBi6Cfu6MzsDZP+sAOnQbOJ8rpIA= github.com/lestrrat-go/jwx/v2 v2.0.6 h1:RlyYNLV892Ed7+FTfj1ROoF6x7WxL965PGTHso/60G0= github.com/lestrrat-go/jwx/v2 v2.0.6/go.mod h1:aVrGuwEr3cp2Prw6TtQvr8sQxe+84gruID5C9TxT64Q= @@ -946,7 +944,6 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= @@ -1008,7 +1005,6 @@ github.com/xmidt-org/webpa-common v1.11.4/go.mod h1:ffQHH+pCRnoxtdbyIkCbOSDVhV62 github.com/xmidt-org/webpa-common v1.11.5-0.20210120003553-3d03d7329aee/go.mod h1:NtJzdNhDznwjWiRKDnj/vxdQZnPOhuQ6haemx+nDMSY= github.com/xmidt-org/webpa-common v1.11.5/go.mod h1:jMyROPQmgvNS+P0csPodDMikqesqPFzlb3v/JVw2SmY= github.com/xmidt-org/webpa-common v1.11.9/go.mod h1:lSfUaPF/LA6PCHviTQk1XuTtqvdFcHzyACwdtH94ZfU= -github.com/xmidt-org/wrp-go v1.3.4 h1:7kj+1VXRNNEI7G0Z3z7C58QpIXrWzTw/eI79FdAhyPA= github.com/xmidt-org/wrp-go v1.3.4/go.mod h1:EWC9BgcYYO1hKgLzz6VFPpg3LU6ZWSDV/uNiWC7zP+o= github.com/xmidt-org/wrp-go/v2 v2.0.1/go.mod h1:v0HK0go/7OSVDvKbnXsUn6c+M987p0yyxWEs8/Fmf60= github.com/xmidt-org/wrp-go/v3 v3.0.1/go.mod h1:08zAEevd+fM81/asCgsMJdgO8sfKLvqclqJGX1pphnE=