Beispiel #1
0
    def create_token(self):
        """Create a time-stamped token"""

        token = unicode(
            hashlib.sha512(str(time.time()) + self.username).hexdigest())

        DataToken.delete_by_username(self.username, self.action)
        # create new one
        token_instance = DataToken.new(token, self.username, self.action)
        return token_instance
Beispiel #2
0
    def create_token(self):
        """Create a time-stamped token"""

        token = unicode(
            hashlib.sha512(str(time.time()) + self.username).hexdigest())

        DataToken.delete_by_username(self.username, self.action)
        # create new one
        token_instance = DataToken.new(token, self.username, self.action)
        return token_instance
Beispiel #3
0
    def create_token(self):
        """Create a time-stamped token"""
        token = unicode(
            hashlib.sha512(str(time.time()) + self.username).hexdigest())

        DataToken.delete_by_username(self.username, self.action)
        # create new one
        token_instance = DataToken(token=token,
                                   username=self.username,
                                   action=self.action,
                                   date=datetime.now() + self.expiration_delay)
        return token_instance
Beispiel #4
0
    def create_token(self):
        """Create a time-stamped token"""
        token = unicode(
            hashlib.sha512(str(time.time()) + self.username).hexdigest())

        DataToken.delete_by_username(self.username, self.action)
        # create new one
        token_instance = DataToken(token=token,
                                   username=self.username,
                                   action=self.action,
                                   date=datetime.now() + self.expiration_delay)
        return token_instance