[users] Document retirement of 'nonempty'

This commit is contained in:
Adriaan de Groot 2023-12-01 18:15:00 +01:00
parent 4e3de90cd0
commit d2214b8d2e
4 changed files with 9 additions and 16 deletions

View File

@ -12,12 +12,17 @@ the history of the 3.2 series (2018-05 - 2022-08).
This release contains contributions from (alphabetically by first name): This release contains contributions from (alphabetically by first name):
- Adriaan de Groot - Adriaan de Groot
- Alberto Salvia Novella
- Christophe Marin - Christophe Marin
- Frede Hundewadt - Frede Hundewadt
## Core ## ## Core ##
## Modules ## ## Modules ##
- *users* and *usersq* no longer support the password requirement 'nonempty'.
Use 'minLength: 1' instead. The example configuration allows the user to
choose any password at all, but also contains suggestions for other
password-requirements schemes. (thanks Alberto)
# 3.3.0-alpha6 (2023-11-16) # 3.3.0-alpha6 (2023-11-16)

View File

@ -834,18 +834,8 @@ addPasswordCheck( const QString& key, const QVariant& value, PasswordCheckList&
} }
else if ( key == "nonempty" ) else if ( key == "nonempty" )
{ {
if ( value.toBool() ) cWarning() << "nonempty check is ignored; use minLength: 1";
{ return false;
passwordChecks.push_back(
PasswordCheck( []() { return QCoreApplication::translate( "PWQ", "Password is empty" ); },
[]( const QString& s ) { return !s.isEmpty(); },
PasswordCheck::Weight( 1 ) ) );
}
else
{
cDebug() << "nonempty check is mentioned but set to false";
return false;
}
} }
#ifdef CHECK_PWQUALITY #ifdef CHECK_PWQUALITY
else if ( key == "libpwquality" ) else if ( key == "libpwquality" )

View File

@ -41,7 +41,6 @@ properties:
additionalProperties: false additionalProperties: false
type: object type: object
properties: properties:
nonempty: { type: boolean, default: true }
minLength: { type: number } minLength: { type: number }
maxLength: { type: number } maxLength: { type: number }
libpwquality: { type: array, items: { type: string } } # Don't know what libpwquality supports libpwquality: { type: array, items: { type: string } } # Don't know what libpwquality supports

View File

@ -27,9 +27,8 @@ setRootPassword: true
doReusePassword: true doReusePassword: true
passwordRequirements: passwordRequirements:
nonempty: true minLength: -1
minLength: -1 # Password at least this many characters maxLength: -1
maxLength: -1 # Password at most this many characters
libpwquality: libpwquality:
- minlen=0 - minlen=0
- minclass=0 - minclass=0