-
Notifications
You must be signed in to change notification settings - Fork 95
Properly fix version of json-smart transitive dependency for third parties #266
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
Conversation
Signed-off-by: Marko Strukelj <[email protected]>
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.
Should we keep it in the dependency management in the main pom and just reference it in the oauth-commoon
pom?
I think that keeping it in the |
I'm not sure it is ineffective. I think it will be effective, but you have to use the dependency defined in the dependency management in the right place. That would correspond to how we use it in the other projects. I do not have strong feelings about the use of the dependency management. But I think you should either handle all dependencies through it or you should get rid of it completely. |
I take your point about the consistency - e.g. having things listed. But then you might argue that we list things to the extent that they have an effect. You expect for dependencies within Ideally there was some maven plugin that flagged a warning about having a dependency in |
My understanding is that the dependency management defines the versions of the dependencies you use. And you have to define in the actual child poms where exactly you want it to be used. And you did not use this module anywhere directly in 0.16.1. That is why it had no effect. So from my point of view, you do not need to change the main <!-- Transitive override to address CVE-2024-57699. Remove in the future. -->
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
</dependency> (Notice the version is defined only in the main pom.xml) |
If I understand correctly what you wrote is exactly the current solution 😄 We can add the dependency to the |
That is not the current solution - neither the one from 0.16.1 nor the one from this PR. |
No, I didn't understand it correctly. I see what you mean. Ufff we're running in circles here about an trivial thing. Let me update the PR as it's going to be faster. |
…yManagement Signed-off-by: Marko Strukelj <[email protected]>
Right - with the last commit - that is what I meant and how I believe we do it for example in the operators repo. |
So ... by adding the json-smart directly in the root pom.xml here https://github.com/strimzi/strimzi-kafka-oauth/blob/main/pom.xml#L212 has the effect to bring the desired json-smart version 2.5.2 but only when compiling the oauth project itself because everything is resolved correctly: if you do a mvn dependency tree you should see the json-smart 2.5.2 under the oauth common module. It works and its consistent if your project is multi module but will never be used as dependency of something else but it works on its own (i.e. operator). |
@scholzj Approved? |
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.
Sure, approved assuming it actually works as well 😉
I tested it already but checking out the Marko's branch and installing that oauth version (1.0.0-SNAPSHOT) then used within the bridge locally. It's bringing the right json-smart and the CVE is not detected. |
Signed-off-by: Marko Strukelj <[email protected]>
Proper fix for #265