-
Notifications
You must be signed in to change notification settings - Fork 838
feat: added aws-sdk-go-v2 IAM Mechanism for MSK authentication #937
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
feat: added aws-sdk-go-v2 IAM Mechanism for MSK authentication #937
Conversation
|
This looks like a good starting point to me, have you had a chance to test this out in your own setup, by any chance? |
|
The dependency surface area is pretty small, all we are using is the request signer, so I wonder if it's possible to abstract away the details of whether you're using v1 or v2 behind an interface or a type alias so you didn't need a whole separate model. I'll do some digging here. |
|
Yeah I agree what you said. Actually I thought through the ways to abstract the signer (v1 and v2) while developing. But I couldn't figure out the way to refactor current module without breaking change. There are several limitations such as the SDKs use different name of methods and we pass AWS Signer struct to Mechanism directly. I can change the new module to more generic by having a layer to abstract SDK version. Is this what you want to suggest me? |
|
Yeah, that's what I was discovering too. If you can find a way to unify these, that would be great, I haven't had as much time to look into this as I hoped last week. |
|
Cool. I will develop new one with abstracting the v1 and v2 SDK. |
07e1eeb to
6147f34
Compare
|
@dominicbarnes I have completed the changes. Can you please take a look? I have confirmed it works with MSK in my environment. |
|
@kikyomits: I'm not involved with the development of kafka-go, just a random user who very much appreciates this PR, thanks! FWIW, I can confirm this works with MSK in my environment too! One suggestion for the Not being familiar with |
6147f34 to
a1ecfbe
Compare
|
@shric thanks for the feedback and very happy to hear you liked this change. I have added @dominicbarnes would you mind to review this PR? |
a1ecfbe to
c616e36
Compare
|
@kikyomits sorry for the delayed response. I feel bad about this, but I think I'd like you to revert your PR back to what you had before. My main issue now with this approach is that this 1 sub-module now imports 2 very large packages (aws-sdk v1 and v2), which will likely create conflicts for any sufficiently large codebase which may have a mixture of both. I've cloned your branch locally and was trying to find a way to put the different SDK versions behind their own sub-modules, but this is really challenging to do so without either breaking the API or adding significant complexity. One option would be to create 2 more sub-modules, which would take on the responsibility of importing aws-sdk v1 or v2 respectively. The current We could theoretically remove the In my eyes, having 2 sub-modules (even with some code duplication) is preferable to 1 sub-module which ends up importing 2 significant dependencies at once, as no single user would end up using both. Again, sorry to ask, but would you mind rolling back to the 2-module version? |
|
@dominicbarnes thanks for the review and comments. Appreciate sharing your thoughts. I initially thought about the disadvantages as you said - large dependencies - and decoupled the modules. I like the my initial approach too and happy to revert back. Will send an update to you in the next 24 hours |
1395b63 to
8ac2a82
Compare
…ism for MSK authentication The main motivation of this new feature allows to avoid having aws-sdk-go and aws-sdk-go-v2 in user's go.mod (assuming most of users are using aws-sdk-go-v2). This doesn't deprecate existing aws_msk_iam module as aws-sdk-go hasn't been deprecated yet. See segmentio#934
8ac2a82 to
4353eb7
Compare
|
@dominicbarnes finished the changes and developed new module |
|
Thank you for the contribution, as well as the patience to work through a few revisions. :) |
Added new module
aws_msk_iam_v2to support functionality of authentication with MSK through aws-sdk-go-v2.The main motivation of this new feature allows to avoid having aws-sdk-go and aws-sdk-go-v2 in user's go.mod (assuming most of users are using aws-sdk-go-v2).
This doesn't deprecate existing aws_msk_iam module as aws-sdk-go hasn't been deprecated yet.
See #934