Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
82dcd8d
Update settings.rst
juanifioren Dec 18, 2023
f7c3134
Update LICENSE
juanifioren Dec 19, 2023
82fd925
Default ordering RSA keys + example app for Django 4.2
juanifioren Oct 3, 2024
94734e2
Update docs
juanifioren Oct 3, 2024
7086a49
Update docs
juanifioren Oct 4, 2024
a981a3d
Work on end_session_endpoint
juanifioren Dec 2, 2024
102f1c1
Work on end_session_endpoint
juanifioren Dec 2, 2024
8b29c30
Work on end_session_endpoint
juanifioren Dec 3, 2024
c9201d7
Work on end_session_endpoint
juanifioren Dec 4, 2024
981b779
Work on end_session_endpoint
juanifioren Dec 4, 2024
6a250a8
Work on end_session_endpoint
juanifioren Dec 4, 2024
98b9810
Work on end_session_endpoint
juanifioren Dec 4, 2024
b744992
Fix create_id_token with extra scope claims + add ruff as formatter.
juanifioren Dec 5, 2024
1756c20
Fix create_id_token with extra scope claims + add ruff as formatter.
juanifioren Dec 5, 2024
1a1c55c
Fix create_id_token with extra scope claims + add ruff as formatter.
juanifioren Dec 5, 2024
c20562e
Bump version 0.8.3
juanifioren Dec 6, 2024
2175027
Update README.md
juanifioren Dec 9, 2024
3eb11dc
Tox improvement + id token better serializer
juanifioren Dec 12, 2024
dd74057
docs
juanifioren Dec 12, 2024
67f1d89
tox
juanifioren Dec 12, 2024
41f8306
Update README.md
juanifioren Dec 12, 2024
d1be6fe
Update README.md
juanifioren Dec 13, 2024
836b49b
Docs improvement.
juanifioren Dec 13, 2024
e7b80a7
Replace mock with unittest.mock
juanifioren Dec 14, 2024
1001d26
Replace mock with unittest.mock
juanifioren Dec 14, 2024
114a975
Replace mock with unittest.mock
juanifioren Dec 14, 2024
61a1ff1
Request parameter + max_age parameter
juanifioren Dec 27, 2024
cb476c4
Request parameter + max_age parameter
juanifioren Dec 27, 2024
0948f5e
feat(translation): add simplified chinese translation
U8F69 Feb 17, 2025
76f17f5
Update changelog.
juanifioren Feb 18, 2025
c44c424
Add python 3.12 and 3.13 to tests
stefanfoulis Mar 11, 2025
b4afd68
Update setup.py
juanifioren Mar 27, 2025
4e1e5bf
Update changelog.rst
juanifioren Mar 27, 2025
41825b9
Bump version 0.8.4
juanifioren May 24, 2025
07db410
Added translation to Russian
sinyawskiy Feb 19, 2025
144fe6e
Added translation to Russian
sinyawskiy Feb 19, 2025
e7b9dcf
Update changelog.rst
juanifioren Jun 10, 2025
1582ffc
Update example folder.
juanifioren Aug 24, 2025
6070687
Enforce consistent formatting using ruff
stefanfoulis Aug 19, 2025
2c774de
run "ruff check --fix" and "ruff format" on entire codebase
stefanfoulis Aug 19, 2025
e2a1a2c
Add Ruff to output in problems tab.
juanifioren Aug 25, 2025
348db3c
Update changelog.rst
juanifioren Aug 26, 2025
c30d341
Run tests in matrix on github
stefanfoulis Aug 19, 2025
3ebaec4
Fixed client_id sanitization to prevent DB errors
juanifioren Aug 31, 2025
2bc44e4
Fixed client_id sanitization to prevent DB errors
juanifioren Aug 31, 2025
9297e24
Add Django 5.2 to our test matrix
stefanfoulis Sep 3, 2025
971a7cd
Update README.md
juanifioren Sep 3, 2025
5d4b479
Use PyJWT+cryptography instead of jwkest+Cryptodrome (#446)
stefanfoulis Sep 21, 2025
1db06d1
Update changelog.rst
juanifioren Sep 21, 2025
f8dbf99
Bump version 0.9.0
juanifioren Sep 23, 2025
bb6b326
Black format everything.
mcohoon Sep 30, 2025
4295fdc
UA-4672 | Merge branch 'master' of github.com:juanifioren/django-oidc…
mcohoon Sep 30, 2025
9e11030
UA-4672 | Merge branch 'juanifioren-master-pre' into format
mcohoon Sep 30, 2025
e0d1df6
Add missing import for secrets.token_hex
kdallege Sep 30, 2025
f13330d
format fixes
bendavis78 Sep 30, 2025
8e01a75
lint fixes
bendavis78 Sep 30, 2025
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
65 changes: 50 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,61 @@
name: Django Tests CI

name: "CI"
on:
push:
branches: ["master", "develop"]
pull_request:
branches: ["develop"]

concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
formatting:
name: "Check Code Formatting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
with:
args: "--version"
- run: "ruff format --check --diff"

linting:
name: "Check Code Linting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
with:
args: "--version"
- run: "ruff check --diff"

test_matrix_prep:
name: "Prepare Test Matrix"
runs-on: ubuntu-latest
outputs:
matrix: "${{ steps.set-matrix.outputs.matrix }}"
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- run: uv tool install tox
- id: set-matrix
run: |
matrix=$(tox -l | jq -Rc 'select(test("^py\\d+.*django\\d+")) | capture("^py(?<python>\\d+).*django(?<django>\\d+)") | {"python": (.python | tostring | .[0:1] + "." + .[1:]), "django": (.django | tostring | .[0:1] + "." + .[1:])}' | jq -sc '{include: .}')
echo "matrix=$matrix" >> $GITHUB_OUTPUT

test:
name: "Test Django ${{ matrix.django }} | Python ${{ matrix.python }}"
needs: test_matrix_prep
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.test_matrix_prep.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- run: uv tool install tox
- uses: actions/setup-python@v4
with:
python-version: |
3.8
3.9
3.10
3.11
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
python-version: ${{ matrix.python }}
- name: Run tox
run: tox
run: tox run --skip-missing-interpreters=false -e py$(echo "${{ matrix.python }}" | tr -d '.')-django$(echo "${{ matrix.django }}" | tr -d '.')
11 changes: 8 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
"source.fixAll.ruff": "explicit",
"source.organizeImports.ruff": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff"
}
},
"ruff.enable": true,
"ruff.nativeServer": true,
"python.analysis.ignore": ["*"],
"python.analysis.autoImportCompletions": false,
"pylint.enabled": false
}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Django OpenID Connect Provider

[![Python Versions](https://img.shields.io/pypi/pyversions/django-oidc-provider.svg)](https://pypi.python.org/pypi/django-oidc-provider)
[![Django Versions](https://img.shields.io/badge/Django-3.2%20%7C%204.2-green)](https://pypi.python.org/pypi/django-oidc-provider)
[![Django Versions](https://img.shields.io/badge/Django-3.2%20%7C%204.2%20%7C%205.2-green)](https://pypi.python.org/pypi/django-oidc-provider)
[![PyPI Versions](https://img.shields.io/pypi/v/django-oidc-provider.svg)](https://pypi.python.org/pypi/django-oidc-provider)
[![Documentation Status](https://readthedocs.org/projects/django-oidc-provider/badge/?version=master)](http://django-oidc-provider.readthedocs.io/)

Expand All @@ -18,3 +18,7 @@ Support for Python 3 and latest versions of django.
[Read documentation for more info.](http://django-oidc-provider.readthedocs.org/)

[Do you want to contribute? Please read this.](http://django-oidc-provider.readthedocs.io/en/master/sections/contribute.html)

## Thanks to our sponsors

[![Agilentia](https://avatars.githubusercontent.com/u/1707212?s=60&v=4)](https://github.com/agilentia)
55 changes: 31 additions & 24 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
extensions = []

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
Expand All @@ -41,28 +41,28 @@
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'django-oidc-provider'
copyright = u'2025, Juan Ignacio Fiorentino'
author = u'Juan Ignacio Fiorentino'
project = "django-oidc-provider"
copyright = "2025, Juan Ignacio Fiorentino"
author = "Juan Ignacio Fiorentino"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'0.8'
version = "0.8"
# The full version, including alpha/beta/rc tags.
release = u'0.8'
release = "0.8"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand All @@ -72,7 +72,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns = ["_build"]

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand All @@ -90,7 +90,7 @@
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand All @@ -106,7 +106,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -135,7 +135,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down Expand Up @@ -198,20 +198,17 @@
# html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = 'django-oidc-providerdoc'
htmlhelp_basename = "django-oidc-providerdoc"

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
# 'preamble': '',

# Latex figure (float) alignment
# 'figure_align': 'htbp',
}
Expand All @@ -220,8 +217,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'django-oidc-provider.tex', u'django-oidc-provider Documentation',
u'Juan Ignacio Fiorentino', 'manual'),
(
master_doc,
"django-oidc-provider.tex",
"django-oidc-provider Documentation",
"Juan Ignacio Fiorentino",
"manual",
),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -250,8 +252,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'django-oidc-provider', u'django-oidc-provider Documentation',
[author], 1)
(master_doc, "django-oidc-provider", "django-oidc-provider Documentation", [author], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -264,9 +265,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'django-oidc-provider', u'django-oidc-provider Documentation',
author, 'django-oidc-provider', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"django-oidc-provider",
"django-oidc-provider Documentation",
author,
"django-oidc-provider",
"One line description of project.",
"Miscellaneous",
),
]

# Documents to append as an appendix to all manuals.
Expand Down Expand Up @@ -328,7 +335,7 @@
# epub_post_files = []

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
epub_exclude_files = ["search.html"]

# The depth of the table of contents in toc.ncx.
# epub_tocdepth = 3
Expand Down
23 changes: 22 additions & 1 deletion docs/sections/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,28 @@ All notable changes to this project will be documented in this file.
Unreleased
==========

None
0.9.0
=====

*2025-09-23*

* Changed: Use PyJWT+cryptography instead of jwkest+Cryptodrome.
* Added: Translation to Russian.
* Changed: Ruff as a fast Python linter and code formatter.
* Fixed: client_id sanitization to prevent database errors.

0.8.4
=====

*2025-05-24*

* Added: test package against Python 3.12 and 3.13.
* Added: test package against Django 5.
* Added: support of max_age parameter on authorization request.
* Added: Passing Request Parameters as JWTs now returning request_not_supported error.
* Added: Simplified chinese translation.
* Changed: ID Token JSON encoder improved using DjangoJSONEncoder.
* Changed: Use unittest.mock in tests. Remove mock library.

0.8.3
=====
Expand Down
2 changes: 1 addition & 1 deletion docs/sections/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Improve Documentation

We use `Sphinx <http://www.sphinx-doc.org/>`_ to generate this documentation. If you want to add or modify something just:

* Install Sphinx (``pip install sphinx sphinx_rtd_theme``) and the auto-build tool (``pip install sphinx-autobuild``).
* Install Sphinx and the auto-build tool (``pip install sphinx sphinx_rtd_theme sphinx-autobuild``).
* Move inside the docs folder. ``cd docs/``
* Generate and watch docs by running ``sphinx-autobuild . _build/``.
* Open ``http://127.0.0.1:8000`` in a browser.
4 changes: 2 additions & 2 deletions docs/sections/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Installation
Requirements
============

* Python: ``3.8`` ``3.9`` ``3.10`` ``3.11``
* Django: ``3.2`` ``4.2``
* Python: ``3.8`` ``3.9`` ``3.10`` ``3.11`` ``3.12``
* Django: ``3.2`` ``4.2`` ``5.1``

Quick Installation
==================
Expand Down
23 changes: 21 additions & 2 deletions docs/sections/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Templates
Add your own templates files inside a folder named ``templates/oidc_provider/``.
You can copy the sample html files here and customize them with your own style.

**authorize.html**::
authorize.html
==============
::

<h1>Request for Permission</h1>

Expand All @@ -29,7 +31,9 @@ You can copy the sample html files here and customize them with your own style.

</form>

**error.html**::
error.html
==========
::

<h3>{{ error }}</h3>
<p>{{ description }}</p>
Expand All @@ -51,3 +55,18 @@ The following contexts will be passed to the ``authorize`` and ``error`` templat
'error': 'string stating the error',
'description': 'string stating description of the error'
}

end_session_prompt.html
=======================

Read more at :doc:`Session Management > Logout consent prompt </sections/sessionmanagement>` section.

end_session_completed.html
==========================

Read more at :doc:`Session Management > Other scenarios <../sections/sessionmanagement>` section.

end_session_failed.html
=======================

Read more at :doc:`Session Management > Other scenarios <../sections/sessionmanagement>` section.
19 changes: 18 additions & 1 deletion example/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
FROM python:3-onbuild
FROM python:3.11-slim

WORKDIR /usr/src/app

# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

RUN [ "python", "manage.py", "migrate" ]
RUN [ "python", "manage.py", "creatersakey" ]

# Create superuser with admin:admin credentials
ENV DJANGO_SUPERUSER_USERNAME=admin
ENV [email protected]
ENV DJANGO_SUPERUSER_PASSWORD=admin
RUN [ "python", "manage.py", "createsuperuser", "--noinput" ]

EXPOSE 8000
CMD [ "python", "manage.py", "runserver", "0.0.0.0:8000" ]
Loading
Loading