Skip to content

Commit 3a9f62d

Browse files
port (#9757)
1 parent 82ae9d6 commit 3a9f62d

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

awscli/botocore/credentials.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,7 @@ def load(self):
14951495
access_key, secret_key = self._extract_creds_from_mapping(
14961496
credentials, self.ACCESS_KEY, self.SECRET_KEY
14971497
)
1498+
register_feature_id('CREDENTIALS_BOTO2_CONFIG_FILE')
14981499
return Credentials(
14991500
access_key, secret_key, method=self.METHOD
15001501
)

awscli/botocore/useragent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
'CREDENTIALS_SSO': 's',
9292
'CREDENTIALS_PROFILE_SSO_LEGACY': 't',
9393
'CREDENTIALS_SSO_LEGACY': 'u',
94+
'CREDENTIALS_BOTO2_CONFIG_FILE': 'x',
9495
'CREDENTIALS_HTTP': 'z',
9596
'CREDENTIALS_IMDS': '0',
9697
'BEARER_SERVICE_ENV_VARS': '3',

tests/functional/botocore/test_credentials.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,34 @@ def add_credential_response(self, stubber):
11831183
[],
11841184
'e',
11851185
),
1186+
# Test case 5: Credentials set with Boto2 config
1187+
(
1188+
{},
1189+
{},
1190+
[
1191+
patch(
1192+
"botocore.configloader.raw_config_parse",
1193+
return_value={
1194+
"Credentials": {
1195+
"aws_access_key_id": "FAKEACCESSKEY",
1196+
"aws_secret_access_key": "FAKESECRETKEY",
1197+
}
1198+
},
1199+
),
1200+
patch(
1201+
"botocore.credentials.ConfigProvider.load",
1202+
return_value=None,
1203+
),
1204+
patch(
1205+
"botocore.credentials.SharedCredentialProvider.load",
1206+
return_value=None,
1207+
),
1208+
patch(
1209+
"botocore.credentials.EnvProvider.load", return_value=None
1210+
),
1211+
],
1212+
'x',
1213+
),
11861214
# Test case 6: Credentials set via process provider
11871215
(
11881216
{},

0 commit comments

Comments
 (0)