Skip to content

Commit

Permalink
Merge branch '5.4' into 6.0
Browse files Browse the repository at this point in the history
* 5.4:
  Clarify Pull Request Merging Policy
  [Mercure] fix some typos and outdates sentences
  • Loading branch information
javiereguiluz committed Dec 28, 2021
2 parents f14782a + 66ad276 commit 1fa2ec8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
10 changes: 7 additions & 3 deletions contributing/code/core_team.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,13 @@ A pull request **can be merged** if:

* Enough time was given for peer reviews;

* At least two **Mergers Team** members voted ``+1`` (only one if the submitter
is part of the Mergers team) and no Core member voted ``-1`` (via GitHub
reviews or as comments).
* It is a bug fix and at least two **Mergers Team** members voted ``+1``
(only one if the submitter is part of the Mergers team) and no Core
member voted ``-1`` (via GitHub reviews or as comments).

* It is a new feature and at least two **Mergers Team** members voted
``+1`` (if the submitter is part of the Mergers team, two *other* members)
and no Core member voted ``-1`` (via GitHub reviews or as comments).

Pull Request Merging Process
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
24 changes: 12 additions & 12 deletions mercure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ This secret key must be stored in the ``MERCURE_JWT_SECRET`` environment variabl
MercureBundle will use it to automatically generate and sign the needed JWTs.

In addition to these environment variables,
MercureBundle provides a more advanced configuration configuration:
MercureBundle provides a more advanced configuration:

* ``secret``: the key to use to sign the JWT (all other options, beside `algorithm`, `subscribe`, and `publish` will be ignored)
* ``publish``: a list of topics to allow publishing to when generating the JWT (only usable when `secret`, or `factory` are provided)
* ``subscribe``: a list of topics to allow subscribing to when generating the JWT (only usable when `secret`, or `factory` are provided)
* ``algorithm``: The algorithm to use to sign the JWT (only usable when `secret` is provided)
* ``secret``: the key to use to sign the JWT (all other options, beside ``algorithm``, ``subscribe``, and ``publish`` will be ignored)
* ``publish``: a list of topics to allow publishing to when generating the JWT (only usable when ``secret``, or ``factory`` are provided)
* ``subscribe``: a list of topics to allow subscribing to when generating the JWT (only usable when ``secret``, or ``factory`` are provided)
* ``algorithm``: The algorithm to use to sign the JWT (only usable when ``secret`` is provided)
* ``provider``: The ID of a service to call to provide the JWT (all other options will be ignored)
* ``factory``: The ID of a service to call to create the JWT (all other options, beside `subscribe`, and `publish` will be ignored)
* ``factory``: The ID of a service to call to create the JWT (all other options, beside ``subscribe``, and ``publish`` will be ignored)
* ``value``: the raw JWT to use (all other options will be ignored)

.. configuration-block::
Expand Down Expand Up @@ -186,7 +186,7 @@ MercureBundle provides a more advanced configuration configuration:
.. tip::

The JWT payload must contain at least the following structure to be allowed to
The JWT payload must contain at least the following structure for the client to be allowed to
publish:

.. code-block:: json
Expand Down Expand Up @@ -338,8 +338,8 @@ in a ``Link`` HTTP header.

.. image:: /_images/mercure/discovery.png

You can create ``Link`` headers with the :doc:`WebLink Component </web_link>`,
by using the ``AbstractController::addLink`` helper method::
You can create ``Link`` headers with the ``Discovery`` helper class
(under the hood, it uses the :doc:`WebLink Component </web_link>`)::

// src/Controller/DiscoverController.php
namespace App\Controller;
Expand Down Expand Up @@ -416,10 +416,10 @@ of the ``Update`` constructor to ``true``::
}

To subscribe to private updates, subscribers must provide to the Hub
a JWT containing a topic selector matching by the update's topic.
a JWT containing a topic selector matching by the topic of the update.

To provide this JWT, the subscriber can use a cookie,
or a ``Authorization`` HTTP header.
or an ``Authorization`` HTTP header.

Cookies can be set automatically by Symfony by passing the appropriate options
to the ``mercure()`` Twig function. Cookies set by Symfony are automatically
Expand Down Expand Up @@ -470,7 +470,7 @@ Programmatically Setting The Cookie

Sometimes, it can be convenient to set the authorization cookie from your code
instead of using the Twig function. MercureBundle provides a convenient service,
:class:`Symfony\\Component\\Mercure\\Authorization`, to do so.
``Authorization``, to do so.

In the following example controller, the added cookie contains a JWT, itself
containing the appropriate topic selector.
Expand Down

0 comments on commit 1fa2ec8

Please sign in to comment.