mirror of https://github.com/nextcloud/server
Merge pull request #44640 from nextcloud/fix/noid/returns-real-value-on-details
fix(appconfig): returns correct value on details
This commit is contained in:
commit
b75bb088d1
|
@ -173,8 +173,8 @@ class SetConfig extends Base {
|
||||||
*/
|
*/
|
||||||
$sensitive = $input->getOption('sensitive');
|
$sensitive = $input->getOption('sensitive');
|
||||||
try {
|
try {
|
||||||
$currSensitive = $this->appConfig->isLazy($appName, $configName);
|
$currSensitive = $this->appConfig->isSensitive($appName, $configName, null);
|
||||||
if ($sensitive === null || $sensitive === $currSensitive || !$this->ask($input, $output, ($sensitive) ? 'LAZY' : 'NOT LAZY')) {
|
if ($sensitive === null || $sensitive === $currSensitive || !$this->ask($input, $output, ($sensitive) ? 'SENSITIVE' : 'NOT SENSITIVE')) {
|
||||||
$sensitive = $currSensitive;
|
$sensitive = $currSensitive;
|
||||||
}
|
}
|
||||||
} catch (AppConfigUnknownKeyException) {
|
} catch (AppConfigUnknownKeyException) {
|
||||||
|
|
|
@ -1034,14 +1034,20 @@ class AppConfig implements IAppConfig {
|
||||||
throw new AppConfigUnknownKeyException('unknown config key');
|
throw new AppConfigUnknownKeyException('unknown config key');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$value = $cache[$app][$key];
|
||||||
|
$sensitive = $this->isSensitive($app, $key, null);
|
||||||
|
if ($sensitive && str_starts_with($value, self::ENCRYPTION_PREFIX)) {
|
||||||
|
$value = $this->crypto->decrypt(substr($value, self::ENCRYPTION_PREFIX_LENGTH));
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'app' => $app,
|
'app' => $app,
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'value' => $cache[$app][$key],
|
'value' => $value,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'lazy' => $lazy,
|
'lazy' => $lazy,
|
||||||
'typeString' => $typeString,
|
'typeString' => $typeString,
|
||||||
'sensitive' => $this->isSensitive($app, $key, null)
|
'sensitive' => $sensitive
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1253,7 +1253,7 @@ class AppConfigTest extends TestCase {
|
||||||
[
|
[
|
||||||
'app' => 'sensitive-app',
|
'app' => 'sensitive-app',
|
||||||
'key' => 'lazy-key',
|
'key' => 'lazy-key',
|
||||||
'value' => $this->baseStruct['sensitive-app']['lazy-key']['encrypted'],
|
'value' => 'value',
|
||||||
'type' => 4,
|
'type' => 4,
|
||||||
'lazy' => true,
|
'lazy' => true,
|
||||||
'typeString' => 'string',
|
'typeString' => 'string',
|
||||||
|
|
Loading…
Reference in New Issue