Skip to content

Conversation

kai-ion
Copy link
Contributor

@kai-ion kai-ion commented Aug 29, 2025

Issue #, if available:

Description of changes:
Implement User-Agent 2.1 business metrics for credential provider tracking in AWS SDK for C++.

Changes:

  • Add UserAgentFeature enums for credential providers (ENV_VARS='g', PROFILE='n', PROCESS='w', IMDS='0', SSO='s', STS_ASSUME_ROLE='i')
  • Update credential providers to add user agent features when credentials are retrieved
  • Modify AWSAuthV4Signer to extract and inject credential features into User-Agent headers
  • Add comprehensive unit tests for credential tracking functionality

Supported Credential Providers:

  • Environment variables (AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY)
  • Profile credentials from ~/.aws/credentials
  • Process credentials via credential_process
  • Instance metadata service (IMDS)
  • SSO credentials via SSOCredentialsProvider
  • STS Assume Role Web Identity

The implementation embeds credential features directly in AWSCredentials objects, which are automatically tracked during resolution and injected into User-Agent strings during request signing.

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.

Implement User-Agent 2.1 business metrics for credential provider tracking in AWS SDK for C++.

Changes:
- Add UserAgentFeature enums for credential providers (ENV_VARS='g', PROFILE='n', PROCESS='w', IMDS='0', SSO='s', STS_ASSUME_ROLE='i')
- Update credential providers to add user agent features when credentials are retrieved
- Modify AWSAuthV4Signer to extract and inject credential features into User-Agent headers
- Add comprehensive unit tests for credential tracking functionality

Supported Credential Providers:
- Environment variables (AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY)
- Profile credentials from ~/.aws/credentials
- Process credentials via credential_process
- Instance metadata service (IMDS)
- SSO credentials via SSOCredentialsProvider
- STS Assume Role Web Identity

The implementation embeds credential features directly in AWSCredentials objects, which are automatically tracked during resolution and injected into User-Agent strings during request signing.
@kai-ion kai-ion changed the title feat: Add credential provider tracking (Profile, process, imds, sso, sts)to User-Agent [C++] SDKs to track feature Ids for Credentials (Profile, Process, imds, sso, sts) Aug 29, 2025
Aws::String configFile = awsDir + "/config";

// Ensure directory exists
mkdir(tempDir.c_str(), 0755);
Copy link
Contributor

Choose a reason for hiding this comment

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

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