[Checkins] SVN: z3c.password/trunk/ - ``TooSimilarPassword``: do not round ``maxSimilarity`` up, because we
Adam Groszer
cvs-admin at zope.org
Wed Sep 19 07:26:26 UTC 2012
Log message for revision 127864:
- ``TooSimilarPassword``: do not round ``maxSimilarity`` up, because we
sometimes use 0.999 to avoid the same password set.
0.999 would be displayed as 100% (100% vs. 100%)
Changed:
U z3c.password/trunk/CHANGES.txt
U z3c.password/trunk/src/z3c/password/README.txt
U z3c.password/trunk/src/z3c/password/interfaces.py
-=-
Modified: z3c.password/trunk/CHANGES.txt
===================================================================
--- z3c.password/trunk/CHANGES.txt 2012-09-18 11:36:49 UTC (rev 127863)
+++ z3c.password/trunk/CHANGES.txt 2012-09-19 07:26:22 UTC (rev 127864)
@@ -5,7 +5,9 @@
0.11.1 (unreleased)
-------------------
-- Nothing changed yet.
+- ``TooSimilarPassword``: do not round ``maxSimilarity`` up, because we
+ sometimes use 0.999 to avoid the same password set.
+ 0.999 would be displayed as 100% (100% vs. 100%)
0.11.0 (2012-08-09)
Modified: z3c.password/trunk/src/z3c/password/README.txt
===================================================================
--- z3c.password/trunk/src/z3c/password/README.txt 2012-09-18 11:36:49 UTC (rev 127863)
+++ z3c.password/trunk/src/z3c/password/README.txt 2012-09-19 07:26:22 UTC (rev 127864)
@@ -102,6 +102,14 @@
...
TooSimilarPassword: Password is too similar to old one (similarity 88%, should be at most 60%).
+ >>> pwd2 = password.HighSecurityPasswordUtility()
+ >>> pwd2.maxSimilarity = 0.999
+
+ >>> pwd2.verify('fooBar12', 'fooBar12')
+ Traceback (most recent call last):
+ ...
+ TooSimilarPassword: Password is too similar to old one (similarity 100%, should be at most 99%).
+
- The final check ensures that the password does not have too many characters
of one group. The groups are: lower letters, upper letters, digits,
punctuation, and others.
Modified: z3c.password/trunk/src/z3c/password/interfaces.py
===================================================================
--- z3c.password/trunk/src/z3c/password/interfaces.py 2012-09-18 11:36:49 UTC (rev 127863)
+++ z3c.password/trunk/src/z3c/password/interfaces.py 2012-09-19 07:26:22 UTC (rev 127864)
@@ -75,7 +75,7 @@
'Password is too similar to old one'
' (similarity ${similarity}%, should be at most ${maxSimilarity}%).',
mapping=dict(similarity=int(round(similarity * 100)),
- maxSimilarity=int(round(maxSimilarity * 100))))
+ maxSimilarity=int(maxSimilarity * 100)))
class TooManyGroupCharacters(InvalidPassword):
__doc__ = _('''Password contains too many characters of one group.''')
More information about the checkins
mailing list