From: Julien Lutran Date: Wed, 19 Feb 2020 10:23:51 +0000 (+0100) Subject: Fix issues with Keystone auth v3 in files_external app X-Git-Tag: v19.0.0beta3~5^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3e849daf11ad3c30143f2903fb7b528ef1f7da14;p=nextcloud-server.git Fix issues with Keystone auth v3 in files_external app Signed-off-by: Julien Lutran --- diff --git a/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV3.php b/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV3.php index c8a78f52c41..ee6db4818a6 100644 --- a/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV3.php +++ b/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV3.php @@ -46,6 +46,7 @@ class OpenStackV3 extends AuthMechanism { new DefinitionParameter('domain', $l->t('Domain')), (new DefinitionParameter('password', $l->t('Password'))) ->setType(DefinitionParameter::VALUE_PASSWORD), + new DefinitionParameter('tenant', $l->t('Tenant name')), new DefinitionParameter('url', $l->t('Identity endpoint URL')) ]) ; diff --git a/apps/files_external/lib/Lib/Backend/Swift.php b/apps/files_external/lib/Lib/Backend/Swift.php index 25ed72337a1..5ac4346b422 100644 --- a/apps/files_external/lib/Lib/Backend/Swift.php +++ b/apps/files_external/lib/Lib/Backend/Swift.php @@ -44,8 +44,7 @@ class Swift extends Backend { ->addParameters([ (new DefinitionParameter('service_name', $l->t('Service name'))) ->setFlag(DefinitionParameter::FLAG_OPTIONAL), - (new DefinitionParameter('region', $l->t('Region'))) - ->setFlag(DefinitionParameter::FLAG_OPTIONAL), + new DefinitionParameter('region', $l->t('Region')), new DefinitionParameter('bucket', $l->t('Bucket')), (new DefinitionParameter('timeout', $l->t('Request timeout (seconds)'))) ->setFlag(DefinitionParameter::FLAG_OPTIONAL), diff --git a/lib/private/Files/ObjectStore/SwiftFactory.php b/lib/private/Files/ObjectStore/SwiftFactory.php index 59446576400..7c8a1b995b4 100644 --- a/lib/private/Files/ObjectStore/SwiftFactory.php +++ b/lib/private/Files/ObjectStore/SwiftFactory.php @@ -119,6 +119,10 @@ class SwiftFactory { if (!isset($this->params['tenantName']) && isset($this->params['tenant'])) { $this->params['tenantName'] = $this->params['tenant']; } + if (isset($this->params['domain'])) { + $this->params['scope']['project']['name'] = $this->params['tenant']; + $this->params['scope']['project']['domain']['name'] = $this->params['domain']; + } $this->params = array_merge(self::DEFAULT_OPTIONS, $this->params); $cacheKey = $userName . '@' . $this->params['url'] . '/' . $this->params['container'];