Skip to content
Open
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
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
extensions.append("sphinx.ext.intersphinx")
intersphinx_mapping = {
"python3": ("https://docs.python.org/3.6", None),
"django": ("http://django.readthedocs.org/en/latest/", None),
"django": ("https://django.readthedocs.io/en/latest/", None),
}


Expand Down
3 changes: 3 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ tests both ways. You can see the configurations used in tests/settings.py and te

When there are multiple databases defined, Django tests will not work unless they are told which database(s) to work with.
For test writers this means any test must either:

- instead of Django's TestCase or TransactionTestCase use the versions of those
classes defined in tests/common_testing.py
- when using pytest's `django_db` mark, define it like this:
Expand Down Expand Up @@ -386,12 +387,14 @@ working on multiple branches with different dependencies.
You can use uv sync to set up your environment and install dependencies and run python::

.. code-block:: bash

uv sync # checks deps, installs virtualenv and dependencies as necessary
uv run ... # runs command in the uv environment, syncs deps and python version first if necessary

To run tox uv use `tox uv <https://github.com/tox-dev/tox-uv>`__::

.. code-block:: bash

uv tool install tox --with tox-uv # use uv to install
tox --version # validate you are using the installed tox
tox r -e py312 # will use uv
3 changes: 1 addition & 2 deletions docs/management_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ createapplication

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

.. code-block:: sh
.. code-block:: console
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sphinx complains:

Skip system checks.' as "sh" resulted in an error at token: "'". Retrying in relaxed mode.

console makes more sense: https://pygments.org/docs/lexers/#pygments.lexers.shell.BashSessionLexer


usage: manage.py createapplication [-h] [--client-id CLIENT_ID] [--user USER]
[--redirect-uris REDIRECT_URIS]
Expand Down Expand Up @@ -91,4 +91,3 @@ The ``createapplication`` management command provides a shortcut to create a new
--skip-checks Skip system checks.

If you let ``createapplication`` auto-generate the secret then it displays the value before hashing it.

2 changes: 2 additions & 0 deletions docs/oidc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ mapping a claim name to claim data::
The second form gets no request object, and should return a dictionary
mapping a claim name to a callable, accepting a request and producing
the claim data::

class CustomOAuth2Validator(OAuth2Validator):
# Extend the standard scopes to add a new "permissions" scope
# which returns a "permissions" claim:
Expand Down Expand Up @@ -333,6 +334,7 @@ For example, a ``given_name`` claim is only returned if the ``profile`` scope wa
To change the list of claims and which scopes result in their being returned,
override ``oidc_claim_scope`` with a dict keyed by claim with a value of scope.
The following example adds instructions to return the ``foo`` claim when the ``bar`` scope is granted::

class CustomOAuth2Validator(OAuth2Validator):
oidc_claim_scope = OAuth2Validator.oidc_claim_scope
oidc_claim_scope.update({"foo": "bar"})
Expand Down
6 changes: 3 additions & 3 deletions docs/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ If unset, the default location is used, eg if ``django-oauth-toolkit`` is
mounted at ``/o/``, it will be ``<server-address>/o/userinfo/``.

OIDC_RP_INITIATED_LOGOUT_ENABLED
~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Default: ``False``

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

OIDC_RP_INITIATED_LOGOUT_STRICT_REDIRECT_URIS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Default: ``False``

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

OIDC_RP_INITIATED_LOGOUT_ACCEPT_EXPIRED_TOKENS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Default: ``True``

Whether expired ID tokens are accepted for RP-Initiated Logout. The Tokens must still be signed by the OP and otherwise valid.
Expand Down
2 changes: 1 addition & 1 deletion docs/views/class_based.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ using the *Class Based View* approach.
return HttpResponse('Hello, World!')


Generic views in DOT are obtained composing a set of mixins you can find in the :doc:`views.mixins <mixins>`
Generic views in DOT are obtained composing a set of mixins you can find in the :ref:`Mixins`
module: feel free to use those mixins directly if you want to provide your own class based views.
2 changes: 2 additions & 0 deletions docs/views/details.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Scopes handling.
.. automodule:: oauth2_provider.views.generic
:members:

.. _mixins:

Mixins
------
These views are mainly for internal use, but advanced users may use them as basic components to customize OAuth2 logic
Expand Down
5 changes: 0 additions & 5 deletions docs/views/mixins.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/views/views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ Django OAuth Toolkit provides a set of pre-defined views for different purposes:
class_based
application
token
mixins
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sphinx complains:

WARNING: duplicate object description of oauth2_provider.views.mixins, other instance in views/details, use :no-index: for one of them

This is already fully documented here:

.. automodule:: oauth2_provider.views.mixins
:members:

Since the other reference has more context and the mixins are indeed more internal than user-facing, keep only those docs.

3 changes: 2 additions & 1 deletion oauth2_provider/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,8 @@ class Meta(AbstractRefreshToken.Meta):
class AbstractIDToken(models.Model):
"""
An IDToken instance represents the actual token to
access user's resources, as in :openid:`2`.
access user's resources, as in
`OpenID Connect Core 1.0 Section 2 <https://openid.net/specs/openid-connect-core-1_0.html#IDToken/>`_.
Comment on lines +565 to +566
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other parts of this file use a syntax like :rfc:`2.2`, which is parsed by

def rfclink(name, rawtext, text, lineno, inliner, options={}, content=[]):

No such support actually exists for a :openid:`2` syntax.

However, it's apparent that this is the intended external link.


Fields:

Expand Down
Loading