Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 84de1a3

Browse filesBrowse files
bug #35099 [FrameworkBundle] Do not throw exception on value generate key (jderusse)
This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] Do not throw exception on value generate key | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A When using env variable instead of key files and creating a new Secret, the check in `generateKeys` (called by the command `SecretsSetCommand`) prevents generating a secret. reproducer: ``` $ rm config/secrets/prod/prod.decrypt.private.php $ export SYMFONY_DECRYPTION_SECRET=XXX $ ./bin/console secret:set FOO In SodiumVault.php line 50: Cannot generate keys when a decryption key has been provided while instantiating the vault. ``` This PR converts the exception in a warning message. Commits ------- 2f608b4 Do not throw exception on valut generate key
2 parents 415761e + 2f608b4 commit 84de1a3
Copy full SHA for 84de1a3

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Secrets/SodiumVault.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Secrets/SodiumVault.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ public function generateKeys(bool $override = false): bool
4747
$this->lastMessage = null;
4848

4949
if (null === $this->encryptionKey && '' !== $this->decryptionKey = (string) $this->decryptionKey) {
50-
throw new \LogicException('Cannot generate keys when a decryption key has been provided while instantiating the vault.');
50+
$this->lastMessage = 'Cannot generate keys when a decryption key has been provided while instantiating the vault.';
51+
52+
return false;
5153
}
5254

5355
try {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.