pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone
Blob Blame History Raw
From 0d1c2e1039758c1c11fb60299f571013f3572842 Mon Sep 17 00:00:00 2001
From: Nathaniel McCallum <npmccallum@redhat.com>
Date: Thu, 6 Nov 2014 15:19:01 -0500
Subject: [PATCH] Improve otptoken help messages

https://fedorahosted.org/freeipa/ticket/4689

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
---
 ipalib/plugins/otptoken.py | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/ipalib/plugins/otptoken.py b/ipalib/plugins/otptoken.py
index 2b5f1c5fb83341d392e165a3507f5076820f1d3a..77366bafe7a102f5d2c048ac3d5f7d9948ed7fe4 100644
--- a/ipalib/plugins/otptoken.py
+++ b/ipalib/plugins/otptoken.py
@@ -153,6 +153,7 @@ class otptoken(LDAPObject):
         ),
         StrEnum('type?',
             label=_('Type'),
+            doc=_('Type of the token'),
             default=u'totp',
             autofill=True,
             values=tuple(TOKEN_TYPES.keys() + [x.upper() for x in TOKEN_TYPES]),
@@ -161,42 +162,52 @@ class otptoken(LDAPObject):
         Str('description?',
             cli_name='desc',
             label=_('Description'),
+            doc=_('Token description (informational only)'),
         ),
         Str('ipatokenowner?',
             cli_name='owner',
             label=_('Owner'),
+            doc=_('Assigned user of the token (default: self)'),
         ),
         Str('managedby_user?',
             label=_('Manager'),
+            doc=_('Assigned manager of the token (default: self)'),
             flags=['no_create', 'no_update', 'no_search'],
         ),
         Bool('ipatokendisabled?',
             cli_name='disabled',
-            label=_('Disabled state')
+            label=_('Disabled'),
+            doc=_('Mark the token as disabled (default: false)')
         ),
         DateTime('ipatokennotbefore?',
             cli_name='not_before',
             label=_('Validity start'),
+            doc=_('First date/time the token can be used'),
         ),
         DateTime('ipatokennotafter?',
             cli_name='not_after',
             label=_('Validity end'),
+            doc=_('Last date/time the token can be used'),
         ),
         Str('ipatokenvendor?',
             cli_name='vendor',
             label=_('Vendor'),
+            doc=_('Token vendor name (informational only)'),
         ),
         Str('ipatokenmodel?',
             cli_name='model',
             label=_('Model'),
+            doc=_('Token model (informational only)'),
         ),
         Str('ipatokenserial?',
             cli_name='serial',
             label=_('Serial'),
+            doc=_('Token serial (informational only)'),
         ),
         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'),
@@ -204,6 +215,7 @@ class otptoken(LDAPObject):
         StrEnum('ipatokenotpalgorithm?',
             cli_name='algo',
             label=_('Algorithm'),
+            doc=_('Token hash algorithm'),
             default=u'sha1',
             autofill=True,
             flags=('no_update'),
@@ -212,6 +224,7 @@ class otptoken(LDAPObject):
         IntEnum('ipatokenotpdigits?',
             cli_name='digits',
             label=_('Digits'),
+            doc=_('Number of digits each token code will have'),
             values=(6, 8),
             default=6,
             autofill=True,
@@ -220,6 +233,7 @@ class otptoken(LDAPObject):
         Int('ipatokentotpclockoffset?',
             cli_name='offset',
             label=_('Clock offset'),
+            doc=_('TOTP token / FreeIPA server time difference'),
             default=0,
             autofill=True,
             flags=('no_update'),
@@ -227,6 +241,7 @@ class otptoken(LDAPObject):
         Int('ipatokentotptimestep?',
             cli_name='interval',
             label=_('Clock interval'),
+            doc=_('Length of TOTP token code validity'),
             default=30,
             autofill=True,
             minvalue=5,
@@ -235,6 +250,7 @@ class otptoken(LDAPObject):
         Int('ipatokenhotpcounter?',
             cli_name='counter',
             label=_('Counter'),
+            doc=_('Initial counter for the HOTP token'),
             default=0,
             autofill=True,
             minvalue=0,
-- 
2.1.0