mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-28 18:01:23 -06:00
Fix generation of invalid OTP URIs
https://fedorahosted.org/freeipa/ticket/4169 Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
parent
9cf311db1d
commit
a2ae2918dd
@ -202,6 +202,15 @@ class otptoken_add(LDAPCreate):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
|
def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
|
||||||
|
# These are values we always want to write to LDAP. So if they are
|
||||||
|
# specified as a value that evaluates to False (i.e. None), delete them
|
||||||
|
# and fill in the defaults below.
|
||||||
|
for attr in ('ipatokentotpclockoffset', 'ipatokentotptimestep',
|
||||||
|
'ipatokenotpalgorithm', 'ipatokenotpdigits',
|
||||||
|
'ipatokenotpkey'):
|
||||||
|
if attr in entry_attrs and not entry_attrs[attr]:
|
||||||
|
del entry_attrs[attr]
|
||||||
|
|
||||||
# Set defaults. This needs to happen on the server side because we may
|
# Set defaults. This needs to happen on the server side because we may
|
||||||
# have global configurable defaults in the near future.
|
# have global configurable defaults in the near future.
|
||||||
options.setdefault('type', TOKEN_TYPES[0])
|
options.setdefault('type', TOKEN_TYPES[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user