Page MenuHomeSoftware Heritage

swh.auth.keycloak: Expose KeycloakError exception
ClosedPublic

Authored by ardumont on Mar 22 2021, 6:45 PM.

Details

Summary

This will allow caller code to depend on it without leaking the exception from the
keycloak module.

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 D5301 (id=18988)

Rebasing onto 57583d2bcc...

Current branch diff-target is up to date.
Changes applied before test
commit 94c90cbc9e3bb926e0cea6b7d5823fa64322ac69
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Mar 22 18:44:20 2021 +0100

    swh.auth.keycloak: Expose KeycloakError exception
    
    This will allow caller code to depend on it without leaking the exception from the
    keycloak module.

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

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

you should add a comment above to explain that unused import.

swh/auth/keycloak.py
9

right.

I was also of a mind to update the docstring below (login and the other connection method) to explicit they can raise such exception.

  • Explicit the reason of the import
  • Explicit login and authorization_url which could raise such import

Build is green

Patch application report for D5301 (id=18990)

Rebasing onto 57583d2bcc...

Current branch diff-target is up to date.
Changes applied before test
commit e1bc4f10a31e68a0c37e6074d896dc671ce07dbf
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Mar 22 18:44:20 2021 +0100

    swh.auth.keycloak: Expose KeycloakError exception
    
    This will allow caller code to depend on it without leaking the exception from the
    keycloak module.

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

swh/auth/keycloak.py
9

right

This revision was not accepted when it landed; it landed in state Needs Review.Mar 23 2021, 9:20 AM
This revision was automatically updated to reflect the committed changes.