Skip to content
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

Document transitive dependency exclusion #11

Closed
ennru opened this issue Jun 18, 2019 · 10 comments
Closed

Document transitive dependency exclusion #11

ennru opened this issue Jun 18, 2019 · 10 comments

Comments

@ennru
Copy link
Contributor

ennru commented Jun 18, 2019

Users of this library would normally want to exclude the unused HTTP client libraries brought in by the AWS SDK so they don't interfere with anything.

This should work, right?

"software.amazon.awssdk" % "sns" % AwsSdk2Version excludeAll (
          ExclusionRule("software.amazon.awssdk", "netty-nio-client"),
          ExclusionRule(organization = "io.netty"),
          ExclusionRule("org.apache.httpcomponents", "httpclient")
),
@matsluni
Copy link
Owner

This looks good to me.

In the build.sbt (in this repo) I exclude netty-nio-client (in the test dependencies), because of how Service Loading works for the AWS (async) clients. Otherwise you need to explicitly declare which implementation to use as the underlying http provider for the aws client.

I have not excluded "org.apache.httpcomponents", "httpclient". This would be for a cleaner Classpath I guess?!

I had a quick look in my local Classpath and did a quick test. For me it even works to exclude "software.amazon.awssdk", "apache-client". This will get rid of some more (I guess) unnecessary dependencies. I haven't checked in Alpakka though.

@ennru
Copy link
Contributor Author

ennru commented Jun 19, 2019

Great, excluding the apache-client makes it even slimmer. As a library provider you need to be very strict with pulling in dependencies, especially widely used once may interfere with other user code.

In Alpakka I go with this now:

        "software.amazon.awssdk" % "sns" % AwsSdk2Version excludeAll // ApacheV2
        (
          ExclusionRule("software.amazon.awssdk", "apache-client"),
          ExclusionRule("software.amazon.awssdk", "netty-nio-client")
        ),
        // overriding AWS SDK version to avoid https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12086
        "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9",

@matsluni
Copy link
Owner

Yes, I understand this! 👍

Can the issue be closed?

@ennru
Copy link
Contributor Author

ennru commented Jun 19, 2019

I thought it might be an idea to add this information to the readme of this project.

@matsluni
Copy link
Owner

Yes, you are right. This is a good idea. As soon as you depend on a specific service (s3, sqs), you potentially have this issue, which you can run into.

@matsluni
Copy link
Owner

@ennru, do you want to add something or is it what you had expected?

@matsluni matsluni reopened this Jun 25, 2019
@ennru
Copy link
Contributor Author

ennru commented Jun 26, 2019

All users will want to exclude "software.amazon.awssdk", "apache-client", right?
You choose this library to use Akka HTTP instead.

@matsluni
Copy link
Owner

Yes, I think users can also exclude "software.amazon.awssdk", "apache-client", but this is more optional I would think. Whereas the included Netty client can cause trouble as both (Netty and Akka-http) are implementations for the async http client.

I can put it as an additional optional step to further trim the class path.

@matsluni
Copy link
Owner

matsluni commented Jul 7, 2019

@ennru, I added an additional section. Can you check 3051fbe?

@ennru
Copy link
Contributor Author

ennru commented Jul 14, 2019

Sure, that's great.

@ennru ennru closed this as completed Jul 14, 2019
jtjeferreira pushed a commit to jtjeferreira/aws-spi-akka-http that referenced this issue Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants