summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-07-07 19:29:43 +0200
committerGitHub <noreply@github.com>2016-07-07 19:29:43 +0200
commit2a1a3957b65e847d51c4c735acf033f7df29cba6 (patch)
treee53ac77b3dfa0d425b9ea8084420988a4d7054b7 /apps/files_external
parentf5ed01617045a816977688a6c9e549fdf2dab509 (diff)
parentbeae00a5e5457c41994e54c7f0563245d9ccf5ce (diff)
downloadnextcloud-server-2a1a3957b65e847d51c4c735acf033f7df29cba6.tar.gz
nextcloud-server-2a1a3957b65e847d51c4c735acf033f7df29cba6.zip
Merge pull request #333 from nextcloud/sync-master
Sync master
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/Command/Backends.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/apps/files_external/lib/Command/Backends.php b/apps/files_external/lib/Command/Backends.php
index 260ea210397..d1da6db3f6a 100644
--- a/apps/files_external/lib/Command/Backends.php
+++ b/apps/files_external/lib/Command/Backends.php
@@ -98,15 +98,30 @@ class Backends extends Base {
$result = [
'name' => $data['name'],
'identifier' => $data['identifier'],
- 'configuration' => array_map(function (DefinitionParameter $parameter) {
- return $parameter->getTypeName();
- }, $data['configuration'])
+ 'configuration' => $this->formatConfiguration($data['configuration'])
];
if ($backend instanceof Backend) {
$result['storage_class'] = $backend->getStorageClass();
$authBackends = $this->backendService->getAuthMechanismsByScheme(array_keys($backend->getAuthSchemes()));
$result['supported_authentication_backends'] = array_keys($authBackends);
+ $authConfig = array_map(function (AuthMechanism $auth) {
+ return $this->serializeAuthBackend($auth)['configuration'];
+ }, $authBackends);
+ $result['authentication_configuration'] = array_combine(array_keys($authBackends), $authConfig);
}
return $result;
}
+
+ /**
+ * @param DefinitionParameter[] $parameters
+ * @return string[]
+ */
+ private function formatConfiguration(array $parameters) {
+ $configuration = array_filter($parameters, function (DefinitionParameter $parameter) {
+ return $parameter->getType() !== DefinitionParameter::VALUE_HIDDEN;
+ });
+ return array_map(function (DefinitionParameter $parameter) {
+ return $parameter->getTypeName();
+ }, $configuration);
+ }
}