littlefish/attackprotect.py
def log_attempt(self, key):
        """
        Log an attempt against key, incrementing the number of attempts for that key and potentially adding a lock to
        the lock table
        """
        with self.lock:
            if key not in self.attempts:
                self.attempts[key] = 1
            else:
                self.attempts[key] += 1

                if self.attempts[key] >= self.max_attempts:
                    log.info('Account %s locked due to too many login attempts' % key)
                    # lock account
                    self.locks[key] = datetime.datetime.utcnow() + datetime.timedelta(seconds=self.lock_duration)
def log_attempt(self, key):
        """
        Log an attempt against key, incrementing the number of attempts for that key and potentially adding a lock to
        the lock table
        """
        with self.lock:
            if key not in self.attempts:
                self.attempts[key] = 1
            else:
                self.attempts[key] += 1

                if self.attempts[key] >= self.max_attempts:
                    log.info('Account %s locked due to too many login attempts' % key)
                    # lock account
                    self.locks[key] = datetime.datetime.utcnow() + datetime.timedelta(seconds=self.lock_duration)
Log an attempt against key, incrementing the number of attempts for that key and potentially adding a lock to
        the lock table