Skip to content

Commit

Permalink
fix returned error if dynamic metadata is incorrect
Browse files Browse the repository at this point in the history
Signed-off-by: tjons <tyler.schade@solo.io>
  • Loading branch information
tjons committed Nov 6, 2023
1 parent 78ec048 commit 68f42dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package internal
import (
"context"
"fmt"
"github.com/open-policy-agent/opa/topdown"
"math"
"net"
"net/url"
Expand All @@ -17,6 +16,8 @@ import (
"sync"
"time"

"github.com/open-policy-agent/opa/topdown"

ext_core_v2 "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
ext_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
ext_authz_v2 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v2"
Expand Down Expand Up @@ -466,7 +467,9 @@ func (p *envoyExtAuthzGrpcServer) check(ctx context.Context, req interface{}) (*

dynamicMetadata, err := result.GetDynamicMetadata()
if err != nil {
return nil, stop, errors.Wrap(err, "failed to get dynamic metadata")
err = errors.Wrap(err, "failed to get dynamic metadata")
internalErr = internalError(EnvoyAuthResultErr, err)
return nil, stop, &internalErr
}
resp.DynamicMetadata = dynamicMetadata

Expand Down

0 comments on commit 68f42dc

Please sign in to comment.