Merge pull request #9287 from nextcloud/backport/9280/stable-swift-v3

[swift] Swift v3 requires setting a scope
This commit is contained in:
Roeland Jago Douma 2018-04-24 11:05:18 +02:00 committed by GitHub
commit e0e687f2a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -1228,10 +1228,18 @@ $CONFIG = array(
'name' => 'default',
],
],
'scope' => [
'project' => [
'name' => 'service',
'domain' => [
'name' => 'default',
],
],
],
'tenantName' => 'service',
'serviceName' => 'swift',
'region' => 'regionOne',
'url' => "http://yourswifthost:5000/v3",
'url' => 'http://yourswifthost:5000/v3',
'bucket' => 'nextcloud',
],
],

View File

@ -108,6 +108,10 @@ class SwiftFactory {
]);
if (isset($this->params['user']) && isset($this->params['user']['name'])) {
if (!isset($this->params['scope'])) {
throw new StorageAuthException('Scope has to be defined for V3 requests');
}
return $this->auth(IdentityV3Service::factory($httpClient), $cacheKey);
} else {
return $this->auth(IdentityV2Service::factory($httpClient), $cacheKey);