Merge pull request #2467 from influxdata/fix/basepath-logout

Update oauth logout to include basepath
pull/2479/head
Nathan Haugo 2017-12-04 15:19:00 -08:00 committed by GitHub
commit 5f05fc00fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 8 deletions

View File

@ -20,8 +20,10 @@
1. [#2416](https://github.com/influxdata/chronograf/pull/2416): Fix default y-axis labels not displaying properly
1. [#2423](https://github.com/influxdata/chronograf/pull/2423): Gracefully scale Template Variables Manager overlay on smaller displays
1. [#2426](https://github.com/influxdata/chronograf/pull/2426): Fix Influx Enterprise users from deletion in race condition
1. [#2467](https://github.com/influxdata/chronograf/pull/2467): Fix oauth2 logout link not having basepath
1. [#2466](https://github.com/influxdata/chronograf/pull/2466): Fix supplying a role link to sources that do not have a metaURL
### Features
1. [#2188](https://github.com/influxdata/chronograf/pull/2188): Add Kapacitor logs to the TICKscript editor
1. [#2384](https://github.com/influxdata/chronograf/pull/2384): Add filtering by name to Dashboard index page

View File

@ -217,7 +217,10 @@ func Test_Service_DashboardCells(t *testing.T) {
ctx := context.Background()
params := httprouter.Params{}
for k, v := range test.ctxParams {
params = append(params, httprouter.Param{k, v})
params = append(params, httprouter.Param{
Key: k,
Value: v,
})
}
ctx = httprouter.WithParams(ctx, params)

View File

@ -213,12 +213,12 @@ func Test_KapacitorRulesGet(t *testing.T) {
bg := context.Background()
params := httprouter.Params{
{
"id",
"1",
Key: "id",
Value: "1",
},
{
"kid",
"1",
Key: "kid",
Value: "1",
},
}
ctx := httprouter.WithParams(bg, params)
@ -244,8 +244,8 @@ func Test_KapacitorRulesGet(t *testing.T) {
actual := make([]chronograf.AlertRule, len(frame.Rules))
for idx, _ := range frame.Rules {
actual[idx] = frame.Rules[idx].AlertRule
for i := range frame.Rules {
actual[i] = frame.Rules[i].AlertRule
}
if resp.StatusCode != http.StatusOK {

View File

@ -202,7 +202,7 @@ func NewMux(opts MuxOpts, service Service) http.Handler {
// Encapsulate the router with OAuth2
var auth http.Handler
auth, allRoutes.AuthRoutes = AuthAPI(opts, router)
allRoutes.LogoutLink = "/oauth/logout"
allRoutes.LogoutLink = path.Join(opts.Basepath, "/oauth/logout")
// Create middleware that redirects to the appropriate provider logout
router.GET(allRoutes.LogoutLink, Logout("/", basepath, allRoutes.AuthRoutes))