shieldapi 2.0.0rc0__tar.gz → 2.0.0rc4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {shieldapi-2.0.0rc0/shieldapi.egg-info → shieldapi-2.0.0rc4}/PKG-INFO +1 -1
  2. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/setup.cfg +1 -1
  3. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/shieldapi/frameworks/fastapi.py +1 -1
  4. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/shieldapi/keycloak_utils.py +5 -5
  5. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4/shieldapi.egg-info}/PKG-INFO +1 -1
  6. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/LICENSE +0 -0
  7. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/README.md +0 -0
  8. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/pyproject.toml +0 -0
  9. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/setup.py +0 -0
  10. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/shieldapi/__init__.py +0 -0
  11. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/shieldapi/frameworks/__init__.py +0 -0
  12. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/shieldapi/frameworks/flask.py +0 -0
  13. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/shieldapi.egg-info/SOURCES.txt +0 -0
  14. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/shieldapi.egg-info/dependency_links.txt +0 -0
  15. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/shieldapi.egg-info/requires.txt +0 -0
  16. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/shieldapi.egg-info/top_level.txt +0 -0
  17. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/tests/__init__.py +0 -0
  18. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/tests/conftest.py +0 -0
  19. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/tests/mock.py +0 -0
  20. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/tests/test_fastapi.py +0 -0
  21. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/tests/test_flask.py +0 -0
  22. {shieldapi-2.0.0rc0 → shieldapi-2.0.0rc4}/tests/test_keycloak_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: shieldapi
3
- Version: 2.0.0rc0
3
+ Version: 2.0.0rc4
4
4
  Summary: A package for endpoint protection of APIs using Keycloak
5
5
  Author: SINTEF, Fraunhofer IWM
6
6
  Author-email: yoav.nahshon@iwm.fraunhofer.de
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = shieldapi
3
- version = v2.0.0rc0
3
+ version = v2.0.0rc4
4
4
  author = SINTEF, Fraunhofer IWM
5
5
  author_email = yoav.nahshon@iwm.fraunhofer.de
6
6
  description = A package for endpoint protection of APIs using Keycloak
@@ -59,7 +59,7 @@ class AuthTokenBearer(HTTPBearer):
59
59
  )
60
60
 
61
61
  if not check_token_validity(auth.credentials):
62
- logger.warning(f"AuthTokenBearer.__call__: Token validation failed: {e}")
62
+ logger.warning(f"AuthTokenBearer.__call__: Token validation failed")
63
63
  raise HTTPException(status_code=401, detail="Token validation failed")
64
64
  return f"Bearer {auth.credentials}"
65
65
 
@@ -389,18 +389,18 @@ def make_auth_header(
389
389
  return credentials
390
390
 
391
391
 
392
- def get_userinfo() -> dict:
392
+ def get_userinfo(token) -> dict:
393
393
  """
394
394
  Returns the user information from the access token.
395
395
 
396
+ Args:
397
+ token: str
398
+ The access token of the user.
399
+
396
400
  Returns:
397
401
  dict:
398
402
  The user information.
399
403
  """
400
- token = get_access_token()
401
- if not token:
402
- logger.warning("get_userinfo: No access token found")
403
- return {}
404
404
  userinfo = get_keycloak_openid().userinfo(token)
405
405
  logger.debug(f"get_userinfo: Retrieved user info {userinfo}")
406
406
  return userinfo
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: shieldapi
3
- Version: 2.0.0rc0
3
+ Version: 2.0.0rc4
4
4
  Summary: A package for endpoint protection of APIs using Keycloak
5
5
  Author: SINTEF, Fraunhofer IWM
6
6
  Author-email: yoav.nahshon@iwm.fraunhofer.de
File without changes
File without changes
File without changes
File without changes