diff options
Diffstat (limited to 'src/mailman/rules')
| -rw-r--r-- | src/mailman/rules/approved.py | 2 | ||||
| -rw-r--r-- | src/mailman/rules/docs/approved.rst | 5 | ||||
| -rw-r--r-- | src/mailman/rules/tests/test_approved.py | 13 |
3 files changed, 7 insertions, 13 deletions
diff --git a/src/mailman/rules/approved.py b/src/mailman/rules/approved.py index 1f4fc1369..dadc25322 100644 --- a/src/mailman/rules/approved.py +++ b/src/mailman/rules/approved.py @@ -28,11 +28,11 @@ __all__ = [ import re from email.iterators import typed_subpart_iterator -from flufl.password import verify from zope.interface import implementer from mailman.core.i18n import _ from mailman.interfaces.rules import IRule +from mailman.utilities.passwords import verify EMPTYSTRING = '' diff --git a/src/mailman/rules/docs/approved.rst b/src/mailman/rules/docs/approved.rst index 9c61a7419..7f0714e17 100644 --- a/src/mailman/rules/docs/approved.rst +++ b/src/mailman/rules/docs/approved.rst @@ -20,9 +20,8 @@ which is shared among all the administrators. This password will not be stored in clear text, so it must be hashed using the configured hash protocol. - >>> from flufl.password import lookup, make_secret - >>> scheme = lookup(config.passwords.password_scheme.upper()) - >>> mlist.moderator_password = make_secret('super secret', scheme) + >>> from mailman.utilities.passwords import encrypt + >>> mlist.moderator_password = encrypt('super secret') The ``approved`` rule determines whether the message contains the proper approval or not. diff --git a/src/mailman/rules/tests/test_approved.py b/src/mailman/rules/tests/test_approved.py index d078556ba..de409f654 100644 --- a/src/mailman/rules/tests/test_approved.py +++ b/src/mailman/rules/tests/test_approved.py @@ -30,14 +30,12 @@ __all__ = [ import unittest -from flufl.password import lookup, make_secret - from mailman.app.lifecycle import create_list -from mailman.config import config from mailman.rules import approved from mailman.testing.helpers import ( specialized_message_from_string as mfs) from mailman.testing.layers import ConfigLayer +from mailman.utilities.passwords import encrypt @@ -48,8 +46,7 @@ class TestApproved(unittest.TestCase): def setUp(self): self._mlist = create_list('test@example.com') - scheme = lookup(config.passwords.password_scheme.upper()) - self._mlist.moderator_password = make_secret('super secret', scheme) + self._mlist.moderator_password = encrypt('super secret') self._rule = approved.Approved() self._msg = mfs("""\ From: anne@example.com @@ -150,8 +147,7 @@ class TestApprovedPseudoHeader(unittest.TestCase): def setUp(self): self._mlist = create_list('test@example.com') - scheme = lookup(config.passwords.password_scheme.upper()) - self._mlist.moderator_password = make_secret('super secret', scheme) + self._mlist.moderator_password = encrypt('super secret') self._rule = approved.Approved() self._msg = mfs("""\ From: anne@example.com @@ -283,8 +279,7 @@ class TestApprovedPseudoHeaderMIME(unittest.TestCase): def setUp(self): self._mlist = create_list('test@example.com') - scheme = lookup(config.passwords.password_scheme.upper()) - self._mlist.moderator_password = make_secret('super secret', scheme) + self._mlist.moderator_password = encrypt('super secret') self._rule = approved.Approved() self._msg_text_template = """\ From: anne@example.com |
