forked from Github-Mirrors/canaille
Merge branch 'ci-fix' into 'main'
LDAPObject: fixed a bug in python <-> ldap attributes conversion. See merge request yaal/canaille!64
This commit is contained in:
commit
840830b7bb
2 changed files with 9 additions and 2 deletions
|
@ -13,6 +13,7 @@ Fixed
|
||||||
the LDAP schema update of 0.0.12
|
the LDAP schema update of 0.0.12
|
||||||
- Fixed a bug happening during RP initiated logout on clients without
|
- Fixed a bug happening during RP initiated logout on clients without
|
||||||
`post_logout_redirect_uri` defined.
|
`post_logout_redirect_uri` defined.
|
||||||
|
- Gitlab CI fix. :pr:`64`
|
||||||
|
|
||||||
Added
|
Added
|
||||||
*****
|
*****
|
||||||
|
|
|
@ -170,7 +170,10 @@ class LDAPObject:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def ldap_to_python(name, value):
|
def ldap_to_python(name, value):
|
||||||
syntax = LDAPObject.ldap_object_attributes()[name].syntax
|
try:
|
||||||
|
syntax = LDAPObject.ldap_object_attributes()[name].syntax
|
||||||
|
except KeyError:
|
||||||
|
return value
|
||||||
|
|
||||||
if syntax == "1.3.6.1.4.1.1466.115.121.1.24": # Generalized Time
|
if syntax == "1.3.6.1.4.1.1466.115.121.1.24": # Generalized Time
|
||||||
value = value.decode("utf-8")
|
value = value.decode("utf-8")
|
||||||
|
@ -189,7 +192,10 @@ class LDAPObject:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def python_to_ldap(name, value):
|
def python_to_ldap(name, value):
|
||||||
syntax = LDAPObject.ldap_object_attributes()[name].syntax
|
try:
|
||||||
|
syntax = LDAPObject.ldap_object_attributes()[name].syntax
|
||||||
|
except KeyError:
|
||||||
|
return value
|
||||||
|
|
||||||
if syntax == "1.3.6.1.4.1.1466.115.121.1.24": # Generalized Time
|
if syntax == "1.3.6.1.4.1.1466.115.121.1.24": # Generalized Time
|
||||||
return value.strftime("%Y%m%d%H%M%SZ").encode("utf-8")
|
return value.strftime("%Y%m%d%H%M%SZ").encode("utf-8")
|
||||||
|
|
Loading…
Reference in a new issue