diff --git a/Userland/Services/ConfigServer/ClientConnection.cpp b/Userland/Services/ConfigServer/ClientConnection.cpp index e0ad17c0ee7..d52e2bf2374 100644 --- a/Userland/Services/ConfigServer/ClientConnection.cpp +++ b/Userland/Services/ConfigServer/ClientConnection.cpp @@ -135,6 +135,22 @@ void ClientConnection::sync_dirty_domains_to_disk() } } +Messages::ConfigServer::ListConfigKeysResponse ClientConnection::list_config_keys(String const& domain, String const& group) +{ + if (!validate_access(domain, group, "")) + return Vector {}; + auto& config = ensure_domain_config(domain); + return { config.keys(group) }; +} + +Messages::ConfigServer::ListConfigGroupsResponse ClientConnection::list_config_groups(String const& domain) +{ + if (!validate_access(domain, "", "")) + return Vector {}; + auto& config = ensure_domain_config(domain); + return { config.groups() }; +} + Messages::ConfigServer::ReadStringValueResponse ClientConnection::read_string_value(String const& domain, String const& group, String const& key) { if (!validate_access(domain, group, key)) diff --git a/Userland/Services/ConfigServer/ClientConnection.h b/Userland/Services/ConfigServer/ClientConnection.h index 24332b7a020..60b8c34a3ab 100644 --- a/Userland/Services/ConfigServer/ClientConnection.h +++ b/Userland/Services/ConfigServer/ClientConnection.h @@ -27,6 +27,8 @@ private: virtual void pledge_domains(Vector const&) override; virtual void monitor_domain(String const&) override; + virtual Messages::ConfigServer::ListConfigGroupsResponse list_config_groups([[maybe_unused]] String const& domain) override; + virtual Messages::ConfigServer::ListConfigKeysResponse list_config_keys([[maybe_unused]] String const& domain, [[maybe_unused]] String const& group) override; virtual Messages::ConfigServer::ReadStringValueResponse read_string_value([[maybe_unused]] String const& domain, [[maybe_unused]] String const& group, [[maybe_unused]] String const& key) override; virtual Messages::ConfigServer::ReadI32ValueResponse read_i32_value([[maybe_unused]] String const& domain, [[maybe_unused]] String const& group, [[maybe_unused]] String const& key) override; virtual Messages::ConfigServer::ReadBoolValueResponse read_bool_value([[maybe_unused]] String const& domain, [[maybe_unused]] String const& group, [[maybe_unused]] String const& key) override; diff --git a/Userland/Services/ConfigServer/ConfigServer.ipc b/Userland/Services/ConfigServer/ConfigServer.ipc index a0e65fe2135..e7bd355cb19 100644 --- a/Userland/Services/ConfigServer/ConfigServer.ipc +++ b/Userland/Services/ConfigServer/ConfigServer.ipc @@ -4,6 +4,9 @@ endpoint ConfigServer monitor_domain(String domain) =| + list_config_groups(String domain) => (Vector groups) + list_config_keys(String domain, String group) => (Vector keys) + read_string_value(String domain, String group, String key) => (Optional value) read_i32_value(String domain, String group, String key) => (Optional value) read_bool_value(String domain, String group, String key) => (Optional value)