Skip to content

Feature/profile name credentials chain#3488

Closed
pulimsr wants to merge 0 commit intomainfrom
feature/profile-name-credentials-chain
Closed

Feature/profile name credentials chain#3488
pulimsr wants to merge 0 commit intomainfrom
feature/profile-name-credentials-chain

Conversation

@pulimsr
Copy link
Contributor

@pulimsr pulimsr commented Jul 21, 2025

Issue #, if available: #3395

Description of changes: Added support for profile names in DefaultAWSCredentialsProviderChain by extending the constructor to accept a CredentialProviderConfiguration parameter. This addresses the feature request to allow specification of non-default profile names in the credentials chain.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

#include <memory>
#include <aws/core/utils/memory/stl/AWSVector.h>

namespace Aws
Copy link
Contributor

Choose a reason for hiding this comment

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

dont format the entire file as part of the PR, even if clang-format fails. It makes reading the file of what actually changed, much more difficult

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay

* EnvironmentAWSCredentialsProvider, ProfileConfigFileAWSCredentialsProvider,
* ProcessCredentialsProvider, STSAssumeRoleWebIdentityCredentialsProvider and SSOCredentialsProvider.
*/
DefaultAWSCredentialsProviderChain(
Copy link
Contributor

Choose a reason for hiding this comment

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

adding a default parameter will break ABI, we cant update a no-arg constructor to have a default value

DefaultAWSCredentialsProviderChain();
DefaultAWSCredentialsProviderChain(const Aws::Client::CredentialProviderConfiguration& config);
DefaultAWSCredentialsProviderChain(const DefaultAWSCredentialsProviderChain& chain);

* such as profile name and client configuration for HTTP requests made by
* credential providers that need to make network calls (e.g., InstanceProfileCredentialsProvider).
*/
struct CredentialProviderConfiguration {
Copy link
Contributor

Choose a reason for hiding this comment

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

this only declares a struct, it doesnt actually create a member in the client configuration object.

#set($AdditionalServiceSpecificConfigLoadString = "Load${metadata.classNamePrefix}SpecificConfig(config);")
#end
#set($clientConfigurationNamespace = "Client")
#if($clientConfiguration.profileName && !$clientConfiguration.profileName.empty())
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont think the object $clientConfiguration declared in this flow? i see it declared as a string, but not as a object? it doesnt have the member profileName, that is passed at runtime. i dont think this is accomplishing what you you think its doing.

when we create the credentials provider chain as part of the code generation process you want to pass the client configuration that is created in the constructor.

/**
* AWS profile name to use for credentials.
*/
Aws::String profile;
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs to be initialized to the same value of client configuration profile in its constructor, i think we're missing that

@pulimsr pulimsr force-pushed the feature/profile-name-credentials-chain branch from 297aeec to 03a9e59 Compare July 22, 2025 16:00
@pulimsr pulimsr closed this Jul 22, 2025
@pulimsr pulimsr force-pushed the feature/profile-name-credentials-chain branch from da2cc7b to f885df4 Compare July 22, 2025 17:18
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.

2 participants