Skip to content

[FrameworkBundle] Add commented base64 version of secrets' keys #41786

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
Jun 23, 2021

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Jun 22, 2021

Q A
Branch? 4.4
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

I'm proposing this minor DX improvement: adding the base64-encoded version of secrets' keys in their source file.
Here is an example output. L3 is the new one.

<?php // dev.decrypt.private on Tue, 22 Jun 2021 15:30:09 +0200
  
// SYMFONY_DECRYPTION_SECRET=GpvL44UBcwxbXrJHc2dHK+zFVssHsQk04hyzXBjBum81lNFTuHIVldehxdgdDJ/anfrTD4eYN3Wn5H7BW2a1Kg==
return "\x1A\x9B\xCB\xE3\x85\x01s\x0C\x5B\x5E\xB2GsgG\x2B\xEC\xC5V\xCB\x07\xB1\x094\xE2\x1C\xB3\x5C\x18\xC1\xBAo5\x94\xD1S\xB8r\x15\x95\xD7\xA1\xC5\xD8\x1D\x0C\x9F\xDA\x9D\xFA\xD3\x0F\x87\x987u\xA7\xE4~\xC1\x5Bf\xB5\x2A";

Should make it a bit easier to populate the SYMFONY_DECRYPTION_SECRET env var by enabling copy/pasting.

@carsonbot carsonbot added this to the 4.4 milestone Jun 22, 2021
@nicolas-grekas nicolas-grekas force-pushed the fwb-secrets-b64 branch 2 times, most recently from fc5f856 to a9a5ca0 Compare June 22, 2021 13:29
@stof
Copy link
Member

stof commented Jun 22, 2021

do we need quoting the value to avoid issues with = in the base64 alphabet ?

@nicolas-grekas
Copy link
Member Author

do we need quoting the value to avoid issues with = in the base64 alphabet ?

we don't have to, I don't think a = in the value is an issue.

Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for 5.4

@fabpot fabpot changed the base branch from 4.4 to 5.4 June 23, 2021 09:39
@fabpot fabpot force-pushed the fwb-secrets-b64 branch from a9a5ca0 to de3ea13 Compare June 23, 2021 09:39
@fabpot
Copy link
Member

fabpot commented Jun 23, 2021

Thank you @nicolas-grekas.

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.

5 participants