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

Pass AWS client configuration to STSProfileWithWebIdentityCredentialsProvider. #4641

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

teo-tsirpanis
Copy link
Member

This PR applies a similar fix to #4616 but for STSProfileWithWebIdentityCredentialsProvider. That class was also adjusted to prevent a memory leak, to use the user-provided STSClient if available, and to use public APIs.

The issue has been validated to be fixed.


TYPE: BUG
DESC: Fix HTTP requests for AWS assume role with web identity not honoring config options.

@@ -132,11 +132,15 @@ class /* AWS_IDENTITY_MANAGEMENT_API */
const Aws::String& externalID,
Aws::STS::STSClient* client);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could document this function and the one above, not a blocker as this is high priority.

@teo-tsirpanis teo-tsirpanis changed the title Correctly pass AWS client configuration to STSProfileWithWebIdentityCredentialsProvider. Pass AWS client configuration to STSProfileWithWebIdentityCredentialsProvider. Jan 17, 2024
Aws::Client::ClientConfiguration config;
config.scheme = Aws::Http::Scheme::HTTPS;
config.region = tmpRegion;
AssumeRoleWithWebIdentityRequest request;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change based on upstream changes? We seem to be missing the retry strategy now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The retry strategy is being set here and that client config gets passed to the STS client here.

config.retryStrategy =
Aws::MakeShared<Aws::Client::SpecifiedRetryableErrorsRetryStrategy>(
CLASS_TAG, retryableErrors, 3 /*maxRetries*/);
auto outcome = client->AssumeRoleWithWebIdentity(request);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change from GetAssumeRoleWithWebIdentityCredentials?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this method's logic were to replace the use of internal APIs with public ones.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a requirement to do that now? Seeing how we've already had issues for 2 releases, in my opinion it'd be much better to minimize changes needed to solve the issue. We can then follow up with refactoring and additional testing.

If there is a high degree of confidence and there has been sufficient testing and validation of these changes, then I'm okay to move forward, but I don't like mixing defect fixes and refactoring that is not required for the defect fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the changes that got successfully validated yesterday. We have to use the public STSClient class provided by the user because it has been created with the right client configuration.

@KiterLuc KiterLuc merged commit 4498063 into dev Jan 17, 2024
66 checks passed
@KiterLuc KiterLuc deleted the teo/assume-role-fix branch January 17, 2024 16:11
github-actions bot pushed a commit that referenced this pull request Jan 17, 2024
…sProvider`. (#4641)

This PR applies a similar fix to #4616 but for
`STSProfileWithWebIdentityCredentialsProvider`. That class was also
adjusted to prevent a memory leak, to use the user-provided `STSClient`
if available, and to use public APIs.

The issue has been validated to be fixed.

---
TYPE: BUG
DESC: Fix HTTP requests for AWS assume role with web identity not
honoring config options.

(cherry picked from commit 4498063)
github-actions bot pushed a commit that referenced this pull request Jan 17, 2024
…sProvider`. (#4641)

This PR applies a similar fix to #4616 but for
`STSProfileWithWebIdentityCredentialsProvider`. That class was also
adjusted to prevent a memory leak, to use the user-provided `STSClient`
if available, and to use public APIs.

The issue has been validated to be fixed.

---
TYPE: BUG
DESC: Fix HTTP requests for AWS assume role with web identity not
honoring config options.

(cherry picked from commit 4498063)
KiterLuc pushed a commit that referenced this pull request Jan 17, 2024
…ithWebIdentityCredentialsProvider`. (#4643)

Backport 4498063 from #4641.

Co-authored-by: Theodore Tsirpanis <theodore.tsirpanis@tiledb.com>
KiterLuc pushed a commit that referenced this pull request Jan 18, 2024
…ithWebIdentityCredentialsProvider`. (#4644)

Backport 4498063 from #4641.

Co-authored-by: Theodore Tsirpanis <theodore.tsirpanis@tiledb.com>
teo-tsirpanis added a commit that referenced this pull request Sep 24, 2024
…in. (#5315)

[SC-55378](https://app.shortcut.com/tiledb-inc/story/55378/ensure-all-aws-clients-and-credentials-providers-are-being-passed-client-configuration)

This PR applies a similar fix to #4641, but for the
`DefaultAWSCredentialsProviderChain` which was being implicitly used
when we don't pass any credentials provider to `S3Client` (it's now
explicitly used).

Because `DefaultAWSCredentialsProviderChain` does not accept a
`ClientConfiguration`, I copied its sources, as well as the sources of
all applicable credentials providers and updated them to accept a
`ClientConfiguration`. This is a temporary measure until the changes to
the providers are upstreamed to the AWS SDK.

You are encouraged to review this PR by looking at each commit
individually.

---
TYPE: BUG
DESC: Fix HTTP requests for AWS default credentials provider chain not
honoring config options.
teo-tsirpanis added a commit that referenced this pull request Sep 24, 2024
…in. (#5315)

[SC-55378](https://app.shortcut.com/tiledb-inc/story/55378/ensure-all-aws-clients-and-credentials-providers-are-being-passed-client-configuration)

This PR applies a similar fix to #4641, but for the
`DefaultAWSCredentialsProviderChain` which was being implicitly used
when we don't pass any credentials provider to `S3Client` (it's now
explicitly used).

Because `DefaultAWSCredentialsProviderChain` does not accept a
`ClientConfiguration`, I copied its sources, as well as the sources of
all applicable credentials providers and updated them to accept a
`ClientConfiguration`. This is a temporary measure until the changes to
the providers are upstreamed to the AWS SDK.

You are encouraged to review this PR by looking at each commit
individually.

---
TYPE: BUG
DESC: Fix HTTP requests for AWS default credentials provider chain not
honoring config options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants