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

IAMLoginModule should be marked to be initialized at runtime #1204

Open
galderz opened this issue Apr 2, 2024 · 6 comments
Open

IAMLoginModule should be marked to be initialized at runtime #1204

galderz opened this issue Apr 2, 2024 · 6 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@galderz
Copy link

galderz commented Apr 2, 2024

IAMSaslClientProvider lookup fails when running with Quarkus native. This is due to the mechanism name registration depending on classloader hashcode values. The issue arises because by default Quarkus initializes all classes at build time rather than runtime, so the static block in software.amazon.msk.auth.iam.IAMLoginModule runs at build time, and that registers the mech name with a hashcode value, which is different to the one computed at runtime.

The issue can easily be solved by making sure that software.amazon.msk.auth.iam.IAMLoginModule is runtime initialized. This should really be done by the Quarkus Amazon integration, but until then the following workaround can be passed to a native build

-Dquarkus.native.additional-build-args=--initialize-at-run-time=software.amazon.msk.auth.iam.IAMLoginModule

More details in quarkusio/quarkus#39548

@galderz
Copy link
Author

galderz commented Apr 2, 2024

This should have a "good-first-issue" label applied.

@gastaldi gastaldi added the good first issue Good for newcomers label Apr 2, 2024
@scrocquesel scrocquesel added the help wanted Extra attention is needed label Apr 6, 2024
@scrocquesel
Copy link
Member

Looking into the aforementioned issue, it is related to another SDK that this extension is primarily focused on (aws-sdk-java-v2). There is another issue requesting an AWS JDBC driver extension.

Given that AWS has numerous SDKs, some more maintained than others, I don't believe this extension should handle all of them. While some SDKs may use aws-sdk-java-v2, others may still rely on v1, which AWS announced will enter maintenance mode in July 2024.

I'd like to hear your thoughts on this. @gsmet, any thoughts?

@scrocquesel
Copy link
Member

@gastaldi @gsmet any thoughts on my previous comment ?

@gastaldi
Copy link
Member

gastaldi commented May 6, 2024

I believe this issue exists because of the iam module which contains the https://github.com/aws/aws-msk-iam-auth/blob/main/src/main/java/software/amazon/msk/auth/iam/IAMLoginModule.java class that @galderz is referring to.

@joseiedo
Copy link

joseiedo commented Sep 5, 2024

I'm a bit lost about how to proceed with this issue. I couldn't find the aws-msk-auth-iam dependency in the project...
Would the plan be to add this library to the project and manually register the components with reflection?

I'm willing to submit a PR, it's just that I'm not sure about what we can do here 😅

@galderz
Copy link
Author

galderz commented Sep 11, 2024

Actually, this might be an issue with a previous AWS API version. I'm no expert but maybe it's only relevant for v1 of the API. Looks like Quarkus might be using v2 now. If this is the case, then the issue can probably be closed. Can someone confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants