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

Login: Fix failure to login a new user via an external provider if quota are enabled #60015

Merged
merged 2 commits into from Dec 9, 2022

Conversation

papagian
Copy link
Contributor

@papagian papagian commented Dec 8, 2022

What is this feature?

It fixes a bug where new users (not previously seen) coming from external providers failed to login if quota are enabled.
Quota check used to fail with:
no usage for target:org:org_user:org
because it used to try checking also for user and org quota during login where there was no user signed in.
This fix checks for user and org scope quota only if the userID and orgID scope parameters are present.

Why do we need this feature?

[Add a description of the problem the feature is trying to solve.]

Who is this feature for?

[Add information on what kind of user the feature is for.]

Which issue(s) does this PR fix?:

Fixes #

Special notes for your reviewer:
To reproduce the bug one can start grafana like:

GF_QUOTA_ENABLED=true \
GF_AUTH_GOOGLE_ENABLED=true \
GF_AUTH_GOOGLE_CLIENT_ID=$CLIENT_ID \
GF_AUTH_GOOGLE_CLIENT_SECRET=$CLIENT_SECRET \
GF_LOG_LEVEL=debug make run

and try to login with an not existing google user.

@papagian papagian marked this pull request as ready for review December 8, 2022 14:35
@papagian papagian requested a review from a team as a code owner December 8, 2022 14:35
@papagian papagian requested review from zserge, mildwonkey and idafurjes and removed request for a team December 8, 2022 14:35
@papagian papagian enabled auto-merge (squash) December 8, 2022 15:40
@papagian papagian requested review from a team, vtorosyan and gamab and removed request for a team December 9, 2022 08:28
@papagian papagian merged commit 341d7b0 into main Dec 9, 2022
@papagian papagian deleted the papagian/fix-login-quota-failure branch December 9, 2022 11:30
grafanabot pushed a commit that referenced this pull request Dec 9, 2022
…ota are enabled (#60015)

* Login: Fix failure to login a new user via an external provider if quota are enabled

(cherry picked from commit 341d7b0)
papagian added a commit that referenced this pull request Dec 9, 2022
…der if quota are enabled (#60086)

Login: Fix failure to login a new user via an external provider if quota are enabled (#60015)

* Login: Fix failure to login a new user via an external provider if quota are enabled

(cherry picked from commit 341d7b0)

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
GuYounes pushed a commit to paul-wurth/BIXpert that referenced this pull request Feb 8, 2023
…der if quota are enabled (grafana#60086)

Login: Fix failure to login a new user via an external provider if quota are enabled (grafana#60015)

* Login: Fix failure to login a new user via an external provider if quota are enabled

(cherry picked from commit 341d7b0)

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants