-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[FrameworkBundle] allow using secrets when the sodium ext is missing #34275
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
Conversation
…is missing (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] allow using secrets when the sodium ext is missing | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - When all secrets are defined as env vars, there is no need for the sodium vault, yet it chokes on instantiation currently. Commits ------- 326284a [FrameworkBundle] allow using secrets when the sodium ext is missing
if (!\function_exists('sodium_crypto_box_seal')) { | ||
$this->lastMessage = sprintf('Secret "%s" cannot be revealed as the "sodium" PHP extension missing. Try running "composer require paragonie/sodium_compat" if you cannot enable the extension."', $name); | ||
|
||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we return null
silently here, or throw an exception when trying to use reveal
without the sodium extension ? seal
is throwing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should return null
, that's the design here - it allows e.g. the env var process to take over and provide a fallback behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generateKeys
is missing the validation (as it catches LogicException throwing by loadKeys
and ignore it, this cannot be considered as the validation)
…as-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] fix SodiumVault after stof review | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - As spotted by @stof in #34275 (review) Commits ------- a594599 [FrameworkBundle] fix SodiumVault after stof review
…as-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] fix SodiumVault after stof review | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - As spotted by @stof in symfony/symfony#34275 (review) Commits ------- a594599078 [FrameworkBundle] fix SodiumVault after stof review
When all secrets are defined as env vars, there is no need for the sodium vault, yet it chokes on instantiation currently.