Skip to content

Commit 07d59c7

Browse files
committed
Fix documentation build warnings (#1484)
This commit addresses all the warnings reported when running `tox -e docs`: 1. Fixed title underlines in settings.rst that were too short: - OIDC_RP_INITIATED_LOGOUT_ENABLED - OIDC_RP_INITIATED_LOGOUT_STRICT_REDIRECT_URIS - OIDC_RP_INITIATED_LOGOUT_ACCEPT_EXPIRED_TOKENS 2. Fixed unexpected indentation in contributing.rst by adding a colon before the code block 3. Fixed unexpected indentation in oidc.rst by converting inline code blocks (::) to proper code-block directives at lines 292 and 336 4. Fixed unknown interpreted text role ':openid:' in AbstractIDToken docstring by replacing it with plain text reference to OpenID Connect specification 5. Fixed duplicate object descriptions between views/details.rst and views/mixins.rst by adding :noindex: directive to details.rst 6. Fixed code block lexer warning in management_commands.rst by changing the language from 'sh' to 'text' for the usage output
1 parent 01dfd06 commit 07d59c7

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ For test writers this means any test must either:
258258
- when using pytest's `django_db` mark, define it like this:
259259
`@pytest.mark.django_db(databases=retrieve_current_databases())`
260260

261-
In test code, anywhere the database is referenced the Django router needs to be used exactly like the package's code.
261+
In test code, anywhere the database is referenced the Django router needs to be used exactly like the package's code:
262262

263263
.. code-block:: python
264264

docs/management_commands.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ createapplication
3232

3333
The ``createapplication`` management command provides a shortcut to create a new application in a programmatic way.
3434

35-
.. code-block:: sh
35+
.. code-block:: text
3636
3737
usage: manage.py createapplication [-h] [--client-id CLIENT_ID] [--user USER]
3838
[--redirect-uris REDIRECT_URIS]

docs/oidc.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ mapping a claim name to claim data::
288288

289289
The second form gets no request object, and should return a dictionary
290290
mapping a claim name to a callable, accepting a request and producing
291-
the claim data::
291+
the claim data:
292+
293+
.. code-block:: python
294+
292295
class CustomOAuth2Validator(OAuth2Validator):
293296
# Extend the standard scopes to add a new "permissions" scope
294297
# which returns a "permissions" claim:
@@ -332,7 +335,10 @@ For example, a ``given_name`` claim is only returned if the ``profile`` scope wa
332335

333336
To change the list of claims and which scopes result in their being returned,
334337
override ``oidc_claim_scope`` with a dict keyed by claim with a value of scope.
335-
The following example adds instructions to return the ``foo`` claim when the ``bar`` scope is granted::
338+
The following example adds instructions to return the ``foo`` claim when the ``bar`` scope is granted:
339+
340+
.. code-block:: python
341+
336342
class CustomOAuth2Validator(OAuth2Validator):
337343
oidc_claim_scope = OAuth2Validator.oidc_claim_scope
338344
oidc_claim_scope.update({"foo": "bar"})

docs/settings.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ If unset, the default location is used, eg if ``django-oauth-toolkit`` is
354354
mounted at ``/o/``, it will be ``<server-address>/o/userinfo/``.
355355

356356
OIDC_RP_INITIATED_LOGOUT_ENABLED
357-
~~~~~~~~~~~~~~~~~~~~~~~~
357+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
358358
Default: ``False``
359359

360360
When is set to ``False`` (default) the `OpenID Connect RP-Initiated Logout <https://openid.net/specs/openid-connect-rpinitiated-1_0.html>`_
@@ -369,13 +369,13 @@ Whether to always prompt the :term:`Resource Owner` (End User) to confirm a logo
369369
:term:`Client` (Relying Party). If it is disabled the :term:`Resource Owner` (End User) will only be prompted if required by the standard.
370370

371371
OIDC_RP_INITIATED_LOGOUT_STRICT_REDIRECT_URIS
372-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
372+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
373373
Default: ``False``
374374

375375
Enable this setting to require `https` in post logout redirect URIs. `http` is only allowed when a :term:`Client` is `confidential`.
376376

377377
OIDC_RP_INITIATED_LOGOUT_ACCEPT_EXPIRED_TOKENS
378-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
378+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
379379
Default: ``True``
380380

381381
Whether expired ID tokens are accepted for RP-Initiated Logout. The Tokens must still be signed by the OP and otherwise valid.

docs/views/details.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ inside their Django applications.
1717

1818
.. automodule:: oauth2_provider.views.mixins
1919
:members:
20+
:noindex:
2021

2122
Base
2223
----

oauth2_provider/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ class Meta(AbstractRefreshToken.Meta):
557557
class AbstractIDToken(models.Model):
558558
"""
559559
An IDToken instance represents the actual token to
560-
access user's resources, as in :openid:`2`.
560+
access user's resources, as defined in the OpenID Connect specification.
561561
562562
Fields:
563563

0 commit comments

Comments
 (0)