diff --git a/ipalib/parameters.py b/ipalib/parameters.py index f06e1afee..22c82f6b6 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -1646,6 +1646,11 @@ class Password(Str): A parameter for passwords (stored in the ``unicode`` type). """ + kwargs = Data.kwargs + ( + ('pattern', (str,), None), + ('noextrawhitespace', bool, False), + ) + password = True def _convert_scalar(self, value, index=None): diff --git a/ipaserver/plugins/host.py b/ipaserver/plugins/host.py index 766d232db..5479021fd 100644 --- a/ipaserver/plugins/host.py +++ b/ipaserver/plugins/host.py @@ -27,7 +27,7 @@ import six from ipalib import api, errors, util from ipalib import messages from ipalib import Str, StrEnum, Flag -from ipalib.parameters import Principal, Certificate +from ipalib.parameters import Data, Principal, Certificate from ipalib.plugable import Registry from .baseldap import (LDAPQuery, LDAPObject, LDAPCreate, LDAPDelete, LDAPUpdate, LDAPSearch, @@ -260,6 +260,12 @@ class HostPassword(Str): setting a password on the command-line which would break backwards compatibility. """ + + kwargs = Data.kwargs + ( + ('pattern', (str,), None), + ('noextrawhitespace', bool, False), + ) + def safe_value(self, value): return u'********'