Skip to content

Commit 8bffa34

Browse files
authored
FFM-12443 - Remove indirect dependency on github.com/golang-jwt/jwt v3.2.2+incompatible (#400)
* update deps * remove fanout deps * update echo packages * tests passing * add depends on redis to docker compose
1 parent 737c168 commit 8bffa34

File tree

11 files changed

+68
-61
lines changed

11 files changed

+68
-61
lines changed

cache/wrapper_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ var (
2727
Environment: strPtr("env"),
2828
Excluded: &[]rest.Target{{Identifier: "exlc1"}, {Identifier: "exlc2"}},
2929
Included: &[]rest.Target{{Identifier: "incl1"}, {Identifier: "incl2"}},
30-
Rules: &[]rest.Clause{{Attribute: "attr", Id: "id", Negate: false, Op: "contains", Values: []string{"val1", "val2"}}},
31-
Tags: &[]rest.Tag{{Name: "tagName", Value: strPtr("tagValue")}},
30+
Rules: &[]rest.Clause{{Attribute: "attr", Id: strPtr("id"), Negate: false, Op: "contains", Values: []string{"val1", "val2"}}},
31+
Tags: &[]rest.Tag{{Name: "tagName", Identifier: "tagValue"}},
3232
Version: int64Ptr(2),
3333
}
3434

@@ -53,9 +53,9 @@ var (
5353
Project: "proj",
5454
Rules: &[]rest.ServingRule{
5555
{
56-
Clauses: []rest.Clause{{Attribute: "attr", Id: "id", Negate: false, Op: "contains", Values: []string{"val1", "val2"}}},
56+
Clauses: []rest.Clause{{Attribute: "attr", Id: strPtr("id"), Negate: false, Op: "contains", Values: []string{"val1", "val2"}}},
5757
Priority: 1,
58-
RuleId: "ID",
58+
RuleId: strPtr("ID"),
5959
Serve: rest.Serve{
6060
Distribution: nil,
6161
Variation: strPtr("str"),
@@ -66,7 +66,7 @@ var (
6666
VariationToTargetMap: &[]rest.VariationMap{
6767
{
6868
TargetSegments: &[]string{"segment1", "segment2", "segment3"},
69-
Targets: &[]rest.TargetMap{{strPtr("target1"), "target1"}, {strPtr("target2"), "target2"}, {strPtr("target3"), "target3"}},
69+
Targets: &[]rest.TargetMap{{"target1", "target1"}, {"target2", "target2"}, {"target3", "target3"}},
7070
Variation: "var",
7171
},
7272
},

cmd/example-sdk/main.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"time"
1111

1212
harness "github.com/harness/ff-golang-server-sdk/client"
13-
"github.com/harness/ff-golang-server-sdk/logger"
1413

1514
"github.com/harness/ff-golang-server-sdk/dto"
1615
)
@@ -35,11 +34,6 @@ func init() {
3534
}
3635

3736
func main() {
38-
logger, err := logger.NewZapLogger(true)
39-
if err != nil {
40-
log.Fatal(err)
41-
}
42-
4337
target := dto.NewTargetBuilder(targetIdentifier).
4438
Name(targetIdentifier).
4539
Build()
@@ -49,7 +43,6 @@ func main() {
4943
harness.WithURL(baseURL),
5044
harness.WithEventsURL(eventsURL),
5145
harness.WithTarget(target),
52-
harness.WithLogger(logger),
5346
harness.WithPullInterval(1),
5447
)
5548
defer func() {

cmd/ff-proxy/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"github.com/prometheus/client_golang/prometheus"
2020
"github.com/prometheus/client_golang/prometheus/collectors"
2121

22-
"github.com/fanout/go-gripcontrol"
22+
"github.com/harness-community/go-gripcontrol"
2323
"github.com/hashicorp/go-retryablehttp"
2424

2525
"cloud.google.com/go/profiler"

config/local_config_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var (
4343
Clauses: []rest.Clause{
4444
{
4545
Attribute: "age",
46-
Id: "79f5bca0-17ca-42c2-8934-5cee840fe2e0",
46+
Id: strPtr("79f5bca0-17ca-42c2-8934-5cee840fe2e0"),
4747
Negate: false,
4848
Op: "equal",
4949
Values: []string{
@@ -52,7 +52,7 @@ var (
5252
},
5353
},
5454
Priority: 1,
55-
RuleId: "8756c207-abf8-4202-83fd-dedf5d27e2c2",
55+
RuleId: strPtr("8756c207-abf8-4202-83fd-dedf5d27e2c2"),
5656
Serve: rest.Serve{
5757
Variation: strPtr("false"),
5858
},
@@ -66,7 +66,7 @@ var (
6666
},
6767
Targets: &[]rest.TargetMap{
6868
{
69-
Identifier: strPtr("davej"),
69+
Identifier: "davej",
7070
Name: "Dave Johnston",
7171
},
7272
},
@@ -128,7 +128,7 @@ var (
128128
Rules: &[]rest.Clause{
129129
{
130130
Attribute: "ip",
131-
Id: "31c18ee7-8051-44cc-8507-b44580467ee5",
131+
Id: strPtr("31c18ee7-8051-44cc-8507-b44580467ee5"),
132132
Negate: false,
133133
Op: "equal",
134134
Values: []string{"2a00:23c5:b672:2401:158:f2a6:67a0:6a79"},

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ services:
3232
- ./tests/e2e/certs:/certs
3333
ports:
3434
- 7000:${PORT:-7000}
35+
depends_on:
36+
- redis
3537

3638
redis:
3739
image: "redis:latest"

go.mod

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,25 @@ require (
77
github.com/alicebob/miniredis/v2 v2.30.4
88
github.com/avast/retry-go v3.0.0+incompatible
99
github.com/deepmap/oapi-codegen v1.11.0
10-
github.com/fanout/go-gripcontrol v1.2.0
11-
github.com/fanout/go-pubcontrol v1.2.0
1210
github.com/go-kit/kit v0.12.0
1311
github.com/go-redis/cache/v8 v8.4.4
1412
github.com/go-redis/redis/v8 v8.11.4
1513
github.com/golang-jwt/jwt/v4 v4.5.2
1614
github.com/google/uuid v1.5.0
15+
github.com/harness-community/go-gripcontrol v1.2.1
16+
github.com/harness-community/go-pubcontrol v1.2.1
1717
github.com/harness-community/sse/v3 v3.1.0
18-
github.com/harness/ff-golang-server-sdk v0.1.20
18+
github.com/harness/ff-golang-server-sdk v0.1.26
1919
github.com/hashicorp/go-multierror v1.1.1
2020
github.com/hashicorp/go-retryablehttp v0.7.7
2121
github.com/joho/godotenv v1.4.0
2222
github.com/json-iterator/go v1.1.12
23-
github.com/labstack/echo/v4 v4.11.4
23+
github.com/labstack/echo-jwt/v4 v4.1.0
24+
github.com/labstack/echo/v4 v4.13.4
2425
github.com/patrickmn/go-cache v2.1.0+incompatible
2526
github.com/prometheus/client_golang v1.11.1
2627
github.com/sirupsen/logrus v1.8.1
27-
github.com/stretchr/testify v1.8.4
28+
github.com/stretchr/testify v1.10.0
2829
go.uber.org/zap v1.19.1
2930
gopkg.in/yaml.v2 v2.4.0
3031
)
@@ -33,15 +34,16 @@ require (
3334
cloud.google.com/go v0.110.10 // indirect
3435
cloud.google.com/go/compute/metadata v0.3.0 // indirect
3536
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
37+
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
3638
github.com/beorn7/perks v1.0.1 // indirect
3739
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
3840
github.com/cespare/xxhash/v2 v2.2.0 // indirect
3941
github.com/davecgh/go-spew v1.1.1 // indirect
42+
github.com/deepmap/oapi-codegen/v2 v2.1.0 // indirect
4043
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
4144
github.com/getkin/kin-openapi v0.124.0 // indirect
4245
github.com/go-openapi/jsonpointer v0.20.2 // indirect
4346
github.com/go-openapi/swag v0.22.8 // indirect
44-
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
4547
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
4648
github.com/golang/protobuf v1.5.3 // indirect
4749
github.com/google/pprof v0.0.0-20221103000818-d260c55eee4c // indirect
@@ -56,21 +58,21 @@ require (
5658
github.com/klauspost/compress v1.16.7 // indirect
5759
github.com/labstack/gommon v0.4.2 // indirect
5860
github.com/mailru/easyjson v0.7.7 // indirect
59-
github.com/mattn/go-colorable v0.1.13 // indirect
61+
github.com/mattn/go-colorable v0.1.14 // indirect
6062
github.com/mattn/go-isatty v0.0.20 // indirect
6163
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
6264
github.com/mitchellh/go-homedir v1.1.0 // indirect
6365
github.com/mitchellh/mapstructure v1.4.2 // indirect
6466
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6567
github.com/modern-go/reflect2 v1.0.2 // indirect
6668
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
69+
github.com/oapi-codegen/runtime v1.1.1 // indirect
6770
github.com/perimeterx/marshmallow v1.1.5 // indirect
6871
github.com/pmezard/go-difflib v1.0.0 // indirect
6972
github.com/prometheus/client_model v0.2.0 // indirect
7073
github.com/prometheus/common v0.30.0 // indirect
7174
github.com/prometheus/procfs v0.7.3 // indirect
7275
github.com/spaolacci/murmur3 v1.1.0 // indirect
73-
github.com/ugorji/go/codec v1.2.11 // indirect
7476
github.com/valyala/bytebufferpool v1.0.0 // indirect
7577
github.com/valyala/fasttemplate v1.2.2 // indirect
7678
github.com/vmihailenco/go-tinylfu v0.2.2 // indirect
@@ -82,12 +84,12 @@ require (
8284
go.uber.org/multierr v1.7.0 // indirect
8385
golang.org/x/crypto v0.38.0 // indirect
8486
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
85-
golang.org/x/net v0.36.0 // indirect
87+
golang.org/x/net v0.40.0 // indirect
8688
golang.org/x/oauth2 v0.30.0 // indirect
8789
golang.org/x/sync v0.14.0 // indirect
8890
golang.org/x/sys v0.33.0 // indirect
8991
golang.org/x/text v0.25.0 // indirect
90-
golang.org/x/time v0.5.0 // indirect
92+
golang.org/x/time v0.11.0 // indirect
9193
google.golang.org/api v0.149.0 // indirect
9294
google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect
9395
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect

0 commit comments

Comments
 (0)