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

feat: Update CRT to 0.5.0+ #777

Merged
merged 14 commits into from
Jan 4, 2023
Merged

feat: Update CRT to 0.5.0+ #777

merged 14 commits into from
Jan 4, 2023

Conversation

epau
Copy link
Contributor

@epau epau commented Dec 21, 2022

Issue #

#756

Description of changes

Updates code to make it compatible with CRT 0.5.0+

New/existing dependencies impact assessment, if applicable

Conventional Commits

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@epau epau force-pushed the epau/feat/support-crt-0.5.0 branch from 6942e2a to 546165c Compare December 21, 2022 21:12
@epau epau requested review from ganeshnj and jbelkins December 22, 2022 15:28
@epau epau marked this pull request as ready for review December 22, 2022 15:29

init(awsCredentialsProvider: CRTAWSCredentialsProvider) {
init(awsCredentialsProvider: AwsCommonRuntimeKit.CredentialsProvider) {
self.crtCredentialsProvider = awsCredentialsProvider
}

public static func fromEnv() throws -> AWSCredentialsProvider {
Copy link
Contributor

Choose a reason for hiding this comment

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

all these static methods look scary from testing point of view. Not related to this PR. I would much prefer a singleton pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are we only ever supposed to have a single credentials provider instance (for each type?), if not then im not sure we want singleton pattern here. (ideally i'd like to avoid singletons and global state whenever possible).

But I agree, the current interface for creating credential providers has much room for improvement

}
}

struct CredentialsProviderProfileOptions: CRTCredentialsProviderProfileOptions {
Copy link
Contributor

Choose a reason for hiding this comment

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

not required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. This struct no longer has any purpose.
Checkout the related factory method in [AwsCredentialsProvider]](https://github.com/awslabs/aws-sdk-swift/pull/777/files#diff-c858c06a42a458b91bb72c1ce5190f515a40cf4463775e74d8f8f91d4e53c506) to see why its no needed.

}
}

struct CredentialsProviderSTSConfig: CRTCredentialsProviderSTSConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

not required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. This struct no longer has any purpose.
Checkout the related factory method in [AwsCredentialsProvider]](https://github.com/awslabs/aws-sdk-swift/pull/777/files#diff-c858c06a42a458b91bb72c1ce5190f515a40cf4463775e74d8f8f91d4e53c506) to see why its no needed.

}
}

struct CredentialsProviderStaticConfig: CRTCredentialsProviderStaticConfigOptions {
Copy link
Contributor

Choose a reason for hiding this comment

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

not required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. This struct no longer has any purpose.
Checkout the related factory method in [AwsCredentialsProvider]](https://github.com/awslabs/aws-sdk-swift/pull/777/files#diff-c858c06a42a458b91bb72c1ce5190f515a40cf4463775e74d8f8f91d4e53c506) to see why its no needed.

}
}

struct CredentialsProviderWebIdentityConfig: CRTCredentialsProviderWebIdentityConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

not required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. This struct no longer has any purpose.
Checkout the related factory method in [AwsCredentialsProvider]](https://github.com/awslabs/aws-sdk-swift/pull/777/files#diff-c858c06a42a458b91bb72c1ce5190f515a40cf4463775e74d8f8f91d4e53c506) to see why its no needed.

}

public func getError() throws -> String? {
try crtResolvedEndpoint.getError()
public func getError() -> String? {
Copy link
Contributor

Choose a reason for hiding this comment

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

this would require changes in endpoint resolver. you would have to include those changes in this PR to pass checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Will update!

Copy link
Contributor

@jbelkins jbelkins left a comment

Choose a reason for hiding this comment

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

A question and a few superficial changes

@epau epau requested review from jbelkins and ganeshnj December 22, 2022 18:31
Copy link
Contributor

@jbelkins jbelkins left a comment

Choose a reason for hiding this comment

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

Approved, pending resolution of @ganeshnj's comments and a green build.

@epau epau merged commit 6dd1d5a into main Jan 4, 2023
@epau epau deleted the epau/feat/support-crt-0.5.0 branch January 4, 2023 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants