Skip to content

Commit 1f23587

Browse files
author
Yevhen Miroshnychenko
committed
MAGETWO-64556: Configuration management - Hide sensitive values from config:show command
1 parent 561318f commit 1f23587

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/code/Magento/Config/Console/Command/ConfigShow/ValueProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function process($scope, $scopeCode, $value, $path)
9292
$backendModel->setValue($value);
9393
$backendModel->afterLoad();
9494

95-
return ($backendModel instanceof Encrypted)
95+
return ($backendModel instanceof Encrypted) && !empty($backendModel->getValue())
9696
? self::SAFE_PLACEHOLDER
9797
: $backendModel->getValue();
9898
}

app/code/Magento/Config/Console/Command/ConfigShowCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
144144
try {
145145
$this->scope = $input->getOption(self::INPUT_OPTION_SCOPE);
146146
$this->scopeCode = $input->getOption(self::INPUT_OPTION_SCOPE_CODE);
147-
$this->inputPath = $input->getArgument(self::INPUT_ARGUMENT_PATH);
147+
$this->inputPath = trim($input->getArgument(self::INPUT_ARGUMENT_PATH), "/");
148148

149149
$this->scopeValidator->isValid($this->scope, $this->scopeCode);
150150
$configPath = $this->pathResolver->resolve($this->inputPath, $this->scope, $this->scopeCode);

app/code/Magento/Config/Test/Unit/Console/Command/ConfigShow/ValueProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function processDataProvider()
178178
'hasBackendModel' => true,
179179
'expectsGetBackendModel' => $this->once(),
180180
'expectsCreate' => $this->never(),
181-
'expectsGetValue' => $this->never(),
181+
'expectsGetValue' => $this->once(),
182182
'expectsValue' => ValueProcessor::SAFE_PLACEHOLDER,
183183
'className' => Encrypted::class,
184184
],

0 commit comments

Comments
 (0)