Skip to content

Commit c109747

Browse files
committed
refactor: Remove redundant feature ID when static credentials are resolved from a profile
1 parent 3fef6be commit c109747

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sdk/src/Core/Amazon.Runtime/CredentialManagement/AWSCredentialsFactory.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ private static AWSCredentials GetAWSCredentialsInternal(
204204
{
205205
case CredentialProfileType.Basic:
206206
awsCredentials = new BasicAWSCredentials(options.AccessKey, options.SecretKey, options.AwsAccountId);
207+
208+
// CREDENTIALS_PROFILE already implies static credentials so we can remove the redundant CREDENTIALS_CODE feature ID.
209+
awsCredentials.FeatureIdSources.Remove(UserAgentFeatureId.CREDENTIALS_CODE);
207210
awsCredentials.FeatureIdSources.Add(UserAgentFeatureId.CREDENTIALS_PROFILE);
208211
break;
209212
case CredentialProfileType.Session:

0 commit comments

Comments
 (0)