Skip to content

Commit 82ae9d6

Browse files
port (#9756)
1 parent 8454f0b commit 82ae9d6

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

awscli/botocore/credentials.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,9 @@ def load(self):
10481048
if credential_process is None:
10491049
return
10501050

1051+
register_feature_id('CREDENTIALS_PROFILE_PROCESS')
10511052
creds_dict = self._retrieve_credentials_using(credential_process)
1053+
register_feature_id('CREDENTIALS_PROCESS')
10521054
if creds_dict.get('expiry_time') is not None:
10531055
return RefreshableCredentials.create_from_metadata(
10541056
creds_dict,

awscli/botocore/useragent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
'FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED': 'c',
7979
'CREDENTIALS_CODE': 'e',
8080
'CREDENTIALS_ENV_VARS': 'g',
81+
'CREDENTIALS_PROFILE_PROCESS': 'v',
82+
'CREDENTIALS_PROCESS': 'w',
8183
'CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN': 'h',
8284
'CREDENTIALS_STS_ASSUME_ROLE': 'i',
8385
'CREDENTIALS_STS_ASSUME_ROLE_WEB_ID': 'k',

tests/functional/botocore/test_credentials.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,41 @@ def add_credential_response(self, stubber):
11831183
[],
11841184
'e',
11851185
),
1186+
# Test case 6: Credentials set via process provider
1187+
(
1188+
{},
1189+
{},
1190+
[
1191+
patch(
1192+
"botocore.credentials.ProcessProvider._retrieve_credentials_using",
1193+
return_value={
1194+
'access_key': "FAKEACCESSKEY",
1195+
'secret_key': "FAKESECRETKEY",
1196+
'token': "FAKETOKEN",
1197+
},
1198+
),
1199+
patch(
1200+
"botocore.credentials.ProcessProvider._credential_process",
1201+
return_value="Mock_credential_process",
1202+
),
1203+
patch(
1204+
"botocore.credentials.ContainerProvider.load",
1205+
return_value=None,
1206+
),
1207+
patch(
1208+
"botocore.credentials.ConfigProvider.load",
1209+
return_value=None,
1210+
),
1211+
patch(
1212+
"botocore.credentials.SharedCredentialProvider.load",
1213+
return_value=None,
1214+
),
1215+
patch(
1216+
"botocore.credentials.EnvProvider.load", return_value=None
1217+
),
1218+
],
1219+
['v', 'w'],
1220+
),
11861221
],
11871222
)
11881223
def test_user_agent_feature_ids(

0 commit comments

Comments
 (0)