403b09
From 321bd7bf56109c546a92298d54bcaccfe1289800 Mon Sep 17 00:00:00 2001
403b09
From: David Kupka <dkupka@redhat.com>
403b09
Date: Thu, 25 Aug 2016 11:53:39 +0200
403b09
Subject: [PATCH] otptoken, permission: Convert custom type parameters on
403b09
 server
403b09
403b09
Force client to send the value of ipatokenotpkey and ipapermlocation as
403b09
entered by user.
403b09
403b09
https://fedorahosted.org/freeipa/ticket/6247
403b09
403b09
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
403b09
---
403b09
 ipaserver/plugins/otptoken.py   | 2 ++
403b09
 ipaserver/plugins/permission.py | 2 ++
403b09
 2 files changed, 4 insertions(+)
403b09
403b09
diff --git a/ipaserver/plugins/otptoken.py b/ipaserver/plugins/otptoken.py
403b09
index 39012e2f9106c33c520e19f14331fc440333015a..0b4250043618b4f434d2f8b337b88ee396c312ce 100644
403b09
--- a/ipaserver/plugins/otptoken.py
403b09
+++ b/ipaserver/plugins/otptoken.py
403b09
@@ -214,6 +214,8 @@ class otptoken(LDAPObject):
403b09
             doc=_('Token secret (Base32; default: random)'),
403b09
             default_from=lambda: os.urandom(KEY_LENGTH),
403b09
             autofill=True,
403b09
+            # force server-side conversion
403b09
+            normalizer=lambda x: x,
403b09
             flags=('no_display', 'no_update', 'no_search'),
403b09
         ),
403b09
         StrEnum('ipatokenotpalgorithm?',
403b09
diff --git a/ipaserver/plugins/permission.py b/ipaserver/plugins/permission.py
403b09
index 830773ae7a09f0197da702e4ec31b0b58f1214dd..0c040ce874534dc4716e700493e547df5b97ea99 100644
403b09
--- a/ipaserver/plugins/permission.py
403b09
+++ b/ipaserver/plugins/permission.py
403b09
@@ -283,6 +283,8 @@ class permission(baseldap.LDAPObject):
403b09
             cli_name='subtree',
403b09
             label=_('Subtree'),
403b09
             doc=_('Subtree to apply permissions to'),
403b09
+            # force server-side conversion
403b09
+            normalizer=lambda x: x,
403b09
             flags={'ask_create'},
403b09
         ),
403b09
         Str(
403b09
-- 
403b09
2.7.4
403b09