예제 #1
0
파일: stores.py 프로젝트: di445/server
    def lookup_token(self, token_type, token):
        if token_type == 'request':
            token_type = Token.REQUEST
        elif token_type == 'access':
            token_type = Token.ACCESS
        
        logger.debug("!!! In GAEOAuthDataStore.lookup_token  key_:%s, token_type: %s"%(token,token_type))

        request_tokens = Token.all()\
            .filter('key_ =',token)\
            .filter('token_type =',token_type).fetch(1000)
        
        if len(request_tokens) == 1:
            self.request_token = request_tokens[0]
            return self.request_token
        elif len(request_tokens) == 0:
            return None
        else:
            raise Exception('More then one %s token matches token "%s"'%(token_type,token))
예제 #2
0
    def lookup_token(self, token_type, token):
        if token_type == 'request':
            token_type = Token.REQUEST
        elif token_type == 'access':
            token_type = Token.ACCESS

        request_tokens = (Token.all().filter('key_ =', token).filter(
            'token_type =', token_type).fetch(1000))

        if len(request_tokens) == 1:
            self.request_token = request_tokens[0]
            return self.request_token
        elif len(request_tokens) == 0:
            logging.info("No token found")
            return None
        else:
            logging.info("%d tokens found" % len(request_tokens))
            raise Exception('More then one %s token matches token "%s"' %
                            (token_type, token))
예제 #3
0
    def lookup_token(self, token_type, token):
        if token_type == 'request':
            token_type = Token.REQUEST
        elif token_type == 'access':
            token_type = Token.ACCESS
        
        logger.debug("!!! In GAEOAuthDataStore.lookup_token  key_:%s, token_type: %s"%(token,token_type))

        request_tokens = Token.all()\
            .filter('key_ =',token)\
            .filter('token_type =',token_type).fetch(1000)
        
        if len(request_tokens) == 1:
            self.request_token = request_tokens[0]
            return self.request_token
        elif len(request_tokens) == 0:
            return None
        else:
            raise Exception('More then one %s token matches token "%s"'%(token_type,token))
예제 #4
0
    def lookup_token(self, token_type, token):
        if token_type == 'request':
            token_type = Token.REQUEST
        elif token_type == 'access':
            token_type = Token.ACCESS

        request_tokens = (Token.all().
                filter('key_ =', token).
                filter('token_type =', token_type).
                fetch(1000))

        if len(request_tokens) == 1:
            self.request_token = request_tokens[0]
            return self.request_token
        elif len(request_tokens) == 0:
            logging.info("No token found")
            return None
        else:
            logging.info("%d tokens found" % len(request_tokens))
            raise Exception('More then one %s token matches token "%s"'%(token_type,token))