Skip to content
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

[FrameworkBundle] allow using secrets when the sodium ext is missing #34275

Merged
merged 1 commit into from Nov 7, 2019

Conversation

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Nov 7, 2019

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.

@fabpot
fabpot approved these changes Nov 7, 2019
nicolas-grekas added a commit that referenced this pull request Nov 7, 2019
…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
@nicolas-grekas nicolas-grekas merged commit 326284a into symfony:4.4 Nov 7, 2019
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details
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;

This comment has been minimized.

Copy link
@stof

stof Nov 7, 2019

Member

should we return null silently here, or throw an exception when trying to use reveal without the sodium extension ? seal is throwing.

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Nov 7, 2019

Author Member

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

Copy link
Member

stof left a comment

generateKeys is missing the validation (as it catches LogicException throwing by loadKeys and ignore it, this cannot be considered as the validation)

@nicolas-grekas nicolas-grekas deleted the nicolas-grekas:secret-relax branch Nov 7, 2019
nicolas-grekas added a commit that referenced this pull request Nov 8, 2019
…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
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Nov 8, 2019
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.