See https://forge.softwareheritage.org/D3304#80832
Depends on D3309.
Differential D3312
tests/auth/test_backends: Document each test case Authored by anlambert on Jun 18 2020, 12:13 PM.
Details
See https://forge.softwareheritage.org/D3304#80832 Depends on D3309.
Diff Detail
Event TimelineComment Actions Build is green Patch application report for D3312 (id=11723)Could not rebase; Attempt merge onto e926cadb92... Updating e926cadb..bf7f32c1 Fast-forward swh/web/api/throttling.py | 6 ++- swh/web/auth/backends.py | 5 +++ swh/web/auth/models.py | 39 ++++++++++++++++++- swh/web/tests/api/test_throttling.py | 35 +++++++++++++++++- swh/web/tests/auth/keycloak_mock.py | 20 ++++++++-- swh/web/tests/auth/sample_data.py | 27 ++++++++++++++ swh/web/tests/auth/test_backends.py | 72 +++++++++++++++++++++++++++++++++--- 7 files changed, 190 insertions(+), 14 deletions(-) Changes applied before testcommit bf7f32c14e87f860d946b04251d7be6acf868f4c
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date: Thu Jun 18 12:10:33 2020 +0200
tests/auth/test_backends: Document each test case
commit 644fcc014b1faa5003400dcaee5a831147feba6d
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date: Wed Jun 17 17:40:18 2020 +0200
api/throttling: Lift rate limit when user has special permission
If a Django user has the "swh.web.api.throttling_exempted" permission, he
will not be rate limited.
Related to T1927
commit 7e719461588132fdaf854e20ccf244b83bc607da
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date: Wed Jun 17 16:02:08 2020 +0200
auth: Map Keycloak user permissions to Django ones
Keycloak user permissions are named Roles in Keycloak semantics.
Extract them from each decoded access token and override methods from
django.contrib.auth.models.PermissionsMixin in order to manipulate them
as Django user permissions.
Closes T2247See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/190/ for more details. |