Skip to content

Commit 6422ac0

Browse files
authored
Merge pull request #20 from oreillymedia/format
UA-4672 | Bring in everyone's changes to one branch
2 parents 15c8705 + 8e01a75 commit 6422ac0

File tree

83 files changed

+3519
-2086
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3519
-2086
lines changed

.github/workflows/main.yml

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,61 @@
1-
name: Django Tests CI
2-
1+
name: "CI"
32
on:
43
push:
54
branches: ["master", "develop"]
65
pull_request:
7-
branches: ["develop"]
6+
7+
concurrency:
8+
group: check-${{ github.ref }}
9+
cancel-in-progress: true
810

911
jobs:
10-
tests:
12+
formatting:
13+
name: "Check Code Formatting"
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: astral-sh/ruff-action@v3
18+
with:
19+
args: "--version"
20+
- run: "ruff format --check --diff"
21+
22+
linting:
23+
name: "Check Code Linting"
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: astral-sh/ruff-action@v3
28+
with:
29+
args: "--version"
30+
- run: "ruff check --diff"
31+
32+
test_matrix_prep:
33+
name: "Prepare Test Matrix"
34+
runs-on: ubuntu-latest
35+
outputs:
36+
matrix: "${{ steps.set-matrix.outputs.matrix }}"
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: astral-sh/setup-uv@v3
40+
- run: uv tool install tox
41+
- id: set-matrix
42+
run: |
43+
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: .}')
44+
echo "matrix=$matrix" >> $GITHUB_OUTPUT
45+
46+
test:
47+
name: "Test Django ${{ matrix.django }} | Python ${{ matrix.python }}"
48+
needs: test_matrix_prep
1149
runs-on: ubuntu-latest
50+
strategy:
51+
fail-fast: false
52+
matrix: ${{ fromJson(needs.test_matrix_prep.outputs.matrix) }}
1253
steps:
13-
- uses: actions/checkout@v3
54+
- uses: actions/checkout@v4
55+
- uses: astral-sh/setup-uv@v3
56+
- run: uv tool install tox
1457
- uses: actions/setup-python@v4
1558
with:
16-
python-version: |
17-
3.8
18-
3.9
19-
3.10
20-
3.11
21-
- name: Install tox
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install tox
59+
python-version: ${{ matrix.python }}
2560
- name: Run tox
26-
run: tox
61+
run: tox run --skip-missing-interpreters=false -e py$(echo "${{ matrix.python }}" | tr -d '.')-django$(echo "${{ matrix.django }}" | tr -d '.')

.vscode/settings.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
"[python]": {
33
"editor.formatOnSave": true,
44
"editor.codeActionsOnSave": {
5-
"source.fixAll": "explicit",
6-
"source.organizeImports": "explicit"
5+
"source.fixAll.ruff": "explicit",
6+
"source.organizeImports.ruff": "explicit"
77
},
88
"editor.defaultFormatter": "charliermarsh.ruff"
9-
}
9+
},
10+
"ruff.enable": true,
11+
"ruff.nativeServer": true,
12+
"python.analysis.ignore": ["*"],
13+
"python.analysis.autoImportCompletions": false,
14+
"pylint.enabled": false
1015
}

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Django OpenID Connect Provider
22

33
[![Python Versions](https://img.shields.io/pypi/pyversions/django-oidc-provider.svg)](https://pypi.python.org/pypi/django-oidc-provider)
4-
[![Django Versions](https://img.shields.io/badge/Django-3.2%20%7C%204.2-green)](https://pypi.python.org/pypi/django-oidc-provider)
4+
[![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)
55
[![PyPI Versions](https://img.shields.io/pypi/v/django-oidc-provider.svg)](https://pypi.python.org/pypi/django-oidc-provider)
66
[![Documentation Status](https://readthedocs.org/projects/django-oidc-provider/badge/?version=master)](http://django-oidc-provider.readthedocs.io/)
77

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

2020
[Do you want to contribute? Please read this.](http://django-oidc-provider.readthedocs.io/en/master/sections/contribute.html)
21+
22+
## Thanks to our sponsors
23+
24+
[![Agilentia](https://avatars.githubusercontent.com/u/1707212?s=60&v=4)](https://github.com/agilentia)

docs/conf.py

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
extensions = []
3232

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

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

4343
# The master toctree document.
44-
master_doc = 'index'
44+
master_doc = "index"
4545

4646
# General information about the project.
47-
project = u'django-oidc-provider'
48-
copyright = u'2025, Juan Ignacio Fiorentino'
49-
author = u'Juan Ignacio Fiorentino'
47+
project = "django-oidc-provider"
48+
copyright = "2025, Juan Ignacio Fiorentino"
49+
author = "Juan Ignacio Fiorentino"
5050

5151
# The version info for the project you're documenting, acts as replacement for
5252
# |version| and |release|, also used in various other places throughout the
5353
# built documents.
5454
#
5555
# The short X.Y version.
56-
version = u'0.8'
56+
version = "0.8"
5757
# The full version, including alpha/beta/rc tags.
58-
release = u'0.8'
58+
release = "0.8"
5959

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

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

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

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

9292
# The name of the Pygments (syntax highlighting) style to use.
93-
pygments_style = 'sphinx'
93+
pygments_style = "sphinx"
9494

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

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

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

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

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

203203
# -- Options for LaTeX output ---------------------------------------------
204204

205205
latex_elements = {
206206
# The paper size ('letterpaper' or 'a4paper').
207207
# 'papersize': 'letterpaper',
208-
209208
# The font size ('10pt', '11pt' or '12pt').
210209
# 'pointsize': '10pt',
211-
212210
# Additional stuff for the LaTeX preamble.
213211
# 'preamble': '',
214-
215212
# Latex figure (float) alignment
216213
# 'figure_align': 'htbp',
217214
}
@@ -220,8 +217,13 @@
220217
# (source start file, target name, title,
221218
# author, documentclass [howto, manual, or own class]).
222219
latex_documents = [
223-
(master_doc, 'django-oidc-provider.tex', u'django-oidc-provider Documentation',
224-
u'Juan Ignacio Fiorentino', 'manual'),
220+
(
221+
master_doc,
222+
"django-oidc-provider.tex",
223+
"django-oidc-provider Documentation",
224+
"Juan Ignacio Fiorentino",
225+
"manual",
226+
),
225227
]
226228

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

257258
# If true, show URL addresses after external links.
@@ -264,9 +265,15 @@
264265
# (source start file, target name, title, author,
265266
# dir menu entry, description, category)
266267
texinfo_documents = [
267-
(master_doc, 'django-oidc-provider', u'django-oidc-provider Documentation',
268-
author, 'django-oidc-provider', 'One line description of project.',
269-
'Miscellaneous'),
268+
(
269+
master_doc,
270+
"django-oidc-provider",
271+
"django-oidc-provider Documentation",
272+
author,
273+
"django-oidc-provider",
274+
"One line description of project.",
275+
"Miscellaneous",
276+
),
270277
]
271278

272279
# Documents to append as an appendix to all manuals.
@@ -328,7 +335,7 @@
328335
# epub_post_files = []
329336

330337
# A list of files that should not be packed into the epub file.
331-
epub_exclude_files = ['search.html']
338+
epub_exclude_files = ["search.html"]
332339

333340
# The depth of the table of contents in toc.ncx.
334341
# epub_tocdepth = 3

docs/sections/changelog.rst

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,28 @@ All notable changes to this project will be documented in this file.
88
Unreleased
99
==========
1010

11-
None
11+
0.9.0
12+
=====
13+
14+
*2025-09-23*
15+
16+
* Changed: Use PyJWT+cryptography instead of jwkest+Cryptodrome.
17+
* Added: Translation to Russian.
18+
* Changed: Ruff as a fast Python linter and code formatter.
19+
* Fixed: client_id sanitization to prevent database errors.
20+
21+
0.8.4
22+
=====
23+
24+
*2025-05-24*
25+
26+
* Added: test package against Python 3.12 and 3.13.
27+
* Added: test package against Django 5.
28+
* Added: support of max_age parameter on authorization request.
29+
* Added: Passing Request Parameters as JWTs now returning request_not_supported error.
30+
* Added: Simplified chinese translation.
31+
* Changed: ID Token JSON encoder improved using DjangoJSONEncoder.
32+
* Changed: Use unittest.mock in tests. Remove mock library.
1233

1334
0.8.3
1435
=====

docs/sections/contribute.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Improve Documentation
3434

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

37-
* Install Sphinx (``pip install sphinx sphinx_rtd_theme``) and the auto-build tool (``pip install sphinx-autobuild``).
37+
* Install Sphinx and the auto-build tool (``pip install sphinx sphinx_rtd_theme sphinx-autobuild``).
3838
* Move inside the docs folder. ``cd docs/``
3939
* Generate and watch docs by running ``sphinx-autobuild . _build/``.
4040
* Open ``http://127.0.0.1:8000`` in a browser.

docs/sections/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Installation
66
Requirements
77
============
88

9-
* Python: ``3.8`` ``3.9`` ``3.10`` ``3.11``
10-
* Django: ``3.2`` ``4.2``
9+
* Python: ``3.8`` ``3.9`` ``3.10`` ``3.11`` ``3.12``
10+
* Django: ``3.2`` ``4.2`` ``5.1``
1111

1212
Quick Installation
1313
==================

docs/sections/templates.rst

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Templates
66
Add your own templates files inside a folder named ``templates/oidc_provider/``.
77
You can copy the sample html files here and customize them with your own style.
88

9-
**authorize.html**::
9+
authorize.html
10+
==============
11+
::
1012

1113
<h1>Request for Permission</h1>
1214

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

3032
</form>
3133

32-
**error.html**::
34+
error.html
35+
==========
36+
::
3337

3438
<h3>{{ error }}</h3>
3539
<p>{{ description }}</p>
@@ -51,3 +55,18 @@ The following contexts will be passed to the ``authorize`` and ``error`` templat
5155
'error': 'string stating the error',
5256
'description': 'string stating description of the error'
5357
}
58+
59+
end_session_prompt.html
60+
=======================
61+
62+
Read more at :doc:`Session Management > Logout consent prompt </sections/sessionmanagement>` section.
63+
64+
end_session_completed.html
65+
==========================
66+
67+
Read more at :doc:`Session Management > Other scenarios <../sections/sessionmanagement>` section.
68+
69+
end_session_failed.html
70+
=======================
71+
72+
Read more at :doc:`Session Management > Other scenarios <../sections/sessionmanagement>` section.

example/Dockerfile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1-
FROM python:3-onbuild
1+
FROM python:3.11-slim
2+
3+
WORKDIR /usr/src/app
4+
5+
# Copy requirements and install dependencies
6+
COPY requirements.txt .
7+
RUN pip install --upgrade pip && \
8+
pip install --no-cache-dir -r requirements.txt
9+
10+
# Copy application code
11+
COPY . .
212

313
RUN [ "python", "manage.py", "migrate" ]
414
RUN [ "python", "manage.py", "creatersakey" ]
15+
16+
# Create superuser with admin:admin credentials
17+
ENV DJANGO_SUPERUSER_USERNAME=admin
18+
19+
ENV DJANGO_SUPERUSER_PASSWORD=admin
20+
RUN [ "python", "manage.py", "createsuperuser", "--noinput" ]
21+
522
EXPOSE 8000
623
CMD [ "python", "manage.py", "runserver", "0.0.0.0:8000" ]

0 commit comments

Comments
 (0)