Skip to content

Commit 88747da

Browse files
[DependencyInjection] Fix loading all env vars from secrets when only a subset is needed
1 parent e526d81 commit 88747da

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Secrets/SodiumVault.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Secrets;
1313

1414
use Symfony\Component\DependencyInjection\EnvVarLoaderInterface;
15+
use Symfony\Component\String\LazyString;
1516
use Symfony\Component\VarExporter\VarExporter;
1617

1718
/**
@@ -169,7 +170,14 @@ public function list(bool $reveal = false): array
169170

170171
public function loadEnvVars(): array
171172
{
172-
return $this->list(true);
173+
$envs = [];
174+
$reveal = $this->reveal(...);
175+
176+
foreach ($this->list() as $name => $value) {
177+
$envs[$name] = LazyString::fromCallable($reveal, $name);
178+
}
179+
180+
return $envs;
173181
}
174182

175183
private function loadKeys(): void

0 commit comments

Comments
 (0)