Skip to content

fix: check for existing superuser#564

Merged
lhotari merged 1 commit intoapache:masterfrom
maranmaran:fix/check-superuser-exists
May 3, 2024
Merged

fix: check for existing superuser#564
lhotari merged 1 commit intoapache:masterfrom
maranmaran:fix/check-superuser-exists

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
@liangyepianzhou liangyepianzhou added this to the 0.4.0 milestone Jan 10, 2025
liangyepianzhou pushed a commit that referenced this pull request Jan 12, 2025
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

3 participants