Page MenuHomeSoftware Heritage

keycloak: Open from_config* method to instantiate KeycloakOpenIDConnect
ClosedPublic

Authored by ardumont on Mar 5 2021, 2:12 PM.

Diff Detail

Repository
rDAUTH Common authentication libraries
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 D5201 (id=18636)

Rebasing onto bd3d8437f1...

Current branch diff-target is up to date.
Changes applied before test
commit 16d48b094f3e808bcb3cbe2f5c4d36114a433853
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Mar 5 14:11:13 2021 +0100

    keycloak: Open from_config* method to instantiate KeycloakOpenIDConnect
    
    Related to T3079

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

anlambert added inline comments.
swh/auth/keycloak.py
181

You should allow to override the config with keyword arguments (as in listers).

config = dict(load_from_envvar())
config.update({k: v for k, v in kwargs.items() if v is not None})

This is useful for testing.

swh/auth/keycloak.py
181

interesting, i did not notice, thx

Adapt according to review about allowing override from calling the from_configfile method.

Also add missing docstrings.

Build is green

Patch application report for D5201 (id=18637)

Rebasing onto bd3d8437f1...

Current branch diff-target is up to date.
Changes applied before test
commit a44082d1872a9e55c9ab97ad01aadab2b7c44028
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Mar 5 14:11:13 2021 +0100

    keycloak: Open from_config* method to instantiate KeycloakOpenIDConnect
    
    Related to T3079

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

swh/auth/keycloak.py
199

You should use .get("keycloak", {}) to avoid possible error

Adapt according to last suggestion (thx)

Build is green

Patch application report for D5201 (id=18638)

Rebasing onto bd3d8437f1...

Current branch diff-target is up to date.
Changes applied before test
commit fa523d66b63a2a3bc02f78957e37d9b2078a8baf
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Mar 5 14:11:13 2021 +0100

    keycloak: Open from_config* method to instantiate KeycloakOpenIDConnect
    
    Related to T3079

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

This revision is now accepted and ready to land.Mar 5 2021, 2:39 PM