Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard: Fixes kiosk state after being redirected to login page and back #29273

Merged
merged 5 commits into from
Nov 20, 2020

Conversation

torkelo
Copy link
Member

@torkelo torkelo commented Nov 20, 2020

Fixes #26899

This fixes a bug in the golang query Values Encode function where it write "=" even for keys that have no value. A query parameter "&kiosk" is treated as a boolean true in the frontend but "&kiosk=" is treated as an empty string by the frontend.

A big hacky fix but since the bug is in the golang standard lib not sure what is best here.

@torkelo torkelo requested a review from a team as a code owner November 20, 2020 15:44
@torkelo torkelo requested review from papagian and jessabe and removed request for a team November 20, 2020 15:44
Copy link
Contributor

@papagian papagian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested it by enabling anonymous access and signing in (by using the Sign in link from the side menu) with:

  • basic auth and
  • google OAuth

and everything works fine!

@marefr
Copy link
Contributor

marefr commented Nov 20, 2020

@papagian care to take another look. Pushed some additional tests for this

@marefr marefr requested a review from papagian November 20, 2020 16:47
@marefr marefr added this to the 7.3.4 milestone Nov 20, 2020
Copy link
Contributor

@papagian papagian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice; I've added two more cases.

pkg/middleware/auth_test.go Show resolved Hide resolved
@torkelo torkelo added the old backport v7.3.x Mark PR to be automatically backported to v7.3.x label Nov 20, 2020
@torkelo torkelo changed the title Login: Fixes issue where url parameters where modified by golang url code Dashboard: Fixes kiosk state after being redirected to login page and back Nov 20, 2020
torkelo and others added 2 commits November 20, 2020 18:34
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
@torkelo torkelo merged commit 1076f47 into master Nov 20, 2020
@torkelo torkelo deleted the login-mangles-boolean-query-params branch November 20, 2020 18:30
grafanabot pushed a commit that referenced this pull request Nov 20, 2020
… back (#29273)

* Login: Fixes issue where url parameters where modified by golang url code

* Add tests

* Fix test cases

* Update pkg/middleware/auth_test.go

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>

* fixed formatting

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
(cherry picked from commit 1076f47)
torkelo added a commit that referenced this pull request Nov 20, 2020
… back (#29273) (#29278)

* Login: Fixes issue where url parameters where modified by golang url code

* Add tests

* Fix test cases

* Update pkg/middleware/auth_test.go

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>

* fixed formatting

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
(cherry picked from commit 1076f47)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
xlson added a commit to AgnesToulet/grafana that referenced this pull request Nov 24, 2020
* master: (71 commits)
  Security: Fixes minor security issue with alert notification webhooks that allowed GET & DELETE requests grafana#29330
  Chore: Bump storybook to v6 (grafana#28926)
  ReleaseNotes: Updates release notes link in package.json (master) (grafana#29329)
  Docs: Accurately reflecting available variables (grafana#29302)
  Heatmap: Fixes issue introduced by new eventbus (grafana#29322)
  Dashboard Schemas (grafana#28793)
  devenv: Add docker load test which authenticates with API key (grafana#28905)
  Login: Fixes redirect url encoding issues of # %23 being unencoded after login (grafana#29299)
  InfluxDB: update flux library and support boolean label values (grafana#29310)
  Explore/Logs: Update Parsed fields to Detected fields (grafana#28881)
  GraphNG: Init refactorings and fixes (grafana#29275)
  fixing a broken relref link (grafana#29312)
  Drone: Upgrade build pipeline tool (grafana#29308)
  decreasing frontend docs threshold. (grafana#29304)
  Docker: update docker root group docs and docker image (grafana#29222)
  WebhookNotifier: Convert tests away from goconvey (grafana#29291)
  Annotations: fixing so when changing annotations query links submenu will be updated. (grafana#28990)
  [graph-ng] add temporal DataFrame alignment/outerJoin & move null-asZero pass inside (grafana#29250)
  Dashboard: Fixes kiosk state after being redirected to login page and back (grafana#29273)
  make it possible to hide change password link in profile menu (grafana#29246)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog old backport v7.3.x Mark PR to be automatically backported to v7.3.x type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kiosk mode doesn't work after oauth redirect
3 participants