Override @c Publisher Default Authentication

 namespace pubsub = ::google::cloud::pubsub; using ::google::cloud::Options; [](std::string project_id, std::string topic_id, std::string const& keyfile) { auto is = std::ifstream(keyfile); is.exceptions(std::ios::badbit); auto contents = std::string(std::istreambuf_iterator<char>(is.rdbuf()), {}); auto topic = pubsub::Topic(std::move(project_id), std::move(topic_id)); return pubsub::Publisher(pubsub::MakePublisherConnection( std::move(topic), Options{}.set<google::cloud::UnifiedCredentialsOption>( google::cloud::MakeServiceAccountCredentials(contents)))); }