Skip to content

Commit

Permalink
[DependencyInjection] Reset env vars when resetting the container
Browse files Browse the repository at this point in the history
  • Loading branch information
faizanakram99 authored and fabpot committed May 2, 2024
1 parent 8c5cd75 commit e8cba21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CHANGELOG
* Attach the workflow's configuration to the `workflow` tag
* Add the `allowed_recipients` option for mailer to allow some users to receive
emails even if `recipients` is defined.
* Reset env vars when resetting the container

7.0
---
Expand Down
4 changes: 4 additions & 0 deletions Resources/config/secrets.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Symfony\Bundle\FrameworkBundle\Secrets\DotenvVault;
use Symfony\Bundle\FrameworkBundle\Secrets\SodiumVault;
use Symfony\Component\DependencyInjection\StaticEnvVarLoader;

return static function (ContainerConfigurator $container) {
$container->services()
Expand All @@ -21,6 +22,9 @@
abstract_arg('Secret dir, set in FrameworkExtension'),
service('secrets.decryption_key')->ignoreOnInvalid(),
])

->set('secrets.env_var_loader', StaticEnvVarLoader::class)
->args([service('secrets.vault')])
->tag('container.env_var_loader')

->set('secrets.decryption_key')
Expand Down

0 comments on commit e8cba21

Please sign in to comment.