Page MenuHomeSoftware Heritage

auth: Use KeycloakOpenIDConnect class and fixture factory from swh-auth
ClosedPublic

Authored by anlambert on Mar 22 2021, 7:09 PM.

Details

Summary

The KeycloakOpenIDConnect class and its mocked version have been moved
to the swh-auth module in order to reuse them across multiple modules.

So remove duplicated code and adapt tests to use the fixture factory
function from swh.auth.pytest_plugin.

Related to T3150

Diff Detail

Repository
rDWAPPS Web applications
Branch
use-swh-auth-keycloak-oidc
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 20069
Build 31156: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 31155: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D5303 (id=18992)

Rebasing onto 65c0037d90...

Current branch diff-target is up to date.
Changes applied before test
commit 9b2507a81b4b30da13ee4f8d612bf85280fd04f4
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Mon Mar 22 19:02:24 2021 +0100

    auth: Use KeycloakOpenIDConnect class and fixture factory from swh-auth
    
    The KeycloakOpenIDConnect class and its mocked version have been moved
    to the swh-auth module in order to reuse them across multiple modules.
    
    So remove duplicated code and adapt tests to use the fixture factory
    function from swh.auth.pytest_plugin.
    
    Related to T3150

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

ardumont added inline comments.
swh/web/auth/backends.py
23–50

you might want to simplify this even further?

54–67

That might be worth pushing this upstream as well.

swh/web/auth/backends.py
23–50

I will do it tomorrow when moving the backends to swh-auth

54–67

Yes, I will do it tomorrow in the diff moving the backends.

lgtm

swh/web/auth/backends.py
23–50

d'oh, right ;)

This revision is now accepted and ready to land.Mar 23 2021, 9:14 AM