-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
Use remote cache instead of session storage #16114
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job. This one is truly a hairy method, looking forward to when we have tests for it and can refactor safely.
2ec946c
to
2ebf264
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/middleware/auth_proxy_test.go
"unit" tests were removed since we are doing #16147 anyway and old stuff has to be rewrited there anyway.
Although, it seems middleware ("integration") tests already pretty extensive for auth_proxy
module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. I did not have time to look at the tests properly, will try to take a look tonight or tomorrow when a I take a brea.
52d5ccc
to
ff74199
Compare
@@ -265,287 +267,192 @@ func TestMiddlewareContext(t *testing.T) { | |||
}) | |||
}) | |||
|
|||
middlewareScenario("When auth_proxy is enabled enabled and user exists", func(sc *scenarioContext) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't run the code so maybe I'm missing something here, but shouldn't this test still work after the changes? I see further tests that are related to auth_proxy without ldap, it seems like a bad idea to remove them. Let's sync up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me and @xlson had talk about it - the tests are changed a little: description, tree-like structure report and default values hoisted from test blocks, plus added couple more, that's the gist of it :).
It seems we are good here
ff74199
to
7bb88ff
Compare
Looks good. You can merge this now. |
* grafana/master: (27 commits) docs: fixes and update current version Docs: Updated changelog for v6.1.3 Graph: fixed png rendering with legend to the right (grafana#16463) Fix: Disables auto open datasource picker on focus (grafana#16398) add some mock/stub guidelines to testing guideline (grafana#16466) Feat: Suggestion list in Explore is virtualized (grafana#16342) Docs: Updated roadmap issue to link to the pinned roadmap issues Graph: Fixed auto decimals in legend values (grafana#16455) Styling: Aligned heading (grafana#16456) add PromQL keyword for adhoc filter (grafana#16426) Singlestat: Use decimal override when manually specified (grafana#16451) Graph: follow-up graph decimals fix, grafana#16414 (grafana#16450) Chore: use remote cache instead of session storage (grafana#16114) Docs: Minor changelog tweak Docs: Updated changelog with v6.1.2 release issues datasource: fix disable query when using mixed datasource (grafana#16409) Graph: Fixed series legend color for hidden series (grafana#16438) Templating: Fixed loading React variable query editor (grafana#16439) Styles: Fixed left menu highlight (grafana#16431) Fix: remove test artefact (grafana#16411) ...
* Added monkey dep for easy test stubbing * Small refactoring of the settings module * Update docs - remove references for the session storage * Update config files (sample and default configs) * Added tests for warning during the config load on defined storage cache * Removed all references to session storage * Removed macaron session dependency Fixes grafana#16148 Ref grafana#16114
* Chore: remove session storage references * Small refactoring of the settings module * Update docs - remove references for the session storage * Update config files (sample and default configs) * Add tests for warning during the config load on defined storage cache * Remove all references to session storage * Remove macaron session dependency * Remove leftovers * Fix: address review comments * Fix: remove old deps * Fix: add skipStaticRootValidation = true to tests * Fix: improve the docs and warning message As per discussion in here - https://github.com/grafana/grafana/pull/16445/files#r273026255 * Chore: make linter happy Fixes #16148 Ref #16114
What this PR does / why we need it:
Replaces session storage in auth_proxy middleware with remote cache
Which issue(s) this PR fixes:
Fixes #15161