-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add AuthenticationRequest attributes to AuthenticationRequestContext so that users can access RoutingContext #40
Conversation
@sberyozkin I can't request review from you, can you have a look please? |
@stuartwdouglas not sure if you wanna have a look and have a time? |
Point here is that we already have a map with the context and users are trying to active CDI request context too early, so why don't give them chance to use the |
8ea13ef
to
c1cefd0
Compare
I've changed my original proposal after talking to @sberyozkin . My original proposal was that we should add to
and I'd drop deprecation from my first commit, but Sergey raised the point that changing interface can be avoided by creating new authentication request context for every authentication request, so I accepted his proposal (it's normal we have different preferences :-), I liked mine). I'll adjust PR description, title and maybe we can move on this. |
Hi @michalvavrik Thanks, sure, I'd still appreciate @stuartwdouglas commenting, only Stuart can merge it anyway. Maybe your original proposal will win, today, now that I think about it after seeing both proposals, it looks OK, my only concern there is that the deprecated method will likely stay forever. But like you said, no context objects will be created during the augmentation - though an extra object will be allocated only if the augmentors are registered, which will not always be the case. Can you please create a Quarkus branch based on the current PR for @stuartwdouglas to have a look ? I'll have no problems with your original PR code restored if this is what would be preferred. Thanks |
@stuartwdouglas Please comment |
Hi, this is how Quarkus changes will look like (I'll write docs when there is final version of this PR) with current version of this PR: quarkusio/quarkus@3b741aa Part that I consider strange is that during authentication (inside Here is my preference:
|
Thanks @michalvavrik. Thanks |
Hmm, yeah, that is not quite cool. I suppose it favors your original PR then 👍 |
Let's hear third opinion, I think both proposals are acceptable. It can wait for Stuart. Thanks for your comments. |
I'm now leaning toward your original proposal because having an ambiguity in the way these properties can be accepted in my proposal is not good, thanks. Hope Stuart will agree |
c1cefd0
to
06ce769
Compare
in that case I switched to my original proposal but without deprecation, let's move on this one |
Thank you for review. I've pinged @gsmet to make release when he finds a time. |
We add
RoutingContext
to authentication request attributeshttps://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/HttpSecurityUtils.java#L14
which makes it possible for users to access
RoutingContext
when proactive auth is enabled. There are issues opened related toRoutingContext
in augmentorRoutingContext
accessible from theSecurityIdentityAugmentor
like in Support for AuthenticationRequest enrichment / agumentation quarkus#16861I've tried to explore passing the context via duplicated context local data quarkusio/quarkus#37795 but from comments you can see there are performance arguments against it. We already have this map with the
RoutingContext
, so now I propose to add authentication attributes to the authentication request context.