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

fix: check for existing superuser #564

Merged
merged 1 commit into from
May 3, 2024

Conversation

maranmaran
Copy link
Contributor

Fixes #563 and #537

Motivation

When creating superuser, currently there's no guard to protect against already created superuser.
If you seed superuser more then one times, it breaks login for that particular user as the request throws InternalServerError on login

Modifications

In the same style of other guards within UsersController I've added query to repository to get entity by name for the incoming user payload. If the entity exists we return validation error.

Verifying this change

  • Make sure that the change passes the ./gradlew build checks.

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@lhotari
Copy link
Member

lhotari commented May 3, 2024

Thanks for the contribution @maranmaran

@lhotari lhotari merged commit abf8328 into apache:master May 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/pulsar-manager/users/superuser can create multiple same superusers, login throws InternalServerError
2 participants