-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix mp.jwt.verify.publickey check in SmallryeJwtDevModeProcessor #46932
Fix mp.jwt.verify.publickey check in SmallryeJwtDevModeProcessor #46932
Conversation
This comment has been minimized.
This comment has been minimized.
oki, I will fix this. it's (SmallryeJwtDevModeProcessor) obviously also for tests |
79a0c1a
to
b359947
Compare
This comment has been minimized.
This comment has been minimized.
@@ -55,7 +56,7 @@ public class SmallryeJwtDevModeProcessor { | |||
* | |||
* @throws NoSuchAlgorithmException if RSA-256 key generation fails. | |||
*/ | |||
@BuildStep(onlyIfNot = { IsNormal.class }) | |||
@BuildStep(onlyIfNot = { IsNormal.class, NativeOrNativeSourcesBuild.class }) |
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 would expect the native build to run in normal mode? So I'm a bit surprised it makes a difference?
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.
my bet is NativeSourcesBuild part, but I can look more into 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.
Having just @BuildStep(onlyIfNot = { IsNormal.class, NativeSourcesBuild.class })
doesn't fix the issue
So my change is the minimal one.
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'm not exactly excited about this change and I would like us to get to the bottom of it.
What I understand is that you are pointing to a non-existing public key and hoping things will work.
Also I'm not exactly sure why you have JWT around but jwt is not really used
.
Could you clarify exactly what you're doing in this test, why you need to define a JWT key that points to nowhere - and why you expect this to be fine.
Maybe your patch is right but at this point I can't be sure.
BeefyTS is legacy and we keep it alive to see if old approaches work. The 003-quarkus-many-extensions module combines a lot of extensions and the intention is to ensure it can be built in JVM and Native mode. JWT properties in https://github.com/quarkus-qe/beefy-scenarios/blob/main/003-quarkus-many-extensions/src/main/resources/application.properties#L4-L5 were needed when the app was composed, now the JWT extension doesn't need these properties to be defined when no JWT logic is triggered. I can remove them and things will work again. I identified the PR that caused failure of the module in native. It's #44272 as mentioned in #46928 (comment) Very strange thing is that JVM mode doesn't fail, but native mode fails trying to read the #44272 states that So in the end I think I will just adjust 003-quarkus-many-extensions and drop the mp.jwt dummy config. |
oh, I think I hit something :) I will update the PR |
b359947
to
1675e64
Compare
@gsmet PR updated to check |
I have updated #44272 title to mention also test Let me know about the |
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 @rsvoboda 🙏
Status for workflow
|
I'll hold off the merge for now, I'm on the road and missed there was the discussion, I think the fix is good, but would appreciate @mcruzdev having a look. |
I am taking a look now |
If the user does not set the property then should be setted as @sberyozkin, @gsmet I think we can merge this one. |
Thanks @mcruzdev |
Latest PR update fixes the typo, with the rationale behind this update also clarified. #44272 has tests but I think the ordering of checks have prevented detecting the typo earlier
Fix mp.jwt.verify.publickey check in SmallryeJwtDevModeProcessor
Fixes #46928 / native mode case