Skip to content

Commit 5260432

Browse files
committed
Merge remote-tracking branch 'upstream/7.3' into 7.3
* upstream/7.3: Minor tweaks Add `role_fetcher` option to LDAP security configuration Minor tweaks Update http client timeout option docs [FrameworkBundle] Allow to pass signals to `StopWorkerOnSignalsListener` in XML config and as plain strings
2 parents 8f86b2c + 85b4530 commit 5260432

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed

messenger.rst

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,56 @@ message before terminating.
848848

849849
However, you might prefer to use different POSIX signals for graceful shutdown.
850850
You can override default ones by setting the ``framework.messenger.stop_worker_on_signals``
851-
configuration option.
851+
configuration option:
852+
853+
.. configuration-block::
854+
855+
.. code-block:: yaml
856+
857+
# config/packages/messenger.yaml
858+
framework:
859+
messenger:
860+
stop_worker_on_signals:
861+
- SIGTERM
862+
- SIGINT
863+
- SIGUSR1
864+
865+
.. code-block:: xml
866+
867+
<!-- config/packages/messenger.xml -->
868+
<?xml version="1.0" encoding="UTF-8" ?>
869+
<container xmlns="http://symfony.com/schema/dic/services"
870+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
871+
xmlns:framework="http://symfony.com/schema/dic/symfony"
872+
xsi:schemaLocation="http://symfony.com/schema/dic/services
873+
https://symfony.com/schema/dic/services/services-1.0.xsd
874+
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
875+
876+
<framework:config>
877+
<framework:messenger>
878+
<!-- ... -->
879+
<framework:stop-worker-on-signal>SIGTERM</framework:stop-worker-on-signal>
880+
<framework:stop-worker-on-signal>SIGINT</framework:stop-worker-on-signal>
881+
<framework:stop-worker-on-signal>SIGUSR1</framework:stop-worker-on-signal>
882+
</framework:messenger>
883+
</framework:config>
884+
</container>
885+
886+
.. code-block:: php
887+
888+
// config/packages/messenger.php
889+
use Symfony\Config\FrameworkConfig;
890+
891+
return static function (FrameworkConfig $framework): void {
892+
$framework->messenger()
893+
->stopWorkerOnSignals(['SIGTERM', 'SIGINT', 'SIGUSR1']);
894+
};
895+
896+
.. versionadded:: 7.3
897+
898+
Support for signals plain names in configuration was introduced in Symfony 7.3.
899+
Previously, you had to use the numeric values of signals as defined by the
900+
``pcntl`` extension's `predefined constants`_.
852901

853902
In some cases the ``SIGTERM`` signal is sent by Supervisor itself (e.g. stopping
854903
a Docker container having Supervisor as its entrypoint). In these cases you
@@ -3587,3 +3636,4 @@ Learn more
35873636
.. _`high connection churn`: https://www.rabbitmq.com/connections.html#high-connection-churn
35883637
.. _`article about CQRS`: https://martinfowler.com/bliki/CQRS.html
35893638
.. _`SSL context options`: https://php.net/context.ssl
3639+
.. _`predefined constants`: https://www.php.net/pcntl.constants

reference/configuration/framework.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ timeout
12611261

12621262
**type**: ``float`` **default**: depends on your PHP config
12631263

1264-
Time, in seconds, to wait for a response. If the response takes longer, a
1264+
Time, in seconds, to wait for network activity. If the connection is idle for longer, a
12651265
:class:`Symfony\\Component\\HttpClient\\Exception\\TransportException` is thrown.
12661266
Its default value is the same as the value of PHP's `default_socket_timeout`_
12671267
config option.

security/ldap.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,24 @@ This is the default role you wish to give to a user fetched from the LDAP
256256
server. If you do not configure this key, your users won't have any roles,
257257
and will not be considered as authenticated fully.
258258

259+
role_fetcher
260+
............
261+
262+
**Type**: ``string`` **Default**: ``null``
263+
264+
When your LDAP service provides user roles, this option allows you to define
265+
the service that retrieves these roles. The role fetcher service must implement
266+
the ``Symfony\Component\Ldap\Security\RoleFetcherInterface``. When this option
267+
is set, the ``default_roles`` option is ignored.
268+
269+
Symfony provides ``Symfony\Component\Ldap\Security\MemberOfRoles``, a concrete
270+
implementation of the interface that fetches roles from the ``ismemberof``
271+
attribute.
272+
273+
.. versionadded:: 7.3
274+
275+
The ``role_fetcher`` configuration option was introduced in Symfony 7.3.
276+
259277
uid_key
260278
.......
261279

0 commit comments

Comments
 (0)