Skip to content

Commit

Permalink
[DependencyInjection] Fix loading all env vars from secrets when only…
Browse files Browse the repository at this point in the history
… a subset is needed
  • Loading branch information
nicolas-grekas committed Jan 25, 2024
1 parent e526d81 commit 88747da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Secrets/SodiumVault.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Bundle\FrameworkBundle\Secrets;

use Symfony\Component\DependencyInjection\EnvVarLoaderInterface;
use Symfony\Component\String\LazyString;
use Symfony\Component\VarExporter\VarExporter;

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

public function loadEnvVars(): array
{
return $this->list(true);
$envs = [];
$reveal = $this->reveal(...);

foreach ($this->list() as $name => $value) {
$envs[$name] = LazyString::fromCallable($reveal, $name);
}

return $envs;
}

private function loadKeys(): void
Expand Down

0 comments on commit 88747da

Please sign in to comment.