checkers.py 文件源码

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

项目:fluiddb 作者: fluidinfo 项目源码 文件源码
def requestAvatarId(self, credentials):
        """
        Return the avatar id of the avatar which can be accessed using the
        given credentials.

        credentials will be an object with username and password tags.  We
        need to raise an error to indicate failure or return a username to
        indicate success.  requestAvatar will then be called with the
        avatar id we returned.
        """
        try:
            session = yield self.facadeClient.authenticateUserWithPassword(
                credentials.username, credentials.password)
        except (TPasswordIncorrect, TNoSuchUser):
            unauthorizedLogin = error.UnauthorizedLogin('Invalid credentials')
            log.msg('Bad credentials: %r:%r' %
                    (credentials.username, '<sanitized>'))
            raise unauthorizedLogin
        except Exception, e:
            log.msg('requestAvatarId exception authenticating %r/%r.' %
                    (credentials.username, '<sanitized>'))
            log.err(e)
            raise
        else:
            defer.returnValue(session)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号