Skip to content

Commit

Permalink
doc: improved configuration documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Apr 22, 2024
1 parent 0e02933 commit a1a09e6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ Configuration
pytest-iam can be configured by redefining or expanding the :meth:`~pytest_iam.iam_configuration` fixture.
This returns a :const:`dict` containing the canaille :doc:`canaille:configuration`.

.. code:: python
.. code-block:: python
@pytest.fixture(scope="session")
def iam_configuration(iam_configuration):
iam_configuration["ACL"]["DEFAULT"]["WRITE"].append("groups")
iam_configuration["CANAILLE"]["ACL"]["DEFAULT"]["WRITE"].append("groups")
return iam_configuration
The configuration will also be read:
The configuration will also be read from a `.pytest-iam.env` file if existing.

- from a `.pytest-iam.env` file if existing;
- from any environment var with a valid Canaille setting name prefixed by `PYTEST_IAM_`.
.. code-block:: bash
:caption: .pytest-iam.env
CANAILLE_OIDC__REQUIRE_NONCE=false
It can also be read from any environment var with a valid Canaille setting name prefixed by `PYTEST_IAM_`.

.. code-block:: bash
env PYTEST_IAM_CANAILLE_OIDC__REQUIRE_NONCE=false pytest

0 comments on commit a1a09e6

Please sign in to comment.