Hi,

For ipatokennotbefore and ipatokennotafter attributes use DateTime
parameter class instead of Str, since these are represented as
LDAP Generalized Time in LDAP.

Tomas

>From cb671a7c1e746ef5f1c3de0e4ad30ae6ef42dcf1 Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Thu, 9 Jan 2014 11:29:39 +0100
Subject: [PATCH 140/140] ipalib: Use DateTime parameter class for OTP token
 timestamp attributes

For ipatokennotbefore and ipatokennotafter attributes use DateTime
parameter class instead of Str, since these are represented as
LDAP Generalized Time in LDAP.
---
 API.txt                    | 12 ++++++------
 VERSION                    |  4 ++--
 ipalib/plugins/otptoken.py | 10 +++++-----
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/API.txt b/API.txt
index e90cac0702cb9869a3864ff225383c5c37cd9231..a150ba1f6b3c28da7a543e683ad433fabeb09b5e 100644
--- a/API.txt
+++ b/API.txt
@@ -2227,8 +2227,8 @@ option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui
 option: Str('description', attribute=True, cli_name='desc', multivalue=False, required=False)
 option: Bool('ipatokendisabled', attribute=True, cli_name='disabled', multivalue=False, required=False)
 option: Str('ipatokenmodel', attribute=True, cli_name='model', multivalue=False, required=False)
-option: Str('ipatokennotafter', attribute=True, cli_name='not_after', multivalue=False, required=False)
-option: Str('ipatokennotbefore', attribute=True, cli_name='not_before', multivalue=False, required=False)
+option: DateTime('ipatokennotafter', attribute=True, cli_name='not_after', multivalue=False, required=False)
+option: DateTime('ipatokennotbefore', attribute=True, cli_name='not_before', multivalue=False, required=False)
 option: StrEnum('ipatokenotpalgorithm', attribute=True, cli_name='algo', multivalue=False, required=False, values=(u'sha1', u'sha256', u'sha384', u'sha512'))
 option: IntEnum('ipatokenotpdigits', attribute=True, cli_name='digits', multivalue=False, required=False, values=(6, 8))
 option: OTPTokenKey('ipatokenotpkey', attribute=True, cli_name='key', multivalue=False, required=False)
@@ -2260,8 +2260,8 @@ option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui
 option: Str('description', attribute=True, autofill=False, cli_name='desc', multivalue=False, query=True, required=False)
 option: Bool('ipatokendisabled', attribute=True, autofill=False, cli_name='disabled', multivalue=False, query=True, required=False)
 option: Str('ipatokenmodel', attribute=True, autofill=False, cli_name='model', multivalue=False, query=True, required=False)
-option: Str('ipatokennotafter', attribute=True, autofill=False, cli_name='not_after', multivalue=False, query=True, required=False)
-option: Str('ipatokennotbefore', attribute=True, autofill=False, cli_name='not_before', multivalue=False, query=True, required=False)
+option: DateTime('ipatokennotafter', attribute=True, autofill=False, cli_name='not_after', multivalue=False, query=True, required=False)
+option: DateTime('ipatokennotbefore', attribute=True, autofill=False, cli_name='not_before', multivalue=False, query=True, required=False)
 option: StrEnum('ipatokenotpalgorithm', attribute=True, autofill=False, cli_name='algo', multivalue=False, query=True, required=False, values=(u'sha1', u'sha256', u'sha384', u'sha512'))
 option: IntEnum('ipatokenotpdigits', attribute=True, autofill=False, cli_name='digits', multivalue=False, query=True, required=False, values=(6, 8))
 option: Str('ipatokenowner', attribute=True, autofill=False, cli_name='owner', multivalue=False, query=True, required=False)
@@ -2289,8 +2289,8 @@ option: Str('delattr*', cli_name='delattr', exclude='webui')
 option: Str('description', attribute=True, autofill=False, cli_name='desc', multivalue=False, required=False)
 option: Bool('ipatokendisabled', attribute=True, autofill=False, cli_name='disabled', multivalue=False, required=False)
 option: Str('ipatokenmodel', attribute=True, autofill=False, cli_name='model', multivalue=False, required=False)
-option: Str('ipatokennotafter', attribute=True, autofill=False, cli_name='not_after', multivalue=False, required=False)
-option: Str('ipatokennotbefore', attribute=True, autofill=False, cli_name='not_before', multivalue=False, required=False)
+option: DateTime('ipatokennotafter', attribute=True, autofill=False, cli_name='not_after', multivalue=False, required=False)
+option: DateTime('ipatokennotbefore', attribute=True, autofill=False, cli_name='not_before', multivalue=False, required=False)
 option: Str('ipatokenowner', attribute=True, autofill=False, cli_name='owner', multivalue=False, required=False)
 option: Str('ipatokenserial', attribute=True, autofill=False, cli_name='serial', multivalue=False, required=False)
 option: Str('ipatokenvendor', attribute=True, autofill=False, cli_name='vendor', multivalue=False, required=False)
diff --git a/VERSION b/VERSION
index bdb4e601be4a56cdc94e9f7a7c050b6348520d4d..3f649452a5bd572ebd7a90ec105b860ffecec359 100644
--- a/VERSION
+++ b/VERSION
@@ -89,5 +89,5 @@ IPA_DATA_VERSION=20100614120000
 #                                                      #
 ########################################################
 IPA_API_VERSION_MAJOR=2
-IPA_API_VERSION_MINOR=73
-# Last change: tbabej - Expose krbPrincipalExpiration
+IPA_API_VERSION_MINOR=74
+# Last change: tbabej - Fix IPA OTP DateTime params
diff --git a/ipalib/plugins/otptoken.py b/ipalib/plugins/otptoken.py
index 67f24859583bb9c72da1faf2f5fdaa1faf69f437..3d89a2fb15903e3ea9bc2d3e46a1b8ff39479a1e 100644
--- a/ipalib/plugins/otptoken.py
+++ b/ipalib/plugins/otptoken.py
@@ -18,7 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from ipalib.plugins.baseldap import DN, LDAPObject, LDAPCreate, LDAPDelete, LDAPUpdate, LDAPSearch, LDAPRetrieve
-from ipalib import api, Int, Str, Bool, Flag, Bytes, IntEnum, StrEnum, _, ngettext
+from ipalib import api, Int, Str, Bool, DateTime, Flag, Bytes, IntEnum, StrEnum, _, ngettext
 from ipalib.plugable import Registry
 from ipalib.errors import PasswordMismatch, ConversionError, LastMemberError, NotFound
 from ipalib.request import context
@@ -137,13 +137,13 @@ class otptoken(LDAPObject):
             cli_name='disabled',
             label=_('Disabled state')
         ),
-        Str('ipatokennotbefore?',
+        DateTime('ipatokennotbefore?',
             cli_name='not_before',
-            label=_('Validity start'),
+            label=_('Validity start (UTC)'),
         ),
-        Str('ipatokennotafter?',
+        DateTime('ipatokennotafter?',
             cli_name='not_after',
-            label=_('Validity end'),
+            label=_('Validity end (UTC)'),
         ),
         Str('ipatokenvendor?',
             cli_name='vendor',
-- 
1.8.4.2

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to