Seems like a good idea, I'm attaching the updated patch. Autofill does
work when the param is required.
On 08/19/2016 04:19 PM, Martin Basti wrote:
On 16.08.2016 17:35, Tomas Krizek wrote:
Hi,
the attached patch fixes an error message when user provides an empty
key while adding otp token.
https://fedorahosted.org/freeipa/ticket/6200
I'm curious why we don't fix it here:
OTPTokenKey('ipatokenotpkey?',
cli_name='key',
label=_('Key'),
doc=_('Token secret (Base32; default: random)'),
default_from=lambda: os.urandom(KEY_LENGTH),
autofill=True,
flags=('no_display', 'no_update', 'no_search'),
),
If OTPTokenKey is mandratory, it should be required param (autofill
should work in this case too)
Martin^2
--
Tomas Krizek
From cdb4861416b07d1c17c1dbe6ddf67f1861322ff0 Mon Sep 17 00:00:00 2001
From: Tomas Krizek <tkri...@redhat.com>
Date: Mon, 22 Aug 2016 10:15:42 +0200
Subject: [PATCH] Validate key in otptoken-add
Make the OTP token key mandatory and show an appropriate error message if the user
enters an empty key.
https://fedorahosted.org/freeipa/ticket/6200
---
ipaserver/plugins/otptoken.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipaserver/plugins/otptoken.py b/ipaserver/plugins/otptoken.py
index 39012e2f9106c33c520e19f14331fc440333015a..15b25e07a905257f016de68a3d9e182447699d0e 100644
--- a/ipaserver/plugins/otptoken.py
+++ b/ipaserver/plugins/otptoken.py
@@ -208,7 +208,7 @@ class otptoken(LDAPObject):
label=_('Serial'),
doc=_('Token serial (informational only)'),
),
- OTPTokenKey('ipatokenotpkey?',
+ OTPTokenKey('ipatokenotpkey',
cli_name='key',
label=_('Key'),
doc=_('Token secret (Base32; default: random)'),
--
2.7.4
--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code