-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Symfony secrets management support #28
Comments
This should be possible by setting the environment variable with the minified output of the JSON file. You can create it, for example, with $ jq -c . < /path/to/service_account.json This should remove the need to str_replace things and has the benefit of having to set/encrypt just a single value. Please let me know if this helps. |
Oh, I haven't thought of it. It works great this way. Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The problem
Cant use Firebase provided private key encoded with Symfony's new secret encryption system
Details
I dont like to keep Firebase keys in json file. It would be much better to provide them in configuration file as encrypted env variables encoded with Symfony's secret management system. In
config/packages/firebase.yaml
instead ofcredentials
value set to json file I tried to provide list of the values directly:If values are set directly here - it works.
The next step would be to encode these vars ant provide them in bundles yaml file with
'%env(MY_VAR)%'
.But there is an issue with
private_key
value. After I tried to send push notification this warning is received:Warning: openssl_sign(): supplied key param cannot be coerced into a private key.
As I understand the issue here is because of newline character
\n
in this private key. Example: https://i.imgur.com/83eDkL8.pngBut because it is used in yaml, I cant use str_replace to change them. Is there a way to use this key encoded?
The text was updated successfully, but these errors were encountered: