Skip to content

Add CopyableBuilder and ToCopyableBuilder interfaces to the credential providers. #3184

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

Closed
wants to merge 2 commits into from

Conversation

millems
Copy link
Contributor

@millems millems commented May 6, 2022

Fixes #3129

@millems millems requested a review from a team as a code owner May 6, 2022 22:28
Copy link
Contributor

@cenedhryn cenedhryn left a comment

Choose a reason for hiding this comment

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

Looks good, but I don't see any tests

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 6, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

20.5% 20.5% Coverage
0.0% 0.0% Duplication

@millems
Copy link
Contributor Author

millems commented May 9, 2022

We don't traditionally test the toBuilder methods on any of our builders. Do you think we should test each of these?

@cenedhryn
Copy link
Contributor

I'm a bit surprised about that actually! It's easy to introduce bugs when converting to builder, both when the method is added as well as over time if the instance variables are expanded.

public BaseBuilder(Function<B, T> providerConstructor, StsCredentialsProvider provider) {
            this.providerConstructor = providerConstructor;
            this.asyncCredentialUpdateEnabled = provider.asyncCredentialUpdateEnabled;
            this.stsClient = provider.stsClient;
           // this.staleTime = provider.staleTime;   <-- OOPS forgot to add the stale time here -->
            this.prefetchTime = provider.prefetchTime;
 }

Pretty sure I've seen bugs in similar cases before. You can consider it, it's not a blocker.

@millems
Copy link
Contributor Author

millems commented Jun 27, 2022

This was merged as part of #3267

@millems millems closed this Jun 27, 2022
@millems millems deleted the millem/copyable-builders branch June 27, 2022 16:03
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.

AwsCredentialsProvider+Builder types are not assignable to Buildable interface
2 participants