MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / parseUsers

Method parseUsers

src/Access/UsersConfigParser.cpp:855–882  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

853
854
855std::vector<AccessEntityPtr> UsersConfigParser::parseUsers(
856 const Poco::Util::AbstractConfiguration & config,
857 const std::unordered_set<UUID> & allowed_profile_ids,
858 const std::unordered_set<UUID> & role_ids_from_users_config) const
859{
860 Poco::Util::AbstractConfiguration::Keys user_names;
861 config.keys("users", user_names);
862
863 bool no_password_allowed = access_control.isNoPasswordAllowed();
864 bool plaintext_password_allowed = access_control.isPlaintextPasswordAllowed();
865
866 std::vector<AccessEntityPtr> users;
867 users.reserve(user_names.size());
868 for (const auto & user_name : user_names)
869 {
870 try
871 {
872 users.push_back(parseUser(config, user_name, allowed_profile_ids, role_ids_from_users_config, access_control, no_password_allowed, plaintext_password_allowed, log));
873 }
874 catch (Exception & e)
875 {
876 e.addMessage(fmt::format("while parsing user '{}' in users configuration file", user_name));
877 throw;
878 }
879 }
880
881 return users;
882}
883
884std::vector<AccessEntityPtr> UsersConfigParser::parseRoles(
885 const Poco::Util::AbstractConfiguration & config,

Callers 1

parseFromConfigMethod · 0.80

Calls 9

parseUserFunction · 0.85
keysMethod · 0.80
isNoPasswordAllowedMethod · 0.80
formatFunction · 0.50
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
addMessageMethod · 0.45

Tested by

no test coverage detected