mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Validate key in otptoken-add
Verify that key is not empty when adding otp token. If it is empty, raise an appropriate error. https://fedorahosted.org/freeipa/ticket/6200 Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
parent
c346a2d1d1
commit
6f9a029bf5
@ -323,6 +323,10 @@ class otptoken_add(LDAPCreate):
|
||||
except (NotFound, IndexError):
|
||||
pass
|
||||
|
||||
# Check if key is not empty
|
||||
if entry_attrs['ipatokenotpkey'] is None:
|
||||
raise ValidationError(name='key', error=_(u'cannot be empty'))
|
||||
|
||||
# Build the URI parameters
|
||||
args = {}
|
||||
args['issuer'] = issuer
|
||||
|
Loading…
Reference in New Issue
Block a user