Skip to content

Commit 0c5cd13

Browse files
authored
Chore/dependencies update for CVE (#134)
* dependencies update * struct re-arranges
1 parent 7129fa1 commit 0c5cd13

File tree

7 files changed

+86
-111
lines changed

7 files changed

+86
-111
lines changed

completion_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"errors"
88
"fmt"
99
"io"
10-
"io/ioutil"
1110
"net/http"
1211
"net/http/httptest"
1312
"testing"
@@ -109,7 +108,7 @@ func TestCompletable(t *testing.T) {
109108
sqlds := &SQLDatasource{}
110109
sqlds.Completable = test.fakeImpl
111110

112-
b := ioutil.NopCloser(bytes.NewReader([]byte(test.reqBody)))
111+
b := io.NopCloser(bytes.NewReader([]byte(test.reqBody)))
113112
sqlds.getResources(test.method)(w, &http.Request{Body: b})
114113
resp := w.Result()
115114
body, _ := io.ReadAll(resp.Body)
@@ -151,7 +150,7 @@ func Test_registerRoutes(t *testing.T) {
151150
}
152151
mux.ServeHTTP(resp, req)
153152

154-
respByte, err := ioutil.ReadAll(resp.Body)
153+
respByte, err := io.ReadAll(resp.Body)
155154
if err != nil {
156155
t.Fatalf("unexpected error %v", err)
157156
}
@@ -176,10 +175,10 @@ func Test_registerRoutes(t *testing.T) {
176175

177176
func TestParseOptions(t *testing.T) {
178177
tests := []struct {
178+
err error
179+
result Options
179180
description string
180181
input json.RawMessage
181-
result Options
182-
err error
183182
}{
184183
{
185184
description: "parses input",

datasource.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,11 @@ type dbConnection struct {
4545

4646
type SQLDatasource struct {
4747
Completable
48-
connector *Connector
4948
backend.CallResourceHandler
50-
CustomRoutes map[string]func(http.ResponseWriter, *http.Request)
51-
// Enabling multiple connections may cause that concurrent connection limits
52-
// are hit. The datasource enabling this should make sure connections are cached
53-
// if necessary.
54-
EnableMultipleConnections bool
49+
connector *Connector
50+
CustomRoutes map[string]func(http.ResponseWriter, *http.Request)
5551
metrics Metrics
52+
EnableMultipleConnections bool
5653
}
5754

5855
// NewDatasource creates a new `SQLDatasource`.

datasource_connect_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ func Test_getDBConnectionFromQuery(t *testing.T) {
3535
db3 := &sql.DB{}
3636
d := &fakeDriver{openDBfn: func(msg json.RawMessage) (*sql.DB, error) { return db3, nil }}
3737
tests := []struct {
38+
existingDB *sql.DB
39+
expectedDB *sql.DB
3840
desc string
3941
dsUID string
4042
args string
41-
existingDB *sql.DB
4243
expectedKey string
43-
expectedDB *sql.DB
4444
}{
4545
{
4646
desc: "it should return the default db with no args",

driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import (
1313
)
1414

1515
type DriverSettings struct {
16-
Timeout time.Duration
1716
FillMode *data.FillMissing
17+
RetryOn []string
18+
Timeout time.Duration
1819
Retries int
1920
Pause int
20-
RetryOn []string
2121
ForwardHeaders bool
2222
Errors bool
2323
}

go.mod

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ go 1.23
55
toolchain go1.23.0
66

77
require (
8-
github.com/go-sql-driver/mysql v1.4.0
8+
github.com/go-sql-driver/mysql v1.8.1
99
github.com/google/go-cmp v0.6.0
10-
github.com/grafana/dataplane/sdata v0.0.7
11-
github.com/grafana/grafana-plugin-sdk-go v0.245.0
12-
github.com/mithrandie/csvq-driver v1.6.8
13-
github.com/prometheus/client_golang v1.20.0
10+
github.com/grafana/dataplane/sdata v0.0.9
11+
github.com/grafana/grafana-plugin-sdk-go v0.251.0
12+
github.com/mithrandie/csvq-driver v1.7.0
13+
github.com/prometheus/client_golang v1.20.4
1414
github.com/stretchr/testify v1.9.0
1515
)
1616

@@ -45,23 +45,24 @@ require (
4545
github.com/zeebo/xxh3 v1.0.2 // indirect
4646
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
4747
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.53.0 // indirect
48-
go.opentelemetry.io/contrib/propagators/jaeger v1.28.0 // indirect
49-
go.opentelemetry.io/contrib/samplers/jaegerremote v0.22.0 // indirect
50-
go.opentelemetry.io/otel v1.28.0 // indirect
51-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
48+
go.opentelemetry.io/contrib/propagators/jaeger v1.29.0 // indirect
49+
go.opentelemetry.io/contrib/samplers/jaegerremote v0.23.0 // indirect
50+
go.opentelemetry.io/otel v1.29.0 // indirect
51+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect
5252
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect
53-
go.opentelemetry.io/otel/metric v1.28.0 // indirect
54-
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
55-
go.opentelemetry.io/otel/trace v1.28.0 // indirect
53+
go.opentelemetry.io/otel/metric v1.29.0 // indirect
54+
go.opentelemetry.io/otel/sdk v1.29.0 // indirect
55+
go.opentelemetry.io/otel/trace v1.29.0 // indirect
5656
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
5757
golang.org/x/mod v0.17.0 // indirect
5858
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
59-
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
60-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
59+
google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect
60+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
6161
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
6262
)
6363

6464
require (
65+
filippo.io/edwards25519 v1.1.0 // indirect
6566
github.com/apache/arrow/go/v15 v15.0.2 // indirect
6667
github.com/beorn7/perks v1.0.1 // indirect
6768
github.com/cespare/xxhash/v2 v2.3.0 // indirect
@@ -84,11 +85,11 @@ require (
8485
github.com/mattn/go-colorable v0.1.13 // indirect
8586
github.com/mattn/go-isatty v0.0.19 // indirect
8687
github.com/mattn/go-runewidth v0.0.9 // indirect
87-
github.com/mitchellh/go-homedir v1.0.0 // indirect
88+
github.com/mitchellh/go-homedir v1.1.0 // indirect
8889
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
89-
github.com/mithrandie/csvq v1.17.10 // indirect
90+
github.com/mithrandie/csvq v1.18.1 // indirect
9091
github.com/mithrandie/go-file/v2 v2.1.0 // indirect
91-
github.com/mithrandie/go-text v1.5.4 // indirect
92+
github.com/mithrandie/go-text v1.6.0 // indirect
9293
github.com/mithrandie/ternary v1.1.1 // indirect
9394
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
9495
github.com/modern-go/reflect2 v1.0.2 // indirect
@@ -100,16 +101,15 @@ require (
100101
github.com/prometheus/client_model v0.6.1 // indirect
101102
github.com/prometheus/common v0.55.0 // indirect
102103
github.com/prometheus/procfs v0.15.1 // indirect
103-
golang.org/x/crypto v0.26.0 // indirect
104+
golang.org/x/crypto v0.27.0 // indirect
104105
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
105-
golang.org/x/net v0.28.0 // indirect
106+
golang.org/x/net v0.29.0 // indirect
106107
golang.org/x/sync v0.8.0 // indirect
107-
golang.org/x/sys v0.24.0 // indirect
108-
golang.org/x/term v0.23.0 // indirect
109-
golang.org/x/text v0.17.0 // indirect
108+
golang.org/x/sys v0.25.0 // indirect
109+
golang.org/x/term v0.24.0 // indirect
110+
golang.org/x/text v0.18.0 // indirect
110111
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
111-
google.golang.org/appengine v1.6.8 // indirect
112-
google.golang.org/grpc v1.65.0 // indirect
112+
google.golang.org/grpc v1.66.0 // indirect
113113
google.golang.org/protobuf v1.34.2 // indirect
114114
gopkg.in/yaml.v3 v3.0.1 // indirect
115115
)

0 commit comments

Comments
 (0)