Skip to content

Fix ordered lists in secrets management and Form component documentation #16944

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
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions components/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -648,14 +648,15 @@ method:

This defines a common form "workflow", which contains 3 different possibilities:

1) On the initial GET request (i.e. when the user "surfs" to your page),
#. On the initial GET request (i.e. when the user "surfs" to your page),
build your form and render it;

If the request is a POST, process the submitted data (via :method:`Symfony\\Component\\Form\\Form::handleRequest`).
Then:
If the request is a POST, process the submitted data (via :method:`Symfony\\Component\\Form\\Form::handleRequest`).

2) if the form is invalid, re-render the form (which will now contain errors);
3) if the form is valid, perform some action and redirect.
Then:

#. if the form is invalid, re-render the form (which will now contain errors);
#. if the form is valid, perform some action and redirect.

Luckily, you don't need to decide whether or not a form has been submitted.
Just pass the current request to the :method:`Symfony\\Component\\Form\\Form::handleRequest`
Expand Down
34 changes: 17 additions & 17 deletions configuration/secrets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,32 +240,32 @@ Deploy Secrets to Production
Due to the fact that decryption keys should never be committed, you will need to
manually store this file somewhere and deploy it. There are 2 ways to do that:

1) Uploading the file:
#. Uploading the file

The first option is to copy the **production decryption key** -
``config/secrets/prod/prod.decrypt.private.php`` to your server.
The first option is to copy the **production decryption key** -
``config/secrets/prod/prod.decrypt.private.php`` to your server.

2) Using an Environment Variable
#. Using an Environment Variable

The second way is to set the ``SYMFONY_DECRYPTION_SECRET`` environment variable
to the base64 encoded value of the **production decryption key**. A fancy way to
fetch the value of the key is:
The second way is to set the ``SYMFONY_DECRYPTION_SECRET`` environment variable
to the base64 encoded value of the **production decryption key**. A fancy way to
fetch the value of the key is:

.. code-block:: terminal
.. code-block:: terminal

# this command only gets the value of the key; you must also set an env var
# in your system with this value (e.g. `export SYMFONY_DECRYPTION_SECRET=...`)
$ php -r 'echo base64_encode(require "config/secrets/prod/prod.decrypt.private.php");'
# this command only gets the value of the key; you must also set an env var
# in your system with this value (e.g. `export SYMFONY_DECRYPTION_SECRET=...`)
$ php -r 'echo base64_encode(require "config/secrets/prod/prod.decrypt.private.php");'

To improve performance (i.e. avoid decrypting secrets at runtime), you can decrypt
your secrets during deployment to the "local" vault:
To improve performance (i.e. avoid decrypting secrets at runtime), you can decrypt
your secrets during deployment to the "local" vault:

.. code-block:: terminal
.. code-block:: terminal

$ php bin/console secrets:decrypt-to-local --force --env=prod
$ php bin/console secrets:decrypt-to-local --force --env=prod

This will write all the decrypted secrets into the ``.env.prod.local`` file.
After doing this, the decryption key does *not* need to remain on the server(s).
This will write all the decrypted secrets into the ``.env.prod.local`` file.
After doing this, the decryption key does *not* need to remain on the server(s).

Rotating Secrets
----------------
Expand Down