当前位置: 首页>>代码示例>>Python>>正文


Python AuthEncoding.listSchemes方法代码示例

本文整理汇总了Python中AccessControl.AuthEncoding.listSchemes方法的典型用法代码示例。如果您正苦于以下问题:Python AuthEncoding.listSchemes方法的具体用法?Python AuthEncoding.listSchemes怎么用?Python AuthEncoding.listSchemes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AccessControl.AuthEncoding的用法示例。


在下文中一共展示了AuthEncoding.listSchemes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testGoodPassword

# 需要导入模块: from AccessControl import AuthEncoding [as 别名]
# 或者: from AccessControl.AuthEncoding import listSchemes [as 别名]
 def testGoodPassword(self):
     pw = 'good_password'
     assert len(AuthEncoding.listSchemes()) > 0  # At least one must exist!
     for id in AuthEncoding.listSchemes():
         enc = AuthEncoding.pw_encrypt(pw, id)
         assert enc != pw
         assert AuthEncoding.pw_validate(enc, pw)
         assert AuthEncoding.is_encrypted(enc)
         assert not AuthEncoding.is_encrypted(pw)
开发者ID:CGTIC,项目名称:Plone_SP,代码行数:11,代码来源:testPasswordDigest.py

示例2: testBlankPassword

# 需要导入模块: from AccessControl import AuthEncoding [as 别名]
# 或者: from AccessControl.AuthEncoding import listSchemes [as 别名]
 def testBlankPassword(self):
     pw = ''
     for id in AuthEncoding.listSchemes():
         enc = AuthEncoding.pw_encrypt(pw, id)
         assert enc != pw
         assert AuthEncoding.pw_validate(enc, pw)
         assert not AuthEncoding.pw_validate(enc, enc)
         assert not AuthEncoding.pw_validate(enc, 'xxx')
开发者ID:CGTIC,项目名称:Plone_SP,代码行数:10,代码来源:testPasswordDigest.py

示例3: testLongPassword

# 需要导入模块: from AccessControl import AuthEncoding [as 别名]
# 或者: from AccessControl.AuthEncoding import listSchemes [as 别名]
 def testLongPassword(self):
     pw = 'Pw' * 2000
     for id in AuthEncoding.listSchemes():
         enc = AuthEncoding.pw_encrypt(pw, id)
         assert enc != pw
         assert AuthEncoding.pw_validate(enc, pw)
         assert not AuthEncoding.pw_validate(enc, enc)
         assert not AuthEncoding.pw_validate(enc, 'xxx')
         if id != 'CRYPT':
             # crypt truncates passwords and would fail these tests.
             assert not AuthEncoding.pw_validate(enc, pw[:-2])
             assert not AuthEncoding.pw_validate(enc, pw[2:])
开发者ID:CGTIC,项目名称:Plone_SP,代码行数:14,代码来源:testPasswordDigest.py

示例4: testBadPasword

# 需要导入模块: from AccessControl import AuthEncoding [as 别名]
# 或者: from AccessControl.AuthEncoding import listSchemes [as 别名]
 def testBadPasword(self):
     pw = 'OK_pa55w0rd \n'
     for id in AuthEncoding.listSchemes():
         enc = AuthEncoding.pw_encrypt(pw, id)
         assert enc != pw
         assert not AuthEncoding.pw_validate(enc, 'xxx')
         assert not AuthEncoding.pw_validate(enc, enc)
         if id != 'CRYPT':
             # crypt truncates passwords and would fail this test.
             assert not AuthEncoding.pw_validate(enc, pw[:-1])
         assert not AuthEncoding.pw_validate(enc, pw[1:])
         assert AuthEncoding.pw_validate(enc, pw)
开发者ID:CGTIC,项目名称:Plone_SP,代码行数:14,代码来源:testPasswordDigest.py

示例5: testLongPassword

# 需要导入模块: from AccessControl import AuthEncoding [as 别名]
# 或者: from AccessControl.AuthEncoding import listSchemes [as 别名]
 def testLongPassword(self):
     pw = 'Pw' * 2000
     for id in AuthEncoding.listSchemes():
         enc = AuthEncoding.pw_encrypt(pw, id)
         assert enc != pw
         assert AuthEncoding.pw_validate(enc, pw)
         assert not AuthEncoding.pw_validate(enc, enc)
         assert not AuthEncoding.pw_validate(enc, 'xxx')
         if id not in ('CRYPT', 'BCRYPT'):
             # crypt truncates passwords and would fail these tests.
             # bcrypt works with password inputs where len(pw) <= 50
             assert not AuthEncoding.pw_validate(enc, pw[:-2]), (
                 '%r Failed: %s %s' % (id, enc, pw[:-2])
             )
             assert not AuthEncoding.pw_validate(enc, pw[2:])
开发者ID:netsight,项目名称:AccessControl,代码行数:17,代码来源:testPasswordDigest.py

示例6: register_once

# 需要导入模块: from AccessControl import AuthEncoding [as 别名]
# 或者: from AccessControl.AuthEncoding import listSchemes [as 别名]
 def register_once(cls):
     if identity not in set(AuthEncoding.listSchemes()):
         AuthEncoding.registerScheme(identity, cls())
     return cls
开发者ID:collective,项目名称:dexterity.membrane,代码行数:6,代码来源:password.py


注:本文中的AccessControl.AuthEncoding.listSchemes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。