-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Quarkus REST Jackson: Improve detection of generic fields annotated with the @SecureField
and allow to explicitly enable secure serialization
#44669
Conversation
🙈 The PR is closed and the preview is expired. |
This comment has been minimized.
This comment has been minimized.
e86c7f3
to
e8fd90a
Compare
Status for workflow
|
Status for workflow
|
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 a lot @michalvavrik!
Thanks @michalvavrik for the quick fix / enhancement! |
return currentClassInfo | ||
.fields() | ||
.stream() | ||
.filter(fieldInfo -> !fieldInfo.hasAnnotation(JSON_IGNORE)) | ||
.map(FieldInfo::type) | ||
.map(fieldType -> { |
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.
We have better type mapping functions already in place that do better than just handling simple cases like the field type being a type variable. Probably this could be improved.
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.
Can you be more specific? Both in scenarios you have in mind and where these mapping functions are already in place, because I don't know what you mean.
Also, I didn't want to do better because last time I improved this detection there was a complain that it prolongs build-time execution. So if your proposal won't have negative effect, I'm happy to apply it.
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.
Few hints should do, I just want to better understand what do you mean and make sure it wouldn't lead to increased build-time execution.
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 was thinking of the logic we already do to resolve type parameters in resteasy reactive. I think via JandexUtil
and TypeMapper
, but I can only find usages of them to obtain method parameter or return type signatures or the list of type parameters. I can't find anywhere where we resolve an entire Type
with type parameters substituted. Probably I dreamed this :(
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.
np, if you run into this or @geoand knows, please let me know. it's not on the top of my list tbh, so no hurry
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 can't find anywhere where we resolve an entire Type with type parameters substituted. Probably I dreamed this
AFAIR, the cases we've it for are method parameters and method return types
SecurityCustomSerialization
when secure serialization is explicitly enabled with theEnableSecureSerialization
annotation, which gives users means to use@SecureField
for non-trivial scenarios