Skip to content

Commit

Permalink
Ability to set no-redirects=true per path
Browse files Browse the repository at this point in the history
  • Loading branch information
p53 committed Jan 13, 2025
1 parent 5082735 commit b55321c
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions pkg/testsuite/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,45 +649,45 @@ func TestLogoutHandlerGood(t *testing.T) {
},
},
},
// {
// Name: "TestLogoutWithRedirectQueryParam",
// ProxySettings: func(_ *config.Config) {},
// ExecutionSettings: []fakeRequest{
// {
// URI: utils.WithOAuthURI(cfg.BaseURI, cfg.OAuthURI)(constant.LogoutURL) + "?redirect=http://example.com",
// HasToken: true,
// ExpectedCode: http.StatusSeeOther,
// ExpectedLocation: "http://example.com",
// },
// },
// },
// {
// Name: "TestLogoutWithEnabledLogoutRedirect",
// ProxySettings: func(c *config.Config) {
// c.EnableLogoutRedirect = true
// },
// ExecutionSettings: []fakeRequest{
// {
// URI: utils.WithOAuthURI(cfg.BaseURI, cfg.OAuthURI)(constant.LogoutURL),
// HasToken: true,
// ExpectedCode: http.StatusSeeOther,
// ExpectedLocation: "http://127.0.0.1",
// },
// },
// },
// {
// Name: "TestLogoutWithEmptyRedirectQueryParam",
// ProxySettings: func(c *config.Config) {
// c.RedirectionURL = "http://example.com"
// },
// ExecutionSettings: []fakeRequest{
// {
// URI: utils.WithOAuthURI(cfg.BaseURI, cfg.OAuthURI)(constant.LogoutURL) + "?redirect=",
// HasToken: true,
// ExpectedCode: http.StatusSeeOther,
// },
// },
// },
{
Name: "TestLogoutWithRedirectQueryParam",
ProxySettings: func(_ *config.Config) {},
ExecutionSettings: []fakeRequest{
{
URI: utils.WithOAuthURI(cfg.BaseURI, cfg.OAuthURI)(constant.LogoutURL) + "?redirect=http://example.com",
HasToken: true,
ExpectedCode: http.StatusSeeOther,
ExpectedLocation: "http://example.com",
},
},
},
{
Name: "TestLogoutWithEnabledLogoutRedirect",
ProxySettings: func(c *config.Config) {
c.EnableLogoutRedirect = true
},
ExecutionSettings: []fakeRequest{
{
URI: utils.WithOAuthURI(cfg.BaseURI, cfg.OAuthURI)(constant.LogoutURL),
HasToken: true,
ExpectedCode: http.StatusSeeOther,
ExpectedLocation: "http://127.0.0.1",
},
},
},
{
Name: "TestLogoutWithEmptyRedirectQueryParam",
ProxySettings: func(c *config.Config) {
c.RedirectionURL = "http://example.com"
},
ExecutionSettings: []fakeRequest{
{
URI: utils.WithOAuthURI(cfg.BaseURI, cfg.OAuthURI)(constant.LogoutURL) + "?redirect=",
HasToken: true,
ExpectedCode: http.StatusSeeOther,
},
},
},
}

for _, testCase := range testCases {
Expand Down

0 comments on commit b55321c

Please sign in to comment.