JaidenAshmore / java-dynamic-sqs-listener

Java SQS Listener library built to be customisable and dynamic during runtime
MIT License
51 stars 13 forks source link

feat: adding sts into lookup chain #386

Closed sepulworld closed 1 year ago

sepulworld commented 1 year ago

https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html to use WebID token in cred chain we need to load this class

JaidenAshmore commented 1 year ago

I don't think this library should be importing the STS library in it as not everyone would use it and including an unused library. If STS should be in this library, then you could argue that it should actually just be in the AWS SQS SDK instead (and therefore this library would get it from that).

I would be fine to update documentation in this repo explaining how you can configure credentials using STS instead of including this explicitly.

sepulworld commented 1 year ago

Yes, the root of the issue is how the Java AWS SDK is designed. All other languages don't suffer from this disjointed credentials chain design. I'll close this issue since there is a workaround

yonatanaftali commented 1 year ago

The workaround @sepulworld is talking about, is adding AWS STS v2 to your classpath (by adding it to your build.gradle for example). Even if you're already using AWS STS v1 in your project, you'll need to include v2 as well, so you'll have something like that:

implementation 'com.amazonaws:aws-java-sdk-sts:1.12.552'
implementation 'software.amazon.awssdk:sts:2.20.149'

@JaidenAshmore - Maybe worth to include this in the docs.