Skip to content

Commit

Permalink
Fix issues with Keystone auth v3 in files_external app
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Lutran <julien.lutran@corp.ovh.com>
  • Loading branch information
jlutran authored and ChristophWurst committed Apr 15, 2020
1 parent d63abeb commit 3e849da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function __construct(IL10N $l) {
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'))
])
;
Expand Down
3 changes: 1 addition & 2 deletions apps/files_external/lib/Lib/Backend/Swift.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ public function __construct(IL10N $l, OpenStackV2 $openstackAuth, Rackspace $rac
->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),
Expand Down
4 changes: 4 additions & 0 deletions lib/private/Files/ObjectStore/SwiftFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ private function getClient() {
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'];
Expand Down

0 comments on commit 3e849da

Please sign in to comment.