mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 08:27:26 +02:00
authorize: add databroker server and record version to result, force sync via polling (#2024)
* authorize: add databroker server and record version to result, force sync via polling * wrap inmem store to take read lock when grabbing databroker versions * address code review comments * reset max to 0
This commit is contained in:
parent
8f97b0d6ee
commit
d7ab817de7
17 changed files with 467 additions and 362 deletions
|
@ -14,7 +14,7 @@ func TestCustomEvaluator(t *testing.T) {
|
|||
|
||||
store := NewStore()
|
||||
t.Run("bool deny", func(t *testing.T) {
|
||||
ce := NewCustomEvaluator(store.opaStore)
|
||||
ce := NewCustomEvaluator(store)
|
||||
res, err := ce.Evaluate(ctx, &CustomEvaluatorRequest{
|
||||
RegoPolicy: `
|
||||
package pomerium.custom_policy
|
||||
|
@ -29,7 +29,7 @@ func TestCustomEvaluator(t *testing.T) {
|
|||
assert.Empty(t, res.Reason)
|
||||
})
|
||||
t.Run("set deny", func(t *testing.T) {
|
||||
ce := NewCustomEvaluator(store.opaStore)
|
||||
ce := NewCustomEvaluator(store)
|
||||
res, err := ce.Evaluate(ctx, &CustomEvaluatorRequest{
|
||||
RegoPolicy: `
|
||||
package pomerium.custom_policy
|
||||
|
@ -44,7 +44,7 @@ func TestCustomEvaluator(t *testing.T) {
|
|||
assert.Equal(t, "test", res.Reason)
|
||||
})
|
||||
t.Run("missing package", func(t *testing.T) {
|
||||
ce := NewCustomEvaluator(store.opaStore)
|
||||
ce := NewCustomEvaluator(store)
|
||||
res, err := ce.Evaluate(ctx, &CustomEvaluatorRequest{
|
||||
RegoPolicy: `allow = true`,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue