Skip to content

[FrameworkBundle] Do not throw exception on value generate key #35099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2020

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Dec 24, 2019

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.

@nicolas-grekas nicolas-grekas changed the title Do not throw exception on valut generate key [FrameworkBundle] Do not throw exception on value generate key Dec 26, 2019
@nicolas-grekas nicolas-grekas added this to the 4.4 milestone Dec 26, 2019
@nicolas-grekas
Copy link
Member

Thank you @jderusse.

nicolas-grekas added a commit that referenced this pull request Jan 9, 2020
… 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
@nicolas-grekas nicolas-grekas merged commit 2f608b4 into symfony:4.4 Jan 9, 2020
This was referenced Jan 21, 2020
@jderusse jderusse deleted the secret-genkey branch March 5, 2020 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants