validation-bugsnag-email
This commit is contained in:
@@ -9,15 +9,15 @@ trait ParsesIniTrait
|
||||
private static function loadProfiles($filename)
|
||||
{
|
||||
$profileData = \Aws\parse_ini_file($filename, true, INI_SCANNER_RAW);
|
||||
|
||||
$configFilename = self::getHomeDir() . '/.aws/config';
|
||||
$configProfileData = \Aws\parse_ini_file($configFilename, true, INI_SCANNER_RAW);
|
||||
foreach ($configProfileData as $name => $profile) {
|
||||
if (is_readable($configFilename)) {
|
||||
$configProfiles = \Aws\parse_ini_file($configFilename, true, INI_SCANNER_RAW);
|
||||
$profileData = array_merge($configProfiles, $profileData);
|
||||
}
|
||||
foreach ($profileData as $name => $profile) {
|
||||
// standardize config profile names
|
||||
$name = str_replace('profile ', '', $name);
|
||||
if (!isset($profileData[$name])) {
|
||||
$profileData[$name] = $profile;
|
||||
}
|
||||
$profileData[$name] = $profile;
|
||||
}
|
||||
|
||||
return $profileData;
|
||||
|
||||
@@ -18,11 +18,9 @@ class SsoTokenProvider implements RefreshableTokenProviderInterface
|
||||
private $ssoOidcClient;
|
||||
|
||||
/**
|
||||
* Constructs a new SSO token object, with the specified AWS
|
||||
* token
|
||||
*
|
||||
* @param string $token Security token to use
|
||||
* @param int $expires UNIX timestamp for when the token expires
|
||||
* Constructs a new SsoTokenProvider object, which will fetch a token from an authenticated SSO profile
|
||||
* @param string $ssoProfileName The name of the profile that contains the sso_session key
|
||||
* @param int $filename Name of the config file to sso profile from
|
||||
*/
|
||||
public function __construct($ssoProfileName, $filename = null, $ssoOidcClient = null) {
|
||||
$profileName = getenv(self::ENV_PROFILE) ?: 'default';
|
||||
@@ -42,7 +40,7 @@ class SsoTokenProvider implements RefreshableTokenProviderInterface
|
||||
{
|
||||
return Promise\Coroutine::of(function () {
|
||||
if (!@is_readable($this->filename)) {
|
||||
throw new TokenException("Cannot read token from $this->filename");
|
||||
throw new TokenException("Cannot read profiles from $this->filename");
|
||||
}
|
||||
$profiles = self::loadProfiles($this->filename);
|
||||
if (!isset($profiles[$this->ssoProfileName])) {
|
||||
|
||||
Reference in New Issue
Block a user