def generate_tokens(callback_key): """ Function to generate security token """ random_hash = generate_random_security_hash() return generate_security_hash(random_hash, callback_key), random_hash
def validate_callback_key(self, attrs, source): if get_boolean_value(attrs.pop(source, None)): attrs[source] = generate_random_security_hash() return attrs