Commit Graph

29 Commits

Author SHA1 Message Date
renovate[bot]
cda4373544 ⬆️(dependencies) update django to v5.0.7 [SECURITY] 2024-07-12 19:23:55 +02:00
renovate[bot]
ed24beb0f6 ⬆️(dependencies) update djangorestframework to v3.15.2 [SECURITY] 2024-06-27 18:17:46 +02:00
renovate[bot]
928fed9ac7 ⬆️(dependencies) update python dependencies 2024-06-27 18:08:39 +02:00
renovate[bot]
35a897fa60 ⬆️(dependencies) update python dependencies 2024-06-16 23:55:07 +02:00
renovate[bot]
5d1e2bd39d ⬆️(dependencies) update python dependencies 2024-06-03 09:49:51 +02:00
renovate[bot]
04717fd629 ⬆️(dependencies) update python dependencies 2024-05-31 12:53:11 +02:00
renovate[bot]
b12992f125 ⬆️(dependencies) update python dependencies 2024-05-09 23:15:12 +02:00
renovate[bot]
cda59fecec ⬆️(dependencies) update python dependencies 2024-04-22 13:46:27 +02:00
renovate[bot]
1704ba1707 ⬆️(dependencies) update gunicorn to v22 [SECURITY] 2024-04-17 11:23:11 +02:00
renovate[bot]
a1f9cf0854 ⬆️(dependencies) update python dependencies 2024-04-16 10:27:16 +02:00
renovate[bot]
711abcb49f ⬆️(dependencies) update python dependencies 2024-04-08 15:35:12 +02:00
renovate[bot]
e9a628f816 ⬆️(dependencies) update python dependencies 2024-04-02 11:11:42 +02:00
renovate[bot]
32fa653c12 ⬆️(dependencies) update python dependencies 2024-03-25 08:54:42 +01:00
renovate[bot]
2d0fb0ef70 ⬆️(dependencies) update python dependencies 2024-03-21 15:46:42 +01:00
Marie PUPO JEAMMET
7ef67037c3 (backend) convert invitations to accesses
Convert related invitations to accesses upon creating a new identity.
2024-03-21 12:14:10 +01:00
Lebaud Antoine
44b5999df8 🔧(backend) configure RedisCache in production settings
In development, sessions are saved in local memory. It's working well,
however it doesn't adapt to a kubernetized setup. Several pods need
to access the current sessions, which need to be stored in a single
source of truth.

With a local memory cache, pods cannot read session saved in other pods.
We end up returning 401 errors, because we cannot authenticate the user.

I preferred setting up a proper cache than storing sessions in database,
because in the long run it would be a performance bottleneck. Cache will
decrease data access latency when reading current sessions.

I added a Redis cache backend to the production settings. Sessions would
be persisted to Redis. In K8s, a Redis operator will make sure the cached
data are not lost.

Two new dependencies were added, redis and django-redis.

I followed the installation guide of django-redis dependency. These
setting were tested deploying the app to a local K8s cluster.
2024-03-19 16:57:27 +01:00
renovate[bot]
421ef899da ⬆️(dependencies) update python dependencies 2024-03-11 12:25:23 +01:00
Lebaud Antoine
b4e4940fd7 🚨(backend) update Ruff config to suppress deprecation warning
When running make ruff-check, a warning informs the user that
some config are deprecated, and gives her the step to migrate.

This warning appears after Ruff released its v0.2.0.
Fix it, by keeping our pyproject.toml up to date.
2024-03-07 11:31:31 +01:00
renovate[bot]
dad81c8d73 ⬆️(dependencies) update python dependencies 2024-03-07 11:31:31 +01:00
renovate[bot]
29d274ab7c ⬆️(dependencies) update python dependencies 2024-02-28 14:21:49 +01:00
Lebaud Antoine
38c4d33791 (backend) support Authorization code flow
Integrate 'mozilla-django-oidc' dependency, to support
Authorization Code flow, which is required by Agent Connect.

Thus, we provide a secure back channel OIDC flow, and return
to the client only a session cookie.

Done:
- Replace JWT authentication by Session based authentication in DRF
- Update Django settings to make OIDC configurations easily editable
- Add 'mozilla-django-oidc' routes to our router
- Implement a custom Django Authentication class to adapt
'mozilla-django-oidc' to our needs

'mozilla-django-oidc' routes added are:
- /authenticate
- /callback (the redirect_uri called back by the Idp)
- /logout
2024-02-22 11:59:36 +01:00
renovate[bot]
7d90092020 ⬆️(dependencies) update python dependencies 2024-02-19 10:08:28 +01:00
renovate[bot]
9981b9c615 ⬆️(dependencies) update django to v5.0.2 [SECURITY] 2024-02-12 12:00:30 +01:00
renovate[bot]
1d4d4ee902 ⬆️(dependencies) update python dependencies 2024-02-12 10:38:36 +01:00
renovate[bot]
6a0ed04b0d ⬆️(dependencies) update python dependencies 2024-02-05 13:22:56 +01:00
renovate[bot]
6abcf98ad2 ⬆️(dependencies) update python dependencies
Fix new linter issues introduced by Ruff's upgrade.
2024-01-29 15:48:23 +01:00
Samuel Paccoud - DINUM
8b026078bc (models) make user and authentication work with Keycloak and admin
The admin was broken as we did not worry about it up to now. On the frontend
we want to use OIDC authentication only but for the admin, it is better if
the default authentication works as well. To allow this, we propose to add
an "email" field to the user model and make it the identifier in place of
the usual username. Some changes are necessary to make the "createsuperuser"
management command work.

We also had to fix the "oidc_user_getter" method to make it work with Keycloak.
Some tests were added to secure that everything works as expected.
2024-01-17 13:37:55 +01:00
Samuel Paccoud - DINUM
8ebfb8715d 🚨(pylint) make pylint work and fix issues found
Pylint was not installed and wrongly configured. After making
it work, we fix all the issues found so it can be added to our
CI requirements.
2024-01-05 15:31:43 +01:00
Samuel Paccoud - DINUM
eeec372957 (project) first proof of concept based of Joanie
Used https://github.com/openfun/joanie as boilerplate, ran a few
transformations with ChapGPT  and adapted models and endpoints to
fit to my current vision of the project.
2024-01-03 16:31:08 +01:00