From 11cc6c95968ac7076374040e90f35e1927033b5b Mon Sep 17 00:00:00 2001 From: Andrew Asseily Date: Mon, 29 Sep 2025 13:24:16 -0400 Subject: [PATCH] port --- awscli/botocore/credentials.py | 2 ++ awscli/botocore/useragent.py | 2 ++ tests/functional/botocore/test_credentials.py | 35 +++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/awscli/botocore/credentials.py b/awscli/botocore/credentials.py index 1f64cde20080..083652bae783 100644 --- a/awscli/botocore/credentials.py +++ b/awscli/botocore/credentials.py @@ -1048,7 +1048,9 @@ def load(self): if credential_process is None: return + register_feature_id('CREDENTIALS_PROFILE_PROCESS') creds_dict = self._retrieve_credentials_using(credential_process) + register_feature_id('CREDENTIALS_PROCESS') if creds_dict.get('expiry_time') is not None: return RefreshableCredentials.create_from_metadata( creds_dict, diff --git a/awscli/botocore/useragent.py b/awscli/botocore/useragent.py index cd533853d9e9..59dad12919b2 100644 --- a/awscli/botocore/useragent.py +++ b/awscli/botocore/useragent.py @@ -78,6 +78,8 @@ 'FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED': 'c', 'CREDENTIALS_CODE': 'e', 'CREDENTIALS_ENV_VARS': 'g', + 'CREDENTIALS_PROFILE_PROCESS': 'v', + 'CREDENTIALS_PROCESS': 'w', 'CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN': 'h', 'CREDENTIALS_STS_ASSUME_ROLE': 'i', 'CREDENTIALS_STS_ASSUME_ROLE_WEB_ID': 'k', diff --git a/tests/functional/botocore/test_credentials.py b/tests/functional/botocore/test_credentials.py index 310740aa509a..d59bbdb18e8a 100644 --- a/tests/functional/botocore/test_credentials.py +++ b/tests/functional/botocore/test_credentials.py @@ -1183,6 +1183,41 @@ def add_credential_response(self, stubber): [], 'e', ), + # Test case 6: Credentials set via process provider + ( + {}, + {}, + [ + patch( + "botocore.credentials.ProcessProvider._retrieve_credentials_using", + return_value={ + 'access_key': "FAKEACCESSKEY", + 'secret_key': "FAKESECRETKEY", + 'token': "FAKETOKEN", + }, + ), + patch( + "botocore.credentials.ProcessProvider._credential_process", + return_value="Mock_credential_process", + ), + patch( + "botocore.credentials.ContainerProvider.load", + return_value=None, + ), + patch( + "botocore.credentials.ConfigProvider.load", + return_value=None, + ), + patch( + "botocore.credentials.SharedCredentialProvider.load", + return_value=None, + ), + patch( + "botocore.credentials.EnvProvider.load", return_value=None + ), + ], + ['v', 'w'], + ), ], ) def test_user_agent_feature_ids(