mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-02 00:10:45 +02:00
core/ppl: add groups criterion (#4916)
* core/ppl: add groups criterion * remove dead code * add additional test
This commit is contained in:
parent
3ca2f2462d
commit
6a833b365a
16 changed files with 268 additions and 109 deletions
|
@ -4,6 +4,8 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
||||
)
|
||||
|
||||
func TestHTTPPath(t *testing.T) {
|
||||
|
@ -13,7 +15,7 @@ allow:
|
|||
and:
|
||||
- http_path:
|
||||
is: /test
|
||||
`, []dataBrokerRecord{}, Input{HTTP: InputHTTP{Path: "/test"}})
|
||||
`, []*databroker.Record{}, Input{HTTP: InputHTTP{Path: "/test"}})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, A{true, A{ReasonHTTPPathOK}, M{}}, res["allow"])
|
||||
require.Equal(t, A{false, A{}}, res["deny"])
|
||||
|
@ -24,7 +26,7 @@ allow:
|
|||
and:
|
||||
- http_path:
|
||||
is: /test
|
||||
`, []dataBrokerRecord{}, Input{HTTP: InputHTTP{Path: "/not-test"}})
|
||||
`, []*databroker.Record{}, Input{HTTP: InputHTTP{Path: "/not-test"}})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, A{false, A{ReasonHTTPPathUnauthorized}, M{}}, res["allow"])
|
||||
require.Equal(t, A{false, A{}}, res["deny"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue