Skip to content

Commit 8860fed

Browse files
fix(deps): vulnerability fix in connect-rpc validate and ristretto (#3065)
This pull request primarily updates several dependencies in the `service/go.mod` file, especially for validation and caching libraries, and makes the necessary code adjustments to support these upgrades. The most significant changes are grouped below: **Dependency Upgrades:** * Upgraded `buf.build/go/protovalidate` from `v0.13.1` to `v1.0.0`, and `connectrpc.com/validate` from `v0.3.0` to `v0.6.0`, reflecting major version changes for validation libraries. * Updated `github.com/dgraph-io/ristretto` to `v2.4.0` (from v0.2.0) and adjusted all related imports and usages to the new version, which now uses generics. [[1]](diffhunk://#diff-d833fd9c30ece95b8f948d87d2a53aa43ac2a725b869fad2e2a9fe8a71924700L8-R22) [[2]](diffhunk://#diff-86ab8e12a253df7a30da365d95afa01e8149f3ff13ab5727a12c709db8aadec6L9-R9) [[3]](diffhunk://#diff-86ab8e12a253df7a30da365d95afa01e8149f3ff13ab5727a12c709db8aadec6L25-R25) [[4]](diffhunk://#diff-86ab8e12a253df7a30da365d95afa01e8149f3ff13ab5727a12c709db8aadec6L47-R47) [[5]](diffhunk://#diff-86ab8e12a253df7a30da365d95afa01e8149f3ff13ab5727a12c709db8aadec6L155-R155) * Bumped several other dependencies to newer versions, including `github.com/google/cel-go`, `github.com/stoewer/go-strcase`, `go.uber.org/mock`, and `golang.org/x/exp`. [[1]](diffhunk://#diff-d833fd9c30ece95b8f948d87d2a53aa43ac2a725b869fad2e2a9fe8a71924700L108-R107) [[2]](diffhunk://#diff-d833fd9c30ece95b8f948d87d2a53aa43ac2a725b869fad2e2a9fe8a71924700L157-R156) [[3]](diffhunk://#diff-d833fd9c30ece95b8f948d87d2a53aa43ac2a725b869fad2e2a9fe8a71924700L171-R173) **Code Adjustments for Library Upgrades:** * Refactored the creation of the validation interceptor (`validate.NewInterceptor`) to match the updated API, which no longer returns an error. [[1]](diffhunk://#diff-afba8000c9b4da491e00de2d21351395f1a4eb444fdb187f8b6ba3040d01441eL522-R522) [[2]](diffhunk://#diff-afba8000c9b4da491e00de2d21351395f1a4eb444fdb187f8b6ba3040d01441eL545-R542) * Updated the cache manager implementation to use the new generic types required by `ristretto/v2`, including changes to the struct field types and configuration instantiation. [[1]](diffhunk://#diff-86ab8e12a253df7a30da365d95afa01e8149f3ff13ab5727a12c709db8aadec6L25-R25) [[2]](diffhunk://#diff-86ab8e12a253df7a30da365d95afa01e8149f3ff13ab5727a12c709db8aadec6L47-R47) [[3]](diffhunk://#diff-86ab8e12a253df7a30da365d95afa01e8149f3ff13ab5727a12c709db8aadec6L155-R155) **Indirect Dependency Updates:** * Updated indirect dependencies such as `buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go` and removed an unused indirect dependency (`github.com/dgryski/go-farm`). These changes ensure compatibility with the latest versions of the libraries and take advantage of improvements such as generics support and simplified APIs.
1 parent 65eb7c3 commit 8860fed

File tree

4 files changed

+35
-44
lines changed

4 files changed

+35
-44
lines changed

service/go.mod

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ go 1.25.0
55
toolchain go1.25.7
66

77
require (
8-
buf.build/go/protovalidate v0.13.1
8+
buf.build/go/protovalidate v1.0.0
99
connectrpc.com/connect v1.19.1
1010
connectrpc.com/grpchealth v1.4.0
1111
connectrpc.com/grpcreflect v1.3.0
12-
connectrpc.com/validate v0.3.0
12+
connectrpc.com/validate v0.6.0
1313
github.com/Masterminds/squirrel v1.5.4
1414
github.com/Nerzal/gocloak/v13 v13.9.0
1515
github.com/bmatcuk/doublestar v1.3.4
1616
github.com/casbin/casbin/v2 v2.108.0
1717
github.com/creasty/defaults v1.8.0
18-
github.com/dgraph-io/ristretto v0.2.0
18+
github.com/dgraph-io/ristretto/v2 v2.4.0
1919
github.com/docker/docker v28.5.1+incompatible
2020
github.com/docker/go-connections v0.6.0
2121
github.com/eko/gocache/lib/v4 v4.2.0
22-
github.com/eko/gocache/store/ristretto/v4 v4.2.2
22+
github.com/eko/gocache/store/ristretto/v4 v4.3.2
2323
github.com/fsnotify/fsnotify v1.9.0
2424
github.com/go-chi/cors v1.2.1
2525
github.com/go-playground/validator/v10 v10.26.0
@@ -59,13 +59,12 @@ require (
5959
)
6060

6161
require (
62-
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250613105001-9f2d3c737feb.1 // indirect
62+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.9-20250912141014-52f32327d4b0.1 // indirect
6363
cel.dev/expr v0.24.0 // indirect
6464
github.com/Masterminds/semver/v3 v3.4.0 // indirect
6565
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
6666
github.com/containerd/errdefs v1.0.0 // indirect
6767
github.com/containerd/errdefs/pkg v0.3.0 // indirect
68-
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da // indirect
6968
github.com/ebitengine/purego v0.8.4 // indirect
7069
github.com/moby/go-archive v0.1.0 // indirect
7170
github.com/shirou/gopsutil/v4 v4.25.6 // indirect
@@ -105,7 +104,7 @@ require (
105104
github.com/goccy/go-json v0.10.5 // indirect
106105
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
107106
github.com/golang/mock v1.6.0 // indirect
108-
github.com/google/cel-go v0.25.0 // indirect
107+
github.com/google/cel-go v0.26.1 // indirect
109108
github.com/gorilla/mux v1.8.1 // indirect
110109
github.com/gowebpki/jcs v1.0.1 // indirect
111110
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 // indirect
@@ -154,7 +153,7 @@ require (
154153
github.com/spf13/afero v1.12.0 // indirect
155154
github.com/spf13/cast v1.7.1 // indirect
156155
github.com/spf13/pflag v1.0.6 // indirect
157-
github.com/stoewer/go-strcase v1.3.0 // indirect
156+
github.com/stoewer/go-strcase v1.3.1 // indirect
158157
github.com/subosito/gotenv v1.6.0 // indirect
159158
github.com/tchap/go-patricia/v2 v2.3.2 // indirect
160159
github.com/tklauser/go-sysconf v0.3.15 // indirect
@@ -168,10 +167,10 @@ require (
168167
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
169168
go.opentelemetry.io/otel/metric v1.39.0 // indirect
170169
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
171-
go.uber.org/mock v0.4.0 // indirect
170+
go.uber.org/mock v0.6.0 // indirect
172171
go.uber.org/multierr v1.11.0 // indirect
173172
golang.org/x/crypto v0.45.0 // indirect
174-
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
173+
golang.org/x/exp v0.0.0-20250911091902-df9299821621 // indirect
175174
golang.org/x/oauth2 v0.34.0 // indirect
176175
golang.org/x/sync v0.19.0 // indirect
177176
golang.org/x/sys v0.39.0 // indirect

service/go.sum

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250613105001-9f2d3c737feb.1 h1:AUL6VF5YWL01j/1H/DQbPUSDkEwYqwVCNw7yhbpOxSQ=
2-
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250613105001-9f2d3c737feb.1/go.mod h1:avRlCjnFzl98VPaeCtJ24RrV/wwHFzB8sWXhj26+n/U=
3-
buf.build/go/protovalidate v0.13.1 h1:6loHDTWdY/1qmqmt1MijBIKeN4T9Eajrqb9isT1W1s8=
4-
buf.build/go/protovalidate v0.13.1/go.mod h1:C/QcOn/CjXRn5udUwYBiLs8y1TGy7RS+GOSKqjS77aU=
1+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.9-20250912141014-52f32327d4b0.1 h1:DQLS/rRxLHuugVzjJU5AvOwD57pdFl9he/0O7e5P294=
2+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.9-20250912141014-52f32327d4b0.1/go.mod h1:aY3zbkNan5F+cGm9lITDP6oxJIwu0dn9KjJuJjWaHkg=
3+
buf.build/go/protovalidate v1.0.0 h1:IAG1etULddAy93fiBsFVhpj7es5zL53AfB/79CVGtyY=
4+
buf.build/go/protovalidate v1.0.0/go.mod h1:KQmEUrcQuC99hAw+juzOEAmILScQiKBP1Oc36vvCLW8=
55
cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY=
66
cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw=
77
connectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14=
@@ -10,8 +10,8 @@ connectrpc.com/grpchealth v1.4.0 h1:MJC96JLelARPgZTiRF9KRfY/2N9OcoQvF2EWX07v2IE=
1010
connectrpc.com/grpchealth v1.4.0/go.mod h1:WhW6m1EzTmq3Ky1FE8EfkIpSDc6TfUx2M2KqZO3ts/Q=
1111
connectrpc.com/grpcreflect v1.3.0 h1:Y4V+ACf8/vOb1XOc251Qun7jMB75gCUNw6llvB9csXc=
1212
connectrpc.com/grpcreflect v1.3.0/go.mod h1:nfloOtCS8VUQOQ1+GTdFzVg2CJo4ZGaat8JIovCtDYs=
13-
connectrpc.com/validate v0.3.0 h1:eMPASBQM+ztVzuLSXddB61zwJKzvWWZ6RLdIwTgh9Wo=
14-
connectrpc.com/validate v0.3.0/go.mod h1:QLGN/m+oDeI4zaDAANK1L1G5K4i8gg6CUUwyl3HAG4A=
13+
connectrpc.com/validate v0.6.0 h1:DcrgDKt2ZScrUs/d/mh9itD2yeEa0UbBBa+i0mwzx+4=
14+
connectrpc.com/validate v0.6.0/go.mod h1:ihrpI+8gVbLH1fvVWJL1I3j0CfWnF8P/90LsmluRiZs=
1515
dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
1616
dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
1717
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk=
@@ -75,10 +75,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvw
7575
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40=
7676
github.com/dgraph-io/badger/v4 v4.7.0 h1:Q+J8HApYAY7UMpL8d9owqiB+odzEc0zn/aqOD9jhc6Y=
7777
github.com/dgraph-io/badger/v4 v4.7.0/go.mod h1:He7TzG3YBy3j4f5baj5B7Zl2XyfNe5bl4Udl0aPemVA=
78-
github.com/dgraph-io/ristretto v0.2.0 h1:XAfl+7cmoUDWW/2Lx8TGZQjjxIQ2Ley9DSf52dru4WE=
79-
github.com/dgraph-io/ristretto v0.2.0/go.mod h1:8uBHCU/PBV4Ag0CJrP47b9Ofby5dqWNh4FicAdoqFNU=
80-
github.com/dgraph-io/ristretto/v2 v2.2.0 h1:bkY3XzJcXoMuELV8F+vS8kzNgicwQFAaGINAEJdWGOM=
81-
github.com/dgraph-io/ristretto/v2 v2.2.0/go.mod h1:RZrm63UmcBAaYWC1DotLYBmTvgkrs0+XhBd7Npn7/zI=
78+
github.com/dgraph-io/ristretto/v2 v2.4.0 h1:I/w09yLjhdcVD2QV192UJcq8dPBaAJb9pOuMyNy0XlU=
79+
github.com/dgraph-io/ristretto/v2 v2.4.0/go.mod h1:0KsrXtXvnv0EqnzyowllbVJB8yBonswa2lTCK2gGo9E=
8280
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da h1:aIftn67I1fkbMa512G+w+Pxci9hJPB8oMnkcP3iZF38=
8381
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
8482
github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7cNTs5R6Hk4V2lcmLz2NsG2VnInyNo=
@@ -97,8 +95,8 @@ github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0o
9795
github.com/ebitengine/purego v0.8.4/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
9896
github.com/eko/gocache/lib/v4 v4.2.0 h1:MNykyi5Xw+5Wu3+PUrvtOCaKSZM1nUSVftbzmeC7Yuw=
9997
github.com/eko/gocache/lib/v4 v4.2.0/go.mod h1:7ViVmbU+CzDHzRpmB4SXKyyzyuJ8A3UW3/cszpcqB4M=
100-
github.com/eko/gocache/store/ristretto/v4 v4.2.2 h1:lXFzoZ5ck6Gy6ON7f5DHSkNt122qN7KoroCVgVwF7oo=
101-
github.com/eko/gocache/store/ristretto/v4 v4.2.2/go.mod h1:uIvBVJzqRepr5L0RsbkfQ2iYfbyos2fuji/s4yM+aUM=
98+
github.com/eko/gocache/store/ristretto/v4 v4.3.2 h1:DfvjqmB6hPHJ9oduReMohe8rZCVtxmY8OqTkmIu+dk0=
99+
github.com/eko/gocache/store/ristretto/v4 v4.3.2/go.mod h1:1F6nJFAY6fTx/UVd66iYr26V2GzZbVJqQJSl+CkRGh4=
102100
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
103101
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
104102
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
@@ -146,8 +144,8 @@ github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
146144
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
147145
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
148146
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
149-
github.com/google/cel-go v0.25.0 h1:jsFw9Fhn+3y2kBbltZR4VEz5xKkcIFRPDnuEzAGv5GY=
150-
github.com/google/cel-go v0.25.0/go.mod h1:hjEb6r5SuOSlhCHmFoLzu8HGCERvIsDAbxDAyNU/MmI=
147+
github.com/google/cel-go v0.26.1 h1:iPbVVEdkhTX++hpe3lzSk7D3G3QSYqLGoHOcEio+UXQ=
148+
github.com/google/cel-go v0.26.1/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM=
151149
github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q=
152150
github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
153151
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@@ -309,8 +307,8 @@ github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
309307
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
310308
github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4=
311309
github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4=
312-
github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
313-
github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
310+
github.com/stoewer/go-strcase v1.3.1 h1:iS0MdW+kVTxgMoE1LAZyMiYJFKlOzLooE4MxjirtkAs=
311+
github.com/stoewer/go-strcase v1.3.1/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
314312
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
315313
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
316314
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
@@ -375,16 +373,16 @@ go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjce
375373
go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4=
376374
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
377375
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
378-
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
379-
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
376+
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
377+
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
380378
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
381379
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
382380
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
383381
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
384382
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
385383
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
386-
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI=
387-
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
384+
golang.org/x/exp v0.0.0-20250911091902-df9299821621 h1:2id6c1/gto0kaHYyrixvknJ8tUK/Qs5IsmBtrc+FtgU=
385+
golang.org/x/exp v0.0.0-20250911091902-df9299821621/go.mod h1:TwQYMMnGpvZyc+JpB/UAuTNIsVJifOlSkrZkhcvpVUk=
388386
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
389387
golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=
390388
golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=

service/internal/server/server.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -519,12 +519,9 @@ func newConnectRPCIPC(c Config, a *auth.Authentication, logger *logger.Logger) (
519519
}
520520

521521
// Add protovalidate interceptor
522-
vaidationInterceptor, err := validate.NewInterceptor()
523-
if err != nil {
524-
return nil, fmt.Errorf("failed to create validation interceptor: %w", err)
525-
}
522+
validationInterceptor := validate.NewInterceptor()
526523

527-
interceptors = append(interceptors, connect.WithInterceptors(vaidationInterceptor, audit.ContextServerInterceptor(logger.Logger)))
524+
interceptors = append(interceptors, connect.WithInterceptors(validationInterceptor, audit.ContextServerInterceptor(logger.Logger)))
528525

529526
return &ConnectRPC{
530527
Interceptors: interceptors,
@@ -542,12 +539,9 @@ func newConnectRPC(c Config, a *auth.Authentication, logger *logger.Logger) (*Co
542539
}
543540

544541
// Add protovalidate interceptor
545-
vaidationInterceptor, err := validate.NewInterceptor()
546-
if err != nil {
547-
return nil, fmt.Errorf("failed to create validation interceptor: %w", err)
548-
}
542+
validationInterceptor := validate.NewInterceptor()
549543

550-
interceptors = append(interceptors, connect.WithInterceptors(vaidationInterceptor, audit.ContextServerInterceptor(logger.Logger)))
544+
interceptors = append(interceptors, connect.WithInterceptors(validationInterceptor, audit.ContextServerInterceptor(logger.Logger)))
551545

552546
return &ConnectRPC{
553547
Interceptors: interceptors,

service/pkg/cache/cache.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"log/slog"
77
"time"
88

9-
"github.com/dgraph-io/ristretto"
9+
"github.com/dgraph-io/ristretto/v2"
1010
"github.com/eko/gocache/lib/v4/cache"
1111
"github.com/eko/gocache/lib/v4/store"
1212
ristretto_store "github.com/eko/gocache/store/ristretto/v4"
@@ -22,7 +22,7 @@ var (
2222
// Manager is a cache manager for any value.
2323
type Manager struct {
2424
cache *cache.Cache[any]
25-
underlyingStore *ristretto.Cache
25+
underlyingStore *ristretto.Cache[string, any]
2626
}
2727

2828
// Cache is a cache implementation using gocache for any value type.
@@ -44,7 +44,7 @@ func NewCacheManager(maxCost int64) (*Manager, error) {
4444
if err != nil {
4545
return nil, err
4646
}
47-
config := &ristretto.Config{
47+
config := &ristretto.Config[string, any]{
4848
NumCounters: numCounters, // number of keys to track frequency of (10x max items)
4949
MaxCost: maxCost, // maximum cost of cache (e.g., 1<<20 for 1MB)
5050
BufferItems: bufferItems, // number of keys per Get buffer.
@@ -152,7 +152,7 @@ func TestCacheClient(expiration time.Duration) (*Cache, error) {
152152
if err != nil {
153153
return nil, err
154154
}
155-
config := &ristretto.Config{
155+
config := &ristretto.Config[string, any]{
156156
NumCounters: numCounters,
157157
MaxCost: testMaxCost,
158158
BufferItems: bufferItems,

0 commit comments

Comments
 (0)