Ticket #3056: IUsernameMD5Password_Deprecated.patch

File IUsernameMD5Password_Deprecated.patch, 1.9 KB (added by jesstess, 5 years ago)
  • twisted/spread/pb.py

     
    12071207 
    12081208 
    12091209class IUsernameMD5Password(ICredentials): 
    1210     """I encapsulate a username and a hashed password. 
     1210    """ 
     1211    This class is redundant with 
     1212    L{twisted.cred.credentials.IUsernameHashedPassword} and is deprecated. 
    12111213 
     1214    I encapsulate a username and a hashed password. 
     1215 
    12121216    This credential is used for username/password over 
    12131217    PB. CredentialCheckers which check this kind of credential must 
    12141218    store the passwords in plaintext form or as a MD5 digest. 
     
    12161220    @type username: C{str} or C{Deferred} 
    12171221    @ivar username: The username associated with these credentials. 
    12181222    """ 
     1223    def __init__(self): 
     1224        """ 
     1225        This method exists solely to issue a deprecation warning. 
     1226        """ 
     1227        warnings.warn( 
     1228            "twisted.spread.pb.IUsernameMD5Password is deprecated " 
     1229            "since Twisted 10.0", 
     1230            category=DeprecationWarning, 
     1231            stacklevel=2) 
    12191232 
     1233 
    12201234    def checkPassword(password): 
    1221         """Validate these credentials against the correct password. 
     1235        """ 
     1236        Validate these credentials against the correct password. 
    12221237 
    12231238        @param password: The correct, plaintext password against which to 
    12241239            check. 
     
    12271242            password matches. 
    12281243        """ 
    12291244 
     1245 
    12301246    def checkMD5Password(password): 
    1231         """Validate these credentials against the correct MD5 digest of password. 
     1247        """ 
     1248        Validate these credentials against the correct MD5 digest of password. 
    12321249 
    12331250        @param password: The correct, plaintext password against which to 
    12341251            check. 
     
    12381255        """ 
    12391256 
    12401257 
     1258 
    12411259class _PortalRoot: 
    12421260    """Root object, used to login to portal.""" 
    12431261