decision logging: remove unused inter-query cache setup (#5731)

Since a cache was created per request, this did not work as intended.
As it's unlikely that http.send is used in decision log drop/masking
decisions, it should be alright to leave this out until this is
requested, if ever.

Signed-off-by: Anders Eknert <anders@styra.com>
This commit is contained in:
Anders Eknert
2023-03-07 07:46:46 +01:00
committed by GitHub
parent a7c1f9cd5b
commit ff450934d1
-3
View File
@@ -29,7 +29,6 @@ import (
"github.com/open-policy-agent/opa/rego"
"github.com/open-policy-agent/opa/server"
"github.com/open-policy-agent/opa/storage"
"github.com/open-policy-agent/opa/topdown/cache"
"github.com/open-policy-agent/opa/util"
)
@@ -979,7 +978,6 @@ func (p *Plugin) dropEvent(ctx context.Context, txn storage.Transaction, event *
if p.drop == nil {
query := ast.NewBody(ast.NewExpr(ast.NewTerm(p.config.dropDecisionRef)))
interQueryCache := cache.NewInterQueryCache(p.manager.InterQueryBuiltinCacheConfig())
r := rego.New(
rego.ParsedQuery(query),
rego.Compiler(p.manager.GetCompiler()),
@@ -988,7 +986,6 @@ func (p *Plugin) dropEvent(ctx context.Context, txn storage.Transaction, event *
rego.Runtime(p.manager.Info),
rego.EnablePrintStatements(p.manager.EnablePrintStatements()),
rego.PrintHook(p.manager.PrintHook()),
rego.InterQueryBuiltinCache(interQueryCache),
)
pq, err := r.PrepareForEval(context.Background())