authorization.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:cc-server 作者: curious-containers 项目源码 文件源码
def _is_blocked_temporarily(self, username):
        num_login_attempts = self._config.defaults['authorization']['num_login_attempts']
        block_for_seconds = self._config.defaults['authorization']['block_for_seconds']
        self._mongo.db['block_entries'].delete_many({'timestamp': {'$lt': time() - block_for_seconds}})
        block_entries = list(self._mongo.db['block_entries'].find({'username': username}))
        if len(block_entries) > num_login_attempts:
            return True
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号