py-auth-micro 0.2.2__tar.gz → 0.2.4__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 (34) hide show
  1. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/PKG-INFO +2 -2
  2. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Core/_ldap_interactions.py +9 -5
  3. py_auth_micro-0.2.4/py_auth_micro/_version.py +1 -0
  4. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro.egg-info/PKG-INFO +2 -2
  5. py_auth_micro-0.2.2/py_auth_micro/_version.py +0 -1
  6. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/LICENSE +0 -0
  7. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/README.rst +0 -0
  8. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Config/__init__.py +0 -0
  9. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Config/_appconfig.py +0 -0
  10. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Config/_dbconfig.py +0 -0
  11. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Config/_ldapconfig.py +0 -0
  12. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Core/__init__.py +0 -0
  13. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Core/_enums.py +0 -0
  14. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Exceptions/__init__.py +0 -0
  15. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/LoginHandler/__init__.py +0 -0
  16. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/LoginHandler/_loginbaseclass.py +0 -0
  17. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/LoginHandler/_loginldap.py +0 -0
  18. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/LoginHandler/_loginlocal.py +0 -0
  19. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Models/__init__.py +0 -0
  20. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Models/_group.py +0 -0
  21. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Models/_token.py +0 -0
  22. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/Models/_user.py +0 -0
  23. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/WorkFlows/__init__.py +0 -0
  24. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/WorkFlows/_groupworkflow.py +0 -0
  25. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/WorkFlows/_misc.py +0 -0
  26. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/WorkFlows/_sessionworkflow.py +0 -0
  27. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/WorkFlows/_userworkflow.py +0 -0
  28. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro/__init__.py +0 -0
  29. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro.egg-info/SOURCES.txt +0 -0
  30. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro.egg-info/dependency_links.txt +0 -0
  31. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro.egg-info/requires.txt +0 -0
  32. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/py_auth_micro.egg-info/top_level.txt +0 -0
  33. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/setup.cfg +0 -0
  34. {py_auth_micro-0.2.2 → py_auth_micro-0.2.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: py_auth_micro
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: A wrapper around pyjwt
5
5
  Home-page: https://github.com/bad-microservices/py_auth_micro
6
6
  Author: Ole Hannemann
@@ -30,6 +30,8 @@ class LDAPHelper:
30
30
  @property
31
31
  def email(self):
32
32
  """Extracts the Users email after he sucessfully logged in (if he needs to be created in the Database)"""
33
+ if self._userinfo.get("email", None) is None:
34
+ return f"generated_{self.username}@{self.config.domain}"
33
35
  return self._userinfo["email"]
34
36
 
35
37
  def _get_user_info(self):
@@ -48,12 +50,14 @@ class LDAPHelper:
48
50
  group = group[group.index("CN=") + 3 : group.index(",")]
49
51
  groups.append(group)
50
52
 
51
- try:
52
- mail = data["mail"][0]
53
- except IndexError:
54
- mail = data["mail"]
53
+ mail = data.get("mail", None)
54
+ if mail is not None:
55
+ if isinstance(mail, list):
56
+ mail = mail[0]
57
+ if isinstance(mail, bytes):
58
+ mail = mail.decode("utf-8")
55
59
 
56
- self._userinfo = {"groups": groups, "email": mail.decode("utf-8")}
60
+ self._userinfo = {"groups": groups, "email": mail}
57
61
 
58
62
  def __init__(self, ldap_cfg: LDAPConfig, username: str, password: str):
59
63
  self.config = ldap_cfg
@@ -0,0 +1 @@
1
+ __version__ = "0.2.4"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: py_auth_micro
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: A wrapper around pyjwt
5
5
  Home-page: https://github.com/bad-microservices/py_auth_micro
6
6
  Author: Ole Hannemann
@@ -1 +0,0 @@
1
- __version__ = "0.2.2"
File without changes
File without changes
File without changes
File without changes