aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-07-26 15:15:56 +0200
committerGitHub <noreply@github.com>2019-07-26 15:15:56 +0200
commit2e803dc3d37f8f5eebe3d262bd6cc25fe97e73cd (patch)
tree95b57bfac9c85289f87d71fff1c3f003c7a99b74 /lib/private
parent71e5300f84576bd95bdad5262318c0e0affc0ade (diff)
parent78201bcb729567915b772d0259d992adb2be1991 (diff)
downloadnextcloud-server-2e803dc3d37f8f5eebe3d262bd6cc25fe97e73cd.tar.gz
nextcloud-server-2e803dc3d37f8f5eebe3d262bd6cc25fe97e73cd.zip
Merge pull request #16555 from nextcloud/fix/16529/mask-keys
use a pattern to identify sensitive config keys
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/AppConfig.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php
index 6d24ca5fa8e..8e921dbb7cf 100644
--- a/lib/private/AppConfig.php
+++ b/lib/private/AppConfig.php
@@ -44,10 +44,10 @@ class AppConfig implements IAppConfig {
/** @var array[] */
protected $sensitiveValues = [
'spreed' => [
- 'turn_server_secret',
+ '/^turn_server_secret$/',
],
'user_ldap' => [
- 'ldap_agent_password',
+ '/^(s..)?ldap_agent_password$/',
],
];
@@ -289,8 +289,9 @@ class AppConfig implements IAppConfig {
$values = $this->getValues($app, false);
if (isset($this->sensitiveValues[$app])) {
- foreach ($this->sensitiveValues[$app] as $sensitiveKey) {
- if (isset($values[$sensitiveKey])) {
+ foreach ($this->sensitiveValues[$app] as $sensitiveKeyExp) {
+ $sensitiveKeys = preg_grep($sensitiveKeyExp, array_keys($values));
+ foreach ($sensitiveKeys as $sensitiveKey) {
$values[$sensitiveKey] = IConfig::SENSITIVE_VALUE;
}
}