2013-08-10 07:46:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Core/Types.h>
|
2019-10-08 13:44:44 +00:00
|
|
|
#include <Access/Authentication.h>
|
2019-10-08 14:40:24 +00:00
|
|
|
#include <Access/AllowedClientHosts.h>
|
2017-03-25 05:46:50 +00:00
|
|
|
|
2017-03-25 05:55:49 +00:00
|
|
|
#include <memory>
|
2019-03-29 20:31:06 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
#include <unordered_set>
|
2013-08-10 07:46:45 +00:00
|
|
|
|
|
|
|
|
2017-03-25 05:55:49 +00:00
|
|
|
namespace Poco
|
2016-01-11 21:46:36 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
namespace Util
|
|
|
|
{
|
|
|
|
class AbstractConfiguration;
|
|
|
|
}
|
2017-03-25 05:55:49 +00:00
|
|
|
}
|
2013-08-10 07:46:45 +00:00
|
|
|
|
|
|
|
|
2017-03-25 05:55:49 +00:00
|
|
|
namespace DB
|
2013-08-10 07:46:45 +00:00
|
|
|
{
|
2017-01-14 02:53:40 +00:00
|
|
|
/** User and ACL.
|
2013-08-10 07:46:45 +00:00
|
|
|
*/
|
|
|
|
struct User
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
String name;
|
2013-08-10 07:46:45 +00:00
|
|
|
|
2019-10-08 13:44:44 +00:00
|
|
|
/// Required password.
|
|
|
|
Authentication authentication;
|
2013-08-10 07:46:45 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
String profile;
|
2013-08-10 07:46:45 +00:00
|
|
|
|
2019-10-08 14:40:24 +00:00
|
|
|
AllowedClientHosts allowed_client_hosts;
|
2013-08-10 07:46:45 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
/// List of allowed databases.
|
|
|
|
using DatabaseSet = std::unordered_set<std::string>;
|
2019-11-18 13:35:31 +00:00
|
|
|
std::optional<DatabaseSet> databases;
|
2015-10-01 15:10:41 +00:00
|
|
|
|
2019-09-14 22:55:22 +00:00
|
|
|
/// List of allowed dictionaries.
|
2019-09-13 08:22:34 +00:00
|
|
|
using DictionarySet = std::unordered_set<std::string>;
|
2019-11-18 13:35:31 +00:00
|
|
|
std::optional<DictionarySet> dictionaries;
|
2019-09-13 08:22:34 +00:00
|
|
|
|
2019-03-29 20:31:06 +00:00
|
|
|
/// Table properties.
|
|
|
|
using PropertyMap = std::unordered_map<std::string /* name */, std::string /* value */>;
|
|
|
|
using TableMap = std::unordered_map<std::string /* table */, PropertyMap /* properties */>;
|
|
|
|
using DatabaseMap = std::unordered_map<std::string /* database */, TableMap /* tables */>;
|
|
|
|
DatabaseMap table_props;
|
|
|
|
|
2019-12-01 22:01:05 +00:00
|
|
|
bool is_quota_management_allowed = false;
|
|
|
|
|
2018-07-08 04:54:37 +00:00
|
|
|
User(const String & name_, const String & config_elem, const Poco::Util::AbstractConfiguration & config);
|
2013-08-10 07:46:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|