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

feat: support seeding default superuser via application.properties #565

Conversation

maranmaran
Copy link
Contributor

@maranmaran maranmaran commented May 3, 2024

Fixes #563

Motivation

I'm working on integrating apache pulsar into .NET Aspire
Next to pulsar I wish to deliver a management UI, pulsar manager. Like Kafka and Rabbit do.

Here's my implementation

Right now, in order for me to seed default superuser, I must do this gymnastics of waiting for container and backend to be ready then acquire token, then issue put request.

This is clumsy a little and there should be a way to provide some default superuser via configuration. Like rabbit does, SQL, bunch of other tools.

In particular I'm afraid that Aspire team won't accept a solution like this one

Where I subscribe lifecycle hooks of container and then retry loop till I seed the user.
It works, but it feels too "hacky"

Modifications

In PulsarApplicationListener implemented seedDefaultSuperuser
Removed obsolete pulsar-manager.account

Verifying this change

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

@maranmaran maranmaran force-pushed the feature/support-default-superuser-from-application-props branch from a725de5 to f9106be Compare May 3, 2024 16:11
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

maranmaran added a commit to maranmaran/pulsar-manager that referenced this pull request May 3, 2024
@maranmaran
Copy link
Contributor Author

👋 👋 @lhotari Hey man, some tiny hiccups, I just adjusted my IDE and am good to go.
The build and tests should be okay now (./gradlew build ✅ ).

I have another branch ready to update docs about this change.

Additionally, I have experienced this #567 and I can't run the backend.
I have some proposal fix for it. Would you be so kind and just put some 👀 on the GH issue?

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