예제 #1
0
파일: sasldb.py 프로젝트: hitsl/bouser
 def get_user(self, login, password):
     pwd = safe_bytes(password)
     login = safe_bytes(login)
     db = bsddb.hashopen(self.filename, 'r')
     key = b'%s\x00%s\x00userPassword' % (login, self.realm)
     try:
         if db[key] != pwd:
             raise KeyError
         obj = SasldbAuthObject(login)
         return defer.succeed(obj)
     except (KeyError,):
         pass
     return defer.fail(failure.Failure(EInvalidCredentials()))
예제 #2
0
 def get_user(self, login, password):
     pwd = safe_bytes(password)
     login = safe_bytes(login)
     db = bsddb.hashopen(self.filename, 'r')
     key = b'%s\x00%s\x00userPassword' % (login, self.realm)
     try:
         if db[key] != pwd:
             raise KeyError
         obj = SasldbAuthObject(login)
         return defer.succeed(obj)
     except (KeyError,):
         pass
     return defer.fail(failure.Failure(EInvalidCredentials()))
예제 #3
0
파일: sasldb.py 프로젝트: hitsl/bouser
 def __init__(self, filename, realm):
     self.filename = filename
     self.realm = safe_bytes(realm)
예제 #4
0
 def __init__(self, filename, realm):
     self.filename = filename
     self.realm = safe_bytes(realm)