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

Authn: Prevent empty username and email during sync #76330

Merged
merged 6 commits into from
Oct 11, 2023

Conversation

kalleep
Copy link
Contributor

@kalleep kalleep commented Oct 11, 2023

What is this feature?
Prevent user without email and username to be created during external provider syncs. Previously endpoints for creating and updating users was protected but not other mechanisms such as user sync during external authentication.

I solved this by moving the checks from the api endpoints to user service Create and Update functions

Fixes #47805

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@kalleep kalleep added this to the 10.2.x milestone Oct 11, 2023
@kalleep kalleep requested a review from Jguer October 11, 2023 09:33
@kalleep kalleep self-assigned this Oct 11, 2023
@kalleep kalleep requested review from a team as code owners October 11, 2023 09:33
@kalleep kalleep requested review from linoman, papagian, suntala and yangkb09 and removed request for a team October 11, 2023 09:33
@kalleep kalleep added backport v10.1.x and removed no-backport Skip backport of PR labels Oct 11, 2023
@kalleep kalleep merged commit 1528d6f into main Oct 11, 2023
20 checks passed
@kalleep kalleep deleted the user/prevent-empty-username-and-email branch October 11, 2023 12:27
grafana-delivery-bot bot pushed a commit that referenced this pull request Oct 11, 2023
* Move errors to error file

* Move check for both empty username and email to user service

* Move check for empty email and username to user service Update

* Wrap inner error

* Set username in test

(cherry picked from commit 1528d6f)
@zerok zerok removed this from the 10.2.x milestone Oct 23, 2023
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.

Logout button disappears when using LDAP authentication
4 participants