-
Notifications
You must be signed in to change notification settings - Fork 798
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
Fix aws_msk_iam_v2 module Authentication failure bug #977
Fix aws_msk_iam_v2 module Authentication failure bug #977
Conversation
0aae3eb
to
264bc93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting the contribution!
I left a few comments, let me know if you have concerns about any of the suggestions!
sasl/aws_msk_iam_v2/msk_iam.go
Outdated
// The aws.Credentials of aws-sdk-go-v2. Required. | ||
Credentials aws.Credentials | ||
// The aws.CredentialsProvider of aws-sdk-go-v2. Required. | ||
CredentialsProvider aws.CredentialsProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Credentials
is shorter and clearly communicates the purpose, and the type information already expresses that we expect a provider; how about keeping the original field name?
It's also the name used in the aws.Config
type, so it would remain consistent.
sasl/aws_msk_iam_v2/msk_iam.go
Outdated
sig := signer.NewSigner() | ||
return &Mechanism{ | ||
Signer: sig, | ||
CredentialsProvider: awsCfg.Credentials, | ||
Region: awsCfg.Region, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we could do without the intermediary variable here?
sig := signer.NewSigner() | |
return &Mechanism{ | |
Signer: sig, | |
CredentialsProvider: awsCfg.Credentials, | |
Region: awsCfg.Region, | |
} | |
return &Mechanism{ | |
Signer: signer.NewSigner(), | |
CredentialsProvider: awsCfg.Credentials, | |
Region: awsCfg.Region, | |
} |
sasl/aws_msk_iam_v2/msk_iam.go
Outdated
@@ -32,15 +32,15 @@ const ( | |||
queryExpiryKey = "X-Amz-Expires" | |||
) | |||
|
|||
var signUserAgent = fmt.Sprintf("kafka-go/sasl/aws_msk_iam/%s", runtime.Version()) | |||
var signUserAgent = fmt.Sprintf("kafka-go/sasl/aws_msk_iam_v2/%s", runtime.Version()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor and unrelated to your change, but since it's being modified. This could be a simpler way to express the concatenation:
var signUserAgent = fmt.Sprintf("kafka-go/sasl/aws_msk_iam_v2/%s", runtime.Version()) | |
var signUserAgent = "kafka-go/sasl/aws_msk_iam_v2/" + runtime.Version() |
0cd64d8
to
54fe6c1
Compare
@achille-roussel thanks, I have reflected your comments. Would you mind to tell me how to re-trigger the CI pipeline? Do we have a way to rerun the CI job from PR comment like |
Use `CredentialsProvider` instead of static `Credentials`. See segmentio#976
54fe6c1
to
4455e21
Compare
hi @achille-roussel , I have re-ran the CI and confirmed it passed all checks. Can you please review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, thanks for the contribution!
Thanks for the review! Pleasure to contribute to this great project. |
Use
CredentialsProvider
instead of staticCredentials
. See #976