Skip to content

Commit

Permalink
Cleanup the PR to original state
Browse files Browse the repository at this point in the history
  • Loading branch information
Pushpalanka committed Jan 13, 2025
1 parent f4bcd41 commit d9321d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
10 changes: 2 additions & 8 deletions filters/openpolicyagent/evaluation.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/open-policy-agent/opa-envoy-plugin/envoyauth"
"github.com/open-policy-agent/opa-envoy-plugin/opa/decisionlog"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/plugins/logs"
"github.com/open-policy-agent/opa/server"
"github.com/open-policy-agent/opa/topdown"
"github.com/opentracing/opentracing-go"
Expand Down Expand Up @@ -60,7 +59,7 @@ func (opa *OpenPolicyAgentInstance) Eval(ctx context.Context, req *ext_authz_v3.
return nil, fmt.Errorf("check request timed out before query execution: %w", ctx.Err())
}

logger := opa.Logger().WithFields(map[string]interface{}{"decision-id": result.DecisionID})
logger := opa.manager.Logger().WithFields(map[string]interface{}{"decision-id": result.DecisionID})
input, err = envoyauth.RequestToInput(req, logger, nil, opa.EnvoyPluginConfig().SkipRequestBodyParse)
if err != nil {
return nil, fmt.Errorf("failed to convert request to input: %w", err)
Expand Down Expand Up @@ -112,12 +111,7 @@ func (opa *OpenPolicyAgentInstance) logDecision(ctx context.Context, input inter
info.Path = opa.EnvoyPluginConfig().Path
}

plugin := logs.Lookup(opa.manager)
if plugin == nil {
return nil
}

return decisionlog.LogDecision(ctx, plugin, info, result, err)
return decisionlog.LogDecision(ctx, opa.manager, info, result, err)
}

func withDecisionID(decisionID string) func(*envoyauth.EvalResult) {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ require (
github.com/lightstep/lightstep-tracer-go v0.26.0
github.com/miekg/dns v1.1.62
github.com/oklog/ulid v1.3.1
github.com/open-policy-agent/opa v1.0.0
github.com/open-policy-agent/opa-envoy-plugin v1.0.0-envoy
github.com/open-policy-agent/opa v0.70.0
github.com/open-policy-agent/opa-envoy-plugin v0.70.0-envoy-1
github.com/opentracing/basictracer-go v1.1.0
github.com/opentracing/opentracing-go v1.2.0
github.com/prometheus/client_golang v1.20.5
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,10 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
github.com/open-policy-agent/opa v1.0.0 h1:fZsEwxg1knpPvUn0YDJuJZBcbVg4G3zKpWa3+CnYK+I=
github.com/open-policy-agent/opa v1.0.0/go.mod h1:+JyoH12I0+zqyC1iX7a2tmoQlipwAEGvOhVJMhmy+rM=
github.com/open-policy-agent/opa-envoy-plugin v1.0.0-envoy h1:HUuR33CLBoHJM8Cn75qUiFripmTqq+po7XmZYt7p9Qc=
github.com/open-policy-agent/opa-envoy-plugin v1.0.0-envoy/go.mod h1:fIp3GJ/Mza5coH9ErwmEiCuBeJR3CKz7Q7p09kicPxA=
github.com/open-policy-agent/opa v0.70.0 h1:B3cqCN2iQAyKxK6+GI+N40uqkin+wzIrM7YA60t9x1U=
github.com/open-policy-agent/opa v0.70.0/go.mod h1:Y/nm5NY0BX0BqjBriKUiV81sCl8XOjjvqQG7dXrggtI=
github.com/open-policy-agent/opa-envoy-plugin v0.70.0-envoy-1 h1:nWKvCOUAKYpnvRmjbdcL32dGVPG/eyRa/MeQa3Es+hY=
github.com/open-policy-agent/opa-envoy-plugin v0.70.0-envoy-1/go.mod h1:S+CuCmO3Wk+SnAmjPl69tUB3G8iUgXUH+Jrl56Wje/U=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
Expand Down

0 comments on commit d9321d5

Please sign in to comment.