Skip to content

Commit b75e159

Browse files
authoredMar 12, 2024··
filters/openpolicyagent: use google.golang.org/protobuf (#2975)
Use google.golang.org/protobuf to avoid direct dependency on github.com/golang/protobuf (which is still imported indirectly): ``` $ go mod why -m github.com/golang/protobuf github.com/zalando/skipper/filters/openpolicyagent github.com/envoyproxy/go-control-plane/envoy/config/core/v3 github.com/golang/protobuf/ptypes/any ``` Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
1 parent e8b8d4d commit b75e159

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
 

‎filters/openpolicyagent/openpolicyagent_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616

1717
ext_authz_v3_core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
1818
authv3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3"
19-
_struct "github.com/golang/protobuf/ptypes/struct"
2019
"github.com/open-policy-agent/opa-envoy-plugin/envoyauth"
2120
opaconf "github.com/open-policy-agent/opa/config"
2221
opasdktest "github.com/open-policy-agent/opa/sdk/test"
@@ -30,6 +29,7 @@ import (
3029
"github.com/zalando/skipper/routing"
3130
"github.com/zalando/skipper/tracing/tracingtest"
3231
"google.golang.org/protobuf/encoding/protojson"
32+
_struct "google.golang.org/protobuf/types/known/structpb"
3333
)
3434

3535
type MockOpenPolicyAgentFilter struct {
@@ -68,7 +68,7 @@ func TestLoadEnvoyMetadata(t *testing.T) {
6868
"filter_metadata": {
6969
"envoy.filters.http.header_to_metadata": {
7070
"policy_type": "ingress"
71-
}
71+
}
7272
}
7373
}
7474
`))(cfg)
@@ -99,7 +99,7 @@ func mockControlPlaneWithDiscoveryBundle(discoveryBundle string) (*opasdktest.Se
9999
opasdktest.MockBundle("/bundles/test", map[string]string{
100100
"main.rego": `
101101
package envoy.authz
102-
102+
103103
default allow = false
104104
`,
105105
}),
@@ -144,14 +144,14 @@ func mockControlPlaneWithResourceBundle() (*opasdktest.Server, []byte) {
144144
opasdktest.MockBundle("/bundles/test", map[string]string{
145145
"main.rego": `
146146
package envoy.authz
147-
147+
148148
default allow = false
149149
`,
150150
}),
151151
opasdktest.MockBundle("/bundles/use_body", map[string]string{
152152
"main.rego": `
153153
package envoy.authz
154-
154+
155155
default allow = false
156156
157157
allow { input.parsed_body }
@@ -160,7 +160,7 @@ func mockControlPlaneWithResourceBundle() (*opasdktest.Server, []byte) {
160160
opasdktest.MockBundle("/bundles/anotherbundlename", map[string]string{
161161
"main.rego": `
162162
package envoy.authz
163-
163+
164164
default allow = false
165165
`,
166166
}),
@@ -178,7 +178,7 @@ func mockControlPlaneWithResourceBundle() (*opasdktest.Server, []byte) {
178178
}
179179
},
180180
"plugins": {
181-
"envoy_ext_authz_grpc": {
181+
"envoy_ext_authz_grpc": {
182182
"path": "/envoy/authz/allow",
183183
"dry-run": false,
184184
"skip-request-body-parse": false

‎go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ require (
2020
github.com/envoyproxy/go-control-plane v0.12.0
2121
github.com/ghodss/yaml v1.0.0
2222
github.com/golang-jwt/jwt/v4 v4.5.0
23-
github.com/golang/protobuf v1.5.3
2423
github.com/google/go-cmp v0.6.0
2524
github.com/google/uuid v1.6.0
2625
github.com/hashicorp/memberlist v0.5.0
@@ -101,6 +100,7 @@ require (
101100
github.com/gogo/protobuf v1.3.2 // indirect
102101
github.com/golang/glog v1.2.0 // indirect
103102
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
103+
github.com/golang/protobuf v1.5.3 // indirect
104104
github.com/golang/snappy v0.0.4 // indirect
105105
github.com/google/btree v1.0.0 // indirect
106106
github.com/google/flatbuffers v1.12.1 // indirect

0 commit comments

Comments
 (0)
Please sign in to comment.