]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix issues with Keystone auth v3 in files_external app 19540/head
authorJulien Lutran <julien.lutran@corp.ovh.com>
Wed, 19 Feb 2020 10:23:51 +0000 (11:23 +0100)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Wed, 15 Apr 2020 08:33:08 +0000 (10:33 +0200)
Signed-off-by: Julien Lutran <julien.lutran@corp.ovh.com>
apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV3.php
apps/files_external/lib/Lib/Backend/Swift.php
lib/private/Files/ObjectStore/SwiftFactory.php

index c8a78f52c418f971223853fca74fe660cf05cade..ee6db4818a688d498f3f7f9aef8d03f43f035a7e 100644 (file)
@@ -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'))
                        ])
                ;
index 25ed72337a12bc193258846b30062f1185935e51..5ac4346b422d166f9ea3d097dbbe669075bdb7e6 100644 (file)
@@ -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),
index 59446576400032c6af519458a5b799ffbdb001c2..7c8a1b995b46c766ab3f0e08e81a13bc5cd0da52 100644 (file)
@@ -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'];