mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 08:27:26 +02:00
authorize: fix custom rego panic (#2226)
* fix custom rego panic * fix type cast
This commit is contained in:
parent
cc4c400140
commit
897e7202bb
3 changed files with 48 additions and 20 deletions
|
@ -53,4 +53,17 @@ func TestCustomEvaluator(t *testing.T) {
|
|||
}
|
||||
assert.NotNil(t, res)
|
||||
})
|
||||
t.Run("invalid package", func(t *testing.T) {
|
||||
ce := NewCustomEvaluator(store)
|
||||
res, err := ce.Evaluate(ctx, &CustomEvaluatorRequest{
|
||||
RegoPolicy: `package custom_ext_authz.rego
|
||||
allow {
|
||||
true
|
||||
}`,
|
||||
})
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
assert.NotNil(t, res)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue