def generate_random_codes(self): """ Used to generate random key/secret pairings. Use this after you've added the other data in place of save(). """ self.key = uuid.uuid4().hex self.secret = get_random_string(length=SECRET_SIZE) self.save()
def generate_random_codes(self): """ Used to generate random key/secret pairings. Use this after you've added the other data in place of save(). """ self.key = uuid.uuid4().hex if not self.consumer.rsa_signature: self.secret = get_random_string(length=REGULAR_SECRET_SIZE) self.save()
def generate_random_codes(self): """ Used to generate random key/secret pairings. Use this after you've added the other data in place of save(). """ self.key = uuid.uuid4().hex # LRS CHANGE - KEPT THE SECRET KEY AT 16 LIKE BEFORE (WHEN NOT USING RSA) if not self.rsa_signature: self.secret = get_random_string(length=REGULAR_SECRET_SIZE) self.save()
def create_token(self, consumer, token_type, timestamp, scope, user=None, callback=None, callback_confirmed=False): """Shortcut to create a token with random key/secret.""" token = self.create(consumer=consumer, token_type=token_type, timestamp=timestamp, scope=scope, user=user, callback=callback, callback_confirmed=callback_confirmed, key=uuid.uuid4().hex, secret=get_random_string(length=SECRET_SIZE)) return token