mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-31 07:19:16 +02:00
authorize: fix policy numbers in evaluator test (#4387)
In authorize_test.go, the policy 'to' URLs are numbered from 1 to 11.
However, there is no number 8 (it looks like it was removed in commit
c178819
). Update the URLs with numbers 9 through 11 to remove this gap.
Update the "any authenticated user" test case to use the corresponding
AllowAnyAuthenticatedUser policy (currently this case passes because
it's using the policy that allows any GET request, but it's not testing
what it says it should).
This commit is contained in:
parent
8d09567fd7
commit
577319d26c
1 changed files with 4 additions and 4 deletions
|
@ -76,11 +76,11 @@ func TestEvaluator(t *testing.T) {
|
|||
AllowedDomains: []string{"example.com"},
|
||||
},
|
||||
{
|
||||
To: config.WeightedURLs{{URL: *mustParseURL("https://to9.example.com")}},
|
||||
To: config.WeightedURLs{{URL: *mustParseURL("https://to8.example.com")}},
|
||||
AllowAnyAuthenticatedUser: true,
|
||||
},
|
||||
{
|
||||
To: config.WeightedURLs{{URL: *mustParseURL("https://to10.example.com")}},
|
||||
To: config.WeightedURLs{{URL: *mustParseURL("https://to9.example.com")}},
|
||||
Policy: &config.PPLPolicy{
|
||||
Policy: &parser.Policy{
|
||||
Rules: []parser.Rule{{
|
||||
|
@ -95,7 +95,7 @@ func TestEvaluator(t *testing.T) {
|
|||
},
|
||||
},
|
||||
{
|
||||
To: config.WeightedURLs{{URL: *mustParseURL("https://to11.example.com")}},
|
||||
To: config.WeightedURLs{{URL: *mustParseURL("https://to10.example.com")}},
|
||||
Policy: &config.PPLPolicy{
|
||||
Policy: &parser.Policy{
|
||||
Rules: []parser.Rule{{
|
||||
|
@ -385,7 +385,7 @@ func TestEvaluator(t *testing.T) {
|
|||
Id: "user1",
|
||||
},
|
||||
}, &Request{
|
||||
Policy: &policies[8],
|
||||
Policy: &policies[7],
|
||||
Session: RequestSession{
|
||||
ID: "session1",
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue