indigophox commented on code in PR #34817: URL: https://github.com/apache/arrow/pull/34817#discussion_r1252281435
########## cpp/src/arrow/flight/sql/server_session_middleware.cc: ########## @@ -0,0 +1,179 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include <shared_mutex> +#include "arrow/flight/sql/server_session_middleware.h" +#include <boost/lexical_cast.hpp> +#include <boost/uuid/uuid.hpp> +#include <boost/uuid/uuid_generators.hpp> +#include <boost/uuid/uuid_io.hpp> + +namespace arrow { +namespace flight { +namespace sql { + +/// \brief A factory for ServerSessionMiddleware, itself storing session data. +class ServerSessionMiddlewareFactory : public ServerMiddlewareFactory { + protected: + std::map<std::string, std::shared_ptr<FlightSqlSession>> session_store_; + std::shared_mutex session_store_lock_; + boost::uuids::random_generator uuid_generator_; + + std::vector<std::pair<std::string, std::string>> ParseCookieString( Review Comment: I think having it included as non-test code is really useful for "get up and running" use, so I'll have a look at how much refactoring of the cookie_internals stuff would be needed to make this shared. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
