Skip to content

Commit

Permalink
filters/openpolicyagent: use google.golang.org/protobuf (#2975)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
AlexanderYastrebov authored Mar 12, 2024
1 parent e8b8d4d commit b75e159
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions filters/openpolicyagent/openpolicyagent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (

ext_authz_v3_core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
authv3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3"
_struct "github.com/golang/protobuf/ptypes/struct"
"github.com/open-policy-agent/opa-envoy-plugin/envoyauth"
opaconf "github.com/open-policy-agent/opa/config"
opasdktest "github.com/open-policy-agent/opa/sdk/test"
Expand All @@ -30,6 +29,7 @@ import (
"github.com/zalando/skipper/routing"
"github.com/zalando/skipper/tracing/tracingtest"
"google.golang.org/protobuf/encoding/protojson"
_struct "google.golang.org/protobuf/types/known/structpb"
)

type MockOpenPolicyAgentFilter struct {
Expand Down Expand Up @@ -68,7 +68,7 @@ func TestLoadEnvoyMetadata(t *testing.T) {
"filter_metadata": {
"envoy.filters.http.header_to_metadata": {
"policy_type": "ingress"
}
}
}
}
`))(cfg)
Expand Down Expand Up @@ -99,7 +99,7 @@ func mockControlPlaneWithDiscoveryBundle(discoveryBundle string) (*opasdktest.Se
opasdktest.MockBundle("/bundles/test", map[string]string{
"main.rego": `
package envoy.authz
default allow = false
`,
}),
Expand Down Expand Up @@ -144,14 +144,14 @@ func mockControlPlaneWithResourceBundle() (*opasdktest.Server, []byte) {
opasdktest.MockBundle("/bundles/test", map[string]string{
"main.rego": `
package envoy.authz
default allow = false
`,
}),
opasdktest.MockBundle("/bundles/use_body", map[string]string{
"main.rego": `
package envoy.authz
default allow = false
allow { input.parsed_body }
Expand All @@ -160,7 +160,7 @@ func mockControlPlaneWithResourceBundle() (*opasdktest.Server, []byte) {
opasdktest.MockBundle("/bundles/anotherbundlename", map[string]string{
"main.rego": `
package envoy.authz
default allow = false
`,
}),
Expand All @@ -178,7 +178,7 @@ func mockControlPlaneWithResourceBundle() (*opasdktest.Server, []byte) {
}
},
"plugins": {
"envoy_ext_authz_grpc": {
"envoy_ext_authz_grpc": {
"path": "/envoy/authz/allow",
"dry-run": false,
"skip-request-body-parse": false
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ require (
github.com/envoyproxy/go-control-plane v0.12.0
github.com/ghodss/yaml v1.0.0
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang/protobuf v1.5.3
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/hashicorp/memberlist v0.5.0
Expand Down Expand Up @@ -101,6 +100,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/flatbuffers v1.12.1 // indirect
Expand Down

0 comments on commit b75e159

Please sign in to comment.