Skip to content

Commit ba9ee8b

Browse files
committed
ge secret fom key pair
1 parent dbef635 commit ba9ee8b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/LaravelAwsSecretsManager.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,13 @@ protected function getVariables()
105105
$result = $this->client->getSecretValue([
106106
'SecretId' => $secret['ARN'],
107107
]);
108-
$key = $result['Name'];
109-
$secret = $result['SecretString'];
110-
putenv("$key=$secret");
111-
$this->storeToCache($result['Name'], $result['SecretString']);
108+
$secretValues = json_decode($result['SecretString'], true);
109+
if (isset($secretValues['name']) && isset($secretValues['value'])) {
110+
$key = $secretValues['name'];
111+
$secret = $secretValues['value'];
112+
putenv("$key=$secret");
113+
$this->storeToCache($key, $secret);
114+
}
112115
}
113116
}
114117
}

0 commit comments

Comments
 (0)