arrow::flight::FlightEndpoint create_endpoint()

in src/afs.cc [4175:4203]


	arrow::flight::FlightEndpoint create_endpoint(std::string ticket)
	{
#if ARROW_VERSION_MAJOR >= 14
		return arrow::flight::FlightEndpoint{
			arrow::flight::Ticket{std::move(ticket)}, {}, std::nullopt, ""};
#elif ARROW_VERSION_MAJOR >= 13
		return arrow::flight::FlightEndpoint{
			arrow::flight::Ticket{std::move(ticket)}, {}, std::nullopt};
#else
		return arrow::flight::FlightEndpoint
		{
			arrow::flight::Ticket{std::move(ticket), {}};
#endif
	}

	arrow::Result<uint64_t> session_id(const arrow::flight::ServerCallContext& context)
	{
		auto middleware = reinterpret_cast<HeaderAuthServerMiddleware*>(
			context.GetMiddleware("header-auth"));
		if (!middleware)
		{
			return arrow::flight::MakeFlightError(
				arrow::flight::FlightStatusCode::Unauthenticated, "no authorization");
		}
		return middleware->session_id();
	}

	Proxy* proxy_;
};