2020-07-06 12:23:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-04-06 18:59:34 +00:00
|
|
|
#include <Interpreters/Context.h>
|
2021-02-19 12:51:26 +00:00
|
|
|
#include <Server/HTTP/HTTPRequestHandler.h>
|
2022-09-28 08:45:15 +00:00
|
|
|
#include "config.h"
|
2020-07-06 12:23:36 +00:00
|
|
|
#include <Poco/Logger.h>
|
|
|
|
|
|
|
|
#if USE_ODBC
|
|
|
|
|
2021-03-22 11:40:29 +00:00
|
|
|
|
2020-07-06 12:23:36 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
class Context;
|
2020-07-06 12:23:36 +00:00
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
/// This handler establishes connection to database, and retrieves whether schema is allowed.
|
2021-04-11 06:13:11 +00:00
|
|
|
class SchemaAllowedHandler : public HTTPRequestHandler, WithContext
|
2020-07-06 12:23:36 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-04-11 06:13:11 +00:00
|
|
|
SchemaAllowedHandler(size_t keep_alive_timeout_, ContextPtr context_)
|
|
|
|
: WithContext(context_)
|
|
|
|
, log(&Poco::Logger::get("SchemaAllowedHandler"))
|
2021-04-06 18:59:34 +00:00
|
|
|
, keep_alive_timeout(keep_alive_timeout_)
|
2020-07-06 12:23:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-01-03 09:42:15 +00:00
|
|
|
void handleRequest(HTTPServerRequest & request, HTTPServerResponse & response) override;
|
2020-07-06 12:23:36 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Poco::Logger * log;
|
|
|
|
size_t keep_alive_timeout;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|