mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-02 16:30:17 +02:00
Optimize evaluator
This optimizes the Evaluator in the Authorize service to scale to very large numbers of routes. Additional caching was also added when building rego policy query evaluators in parallel to allow sharing work and to avoid building evaluators for scripts with the same contents.
This commit is contained in:
parent
526e2a58d6
commit
a396c2eab3
16 changed files with 1539 additions and 483 deletions
|
@ -65,12 +65,13 @@ func TestAuthorize_getDataBrokerSessionOrServiceAccount(t *testing.T) {
|
|||
t.Cleanup(clearTimeout)
|
||||
|
||||
opt := config.NewDefaultOptions()
|
||||
a, err := New(context.Background(), &config.Config{Options: opt})
|
||||
require.NoError(t, err)
|
||||
a := New()
|
||||
a.OnConfigChange(context.Background(), &config.Config{Options: opt})
|
||||
require.True(t, a.HasValidState())
|
||||
|
||||
s1 := &session.Session{Id: "s1", ExpiresAt: timestamppb.New(time.Now().Add(-time.Second))}
|
||||
sq := storage.NewStaticQuerier(s1)
|
||||
qctx := storage.WithQuerier(ctx, sq)
|
||||
_, err = a.getDataBrokerSessionOrServiceAccount(qctx, "s1", 0)
|
||||
_, err := a.getDataBrokerSessionOrServiceAccount(qctx, "s1", 0)
|
||||
assert.ErrorIs(t, err, session.ErrSessionExpired)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue