*/
$sensitive = $input->getOption('sensitive');
try {
- $currSensitive = $this->appConfig->isLazy($appName, $configName);
- if ($sensitive === null || $sensitive === $currSensitive || !$this->ask($input, $output, ($sensitive) ? 'LAZY' : 'NOT LAZY')) {
+ $currSensitive = $this->appConfig->isSensitive($appName, $configName, null);
+ if ($sensitive === null || $sensitive === $currSensitive || !$this->ask($input, $output, ($sensitive) ? 'SENSITIVE' : 'NOT SENSITIVE')) {
$sensitive = $currSensitive;
}
} catch (AppConfigUnknownKeyException) {
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 [
'app' => $app,
'key' => $key,
- 'value' => $cache[$app][$key],
+ 'value' => $value,
'type' => $type,
'lazy' => $lazy,
'typeString' => $typeString,
- 'sensitive' => $this->isSensitive($app, $key, null)
+ 'sensitive' => $sensitive
];
}
[
'app' => 'sensitive-app',
'key' => 'lazy-key',
- 'value' => $this->baseStruct['sensitive-app']['lazy-key']['encrypted'],
+ 'value' => 'value',
'type' => 4,
'lazy' => true,
'typeString' => 'string',