1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-15 00:15:00 +02:00

Support only allowed_groups querystring

This commit is contained in:
Nick Meves
2020-11-27 09:07:21 -08:00
parent 025056cba0
commit 65e15f24c1
3 changed files with 22 additions and 28 deletions

View File

@ -2732,7 +2732,14 @@ func TestAuthOnlyAllowedGroups(t *testing.T) {
name: "UserInQuerystringGroup",
allowedGroups: []string{"a", "b"},
groups: []string{"a", "c"},
querystring: "?allowed_group=a",
querystring: "?allowed_groups=a",
expectedStatusCode: http.StatusAccepted,
},
{
name: "UserInMultiParamQuerystringGroup",
allowedGroups: []string{"a", "b"},
groups: []string{"b"},
querystring: "?allowed_groups=a&allowed_groups=b,d",
expectedStatusCode: http.StatusAccepted,
},
{
@ -2742,13 +2749,6 @@ func TestAuthOnlyAllowedGroups(t *testing.T) {
querystring: "?allowed_groups=a,b",
expectedStatusCode: http.StatusAccepted,
},
{
name: "UserInMultiParamQuerystringGroup",
allowedGroups: []string{"a", "b"},
groups: []string{"b"},
querystring: "?allowed_group=a&allowed_group=b",
expectedStatusCode: http.StatusAccepted,
},
{
name: "UserInDelimitedQuerystringGroup",
allowedGroups: []string{"a", "b", "c"},
@ -2760,14 +2760,14 @@ func TestAuthOnlyAllowedGroups(t *testing.T) {
name: "UserNotInQuerystringGroup",
allowedGroups: []string{},
groups: []string{"c"},
querystring: "?allowed_group=a&allowed_group=b",
querystring: "?allowed_groups=a,b",
expectedStatusCode: http.StatusForbidden,
},
{
name: "UserInConfigGroupNotInQuerystringGroup",
allowedGroups: []string{"a", "b", "c"},
groups: []string{"c"},
querystring: "?allowed_group=a&allowed_group=b",
querystring: "?allowed_groups=a,b",
expectedStatusCode: http.StatusForbidden,
},
{