Fix issues with Keystone auth v3 in files_external app

Signed-off-by: Julien Lutran <julien.lutran@corp.ovh.com>
This commit is contained in:
Julien Lutran 2020-02-19 11:23:51 +01:00 committed by Christoph Wurst
parent d63abebc93
commit 3e849daf11
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
3 changed files with 6 additions and 2 deletions

View 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'))
])
;

View 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),

View 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'];