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

STS not supported with native builds due to missing reflect-config #2985

Closed
elrob opened this issue Jan 23, 2022 · 6 comments
Closed

STS not supported with native builds due to missing reflect-config #2985

elrob opened this issue Jan 23, 2022 · 6 comments
Labels
bug This issue is a bug. graalvm p2 This is a standard priority issue

Comments

@elrob
Copy link

elrob commented Jan 23, 2022

Describe the bug

With STS service included as a dependency, the default credentials provider skips STS in the chain as StsWebIdentityCredentialsProviderFactory.class needs to be included in reflect-config.json

Including it manually fixes it. But other clients like S3 have reflect-config.json so STS should too.

Expected behavior

Within a native build, the STS credentials provider should be included as part of the default credentials provider chain if it is included as a dependency.

Current behavior

Even with STS service included as a dependency, the default credentials provider skips STS in the chain as StsWebIdentityCredentialsProviderFactory.class needs to be included in reflect-config.json

Steps to Reproduce

It occurs here:

This use of reflection means the software.amazon.awssdk.services.sts.internal.StsWebIdentityCredentialsProviderFactory is not picked up in a native build unless it is explicitly included in reflect-config.json.

Possible Solution

Create reflect-config.json for STS client package (like S3 etc) and include software.amazon.awssdk.services.sts.internal.StsWebIdentityCredentialsProviderFactory in it.

Context

No response

AWS Java SDK version used

latest

JDK version used

11

Operating System and version

linux

@elrob elrob added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 23, 2022
@elrob
Copy link
Author

elrob commented Jan 25, 2022

Original native image compilation support was added here:
b9d26ef
(sts was left out)

@debora-ito
Copy link
Member

debora-ito commented Jan 27, 2022

Hi @elrob thank you for calling our attention to this. Marking as a bug.

@debora-ito debora-ito added graalvm and removed needs-triage This issue or PR still needs to be triaged. labels Jan 27, 2022
@nicolas-vivot
Copy link

Is it possible to get this fixed ?

@eduanb
Copy link

eduanb commented Feb 18, 2023

This is still an issue, here is how you can add the hint in Spring Boot 3 and Kotlin:

@Configuration
@ImportRuntimeHints(StsRuntineHints::class)
class AwsStsRuntimeHints

class StsRuntineHints : RuntimeHintsRegistrar {
    override fun registerHints(hints: RuntimeHints, classLoader: ClassLoader?) {
        hints.reflection().registerType(StsWebIdentityCredentialsProviderFactory::class.java)
    }
}

aws-sdk-java-automation added a commit that referenced this issue Apr 17, 2024
…e52a4e14b

Pull request: release <- staging/62cbbb21-44f2-4dd7-8634-7ece52a4e14b
@debora-ito
Copy link
Member

Closing this, as it was addressed by #3976.

The build failure reported in #4022 still needs to be root-caused.

Copy link

github-actions bot commented Nov 7, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. graalvm p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

5 participants