authenticated_endpoint.py 文件源码

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

项目:opserv-backend 作者: OpServ-Monitoring 项目源码 文件源码
def prepare(self):
        """
        Ensures that the caller is a validated user
        """
        super().prepare()

        try:
            if self.current_user is None:
                self.send_error(401)  # TODO Add details

        except jwt.InvalidIssuedAtError:
            log.error("The IAT-claim of the passed token is less than the last time the user password changed")
            self.send_error(401, summary="invalidated token")

        except jwt.ExpiredSignatureError:
            log.error("The EXT-claim of the passed token is less than the current UNIX time")
            self.send_error(401, summary="expired token")

        except jwt.InvalidTokenError:
            log.error("The passed token could not be validated")
            self.send_error(401, summary="invalid token")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号