Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

foreach ($this->vault->list(true) as $name => $value) {
$localValue = $this->localVault->reveal($name);
if (null === $localValue = $this->localVault->reveal($name)) {
continue;
}

if (null !== $localValue && $value !== $localValue) {
if ($value !== $localValue) {
$this->vault->seal($name, $localValue);
} elseif (null !== $message = $this->localVault->getLastMessage()) {
$io->error($message);

return 1;
$io->note($this->vault->getLastMessage());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private function addSecretsSection(ArrayNodeDefinition $rootNode): void
->canBeDisabled()
->children()
->scalarNode('vault_directory')->defaultValue('%kernel.project_dir%/config/secrets/%kernel.runtime_environment%')->cannotBeEmpty()->end()
->scalarNode('local_dotenv_file')->defaultValue('%kernel.project_dir%/.env.%kernel.environment%.local')->end()
->scalarNode('local_dotenv_file')->defaultValue('%kernel.project_dir%/.env.%kernel.runtime_environment%.local')->end()
->scalarNode('decryption_env_var')->defaultValue('base64:default::SYMFONY_DECRYPTION_SECRET')->end()
->end()
->end()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function testDoesNotSealIfSameValue()
$this->assertSame('same-value', $revealed);
}

public function testFailsIfLocalSecretIsMissing()
public function testStillSucceedsIfLocalSecretIsMissing()
{
$vault = new SodiumVault($this->vaultDir);
$vault->generateKeys();
Expand All @@ -105,7 +105,8 @@ public function testFailsIfLocalSecretIsMissing()
$command = new SecretsEncryptFromLocalCommand($vault, $localVault);
$tester = new CommandTester($command);

$this->assertSame(1, $tester->execute([]));
$this->assertStringContainsString('Secret "MISSING_IN_LOCAL" not found', $tester->getDisplay());
$this->assertSame(0, $tester->execute([]));
$revealed = $vault->reveal('MISSING_IN_LOCAL');
$this->assertSame('prod-only', $revealed);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphor
'secrets' => [
'enabled' => true,
'vault_directory' => '%kernel.project_dir%/config/secrets/%kernel.runtime_environment%',
'local_dotenv_file' => '%kernel.project_dir%/.env.%kernel.environment%.local',
'local_dotenv_file' => '%kernel.project_dir%/.env.%kernel.runtime_environment%.local',
'decryption_env_var' => 'base64:default::SYMFONY_DECRYPTION_SECRET',
],
'http_cache' => [
Expand Down
Loading