From 51aabb929ac9f0f5821b00c8f66f7db796208b77 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Wed, 12 May 2021 22:23:21 +0300 Subject: [PATCH 01/26] Adjusted logic --- proxy.go | 5 +++-- scope.go | 28 +++++++++++++++++++++++----- utils.go | 13 +++++++++++++ 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/proxy.go b/proxy.go index 9ce26dbf..eb24ce71 100644 --- a/proxy.go +++ b/proxy.go @@ -435,7 +435,7 @@ func (rp *reverseProxy) applyConfig(cfg *config.Config) error { return nil } -// refreshCacheMetrics refresehs cacheSize and cacheItems metrics. +// refreshCacheMetrics refreshes cacheSize and cacheItems metrics. func (rp *reverseProxy) refreshCacheMetrics() { rp.lock.RLock() defer rp.lock.RUnlock() @@ -452,7 +452,7 @@ func (rp *reverseProxy) refreshCacheMetrics() { func (rp *reverseProxy) getScope(req *http.Request) (*scope, int, error) { name, password := getAuth(req) - + sessionId := getSessionId(req) var ( u *user c *cluster @@ -467,6 +467,7 @@ func (rp *reverseProxy) getScope(req *http.Request) (*scope, int, error) { // Fix applyConfig if c or cu equal to nil. c = rp.clusters[u.toCluster] cu = c.users[u.toUser] + c.sessionId = sessionId } rp.lock.RUnlock() diff --git a/scope.go b/scope.go index c5701dba..a750ebfa 100644 --- a/scope.go +++ b/scope.go @@ -19,6 +19,8 @@ import ( "github.com/prometheus/client_golang/prometheus" ) +// var route = make(map[int]*host) + type scopeID uint64 func (sid scopeID) String() string { @@ -305,6 +307,8 @@ var allowedParams = []string{ "extremes", // what to do if the volume of the result exceeds one of the limits "result_overflow_mode", + // session stickiness + "session_id", } // This regexp must match params needed to describe a way to use external data @@ -718,6 +722,8 @@ type cluster struct { killQueryUserName string killQueryUserPassword string + sessionId string + heartBeat *heartBeat } @@ -829,18 +835,30 @@ func (r *replica) getHost() *host { reqs = ^uint32(0) } - if reqs == 0 { - return h - } - // Scan all the hosts for the least loaded host. for i := uint32(1); i < n; i++ { tmpIdx := (idx + i) % n tmpH := r.hosts[tmpIdx] + + // handling sticky session + if r.cluster.sessionId != "" { + sessionId := hash(r.cluster.sessionId) + tmpIdx = (sessionId) % n + tmpHSticky := r.hosts[tmpIdx] + if !tmpHSticky.isActive() { + log.Debugf("Sticky Session Server has been picked up but not available") + continue + } + log.Debugf("Sticky Session Server is: %s, session: %d, idx mod: %d - %d", tmpH.addr, sessionId, tmpIdx, n) + return tmpH + } + + // continue as usual + tmpReqs := tmpH.load() + if !tmpH.isActive() { continue } - tmpReqs := tmpH.load() if tmpReqs == 0 { return tmpH } diff --git a/utils.go b/utils.go index b14c0d62..58474fa0 100644 --- a/utils.go +++ b/utils.go @@ -4,6 +4,7 @@ import ( "bytes" "compress/gzip" "fmt" + "hash/fnv" "io" "io/ioutil" "net/http" @@ -43,6 +44,12 @@ func getAuth(req *http.Request) (string, string) { return "default", "" } +// getSessionId retrieves session id +func getSessionId(req *http.Request) string { + params := req.URL.Query() + return params.Get("session_id") +} + // getQuerySnippet returns query snippet. // // getQuerySnippet must be called only for error reporting. @@ -57,6 +64,12 @@ func getQuerySnippet(req *http.Request) string { return query + body } +func hash(s string) uint32 { + h := fnv.New32a() + h.Write([]byte(s)) + return h.Sum32() +} + func getQuerySnippetFromBody(req *http.Request) string { if req.Body == nil { return "" From 8d905da242b8cd951a8981b9221bc17539647a45 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Wed, 12 May 2021 23:54:49 +0300 Subject: [PATCH 02/26] Error handling --- scope.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scope.go b/scope.go index a750ebfa..fa94b4c5 100644 --- a/scope.go +++ b/scope.go @@ -846,14 +846,14 @@ func (r *replica) getHost() *host { tmpIdx = (sessionId) % n tmpHSticky := r.hosts[tmpIdx] if !tmpHSticky.isActive() { - log.Debugf("Sticky Session Server has been picked up but not available") + log.Debugf("Sticky Session Server has been picked up, but it is not available") continue } log.Debugf("Sticky Session Server is: %s, session: %d, idx mod: %d - %d", tmpH.addr, sessionId, tmpIdx, n) return tmpH } - // continue as usual + // handling least loaded host flow tmpReqs := tmpH.load() if !tmpH.isActive() { From 669e5a7959eca3e5323cae9be86d0a52948c119a Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Thu, 13 May 2021 01:03:15 +0300 Subject: [PATCH 03/26] tests --- main_test.go | 22 ++++++++++++++++++++++ proxy.go | 4 ++-- testdata/http-session-id.yml | 15 +++++++++++++++ utils.go | 4 +++- 4 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 testdata/http-session-id.yml diff --git a/main_test.go b/main_test.go index 6492585e..0e626461 100644 --- a/main_test.go +++ b/main_test.go @@ -284,6 +284,28 @@ func TestServe(t *testing.T) { }, startHTTP, }, + { + "http POST request with session id", + "testdata/http-session-id.yml", + func(t *testing.T) { + // buf := bytes.NewBufferString("SELECT * FROM system.numbers LIMIT 10") + data := url.Values{} + data.Set("query", `SELECT * FROM system.numbers LIMIT 10`) + data.Add("session_id", "1234") + data.Add("query_id", "1234") + req, err := http.NewRequest("POST", "http://127.0.0.1:9090/", bytes.NewBufferString(data.Encode())) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded; param=value") // This makes it work + + checkErr(t, err) + resp, err := http.DefaultClient.Do(req) + checkErr(t, err) + if resp.StatusCode != http.StatusOK { + t.Fatalf("unexpected status code: %d; expected: %d", resp.StatusCode, http.StatusOK) + } + resp.Body.Close() + }, + startHTTP, + }, { "http request", "testdata/http.yml", diff --git a/proxy.go b/proxy.go index eb24ce71..a893f8ed 100644 --- a/proxy.go +++ b/proxy.go @@ -110,9 +110,9 @@ func (rp *reverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { q := getQuerySnippet(req) if srw.statusCode == http.StatusOK { requestSuccess.With(s.labels).Inc() - log.Debugf("%s: request success; query: %q; URL: %q", s, q, req.URL.String()) + log.Debugf("%s: request success; query: %q; Method: %s; URL: %q", s, q, req.Method, req.URL.String()) } else { - log.Debugf("%s: request failure: non-200 status code %d; query: %q; URL: %q", s, srw.statusCode, q, req.URL.String()) + log.Debugf("%s: request failure: non-200 status code %d; query: %q; Method: %s; URL: %q", s, srw.statusCode, q, req.Method, req.URL.String()) } statusCodes.With( diff --git a/testdata/http-session-id.yml b/testdata/http-session-id.yml new file mode 100644 index 00000000..2c00146d --- /dev/null +++ b/testdata/http-session-id.yml @@ -0,0 +1,15 @@ +log_debug: true +server: + http: + listen_addr: ":9090" + allowed_networks: ["127.0.0.1/24"] + +users: + - name: "default" + to_cluster: "default" + to_user: "default" + +clusters: + - name: "default" + nodes: + - 127.0.0.1:8124 diff --git a/utils.go b/utils.go index 58474fa0..55290631 100644 --- a/utils.go +++ b/utils.go @@ -47,7 +47,9 @@ func getAuth(req *http.Request) (string, string) { // getSessionId retrieves session id func getSessionId(req *http.Request) string { params := req.URL.Query() - return params.Get("session_id") + sessionId := params.Get("session_id") + req.Header.Set("X-ClickHouse-Session-ID", sessionId) + return sessionId } // getQuerySnippet returns query snippet. From 881b17a499260c38428e1ac935b68ed48ad45e84 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Thu, 13 May 2021 12:55:20 +0300 Subject: [PATCH 04/26] Adjust --- proxy.go | 7 ++--- scope.go | 78 +++++++++++++++++++++++++++++++++++++++++--------------- utils.go | 1 - 3 files changed, 62 insertions(+), 24 deletions(-) diff --git a/proxy.go b/proxy.go index a893f8ed..2c18f61c 100644 --- a/proxy.go +++ b/proxy.go @@ -51,8 +51,10 @@ func newReverseProxy() *reverseProxy { func (rp *reverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { startTime := time.Now() - s, status, err := rp.getScope(req) + if s.sessionId != "" { + rw.Header().Set("X-ClickHouse-Session-Id", s.sessionId) + } if err != nil { q := getQuerySnippet(req) err = fmt.Errorf("%q: %s; query: %q", req.RemoteAddr, err, q) @@ -467,7 +469,6 @@ func (rp *reverseProxy) getScope(req *http.Request) (*scope, int, error) { // Fix applyConfig if c or cu equal to nil. c = rp.clusters[u.toCluster] cu = c.users[u.toUser] - c.sessionId = sessionId } rp.lock.RUnlock() @@ -490,6 +491,6 @@ func (rp *reverseProxy) getScope(req *http.Request) (*scope, int, error) { return nil, http.StatusForbidden, fmt.Errorf("cluster user %q is not allowed to access", cu.name) } - s := newScope(req, u, c, cu) + s := newScope(req, u, c, cu, sessionId) return s, 0, nil } diff --git a/scope.go b/scope.go index fa94b4c5..75a377d5 100644 --- a/scope.go +++ b/scope.go @@ -42,6 +42,8 @@ type scope struct { user *user clusterUser *clusterUser + sessionId string + remoteAddr string localAddr string @@ -51,9 +53,12 @@ type scope struct { labels prometheus.Labels } -func newScope(req *http.Request, u *user, c *cluster, cu *clusterUser) *scope { - h := c.getHost() +func newScope(req *http.Request, u *user, c *cluster, cu *clusterUser, sessionId string) *scope { + h := c.getHost() + if sessionId != "" { + h = c.getHostSticky(sessionId) + } var localAddr string if addr, ok := req.Context().Value(http.LocalAddrContextKey).(net.Addr); ok { localAddr = addr.String() @@ -65,6 +70,7 @@ func newScope(req *http.Request, u *user, c *cluster, cu *clusterUser) *scope { cluster: c, user: u, clusterUser: cu, + sessionId: sessionId, remoteAddr: req.RemoteAddr, localAddr: localAddr, @@ -722,8 +728,6 @@ type cluster struct { killQueryUserName string killQueryUserPassword string - sessionId string - heartBeat *heartBeat } @@ -816,10 +820,10 @@ func (c *cluster) getReplica() *replica { return r } -// getHost returns least loaded + round-robin host from replica. +// getHostSticky returns host by stickiness from replica. // // Always returns non-nil. -func (r *replica) getHost() *host { +func (r *replica) getHostSticky(sessionId string) *host { idx := atomic.AddUint32(&r.nextHostIdx, 1) n := uint32(len(r.hosts)) if n == 1 { @@ -828,37 +832,63 @@ func (r *replica) getHost() *host { idx %= n h := r.hosts[idx] - reqs := h.load() - - // Set least priority to inactive host. - if !h.isActive() { - reqs = ^uint32(0) - } // Scan all the hosts for the least loaded host. for i := uint32(1); i < n; i++ { tmpIdx := (idx + i) % n - tmpH := r.hosts[tmpIdx] // handling sticky session - if r.cluster.sessionId != "" { - sessionId := hash(r.cluster.sessionId) + if sessionId != "" { + sessionId := hash(sessionId) tmpIdx = (sessionId) % n tmpHSticky := r.hosts[tmpIdx] + log.Debugf("Sticky server candidate is: %s", tmpHSticky.addr) if !tmpHSticky.isActive() { - log.Debugf("Sticky Session Server has been picked up, but it is not available") + log.Debugf("Sticky session server has been picked up, but it is not available") continue } - log.Debugf("Sticky Session Server is: %s, session: %d, idx mod: %d - %d", tmpH.addr, sessionId, tmpIdx, n) - return tmpH + log.Debugf("Sticky session server is: %s, session_id: %d, server_idx: %d, max nodes in pool: %d", tmpHSticky.addr, sessionId, tmpIdx, n) + return tmpHSticky } + } - // handling least loaded host flow - tmpReqs := tmpH.load() + // The returned host may be inactive. This is OK, + // since this means all the hosts are inactive, + // so let's try proxying the request to any host. + return h +} + +// getHost returns least loaded + round-robin host from replica. +// +// Always returns non-nil. +func (r *replica) getHost() *host { + idx := atomic.AddUint32(&r.nextHostIdx, 1) + n := uint32(len(r.hosts)) + if n == 1 { + return r.hosts[0] + } + + idx %= n + h := r.hosts[idx] + reqs := h.load() + + // Set least priority to inactive host. + if !h.isActive() { + reqs = ^uint32(0) + } + + if reqs == 0 { + return h + } + // Scan all the hosts for the least loaded host. + for i := uint32(1); i < n; i++ { + tmpIdx := (idx + i) % n + tmpH := r.hosts[tmpIdx] if !tmpH.isActive() { continue } + tmpReqs := tmpH.load() if tmpReqs == 0 { return tmpH } @@ -874,6 +904,14 @@ func (r *replica) getHost() *host { return h } +// getHostSticky returns host based on stickiness from cluster. +// +// Always returns non-nil. +func (c *cluster) getHostSticky(sessionId string) *host { + r := c.getReplica() + return r.getHostSticky(sessionId) +} + // getHost returns least loaded + round-robin host from cluster. // // Always returns non-nil. diff --git a/utils.go b/utils.go index 55290631..15c8d5b8 100644 --- a/utils.go +++ b/utils.go @@ -48,7 +48,6 @@ func getAuth(req *http.Request) (string, string) { func getSessionId(req *http.Request) string { params := req.URL.Query() sessionId := params.Get("session_id") - req.Header.Set("X-ClickHouse-Session-ID", sessionId) return sessionId } From fc7db12d1d8d73cdfb486d58bcdbb380bd628278 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Thu, 13 May 2021 13:02:24 +0300 Subject: [PATCH 05/26] session_id --- proxy.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proxy.go b/proxy.go index 2c18f61c..72f7fb6f 100644 --- a/proxy.go +++ b/proxy.go @@ -52,9 +52,6 @@ func newReverseProxy() *reverseProxy { func (rp *reverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { startTime := time.Now() s, status, err := rp.getScope(req) - if s.sessionId != "" { - rw.Header().Set("X-ClickHouse-Session-Id", s.sessionId) - } if err != nil { q := getQuerySnippet(req) err = fmt.Errorf("%q: %s; query: %q", req.RemoteAddr, err, q) @@ -117,6 +114,11 @@ func (rp *reverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { log.Debugf("%s: request failure: non-200 status code %d; query: %q; Method: %s; URL: %q", s, srw.statusCode, q, req.Method, req.URL.String()) } + // publish session_id if needed + if s.sessionId != "" { + rw.Header().Set("X-ClickHouse-Session-Id", s.sessionId) + } + statusCodes.With( prometheus.Labels{ "user": s.user.name, From 444a437746b6a86d535dba65af0212647be81247 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Thu, 13 May 2021 15:05:10 +0300 Subject: [PATCH 06/26] test adjustment --- main_test.go | 12 ++++-------- proxy.go | 10 +++++----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/main_test.go b/main_test.go index 0e626461..5dfc72f1 100644 --- a/main_test.go +++ b/main_test.go @@ -288,18 +288,14 @@ func TestServe(t *testing.T) { "http POST request with session id", "testdata/http-session-id.yml", func(t *testing.T) { - // buf := bytes.NewBufferString("SELECT * FROM system.numbers LIMIT 10") - data := url.Values{} - data.Set("query", `SELECT * FROM system.numbers LIMIT 10`) - data.Add("session_id", "1234") - data.Add("query_id", "1234") - req, err := http.NewRequest("POST", "http://127.0.0.1:9090/", bytes.NewBufferString(data.Encode())) - req.Header.Set("Content-Type", "application/x-www-form-urlencoded; param=value") // This makes it work + req, err := http.NewRequest("POST", "http://127.0.0.1:9090/?query_id=45395792-a432-4b92-8cc9-536c14e1e1a9&extremes=0&session_id=default-session-id233", bytes.NewBufferString("SELECT * FROM system.numbers LIMIT 10")) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded;") // This makes it work checkErr(t, err) resp, err := http.DefaultClient.Do(req) checkErr(t, err) - if resp.StatusCode != http.StatusOK { + + if resp.StatusCode != http.StatusOK || resp.Header.Get("X-Clickhouse-Server-Session-Id") == "" { t.Fatalf("unexpected status code: %d; expected: %d", resp.StatusCode, http.StatusOK) } resp.Body.Close() diff --git a/proxy.go b/proxy.go index 72f7fb6f..cd9d54f1 100644 --- a/proxy.go +++ b/proxy.go @@ -98,6 +98,11 @@ func (rp *reverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { ReadCloser: req.Body, } + // publish session_id if needed + if s.sessionId != "" { + rw.Header().Set("X-ClickHouse-Server-Session-Id", s.sessionId) + } + if s.user.cache == nil { rp.proxyRequest(s, srw, srw, req) } else { @@ -114,11 +119,6 @@ func (rp *reverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { log.Debugf("%s: request failure: non-200 status code %d; query: %q; Method: %s; URL: %q", s, srw.statusCode, q, req.Method, req.URL.String()) } - // publish session_id if needed - if s.sessionId != "" { - rw.Header().Set("X-ClickHouse-Session-Id", s.sessionId) - } - statusCodes.With( prometheus.Labels{ "user": s.user.name, From 4f7a4e84a82ae1e80eb005af2b9b5aa9b4ff00df Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Fri, 21 May 2021 20:03:37 +0300 Subject: [PATCH 07/26] session_timeout logic --- proxy.go | 3 ++- scope.go | 26 ++++++++++++++++---------- utils.go | 11 +++++++++++ 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/proxy.go b/proxy.go index cd9d54f1..11684b6d 100644 --- a/proxy.go +++ b/proxy.go @@ -457,6 +457,7 @@ func (rp *reverseProxy) refreshCacheMetrics() { func (rp *reverseProxy) getScope(req *http.Request) (*scope, int, error) { name, password := getAuth(req) sessionId := getSessionId(req) + sessionTimeout := getSessionTimeout(req) var ( u *user c *cluster @@ -493,6 +494,6 @@ func (rp *reverseProxy) getScope(req *http.Request) (*scope, int, error) { return nil, http.StatusForbidden, fmt.Errorf("cluster user %q is not allowed to access", cu.name) } - s := newScope(req, u, c, cu, sessionId) + s := newScope(req, u, c, cu, sessionId, sessionTimeout) return s, 0, nil } diff --git a/scope.go b/scope.go index 75a377d5..fec32513 100644 --- a/scope.go +++ b/scope.go @@ -9,6 +9,7 @@ import ( "net/http" "net/url" "regexp" + "strconv" "strings" "sync/atomic" "time" @@ -42,7 +43,8 @@ type scope struct { user *user clusterUser *clusterUser - sessionId string + sessionId string + sessionTimeout int remoteAddr string localAddr string @@ -53,8 +55,7 @@ type scope struct { labels prometheus.Labels } -func newScope(req *http.Request, u *user, c *cluster, cu *clusterUser, sessionId string) *scope { - +func newScope(req *http.Request, u *user, c *cluster, cu *clusterUser, sessionId string, sessionTimeout int) *scope { h := c.getHost() if sessionId != "" { h = c.getHostSticky(sessionId) @@ -64,13 +65,14 @@ func newScope(req *http.Request, u *user, c *cluster, cu *clusterUser, sessionId localAddr = addr.String() } s := &scope{ - startTime: time.Now(), - id: newScopeID(), - host: h, - cluster: c, - user: u, - clusterUser: cu, - sessionId: sessionId, + startTime: time.Now(), + id: newScopeID(), + host: h, + cluster: c, + user: u, + clusterUser: cu, + sessionId: sessionId, + sessionTimeout: sessionTimeout, remoteAddr: req.RemoteAddr, localAddr: localAddr, @@ -315,6 +317,8 @@ var allowedParams = []string{ "result_overflow_mode", // session stickiness "session_id", + // session timeout + "session_timeout", } // This regexp must match params needed to describe a way to use external data @@ -359,6 +363,8 @@ func (s *scope) decorateRequest(req *http.Request) (*http.Request, url.Values) { // Set query_id as scope_id to have possibility to kill query if needed. params.Set("query_id", s.id.String()) + // Set session_timeout an idle timeout for session + params.Set("session_timeout", strconv.Itoa(s.sessionTimeout)) req.URL.RawQuery = params.Encode() diff --git a/utils.go b/utils.go index 15c8d5b8..c3de05fb 100644 --- a/utils.go +++ b/utils.go @@ -9,6 +9,7 @@ import ( "io/ioutil" "net/http" "sort" + "strconv" "strings" "github.com/Vertamedia/chproxy/chdecompressor" @@ -51,6 +52,16 @@ func getSessionId(req *http.Request) string { return sessionId } +// getSessionId retrieves session id +func getSessionTimeout(req *http.Request) int { + params := req.URL.Query() + sessionTimeout, err := strconv.Atoi(params.Get("session_timeout")) + if err != nil && sessionTimeout > 0 { + return sessionTimeout + } + return 60 +} + // getQuerySnippet returns query snippet. // // getQuerySnippet must be called only for error reporting. From 2ebaa8805c17e08fdf9506ca3782e1686bd93bee Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Fri, 21 May 2021 20:11:05 +0300 Subject: [PATCH 08/26] session_timeout tests --- main_test.go | 4 +++- scope_test.go | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/main_test.go b/main_test.go index 5dfc72f1..63d1e1b1 100644 --- a/main_test.go +++ b/main_test.go @@ -288,7 +288,9 @@ func TestServe(t *testing.T) { "http POST request with session id", "testdata/http-session-id.yml", func(t *testing.T) { - req, err := http.NewRequest("POST", "http://127.0.0.1:9090/?query_id=45395792-a432-4b92-8cc9-536c14e1e1a9&extremes=0&session_id=default-session-id233", bytes.NewBufferString("SELECT * FROM system.numbers LIMIT 10")) + req, err := http.NewRequest("POST", + "http://127.0.0.1:9090/?query_id=45395792-a432-4b92-8cc9-536c14e1e1a9&extremes=0&session_id=default-session-id233", + bytes.NewBufferString("SELECT * FROM system.numbers LIMIT 10")) req.Header.Set("Content-Type", "application/x-www-form-urlencoded;") // This makes it work checkErr(t, err) diff --git a/scope_test.go b/scope_test.go index af3180ac..284c4458 100644 --- a/scope_test.go +++ b/scope_test.go @@ -330,14 +330,14 @@ func TestDecorateRequest(t *testing.T) { "text/plain", "GET", nil, - []string{"query_id", "query"}, + []string{"query_id", "session_timeout", "query"}, }, { "http://127.0.0.1?user=default&password=default&query=SELECT&database=default&wait_end_of_query=1", "text/plain", "GET", nil, - []string{"query_id", "query", "database"}, + []string{"query_id", "session_timeout", "query", "database"}, }, { "http://127.0.0.1?user=default&password=default&query=SELECT&testdata_structure=id+UInt32&testdata_format=TSV", @@ -352,7 +352,7 @@ func TestDecorateRequest(t *testing.T) { }, }, }, - []string{"query_id", "query", "max_threads"}, + []string{"query_id", "session_timeout", "query", "max_threads"}, }, { "http://127.0.0.1?user=default&password=default&query=SELECT&testdata_structure=id+UInt32&testdata_format=TSV", @@ -367,7 +367,7 @@ func TestDecorateRequest(t *testing.T) { }, }, }, - []string{"query_id", "query"}, + []string{"query_id", "session_timeout", "query"}, }, { "http://127.0.0.1?user=default&password=default&query=SELECT&testdata_type_buzz=1&testdata_structure_foo=id+UInt32&testdata_format-bar=TSV", @@ -386,14 +386,14 @@ func TestDecorateRequest(t *testing.T) { }, }, }, - []string{"query_id", "query", "max_threads", "background_pool_size"}, + []string{"query_id", "session_timeout", "query", "max_threads", "background_pool_size"}, }, { "http://127.0.0.1?user=default&password=default&query=SELECT&testdata_structure=id+UInt32&testdata_format=TSV", "multipart/form-data; boundary=foobar", "POST", nil, - []string{"query_id", "testdata_structure", "testdata_format", "query"}, + []string{"query_id", "session_timeout", "testdata_structure", "testdata_format", "query"}, }, } From 14fc89fdc5ccb7d0bf0917ccc1cd053d0e9d24fe Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Fri, 21 May 2021 20:13:04 +0300 Subject: [PATCH 09/26] header test --- main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main_test.go b/main_test.go index 63d1e1b1..d1c63b1b 100644 --- a/main_test.go +++ b/main_test.go @@ -297,7 +297,7 @@ func TestServe(t *testing.T) { resp, err := http.DefaultClient.Do(req) checkErr(t, err) - if resp.StatusCode != http.StatusOK || resp.Header.Get("X-Clickhouse-Server-Session-Id") == "" { + if resp.StatusCode != http.StatusOK || resp.StatusCode != http.StatusOK && resp.Header.Get("X-Clickhouse-Server-Session-Id") == "" { t.Fatalf("unexpected status code: %d; expected: %d", resp.StatusCode, http.StatusOK) } resp.Body.Close() From 26ca1f58de1e5dea02aa65dbc2fba6eda869765e Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Fri, 21 May 2021 20:14:20 +0300 Subject: [PATCH 10/26] cleaning unused code --- scope.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/scope.go b/scope.go index fec32513..9b85ef8f 100644 --- a/scope.go +++ b/scope.go @@ -20,8 +20,6 @@ import ( "github.com/prometheus/client_golang/prometheus" ) -// var route = make(map[int]*host) - type scopeID uint64 func (sid scopeID) String() string { From dce7872666145bde90bd43ec145d3a2739dd2a63 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Fri, 21 May 2021 21:18:03 +0300 Subject: [PATCH 11/26] handling session_id verification --- scope.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/scope.go b/scope.go index 9b85ef8f..951f927f 100644 --- a/scope.go +++ b/scope.go @@ -842,18 +842,16 @@ func (r *replica) getHostSticky(sessionId string) *host { tmpIdx := (idx + i) % n // handling sticky session - if sessionId != "" { - sessionId := hash(sessionId) - tmpIdx = (sessionId) % n - tmpHSticky := r.hosts[tmpIdx] - log.Debugf("Sticky server candidate is: %s", tmpHSticky.addr) - if !tmpHSticky.isActive() { - log.Debugf("Sticky session server has been picked up, but it is not available") - continue - } - log.Debugf("Sticky session server is: %s, session_id: %d, server_idx: %d, max nodes in pool: %d", tmpHSticky.addr, sessionId, tmpIdx, n) - return tmpHSticky + sessionId := hash(sessionId) + tmpIdx = (sessionId) % n + tmpHSticky := r.hosts[tmpIdx] + log.Debugf("Sticky server candidate is: %s", tmpHSticky.addr) + if !tmpHSticky.isActive() { + log.Debugf("Sticky session server has been picked up, but it is not available") + continue } + log.Debugf("Sticky session server is: %s, session_id: %d, server_idx: %d, max nodes in pool: %d", tmpHSticky.addr, sessionId, tmpIdx, n) + return tmpHSticky } // The returned host may be inactive. This is OK, From 456d694cbc71c1fa974684ed6a30d462a1d85216 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Sun, 23 May 2021 22:59:16 +0300 Subject: [PATCH 12/26] Ability to build version under Docker (Native go build doesn't work due to Datadog lib) --- Dockerfile | 2 ++ Makefile | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d36cb9c8..36e45588 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,8 @@ RUN go get golang.org/x/lint/golint RUN mkdir -p /go/src/github.com/Vertamedia/chproxy WORKDIR /go/src/github.com/Vertamedia/chproxy COPY . ./ +ARG EXT_BUILD_TAG +ENV EXT_BUILD_TAG ${EXT_BUILD_TAG} RUN make release-build FROM alpine diff --git a/Makefile b/Makefile index e5f137d8..9617aace 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ +current_dir = $(pwd) pkgs = $(shell go list ./...) gofiles := $(shell find . -name "*.go" -type f -not -path "./vendor/*") -BUILD_TAG = $(shell git tag --points-at HEAD) +BUILD_TAG = $(or $(shell git tag --points-at HEAD), $(EXT_BUILD_TAG), latest) BUILD_CONSTS = \ -X main.buildTime=`date -u '+%Y-%m-%d_%H:%M:%S'` \ @@ -36,7 +37,16 @@ clean: rm -f chproxy release-build: + @echo "Ver: $(BUILD_TAG), OPTS: $(BUILD_OPTS)" GOOS=linux GOARCH=amd64 go build $(BUILD_OPTS) + rm chproxy-linux-amd64-*.tar.gz + tar czf chproxy-linux-amd64-$(BUILD_TAG).tar.gz chproxy release: format lint test clean release-build + @echo "Ver: $(BUILD_TAG), OPTS: $(BUILD_OPTS)" tar czf chproxy-linux-amd64-$(BUILD_TAG).tar.gz chproxy + +release-build-docker: + @echo "Ver: $(BUILD_TAG)" + @DOCKER_BUILDKIT=1 docker build --target build --build-arg EXT_BUILD_TAG=$(BUILD_TAG) --progress plain -t chproxy-build . + @docker run --rm --entrypoint "/bin/sh" -v $(CURDIR):/host chproxy-build -c "/bin/cp /go/src/github.com/Vertamedia/chproxy/*.tar.gz /host" From eca0b6c15ba9704850d4a5a1141b4eaf548708c1 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Mon, 24 May 2021 12:19:21 +0300 Subject: [PATCH 13/26] Error handling in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9617aace..87b74a9e 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ clean: release-build: @echo "Ver: $(BUILD_TAG), OPTS: $(BUILD_OPTS)" GOOS=linux GOARCH=amd64 go build $(BUILD_OPTS) - rm chproxy-linux-amd64-*.tar.gz + @if [ -f chproxy-linux-amd64-*.tar.gz ]; then rm chproxy-linux-amd64-*.tar.gz; fi tar czf chproxy-linux-amd64-$(BUILD_TAG).tar.gz chproxy release: format lint test clean release-build From 4304395eededb678a179adc1414d5c39913ea166 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Mon, 24 May 2021 14:41:49 +0300 Subject: [PATCH 14/26] Bump to newer go + make sure static linking works correctly --- Dockerfile | 4 ++-- Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 36e45588..efa4a22f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM golang:1.13-alpine AS build +FROM golang:1.16-alpine AS build -RUN apk add --update zstd-static zstd-dev make gcc musl-dev git +RUN apk add --no-cache --update zstd-static zstd-dev make gcc musl-dev git libc6-compat RUN go get golang.org/x/lint/golint RUN mkdir -p /go/src/github.com/Vertamedia/chproxy WORKDIR /go/src/github.com/Vertamedia/chproxy diff --git a/Makefile b/Makefile index 87b74a9e..a66b71fc 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ clean: release-build: @echo "Ver: $(BUILD_TAG), OPTS: $(BUILD_OPTS)" - GOOS=linux GOARCH=amd64 go build $(BUILD_OPTS) + @GOOS=linux GOARCH=amd64 go build $(BUILD_OPTS) @if [ -f chproxy-linux-amd64-*.tar.gz ]; then rm chproxy-linux-amd64-*.tar.gz; fi tar czf chproxy-linux-amd64-$(BUILD_TAG).tar.gz chproxy From e5d9dcaf23f852e6777f89da62370d45085468da Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Fri, 4 Jun 2021 01:37:29 +0300 Subject: [PATCH 15/26] Session_id typo fix --- utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.go b/utils.go index c3de05fb..cd40e976 100644 --- a/utils.go +++ b/utils.go @@ -56,7 +56,7 @@ func getSessionId(req *http.Request) string { func getSessionTimeout(req *http.Request) int { params := req.URL.Query() sessionTimeout, err := strconv.Atoi(params.Get("session_timeout")) - if err != nil && sessionTimeout > 0 { + if err == nil && sessionTimeout > 0 { return sessionTimeout } return 60 From 15a760920166656286be53a960887edd6942a411 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Fri, 4 Jun 2021 20:58:12 +0300 Subject: [PATCH 16/26] Adjust tests for session-name and session-timeout --- main_test.go | 22 +++++++++++++++++++--- proxy.go | 5 +++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/main_test.go b/main_test.go index d1c63b1b..77414cab 100644 --- a/main_test.go +++ b/main_test.go @@ -13,6 +13,7 @@ import ( "net/http/httptest" "net/url" "os" + "strconv" "strings" "sync" "testing" @@ -285,11 +286,13 @@ func TestServe(t *testing.T) { startHTTP, }, { - "http POST request with session id", + "http POST request with session_id and session_timeout", "testdata/http-session-id.yml", func(t *testing.T) { + sessionName := "name" + sessionTimeout := 900 req, err := http.NewRequest("POST", - "http://127.0.0.1:9090/?query_id=45395792-a432-4b92-8cc9-536c14e1e1a9&extremes=0&session_id=default-session-id233", + "http://127.0.0.1:9090/?query_id=45395792-a432-4b92-8cc9-536c14e1e1a9&extremes=0&session_id="+sessionName+"&session_timeout="+strconv.Itoa(sessionTimeout), bytes.NewBufferString("SELECT * FROM system.numbers LIMIT 10")) req.Header.Set("Content-Type", "application/x-www-form-urlencoded;") // This makes it work @@ -297,9 +300,22 @@ func TestServe(t *testing.T) { resp, err := http.DefaultClient.Do(req) checkErr(t, err) - if resp.StatusCode != http.StatusOK || resp.StatusCode != http.StatusOK && resp.Header.Get("X-Clickhouse-Server-Session-Id") == "" { + if resp.StatusCode != http.StatusOK { t.Fatalf("unexpected status code: %d; expected: %d", resp.StatusCode, http.StatusOK) } + + // verify correctness of session_id + _sessionName := resp.Header.Get("X-Clickhouse-Server-Session-Id") + if _sessionName != sessionName { + t.Fatalf("unexpected value of X-Clickhouse-Server-Session-Id: %s; expected: %s", _sessionName, sessionName) + } + + // verify correctness of session_id + _sessionTimeout, _ := strconv.Atoi(resp.Header.Get("X-Clickhouse-Server-Session-Timeout")) + if _sessionTimeout != sessionTimeout { + t.Fatalf("unexpected value of X-Clickhouse-Server-Session-Timeout: %d; expected: %d", _sessionTimeout, sessionTimeout) + } + resp.Body.Close() }, startHTTP, diff --git a/proxy.go b/proxy.go index 11684b6d..134dfe71 100644 --- a/proxy.go +++ b/proxy.go @@ -103,6 +103,11 @@ func (rp *reverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { rw.Header().Set("X-ClickHouse-Server-Session-Id", s.sessionId) } + // publish session_timeout if needed + if s.sessionId != "" { + rw.Header().Set("X-ClickHouse-Server-Session-Timeout", strconv.Itoa(s.sessionTimeout)) + } + if s.user.cache == nil { rp.proxyRequest(s, srw, srw, req) } else { From b3fb12b9a0b48ca56ff2fad17f82ce79909ff571 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Thu, 16 Nov 2023 19:10:08 +0200 Subject: [PATCH 17/26] Adjust tests for session-name and session-timeout --- .gitignore | 3 ++- Dockerfile_build | 18 +++++++++++++++ Makefile | 6 ++--- go.sum | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ main_test.go | 31 +++++++++++++++++++------- proxy.go | 5 +++++ 6 files changed, 109 insertions(+), 12 deletions(-) create mode 100644 Dockerfile_build diff --git a/.gitignore b/.gitignore index ff44fe7a..3470997a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ # Examples data directories examples/*/resources/chproxy/data examples/*/resources/clickhouse/data -examples/*/resources/clickhouse/config/*-preprocessed.xml \ No newline at end of file +examples/*/resources/clickhouse/config/*-preprocessed.xml +/config.yml diff --git a/Dockerfile_build b/Dockerfile_build new file mode 100644 index 00000000..e009b5af --- /dev/null +++ b/Dockerfile_build @@ -0,0 +1,18 @@ +ARG GO_VER=1.21.2 +FROM golang:${GO_VER}-alpine AS build + +RUN apk add --no-cache --update zstd-static zstd-dev make gcc musl-dev git libc6-compat +#RUN go get golang.org/x/lint/golint +RUN mkdir -p /go/src/github.com/contentsquare/chproxy +WORKDIR /go/src/github.com/contentsquare/chproxy +COPY . ./ +ARG EXT_BUILD_TAG +ENV EXT_BUILD_TAG ${EXT_BUILD_TAG} +RUN make release-build +RUN ls -al /go/src/github.com/contentsquare/chproxy + +FROM alpine +COPY --from=build /go/src/github.com/contentsquare/chproxy/chproxy* / +RUN ls -al / +ENTRYPOINT [ "/chproxy" ] +CMD [ "--help" ] \ No newline at end of file diff --git a/Makefile b/Makefile index cf6e88fa..600e4ee2 100644 --- a/Makefile +++ b/Makefile @@ -48,8 +48,8 @@ clean: release-build: @echo "Ver: $(BUILD_TAG), OPTS: $(BUILD_OPTS)" GOOS=linux GOARCH=amd64 go build $(BUILD_OPTS) + rm chproxy-linux-amd64-*.tar.gz || true tar czf chproxy-linux-amd64-$(BUILD_TAG).tar.gz chproxy - rm chproxy-linux-amd64-*.tar.gz release: format lint test clean release-build @echo "Ver: $(BUILD_TAG), OPTS: $(BUILD_OPTS)" @@ -57,5 +57,5 @@ release: format lint test clean release-build release-build-docker: @echo "Ver: $(BUILD_TAG)" - @DOCKER_BUILDKIT=1 docker build --target build --build-arg EXT_BUILD_TAG=$(BUILD_TAG) --progress plain -t chproxy-build . - @docker run --rm --entrypoint "/bin/sh" -v $(CURDIR):/host chproxy-build -c "/bin/cp /go/src/github.com/contentsquare/chproxy/*.tar.gz /host" + @DOCKER_BUILDKIT=1 docker build --target build --build-arg EXT_BUILD_TAG=$(BUILD_TAG) --progress plain -t chproxy-build -f Dockerfile_build . + @docker run --rm --entrypoint "/bin/sh" -v $(CURDIR):/host chproxy-build -c "/bin/cp chproxy-linux-*-*.tar.gz /host" diff --git a/go.sum b/go.sum index 34030278..feae0813 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,11 @@ +cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= @@ -13,12 +16,17 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bsm/ginkgo/v2 v2.5.0 h1:aOAnND1T40wEdAtkGSkvSICWeQ8L3UASX7YVCqQx+eQ= +github.com/bsm/ginkgo/v2 v2.5.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w= github.com/bsm/gomega v1.20.0 h1:JhAwLmtRzXFTx2AkALSLa8ijZafntmhSoU63Ok18Uq8= +github.com/bsm/gomega v1.20.0/go.mod h1:JifAceMQ4crZIWYUKrlGcmbN3bqHogVTADMD2ATsbwk= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -28,12 +36,17 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cu github.com/frankban/quicktest v1.7.2 h1:2QxQoC1TS09S7fhCPsrvqYdvP1H5M1P1ih5ABm3BTYk= github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0 h1:DGJh0Sm43HbOeYDNnVZFl8BvcYVvjD5bqYJvp0REbwQ= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= 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 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -55,37 +68,48 @@ 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.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= 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 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 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= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/pierrec/lz4 v2.4.0+incompatible h1:06usnXXDNcPvCHDkmPpkidf4jTc52UKld7UPfqKatY4= github.com/pierrec/lz4 v2.4.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -111,10 +135,12 @@ github.com/redis/go-redis/v9 v9.0.2 h1:BA426Zqe/7r56kCcvxYLWe1mkaz71LKF77GwgFzSx github.com/redis/go-redis/v9 v9.0.2/go.mod h1:/xDTe9EF1LM61hek62Poq2nzQSGj0xSrEtEHbBQevps= 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 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 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.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -123,26 +149,39 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ 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/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 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/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/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 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= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/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-20180905080454-ebe1bf3edb33/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-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -153,20 +192,38 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.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.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +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/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 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= @@ -177,6 +234,7 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= diff --git a/main_test.go b/main_test.go index c60852bf..0767e3c9 100644 --- a/main_test.go +++ b/main_test.go @@ -217,7 +217,7 @@ func TestServe(t *testing.T) { "testdata/https.cache.yml", func(t *testing.T) { // do request which response must be cached - queryURLParam := "SELECT * FROM system.numbers" + queryURLParam := "select * from system.numbers" queryBody := "LIMIT 10" expectedQuery := queryURLParam + "\n" + queryBody buf := bytes.NewBufferString(queryBody) @@ -412,21 +412,36 @@ func TestServe(t *testing.T) { startHTTP, }, { - "http POST request with session id", + "http POST request with session_id and session_timeout", "testdata/http-session-id.yml", func(t *testing.T) { + sessionName := "name" + sessionTimeout := 900 req, err := http.NewRequest("POST", - "http://127.0.0.1:9090/?query_id=45395792-a432-4b92-8cc9-536c14e1e1a9&extremes=0&session_id=default-session-id233", - bytes.NewBufferString("SELECT * FROM system.numbers LIMIT 10")) + "http://127.0.0.1:9090/?query_id=45395792-a432-4b92-8cc9-536c14e1e1a9&extremes=0&session_id="+sessionName+"&session_timeout="+strconv.Itoa(sessionTimeout), + bytes.NewBufferString("select * from system.numbers LIMIT 10")) req.Header.Set("Content-Type", "application/x-www-form-urlencoded;") // This makes it work checkErr(t, err) resp, err := http.DefaultClient.Do(req) checkErr(t, err) - if resp.StatusCode != http.StatusOK || resp.StatusCode != http.StatusOK && resp.Header.Get("X-Clickhouse-Server-Session-Id") == "" { + if resp.StatusCode != http.StatusOK { t.Fatalf("unexpected status code: %d; expected: %d", resp.StatusCode, http.StatusOK) } + + // verify correctness of session_id + _sessionName := resp.Header.Get("X-Clickhouse-Server-Session-Id") + if _sessionName != sessionName { + t.Fatalf("unexpected value of X-Clickhouse-Server-Session-Id: %s; expected: %s", _sessionName, sessionName) + } + + // verify correctness of session_id + _sessionTimeout, _ := strconv.Atoi(resp.Header.Get("X-Clickhouse-Server-Session-Timeout")) + if _sessionTimeout != sessionTimeout { + t.Fatalf("unexpected value of X-Clickhouse-Server-Session-Timeout: %d; expected: %d", _sessionTimeout, sessionTimeout) + } + resp.Body.Close() }, startHTTP, @@ -517,7 +532,7 @@ func TestServe(t *testing.T) { func(t *testing.T) { var buf bytes.Buffer zw := gzip.NewWriter(&buf) - _, err := zw.Write([]byte("SELECT * FROM system.numbers LIMIT 10")) + _, err := zw.Write([]byte("select * from system.numbers LIMIT 10")) checkErr(t, err) zw.Close() req, err := http.NewRequest("POST", "http://127.0.0.1:9090", &buf) @@ -538,7 +553,7 @@ func TestServe(t *testing.T) { "http POST request", "testdata/http.yml", func(t *testing.T) { - buf := bytes.NewBufferString("SELECT * FROM system.numbers LIMIT 10") + buf := bytes.NewBufferString("select * from system.numbers LIMIT 10") req, err := http.NewRequest("POST", "http://127.0.0.1:9090", buf) checkErr(t, err) resp, err := http.DefaultClient.Do(req) @@ -556,7 +571,7 @@ func TestServe(t *testing.T) { func(t *testing.T) { var buf bytes.Buffer zw := gzip.NewWriter(&buf) - _, err := zw.Write([]byte("SELECT * FROM system.numbers LIMIT 1000")) + _, err := zw.Write([]byte("select * from system.numbers LIMIT 1000")) checkErr(t, err) zw.Close() req, err := http.NewRequest("POST", "http://127.0.0.1:9090", &buf) diff --git a/proxy.go b/proxy.go index a848e3be..17db73ab 100644 --- a/proxy.go +++ b/proxy.go @@ -139,6 +139,11 @@ func (rp *reverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { rw.Header().Set("X-ClickHouse-Server-Session-Id", s.sessionId) } + // publish session_timeout if needed + if s.sessionId != "" { + rw.Header().Set("X-ClickHouse-Server-Session-Timeout", strconv.Itoa(s.sessionTimeout)) + } + q, shouldReturnFromCache, err := shouldRespondFromCache(s, origParams, req) if err != nil { respondWith(srw, err, http.StatusBadRequest) From f1e4b6820f7e4e2fd6b86175c63c35d8b4500d9f Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Fri, 17 Nov 2023 15:53:25 +0200 Subject: [PATCH 18/26] Adjust tests for session-name and session-timeout --- Dockerfile_boringcrypto | 42 +++++++++++++++++++++++++++++++++++++++++ Makefile | 7 ++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 Dockerfile_boringcrypto diff --git a/Dockerfile_boringcrypto b/Dockerfile_boringcrypto new file mode 100644 index 00000000..7f875aaf --- /dev/null +++ b/Dockerfile_boringcrypto @@ -0,0 +1,42 @@ +ARG UBUNTU_IMAGE=ubuntu:20.04 +FROM ${UBUNTU_IMAGE} AS build + +ENV GOPATH=/gocode +ENV PATH=$PATH:$GOPATH/bin +ENV GOVERSION=1.21 + +RUN mkdir /scr +WORKDIR /src + +# golang +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + apt-utils \ + software-properties-common \ + gcc \ + libc-dev \ + && add-apt-repository -y ppa:longsleep/golang-backports \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + golang-$GOVERSION-go \ + golang-golang-x-tools \ + && apt-get autoremove -y \ + && apt-get remove -y \ + apt-utils \ + software-properties-common + +# Create symbolic link +RUN ln -s /usr/lib/go-$GOVERSION /gocode + +# tools +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + git \ + make \ + tzdata + +FROM build + +# Build chproxy +COPY . ./ +ARG EXT_BUILD_TAG +ENV GOEXPERIMENT=boringcrypto +RUN make release-build diff --git a/Makefile b/Makefile index 600e4ee2..d56093d5 100644 --- a/Makefile +++ b/Makefile @@ -57,5 +57,10 @@ release: format lint test clean release-build release-build-docker: @echo "Ver: $(BUILD_TAG)" - @DOCKER_BUILDKIT=1 docker build --target build --build-arg EXT_BUILD_TAG=$(BUILD_TAG) --progress plain -t chproxy-build -f Dockerfile_build . + @DOCKER_BUILDKIT=1 docker build -f Dockerfile_build --target build --build-arg EXT_BUILD_TAG=$(BUILD_TAG) --progress plain -t chproxy-build . @docker run --rm --entrypoint "/bin/sh" -v $(CURDIR):/host chproxy-build -c "/bin/cp chproxy-linux-*-*.tar.gz /host" + +release-build-docker-fips: + @echo "Ver: $(BUILD_TAG)" + @DOCKER_BUILDKIT=1 docker build -f Dockerfile_boringcrypto --build-arg EXT_BUILD_TAG=$(BUILD_TAG)-fips --progress plain -t chproxy-build . + @docker run --rm --entrypoint "/bin/sh" -v $(CURDIR):/host chproxy-build -c "/bin/cp /src/chproxy-*.tar.gz /host" From 028c67d0da0ecbe086ab5f86388370f787c4a70d Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Tue, 21 Nov 2023 14:11:32 +0200 Subject: [PATCH 19/26] Adjust tests for session-name and session-timeout --- Makefile | 2 +- fips.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 fips.go diff --git a/Makefile b/Makefile index d56093d5..a6889043 100644 --- a/Makefile +++ b/Makefile @@ -62,5 +62,5 @@ release-build-docker: release-build-docker-fips: @echo "Ver: $(BUILD_TAG)" - @DOCKER_BUILDKIT=1 docker build -f Dockerfile_boringcrypto --build-arg EXT_BUILD_TAG=$(BUILD_TAG)-fips --progress plain -t chproxy-build . + @DOCKER_BUILDKIT=1 docker build -f Dockerfile_boringcrypto --build-arg EXT_BUILD_TAG=$(BUILD_TAG)-fips --build-arg EXT_BUILD_OPTS="-tags fips" --progress plain -t chproxy-build . @docker run --rm --entrypoint "/bin/sh" -v $(CURDIR):/host chproxy-build -c "/bin/cp /src/chproxy-*.tar.gz /host" diff --git a/fips.go b/fips.go new file mode 100644 index 00000000..8c9f52ea --- /dev/null +++ b/fips.go @@ -0,0 +1,5 @@ +//go:build fips + +package main + +import _ "crypto/tls/fipsonly" From 4798d96fe399a49b1ad5b4b44d3ee44b95c98c20 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Sun, 17 Dec 2023 19:50:28 +0200 Subject: [PATCH 20/26] FIPS and Session_ID Documentation --- docs/src/content/docs/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/src/content/docs/index.md b/docs/src/content/docs/index.md index 446ac69e..06a66aae 100644 --- a/docs/src/content/docs/index.md +++ b/docs/src/content/docs/index.md @@ -26,6 +26,14 @@ Chproxy is an HTTP proxy and load balancer for [ClickHouse](https://ClickHouse.y - Exposes various useful [metrics](/configuration/metrics) in [Prometheus text format](https://prometheus.io/docs/instrumenting/exposition_formats/). - Configuration may be updated without restart - just send `SIGHUP` signal to `chproxy` process. - Easy to manage and run - just pass config file path to a single `chproxy` binary. +- Facilitates session affinity through `session_id` mapping, guaranteeing requests from the same user session are routed to the same upstream server (It is useful if one application server performs an initial processing step and stores the results in a temporary table; other servers can efficiently access and utilize that data by reaching the same server where the data is.) +- Service can be built to use only cryptographic algorithms approved by the Federal Information Processing Standard (FIPS) 140-2, making it suitable for processing sensitive government data. +```bash +-- to build regular artifact +make release-build-docker +-- to build artifact with FIPS support relying on Borring Crypto Module +make release-build-docker-fips: +``` - Easy to [configure](https://github.com/contentsquare/chproxy/blob/master/config/examples/simple.yml): ```yml server: From d3f1dd8cc1b1d34b58e4a46a2ef5b8dab57a67bf Mon Sep 17 00:00:00 2001 From: Sean Connole Date: Tue, 22 Oct 2024 14:56:59 -0600 Subject: [PATCH 21/26] chore: update dockerfile, add tests for dockerfile Added tests for dockerfile to ensure that GoVersions in dockerfiles stay in sync with Go.mod version. Updated dockerfile to use a more reliable base image. Install ca-certificates and curl --- Dockerfile | 17 +++++++--- Dockerfile_boringcrypto | 10 +++--- Dockerfile_build | 18 ----------- dockerfile_version_test.go | 66 ++++++++++++++++++++++++++++++++++++++ go.mod | 2 +- go.sum | 56 -------------------------------- 6 files changed, 86 insertions(+), 83 deletions(-) delete mode 100644 Dockerfile_build create mode 100644 dockerfile_version_test.go diff --git a/Dockerfile b/Dockerfile index 21cb8bba..afb0b48d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,19 @@ -FROM debian +ARG GO_VERSION=1.22 +FROM golang:${GO_VERSION} AS build -RUN apt update && apt install -y ca-certificates curl +RUN mkdir -p /go/src/github.com/contentsquare/chproxy +WORKDIR /go/src/github.com/contentsquare/chproxy +COPY . ./ +ARG EXT_BUILD_TAG +ENV EXT_BUILD_TAG=${EXT_BUILD_TAG} +RUN make release-build +RUN ls -al /go/src/github.com/contentsquare/chproxy -COPY chproxy / +FROM alpine +RUN apk add --no-cache curl ca-certificates +COPY --from=build /go/src/github.com/contentsquare/chproxy/chproxy* / EXPOSE 9090 -ENTRYPOINT ["/chproxy"] +ENTRYPOINT [ "/chproxy" ] CMD [ "--help" ] diff --git a/Dockerfile_boringcrypto b/Dockerfile_boringcrypto index 7f875aaf..320b9102 100644 --- a/Dockerfile_boringcrypto +++ b/Dockerfile_boringcrypto @@ -3,7 +3,7 @@ FROM ${UBUNTU_IMAGE} AS build ENV GOPATH=/gocode ENV PATH=$PATH:$GOPATH/bin -ENV GOVERSION=1.21 +ENV GO_VERSION=1.22 RUN mkdir /scr WORKDIR /src @@ -17,7 +17,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins && add-apt-repository -y ppa:longsleep/golang-backports \ && apt-get update \ && apt-get install -y --no-install-recommends \ - golang-$GOVERSION-go \ + golang-$GO_VERSION-go \ golang-golang-x-tools \ && apt-get autoremove -y \ && apt-get remove -y \ @@ -25,13 +25,15 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins software-properties-common # Create symbolic link -RUN ln -s /usr/lib/go-$GOVERSION /gocode +RUN ln -s /usr/lib/go-$GO_VERSION /gocode # tools RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ git \ make \ - tzdata + tzdata \ + curl \ + ca-certificates FROM build diff --git a/Dockerfile_build b/Dockerfile_build deleted file mode 100644 index e009b5af..00000000 --- a/Dockerfile_build +++ /dev/null @@ -1,18 +0,0 @@ -ARG GO_VER=1.21.2 -FROM golang:${GO_VER}-alpine AS build - -RUN apk add --no-cache --update zstd-static zstd-dev make gcc musl-dev git libc6-compat -#RUN go get golang.org/x/lint/golint -RUN mkdir -p /go/src/github.com/contentsquare/chproxy -WORKDIR /go/src/github.com/contentsquare/chproxy -COPY . ./ -ARG EXT_BUILD_TAG -ENV EXT_BUILD_TAG ${EXT_BUILD_TAG} -RUN make release-build -RUN ls -al /go/src/github.com/contentsquare/chproxy - -FROM alpine -COPY --from=build /go/src/github.com/contentsquare/chproxy/chproxy* / -RUN ls -al / -ENTRYPOINT [ "/chproxy" ] -CMD [ "--help" ] \ No newline at end of file diff --git a/dockerfile_version_test.go b/dockerfile_version_test.go new file mode 100644 index 00000000..4e308744 --- /dev/null +++ b/dockerfile_version_test.go @@ -0,0 +1,66 @@ +package main + +import ( + "bufio" + "os" + "regexp" + "testing" +) + +func getVersionFromFile(filename string, searchPhrase string) (string, error) { + file, err := os.Open(filename) + if err != nil { + return "", err + } + defer file.Close() + + scanner := bufio.NewScanner(file) + re := regexp.MustCompile(searchPhrase) // Regex to capture Go version + for scanner.Scan() { + line := scanner.Text() + matches := re.FindStringSubmatch(line) + if len(matches) > 1 { + return matches[1], nil + } + } + + return "", scanner.Err() +} + +// Test function to check if Go version in go.mod matches Dockerfile +func TestGoVersionMatching(t *testing.T) { + goModVersionSearchPhrase := `^go\s+(\d+\.\d+)` + goModVersion, err := getVersionFromFile("go.mod", goModVersionSearchPhrase) + if err != nil { + t.Fatalf("Error getting Go version from go.mod: %v", err) + } + + dockerFileVersionSearchPhrase := "GO_VERSION=(.*)" + dockerfileVersion, err := getVersionFromFile("Dockerfile", dockerFileVersionSearchPhrase) + if err != nil { + t.Fatalf("Error getting Go version from Dockerfile: %v", err) + } + + if goModVersion != dockerfileVersion { + t.Errorf("Go version mismatch: go.mod (%s), Dockerfile (%s)", goModVersion, dockerfileVersion) + } +} + +// Test function to check if Go version in go.mod matches Dockerfile_boringcrypto +func TestGoVersionMatchingBoringCrypto(t *testing.T) { + goModVersionSearchPhrase := `^go\s+(\d+\.\d+)` + goModVersion, err := getVersionFromFile("go.mod", goModVersionSearchPhrase) + if err != nil { + t.Fatalf("Error getting Go version from go.mod: %v", err) + } + + dockerFileVersionSearchPhrase := "GO_VERSION=(.*)" + dockerfileVersion, err := getVersionFromFile("Dockerfile_boringcrypto", dockerFileVersionSearchPhrase) + if err != nil { + t.Fatalf("Error getting Go version from Dockerfile_boringcrypto: %v", err) + } + + if goModVersion != dockerfileVersion { + t.Errorf("Go version mismatch: go.mod (%s), Dockerfile (%s)", goModVersion, dockerfileVersion) + } +} diff --git a/go.mod b/go.mod index cd8f84ca..652943ae 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/contentsquare/chproxy -go 1.19 +go 1.22 require ( github.com/alicebob/miniredis/v2 v2.21.0 diff --git a/go.sum b/go.sum index feae0813..6243b41b 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,8 @@ -cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= @@ -22,11 +19,8 @@ github.com/bsm/gomega v1.20.0/go.mod h1:JifAceMQ4crZIWYUKrlGcmbN3bqHogVTADMD2ATs github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -36,17 +30,12 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cu github.com/frankban/quicktest v1.7.2 h1:2QxQoC1TS09S7fhCPsrvqYdvP1H5M1P1ih5ABm3BTYk= github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0 h1:DGJh0Sm43HbOeYDNnVZFl8BvcYVvjD5bqYJvp0REbwQ= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= 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 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -68,48 +57,37 @@ 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.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= 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 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 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= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/pierrec/lz4 v2.4.0+incompatible h1:06usnXXDNcPvCHDkmPpkidf4jTc52UKld7UPfqKatY4= github.com/pierrec/lz4 v2.4.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -135,12 +113,10 @@ github.com/redis/go-redis/v9 v9.0.2 h1:BA426Zqe/7r56kCcvxYLWe1mkaz71LKF77GwgFzSx github.com/redis/go-redis/v9 v9.0.2/go.mod h1:/xDTe9EF1LM61hek62Poq2nzQSGj0xSrEtEHbBQevps= 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 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 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.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -149,39 +125,26 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ 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/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 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/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/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 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= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/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-20180905080454-ebe1bf3edb33/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-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -192,38 +155,20 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.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.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -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/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 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= @@ -234,7 +179,6 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= From 7d7fc266cb4b0453326a4df2fe5dd06dbef05445 Mon Sep 17 00:00:00 2001 From: Sean Connole Date: Tue, 12 Nov 2024 12:12:47 -0700 Subject: [PATCH 22/26] chore: remove more vulnerabilities --- Dockerfile | 10 ++++++---- Dockerfile_boringcrypto | 2 +- Makefile | 2 +- dockerfile_version_test.go | 5 +++-- go.mod | 10 +++++----- go.sum | 19 ++++++++++--------- 6 files changed, 26 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index afb0b48d..09580943 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,9 @@ -ARG GO_VERSION=1.22 -FROM golang:${GO_VERSION} AS build +ARG GO_VERSION=1.22.7 +FROM golang:${GO_VERSION}-alpine AS build + +RUN apk add --no-cache --update zstd-static zstd-dev make gcc musl-dev git libc6-compat && \ + apk del openssl && \ + apk add --no-cache openssl=3.3.2-r1 RUN mkdir -p /go/src/github.com/contentsquare/chproxy WORKDIR /go/src/github.com/contentsquare/chproxy @@ -13,7 +17,5 @@ FROM alpine RUN apk add --no-cache curl ca-certificates COPY --from=build /go/src/github.com/contentsquare/chproxy/chproxy* / -EXPOSE 9090 - ENTRYPOINT [ "/chproxy" ] CMD [ "--help" ] diff --git a/Dockerfile_boringcrypto b/Dockerfile_boringcrypto index 320b9102..581a9537 100644 --- a/Dockerfile_boringcrypto +++ b/Dockerfile_boringcrypto @@ -5,7 +5,7 @@ ENV GOPATH=/gocode ENV PATH=$PATH:$GOPATH/bin ENV GO_VERSION=1.22 -RUN mkdir /scr +RUN mkdir /src WORKDIR /src # golang diff --git a/Makefile b/Makefile index a6889043..f33b3067 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ release: format lint test clean release-build release-build-docker: @echo "Ver: $(BUILD_TAG)" - @DOCKER_BUILDKIT=1 docker build -f Dockerfile_build --target build --build-arg EXT_BUILD_TAG=$(BUILD_TAG) --progress plain -t chproxy-build . + @DOCKER_BUILDKIT=1 docker build -f Dockerfile --target build --build-arg EXT_BUILD_TAG=$(BUILD_TAG) --progress plain -t chproxy-build . @docker run --rm --entrypoint "/bin/sh" -v $(CURDIR):/host chproxy-build -c "/bin/cp chproxy-linux-*-*.tar.gz /host" release-build-docker-fips: diff --git a/dockerfile_version_test.go b/dockerfile_version_test.go index 4e308744..5e401822 100644 --- a/dockerfile_version_test.go +++ b/dockerfile_version_test.go @@ -4,6 +4,7 @@ import ( "bufio" "os" "regexp" + "strings" "testing" ) @@ -41,7 +42,7 @@ func TestGoVersionMatching(t *testing.T) { t.Fatalf("Error getting Go version from Dockerfile: %v", err) } - if goModVersion != dockerfileVersion { + if !strings.HasPrefix(dockerfileVersion, goModVersion) { t.Errorf("Go version mismatch: go.mod (%s), Dockerfile (%s)", goModVersion, dockerfileVersion) } } @@ -60,7 +61,7 @@ func TestGoVersionMatchingBoringCrypto(t *testing.T) { t.Fatalf("Error getting Go version from Dockerfile_boringcrypto: %v", err) } - if goModVersion != dockerfileVersion { + if !strings.HasPrefix(dockerfileVersion, goModVersion) { t.Errorf("Go version mismatch: go.mod (%s), Dockerfile (%s)", goModVersion, dockerfileVersion) } } diff --git a/go.mod b/go.mod index 652943ae..fac829c5 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/prometheus/client_golang v1.11.1 github.com/redis/go-redis/v9 v9.0.2 github.com/stretchr/testify v1.8.1 - golang.org/x/crypto v0.1.0 + golang.org/x/crypto v0.21.0 golang.org/x/time v0.3.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -30,10 +30,10 @@ require ( github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/protobuf v1.26.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 6243b41b..8ac8a0c6 100644 --- a/go.sum +++ b/go.sum @@ -130,16 +130,16 @@ github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJB golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -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/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 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= @@ -157,12 +157,12 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -177,8 +177,9 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= From 8545d5170c48c90fab4845f732fc87a385b1d07b Mon Sep 17 00:00:00 2001 From: vsirmbard <70996933+vsirmbard@users.noreply.github.com> Date: Wed, 25 Dec 2024 17:01:05 +0600 Subject: [PATCH 23/26] Update go.mod --- go.mod | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index fac829c5..27a49e11 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/prometheus/client_golang v1.11.1 github.com/redis/go-redis/v9 v9.0.2 github.com/stretchr/testify v1.8.1 - golang.org/x/crypto v0.21.0 + golang.org/x/crypto v0.31.0 golang.org/x/time v0.3.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -30,9 +30,9 @@ require ( github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect From bfeec4888319eaa5b6f64ce99893bf519f187185 Mon Sep 17 00:00:00 2001 From: vsirmbard <70996933+vsirmbard@users.noreply.github.com> Date: Wed, 25 Dec 2024 17:01:58 +0600 Subject: [PATCH 24/26] Update go.sum --- go.sum | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/go.sum b/go.sum index 8ac8a0c6..5214e1cd 100644 --- a/go.sum +++ b/go.sum @@ -130,16 +130,16 @@ github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJB golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 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= @@ -157,12 +157,12 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From c4a408cb7095d3865ae722f61da8117bc7297710 Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Wed, 25 Dec 2024 17:14:39 +0200 Subject: [PATCH 25/26] Go 1.22 Fix Action --- .github/workflows/go-test.yaml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go-test.yaml b/.github/workflows/go-test.yaml index d68aeeb0..8e84a9f9 100644 --- a/.github/workflows/go-test.yaml +++ b/.github/workflows/go-test.yaml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.19 + go-version: 1.22 - name: Build run: go build -v ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 20078765..9a31a15d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.19 + go-version: 1.22 - name: Install cross-compile package run: | From 792bae7da51055a79b9aa7630ea6f67595cba20d Mon Sep 17 00:00:00 2001 From: Pavel Nemirovsky Date: Wed, 25 Dec 2024 17:18:05 +0200 Subject: [PATCH 26/26] Go 1.22 Fix Action --- .github/workflows/go-test.yaml | 37 ++++++++++++------------- .github/workflows/golangci-lint.yaml | 13 ++++++--- .github/workflows/release.yml | 40 ++++++++++++---------------- 3 files changed, 46 insertions(+), 44 deletions(-) diff --git a/.github/workflows/go-test.yaml b/.github/workflows/go-test.yaml index 8e84a9f9..bfbfeb14 100644 --- a/.github/workflows/go-test.yaml +++ b/.github/workflows/go-test.yaml @@ -2,31 +2,32 @@ name: go-test on: push: - branches: [ master ] + branches: + - master pull_request: - branches: [ master ] + branches: + - master jobs: - build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.22 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.22 - - name: Build - run: go build -v ./... + - name: Build + run: go build -v ./... - - name: Test - run: go test -v ./... + - name: Test + run: go test -v ./... - - name: Update coverage report - uses: ncruces/go-coverage-report@21fa4b59396f242b81896a3cd212a463589b6742 - with: - report: 'true' - chart: 'true' - amend: 'false' + - name: Update coverage report + uses: ncruces/go-coverage-report@21fa4b59396f242b81896a3cd212a463589b6742 + with: + report: 'false' + chart: 'true' + amend: 'false' \ No newline at end of file diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index d4fc4357..ddc0dd62 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -1,4 +1,5 @@ name: golangci-lint + on: push: tags: @@ -7,13 +8,19 @@ on: - master - main pull_request: + jobs: golangci: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: '1.22' + - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: - version: v1.51.2 + version: v1.57.2 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a31a15d..f60de02c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,9 +3,8 @@ name: goreleaser on: push: tags: - - "v*" - tags_ignore: - - "*-test" + - 'v*' + - '!*-test' permissions: contents: write @@ -14,15 +13,13 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - - name: Checkout - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v2 + - name: Set up Go + uses: actions/setup-go@v5 with: go-version: 1.22 @@ -32,24 +29,21 @@ jobs: sudo apt install -y gcc gcc-aarch64-linux-gnu musl build-essential - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - - - name: Docker login - run: | - docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} - env: - DOCKER_USERNAME: ${{ secrets.docker_username }} - DOCKER_PASSWORD: ${{ secrets.docker_password }} + - name: Docker login + uses: docker/login-action@v3 + with: + username: ${{ secrets.docker_username }} + password: ${{ secrets.docker_password }} - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser version: latest - args: release --debug + args: release --verbose env: - BUILD_TAG: "latest" + BUILD_TAG: 'latest' GOPATH: ${{ env.GOPATH }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file