summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2019-07-26 13:31:14 +0200
committerBackportbot <backportbot-noreply@rullzer.com>2019-07-26 14:07:17 +0000
commit8c956693a5a02b422955d781d09163552d017644 (patch)
treee561f09d990a8759321c074dc40a1b28d0b1bdcd /lib/private
parent7e1369f5d379a66bb226e8b7c2ca3a4a932a3027 (diff)
downloadnextcloud-server-8c956693a5a02b422955d781d09163552d017644.tar.gz
nextcloud-server-8c956693a5a02b422955d781d09163552d017644.zip
treat sensitive config keys by pattern
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
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;
}
}