Remove entropy check on password

It is not a good way to enforce good password. It is better to include common
password with repetitive or sequential characters in the forbidden list.

issue11100
review376341002
This commit is contained in:
Cédric Krier
2022-01-23 13:05:17 +01:00
parent 7c822ccfda
commit c8dc6db2a8
5 changed files with 1 additions and 15 deletions
+1
View File
@@ -1,3 +1,4 @@
* Remove entropy check on password
* Set view_id in the context when calling view_attributes
* Add ip_address and device_cookie login method options
* Add support for Python 3.10
-7
View File
@@ -497,13 +497,6 @@ forbidden
The path to a file containing one forbidden password per line.
entropy
~~~~~~~
The ratio of non repeated characters for the user password.
Default: ``0.75``
reset_timeout
~~~~~~~~~~~~~
-1
View File
@@ -88,7 +88,6 @@ class TrytonConfigParser(configparser.ConfigParser):
self.set('session', 'ip_network_6', '56')
self.add_section('password')
self.set('password', 'length', '8')
self.set('password', 'entropy', '0.75')
self.set('password', 'reset_timeout', str(24 * 60 * 60))
self.add_section('bus')
self.set('bus', 'allow_subscribe', 'False')
-3
View File
@@ -9,9 +9,6 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.message" id="msg_password_forbidden">
<field name="text">The password is forbidden.</field>
</record>
<record model="ir.message" id="msg_password_entropy">
<field name="text">The same characters appear in the password too many times.</field>
</record>
<record model="ir.message" id="msg_password_name">
<field name="text">The password cannot be the same as user's name.</field>
</record>
-4
View File
@@ -295,10 +295,6 @@ class User(avatar_mixin(100, 'login'), DeactivableMixin, ModelSQL, ModelView):
f.fileno(), 0, access=mmap.ACCESS_READ)
if forbidden.find(password_b) >= 0:
raise PasswordError(gettext('res.msg_password_forbidden'))
entropy = config.getfloat('password', 'entropy', default=0)
if entropy:
if len(set(password)) / len(password) < entropy:
raise PasswordError(gettext('res.msg_password_entropy'))
for user in users:
# Use getattr to allow to use non User instances
for test, message in [