Merge pull request #9280 from nextcloud/bugfix/noid/swift-v3-scope
Swift v3 requires setting a scope
This commit is contained in:
commit
1ceb081c9b
|
@ -1229,10 +1229,18 @@ $CONFIG = array(
|
||||||
'name' => 'default',
|
'name' => 'default',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'scope' => [
|
||||||
|
'project' => [
|
||||||
|
'name' => 'service',
|
||||||
|
'domain' => [
|
||||||
|
'name' => 'default',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
'tenantName' => 'service',
|
'tenantName' => 'service',
|
||||||
'serviceName' => 'swift',
|
'serviceName' => 'swift',
|
||||||
'region' => 'regionOne',
|
'region' => 'regionOne',
|
||||||
'url' => "http://yourswifthost:5000/v3",
|
'url' => 'http://yourswifthost:5000/v3',
|
||||||
'bucket' => 'nextcloud',
|
'bucket' => 'nextcloud',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
|
@ -108,6 +108,10 @@ class SwiftFactory {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (isset($this->params['user']) && isset($this->params['user']['name'])) {
|
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);
|
return $this->auth(IdentityV3Service::factory($httpClient), $cacheKey);
|
||||||
} else {
|
} else {
|
||||||
return $this->auth(IdentityV2Service::factory($httpClient), $cacheKey);
|
return $this->auth(IdentityV2Service::factory($httpClient), $cacheKey);
|
||||||
|
|
Loading…
Reference in New Issue