Skip to content

Commit d2cd899

Browse files
committed
handle non array coming back from secrets manager
1 parent aee6d90 commit d2cd899

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/LaravelAwsSecretsManager.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,12 @@ protected function getVariables()
113113
'SecretId' => $item['ARN'],
114114
]);
115115

116-
foreach (json_decode($result['SecretString'], true) as $key => $secret) {
117-
putenv("$key=$secret");
118-
$this->storeToCache($key, $secret);
116+
$secretValues = json_decode($result['SecretString'], true);
117+
if (is_array($secretValues)) {
118+
foreach ($secretValues as $key => $secret) {
119+
putenv("$key=$secret");
120+
$this->storeToCache($key, $secret);
121+
}
119122
}
120123
}
121124
}

0 commit comments

Comments
 (0)