mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
Allow leading/trailing whitespaces in passwords
kwargs is redefined to set the `noextrawhitespace` parameter from the Str class to `False`. Fixes: https://pagure.io/freeipa/issue/7599 Signed-off-by: Antonio Torres Moríñigo <atorresm@protonmail.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
e7827a6f0c
commit
809d9cb80f
@ -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):
|
||||
|
@ -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'********'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user