Page MenuHomeSoftware Heritage

tests/auth/test_backends: Document each test case
ClosedPublic

Authored by anlambert on Jun 18 2020, 12:13 PM.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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 test
commit 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 T2247

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/190/ for more details.

This revision is now accepted and ready to land.Jun 18 2020, 1:44 PM