core/authorize: cache prepared query building

This commit is contained in:
Caleb Doxsey 2023-11-01 17:19:42 -06:00
parent 0b79a28328
commit 42233223cb
11 changed files with 143 additions and 67 deletions

View file

@ -130,8 +130,8 @@ func TestAuthorize_okResponse(t *testing.T) {
}
a := &Authorize{currentOptions: config.NewAtomicOptions(), state: atomicutil.NewValue(new(authorizeState))}
a.currentOptions.Store(opt)
a.store = store.New()
pe, err := newPolicyEvaluator(opt, a.store)
a.compiler = evaluator.NewRegoCompiler(store.New())
pe, err := newPolicyEvaluator(opt, a.compiler)
require.NoError(t, err)
a.state.Load().evaluator = pe