Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changes/nextrelease/imds-updates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"type": "feature",
"category": "Credentials",
"description": "Adds `InstanceProfileProvider` support for sourcing account id and removes support for imdsv1."
}
]
9 changes: 9 additions & 0 deletions .github/workflows/git-secrets-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ jobs:
'/"AccountId": "123456789012"/'
'/"AccountId": "999999999999"/'
'/"AccountId": "012345678901"/'
'/"AccountId": "345678910112"/'
'/"AccountId": "314253647589"/'
'/"AccountId": "234567891011"/'
'/"AccountId": "123456789101"/'
'/"accountId": "314253647589"/'
'/"accountId": "345678910112"/'
'/"accountId": "234567891011"/'
'/"accountId": "123456789101"/'
'/"AccessKeyId": "ASIAIOSFODNN7EXAMPLE"/'
'/"AWS::Auth::AccountId": "012345678901"/'
'/123456789012/'
'/999999999999/'
Expand Down
14 changes: 3 additions & 11 deletions src/Configuration/ConfigurationResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ public static function resolve(
$config = []
)
{
$iniOptions = isset($config['ini_resolver_options'])
? $config['ini_resolver_options']
: [];
$iniOptions = $config['ini_resolver_options'] ?? [];

$envValue = self::env($key, $expectedType);
if (!is_null($envValue)) {
Expand Down Expand Up @@ -115,10 +113,7 @@ public static function ini(
//TODO change after deprecation
$data = @\Aws\parse_ini_file($filename, true, INI_SCANNER_NORMAL);

if (isset($options['section'])
&& isset($options['subsection'])
&& isset($options['key']))
{
if (isset($options['section'], $options['subsection'], $options['key'])) {
return self::retrieveValueFromIniSubsection(
$data,
$profile,
Expand All @@ -128,10 +123,7 @@ public static function ini(
);
}

if ($data === false
|| !isset($data[$profile])
|| !isset($data[$profile][$key])
) {
if (empty($data[$profile][$key]) || $data === false) {
return null;
}

Expand Down
Loading