1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

ConfigServer+LibConfig: Add pledge_domains() API

This API lets applications specify which configuration domains they
will be accessing throughout their lifetime. It works similarly in
spirit to the kernel's pledge().

You cannot pledge_domains() more than once, and once you have used it,
it's no longer possible to access any other configuration domain.

This is obviously just a first cut of this mechanism, and we may need
to tweak it further as we go.
This commit is contained in:
Andreas Kling 2021-08-25 20:02:10 +02:00
parent 870ecd5190
commit eeddaa988a
5 changed files with 64 additions and 0 deletions

View file

@ -19,6 +19,11 @@ Client& Client::the()
return *s_the;
}
void Client::pledge_domains(Vector<String> const& domains)
{
async_pledge_domains(domains);
}
String Client::read_string(StringView domain, StringView group, StringView key, StringView fallback)
{
return read_string_value(domain, group, key).value_or(fallback);