mirror of
https://github.com/arcan1s/queued.git
synced 2025-07-15 06:45:46 +00:00
implement auth for get option methods to hide sensetive settings
This commit is contained in:
@ -225,7 +225,8 @@ QueuedctlCommon::process(QCommandLineParser &_parser, const QString &_cache,
|
||||
break;
|
||||
}
|
||||
case QueuedctlArgument::OptionGet: {
|
||||
result = QueuedctlOption::getOption(args.at(1));
|
||||
QString token = QueuedctlAuth::getToken(_cache, _user);
|
||||
result = QueuedctlOption::getOption(args.at(1), token);
|
||||
break;
|
||||
}
|
||||
case QueuedctlArgument::OptionSet: {
|
||||
|
@ -38,12 +38,12 @@ QueuedctlOption::editOption(const QString &_option, const QVariant &_value,
|
||||
|
||||
|
||||
QueuedctlCommon::QueuedctlResult
|
||||
QueuedctlOption::getOption(const QString &_option)
|
||||
QueuedctlOption::getOption(const QString &_option, const QString &_token)
|
||||
{
|
||||
qCDebug(LOG_APP) << "Get option" << _option;
|
||||
|
||||
QueuedctlCommon::QueuedctlResult output;
|
||||
auto res = QueuedCoreAdaptor::getOption(_option);
|
||||
auto res = QueuedCoreAdaptor::getOption(_option, _token);
|
||||
res.match(
|
||||
[&output](const QVariant &val) {
|
||||
output.status = val.isValid();
|
||||
|
@ -27,7 +27,8 @@ namespace QueuedctlOption
|
||||
QueuedctlCommon::QueuedctlResult editOption(const QString &_option,
|
||||
const QVariant &_value,
|
||||
const QString &_token);
|
||||
QueuedctlCommon::QueuedctlResult getOption(const QString &_option);
|
||||
QueuedctlCommon::QueuedctlResult getOption(const QString &_option,
|
||||
const QString &_token);
|
||||
void parserGet(QCommandLineParser &_parser);
|
||||
void parserSet(QCommandLineParser &_parser);
|
||||
};
|
||||
|
@ -39,8 +39,8 @@ QueuedctlPlugins::addPlugin(const QString &_plugin, const QString &_token)
|
||||
|
||||
QueuedctlCommon::QueuedctlResult QueuedctlPlugins::listPlugins()
|
||||
{
|
||||
auto res
|
||||
= QueuedCoreAdaptor::getOption(QueuedConfig::QueuedSettings::Plugins);
|
||||
auto res = QueuedCoreAdaptor::getOption(
|
||||
QueuedConfig::QueuedSettings::Plugins, "");
|
||||
|
||||
QueuedctlCommon::QueuedctlResult output;
|
||||
res.match(
|
||||
|
Reference in New Issue
Block a user