-
Notifications
You must be signed in to change notification settings - Fork 0
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
Replace AWSCredentialProvider with AwsCredentialProvider #6
Replace AWSCredentialProvider with AwsCredentialProvider #6
Conversation
…tent with SDK v2 naming convention
|
||
private String processKey(Map.Entry<Object, Object> e) { | ||
String key = (String) e.getKey(); | ||
// utilsBean expects key like 'awsCredentialsProvider' to call bean setter setAwsCredentialsProvider |
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.
BeanUtilsBean automatically processes the config keys and tries to find a corresponding setter for each. Previously, key: AWSCredentialsProvider
mapped to setAWSCredentialsProvider
properly.
With new key key: AwsCredentialsProvider
, BeanUtilsBean fails to find a setter for this, as setter setAwsCredentialsProvider
expects a key like awsCredentialsProvider
. Because of this, key: AwsCredentialsProvider
never finds a valid setter, no matter what we name the setAwsCredentialsProvider
fn.
processKey
ensures that any config string that starts with case insensitive awscredentialsprovider__
gets replaced with awsCredentialsProvider__
, so the BeanUtil can find the corresponding setAwsCredentialsProvider__
setter.
This should properly map multilang.properties config strings so all of the following reach the setter...
AWSCredentialsProvider / AWSCredentialsProviderDynamoDB / AWSCredentialsProviderCloudWatch
AwsCredentialsProvider / AwsCredentialsProviderDynamoDB / AwsCredentialsProviderCloudWatch
awsCredentialsProvider / awsCredentialsProviderDynamoDB / awsCredentialsProviderCloudWatch
etc...
|
||
private String processKey(Map.Entry<Object, Object> e) { | ||
String key = (String) e.getKey(); |
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.
do we have a test for 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.
Changed to default access modifier to allow testing. Added a few tests for expected keys.
@@ -8,30 +8,30 @@ This document should help multilang customers configure a suitable `CredentialPr | |||
|
|||
## Sample Provider Configuration | |||
|
|||
In a Properties file, an `AWSCredentialsProperty` configuration might look like: | |||
In a Properties file, an `AwsCredentialsProperty` configuration might look like: |
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.
Let's call out these are v2 credential providers, and maybe provide a link to the public doc that has a list of v2 providers
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.
Added documentation a few lines below.
Replace AWSCredentialProvider with AwsCredentialProvider to be consistent with SDK v2 naming convention.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.