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
Allow adding multiple realms #15915
Allow adding multiple realms #15915
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, great catch!
I added a small question inline.
builder.getValue().addRealm(realmName, realm.getValue()); | ||
public RuntimeValue<SecurityDomain.Builder> addRealm(RuntimeValue<SecurityDomain.Builder> builder, String realmName, | ||
RuntimeValue<SecurityRealm> realm) { | ||
return new RuntimeValue<>(builder.getValue().addRealm(realmName, realm.getValue()).build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree the build() call is missing but do you really need to return the builder? It seems useless to me but I might miss something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it is indeed not needed, I will remove it. The build
call is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks. I squashed the two commits and force pushed. Let's wait for CI!
@gsmet please, check this last change as it was preventing me from authenticating using the DefaultRoleDecoder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second change makes sense too but please get rid of the lambdas you added.
}) | ||
.setRoleDecoder(authorizationIdentity -> CDI.current() | ||
.select(DefaultRoleDecoder.class).get() | ||
.decodeRoles(authorizationIdentity)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't do that, we are not using lambdas in runtime code because it consumes memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know. Will revert immediately
e2ee0e6
to
edfe887
Compare
public Roles decodeRoles(AuthorizationIdentity authorizationIdentity) { | ||
return CDI.current().select(DefaultRoleDecoder.class).get().decodeRoles(authorizationIdentity); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I missing something or did you lose the call to build()
? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am the one losing my head... sorry 😅
Signed-off-by: ruromero <rromerom@redhat.com>
Merged, thanks! |
@gsmet would it be possible to backport it to 1.11? For next releases of JBPM/RHPAM we will be depending on Quarkus 1.11. |
@ruromero sure, I already added the appropriate label as I thought it would be a good fix for 1.11. Everything with the |
Thanks for the clarification |
Signed-off-by: ruromero rromerom@redhat.com
When defining multiple realms only the first one was registered.