Skip to content

Commit 0a51641

Browse files
committed
Merge branch 'main' into logout-template
# Conflicts: # packages/hidp/hidp/otp/views.py
2 parents 3061e47 + 20ccc58 commit 0a51641

File tree

31 files changed

+745
-204
lines changed

31 files changed

+745
-204
lines changed

.github/actions/build-hidp-docs/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ runs:
99
uses: ./.github/actions/setup-python
1010
with:
1111
working-directory: './packages/hidp'
12+
python-version: '3.13'
13+
django-version: '5.2'
1214

1315
- name: Build documentation
1416
run: |

.github/actions/python-qa/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ description: Lint, checks & tests
44
inputs:
55
working-directory:
66
description: The working directory to run the commands in
7+
python-version:
8+
description: The Python version to use
9+
django-version:
10+
description: The Django version to use as dependency
711

812
runs:
913
using: composite
@@ -13,10 +17,15 @@ runs:
1317
uses: ./.github/actions/setup-python
1418
with:
1519
working-directory: ${{ inputs.working-directory }}
20+
python-version: ${{ inputs.python-version }}
21+
django-version: ${{ inputs.django-version }}
1622

1723
- name: Lint, check, test and build (if applicable)
1824
run: |
1925
source ~/.venv/bin/activate
26+
UV_DJANGO_VERSION=$(uv pip list | sed -nE 's/^django[[:space:]]+([0-9]+\.[0-9]+)\..*/\1/p')
27+
echo "Detected uv Django version: $UV_DJANGO_VERSION"
28+
echo "Expected Django version: $DJANGO_VERSION"
2029
make test
2130
working-directory: ${{ inputs.working-directory }}
2231
shell: bash

.github/actions/setup-python/action.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ description: Setup Python and install dependencies
44
inputs:
55
working-directory:
66
description: The working directory to run the commands in
7+
python-version:
8+
description: The Python version to use
9+
django-version:
10+
description: The Django version to use as dependency
711

812
runs:
913
using: composite
@@ -12,7 +16,7 @@ runs:
1216
- name: Setup Python
1317
uses: actions/setup-python@v5
1418
with:
15-
python-version: "3.12"
19+
python-version: ${{ inputs.python-version }}
1620

1721
- name: Install system packages (gettext)
1822
run: |
@@ -30,6 +34,13 @@ runs:
3034
working-directory: ${{ inputs.working-directory }}
3135
shell: bash
3236

37+
- name: Set Django version
38+
run: |
39+
echo ::group::Set Django version environment variable
40+
echo "DJANGO_VERSION=${{ inputs.django-version }}" >> $GITHUB_ENV
41+
echo ::endgroup::
42+
shell: bash
43+
3344
- name: Install dependencies
3445
run: |
3546
echo ::group::Create/activate virtualenv

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
uses: ./.github/actions/python-qa
4040
with:
4141
working-directory: './packages/hidp'
42+
django-version: '5.2'
43+
python-version: '3.13'
4244

4345
- name: Publish to PyPI
4446
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,22 @@ on:
1313

1414
jobs:
1515
test:
16-
name: Linting, checks & tests
16+
name: Linting, checks & tests (${{ toJSON(matrix) }})
1717

1818
strategy:
1919
matrix:
20-
working-directory:
21-
- './packages/hidp'
22-
- './project'
20+
django-version: ['4.2', '5.2']
21+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
22+
working-directory: ['./packages/hidp']
23+
exclude:
24+
- django-version: '4.2'
25+
python-version: '3.13'
26+
- django-version: '5.2'
27+
python-version: '3.9'
28+
include:
29+
- working-directory: './project'
30+
python-version: '3.12'
31+
django-version: '4.2'
2332

2433
runs-on: ubuntu-latest
2534
timeout-minutes: 10
@@ -40,10 +49,12 @@ jobs:
4049
uses: ./.github/actions/python-qa
4150
with:
4251
working-directory: ${{ matrix.working-directory }}
52+
django-version: ${{ matrix.django-version }}
53+
python-version: ${{ matrix.python-version }}
4354

4455
- name: Build documentation
4556
uses: ./.github/actions/build-hidp-docs
46-
if: ${{ matrix.working-directory == './packages/hidp' }}
57+
if: ${{ matrix.working-directory == './packages/hidp' && matrix.django-version == '4.2' && matrix.python-version == '3.12' }}
4758

4859
# Report success/failure
4960
success:

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22

33
Leukeleu's headless identity provider.
44

5+
## Documentation
6+
7+
Read the [online documentation](https://leukeleu.github.io/django-hidp/) for usage and installation instructions.
8+
59
## Development
610

711
See [docker/README.md](docker/README.md)
812

913
## Releasing
1014

1115
Each PR merged to `main` will automatically run the `release-drafter` workflow. This will create/update
12-
draft releases for both the next release candidate and the next final release. The draft release will
13-
contain all the PRs merged since the previous release of the same type.
16+
draft releases for the next final release. The draft release will contain all the PRs merged since the
17+
previous release.
1418

1519
Publishing a release is done by editing the draft release, double checking the PRs and then clicking the
1620
"Publish release" button. This will create a new release and tag the commit with the version number.

SECURITY.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Security Policy
2+
3+
In case you have found a security issue within ANY HIdP project please do NOT open public GitHub issues, pull requests or anything that could leak sensitive information to the public.
4+
5+
Leukeleu asks you to instead responsibly report the security issue by email to [email protected].
6+
7+
Your email is sent to the security team of Leukeleu. A member of the organization will respond to you acknowledging your initial email and then, depending on the action to be taken, further follow-up emails afterwards.
8+
9+
## Scope of this policy
10+
11+
This policy applies to all HIdP projects hosted under the GitHub organization [Leukeleu](`github.com/leukeleu`).
12+
13+
## Supported Versions
14+
15+
We currently support the following versions of HIdP projects with security updates:
16+
- Latest stable release
17+
- Previous stable release
18+
19+
## Response Time
20+
21+
Leukeleu aims to respond to security reports within 5 business days. Resolution times may vary depending on the complexity of the issue.
22+
23+
## Third-Party Dependencies
24+
25+
If the security issue is related to a third-party dependency, we recommend reporting the issue directly to the respective maintainers. Leukeleu will assist in updating the dependency once a fix is available.

packages/hidp/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ clean:
141141
##
142142

143143
../../var/requirements_frozen.txt:
144-
uv pip compile pyproject.toml --extra oidc_provider -q -o "${@}" --no-annotate --no-header
144+
# Pin Django directly to LTS version provided by the test matrix
145+
echo 'Django~=${DJANGO_VERSION}.0' > ../../var/constraints.txt
146+
uv pip compile pyproject.toml --extra oidc_provider -q -o "${@}" --no-annotate --no-header --constraints ../../var/constraints.txt
145147
@echo "### Package dependencies :package:" >> ${GITHUB_STEP_SUMMARY}
146148
@echo '```' >> ${GITHUB_STEP_SUMMARY}
147149
@cat "${@}" >> ${GITHUB_STEP_SUMMARY}

packages/hidp/docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ registering and authenticating users in Django projects.
1414
:maxdepth: 2
1515
installation
1616
installation-extras
17+
registration
1718
configure-oidc-clients
1819
configure-as-oidc-provider
1920
content-security-policy
@@ -24,6 +25,7 @@ templates
2425
translations
2526
management-commands
2627
rate-limiting
28+
terms-of-service
2729
:::
2830

2931
# Indices and tables

packages/hidp/docs/installation.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
full-featured authentication system for Django projects.
55

66
HIdP provides all the default Django authentication functionalities and more:
7-
- Registration (including email verification)
7+
- Registration (including email verification) (see [Registration](project:registration.md))
88
- OpenID Connect (OIDC) Clients (Google and Microsoft included)
99
- One-time passwords (OTP)
1010
- Rate limiting
@@ -101,12 +101,18 @@ AUTH_USER_MODEL = "accounts.User"
101101
```
102102

103103
### `REGISTRATION_ENABLED`
104-
Enable or disable registration in your Django settings (default is `False`):
104+
Enable or disable registration in your Django settings:
105105

106106
```python
107107
REGISTRATION_ENABLED = False
108108
```
109109

110+
:::{note}
111+
If `REGISTRATION_ENABLED` is not defined, it defaults to `True`. In a future version of HIdP, registration will be disabled if `REGISTRATION_ENABLED` is not defined. It is recommended to explicitly set `REGISTRATION_ENABLED` to `True` or `False` in your settings.
112+
:::
113+
114+
See [Registration](project:registration.md) for more information on how HIdP handles account registration.
115+
110116
### `OTP_TOTP_ISSUER`
111117

112118
Specifies the issuer name to be used in the Time-based One-Time Password (TOTP) URI.
@@ -138,8 +144,8 @@ LOGOUT_REDIRECT_URL = "/"
138144
HIdP comes with a set of extra password validators that can be added to
139145
`settings.AUTH_PASSWORD_VALIDATORS` if desired. See [Password Validators](project:password-validation.md)
140146
for more information.
141-
142147
:::
148+
143149
### OpenID Connect based login (social accounts)
144150

145151
To enable users to log in using an existing Google, Microsoft or any other provider that
@@ -184,10 +190,16 @@ urlpatterns = [
184190

185191
### Cache
186192

187-
HIdP requires a caching implementation, in order for the rate limits to properly work
188-
and to store OIDC Provider signing keys. See [Django's cache framework](https://docs.djangoproject.com/en/stable/topics/cache/#django-s-cache-framework).
193+
HIdP requires a working Django cache backend to support rate limiting and to store
194+
OIDC Provider signing keys. A persistent and reliable cache is necessary for correct
195+
operation, especially for features like rate limiting and session management.
196+
197+
For production deployments, it is strongly recommended to use a robust cache backend
198+
such as Redis or Memcached. For more details on cache requirements for rate limiting,
199+
see the [django-ratelimit documentation](https://django-ratelimit.readthedocs.io/en/stable/installation.html#create-or-use-a-compatible-cache)
200+
and [Django's cache framework](https://docs.djangoproject.com/en/stable/topics/cache/#django-s-cache-framework).
189201

190-
For example a Redis cache:
202+
#### Redis Cache Configuration:
191203

192204
```python
193205
CACHES = {

0 commit comments

Comments
 (0)