Skip to content

Commit

Permalink
fix source_profile handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tchernomax committed Sep 23, 2022
1 parent 2025db0 commit 11497f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Credentials/CredentialProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,12 @@ private static function loadRoleProfile(
$sourceProfileName = "";
if (!empty($roleProfile['source_profile'])) {
$sourceProfileName = $roleProfile['source_profile'];
# in ~/.aws/config all the named profile (except 'default') are
# prefix with 'profile '
if ($filename == (self::getHomeDir() . '/.aws/config') &&
$sourceProfileName != 'default') {
$sourceProfileName = 'profile ' . $sourceProfileName;
}
if (!isset($profiles[$sourceProfileName])) {
return self::reject("source_profile " . $sourceProfileName
. " using profile " . $profileName . " does not exist"
Expand Down

0 comments on commit 11497f2

Please sign in to comment.