python-keycloak-client
python-keycloak-client copied to clipboard
Fix authz token handling for Keycloak 12
Original code throws an error as such on Keycloak 12:
File "/usr/local/lib/python3.8/site-packages/keycloak/authz.py", line 119, in get_permissions
decoded_token = self._decode_token(token.split('.')[1])
AttributeError: 'NoneType' object has no attribute 'split'
Seems the required data is now in the access_token
attribute.
Codecov Report
Merging #45 (20ff6b7) into master (08b570d) will decrease coverage by
1.12%
. The diff coverage is0.00%
.
@@ Coverage Diff @@
## master #45 +/- ##
==========================================
- Coverage 65.33% 64.20% -1.13%
==========================================
Files 26 26
Lines 799 799
==========================================
- Hits 522 513 -9
- Misses 277 286 +9
Impacted Files | Coverage Δ | |
---|---|---|
src/keycloak/authz.py | 42.85% <0.00%> (-3.18%) |
:arrow_down: |
src/keycloak/uma1.py | 94.11% <0.00%> (-5.89%) |
:arrow_down: |
src/keycloak/client.py | 78.68% <0.00%> (-4.92%) |
:arrow_down: |
src/keycloak/uma.py | 95.55% <0.00%> (-4.45%) |
:arrow_down: |
src/keycloak/openid_connect.py | 89.09% <0.00%> (-3.64%) |
:arrow_down: |
src/keycloak/well_known.py | 88.88% <0.00%> (+7.40%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 08b570d...20ff6b7. Read the comment docs.