-
Notifications
You must be signed in to change notification settings - Fork 3k
Make Security annotations work on interfaces #22540
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
base: main
Are you sure you want to change the base?
Conversation
b6c65e2
to
22f7fd9
Compare
45cc56d
to
669360a
Compare
acd9052
to
0649a92
Compare
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 0649a92
Failures⚙️ Initial JDK 11 Build #- Failing: extensions/security/deployment
! Skipped: core/test-extension/deployment devtools/bom-descriptor-json docs and 309 more 📦 extensions/security/deployment✖ |
1809706
to
5d45643
Compare
FTR, crosslink: #22530 (comment) |
I am not sure about this TBH given what @famod posted |
It's still a step toward the second point: harmonize bean interface annotation handling across features. And it's not enabled by default ! |
I'll leave it up to @sberyozkin and @michalszynkiewicz |
I'm off to the airport in an hour or so, so I'll comment when I'm back; also CC @stuartwdouglas |
hello @sberyozkin, any news on that topic ? |
@mkouba I think your experience with CDI annotations and inheritance rules could be useful here. |
@sberyozkin I agree it would be nice to have @stuartwdouglas 's opinion on this. I'm assigning this to you but it's really so that you coordinate the work on this. Thanks! |
@gsmet Thanks, I definitely recall Stuart having some reservations, I'll try to find where he commented as well |
Here is another issue, #16840. I see some CDI related concerns are raised there, Stuart does not have objections, @mkouba and @manovotn, @Ladicek, @michalszynkiewicz, can you comment on this PR please |
Hm, do we really want a CDI-breaking feature like this? Personally I am -1 on this, at least in default settings (but then again, if not default, who's gonna use it :-/) BTW if we want to implement it, this approach is fine but we could also just wire it directly into Arc, i.e. make it 'scan' interfaces for annotations. |
My personal opinion is that JAX-RS screwed up by ignoring Common Annotations (though they probably had good reasons), and now we have to live with it. If so, I'd say it would be better to do it consistently in the CDI implementation, and not drive it by configuration, but by code. (Something like |
@rmanibus @rsvoboda Apologies for a delay, we are talking this very issue right now with the team (though as part of a different issue's discussion), let me CC @michalvavrik for now |
@rmanibus Can you please give us a favor and check if it works as expected with the latest Quarkus release, for example, 3.9.3, and if it does not, please show the test hierarchy which does not work (interface and implementation class) |
This comment has been minimized.
This comment has been minimized.
18225cf
to
16eb214
Compare
@stuartwdouglas I was missing a null check, only one test is failing now:
I am wondering if we should just remove this test. or at least we should execute it with this feature deactivated |
Is there a way I could trigger the CI myself ? |
This comment has been minimized.
This comment has been minimized.
@sberyozkin I disabled this feature for the failing test, please tell me if it's ok for you. Build is passing now |
@sberyozkin following up with this one |
@sberyozkin are you still interested in merging this ? |
@rmanibus Sorry for keeping missing your pings, if I don't reply, ping me anytime on Zulip. As far as this and similar issues are concerned, we've been analyzing and looking into them. It is hard to have a consistent treatment of this issue across REST and Resteasy stacks, but the effort is underway, it can take time but sooner or later we'll get the framework for supporting such cases in shape |
@sberyozkin What should we do here? |
@sberyozkin ping? |
FWIW not having this merged is making it impossible to use security features on Jakarta Data repositories at the moment. See #48884 |
Issue with this PR is that only subset of security (annotation) checks are actually performed by CDI as it causes issues and we need to perform most of the checks before actual method invocation, so that checks stays async and runs very early. I never said we shouldn't merge this after rework, but we need to define and document expected behavior, you can find more information in the linked issue and other discussions linked to this. Plus this PR description says it fixes #22530 which it does not, that's not how security checks work. |
@rmanibus I think the easiest solution that doesn't bring that much extra work to what you actually have is that you use annotation store. I remember using the Arc annotation store brought some circular dependency issues, which is why we can't reflect the result of annotation transformations everywhere (just as a fallback). I am not sure if it is still true, we changed a lot of things. If it is, we would have to define our annotation store for security and that one you can enhance with your transformations as well. |
Hey, sorry this was 4 years ago it's a bit rusty in my head, but isn't using the annotation store exactly what I did here ? |
I think I understand what you want, I will try to look into it a bit more in depth |
So that would be true if everything that setup security could rely on Arc annotation store, which it doesn't and cannot. One example - wherever we use
Sure, thanks. Please when you have time, check the linked issue. I left there some context. At the very least, this would require extensive test coverage, but I don't want to repeat everything I wrote elsewhere. |
@rmanibus any update? |
Fix #22530