diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-04-24 10:49:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-24 10:49:27 +0300 |
commit | 1ceb081c9be32fd0bb6167171f7437852ab17207 (patch) | |
tree | 29bfda53b478f8b6cd5010ca9e7dd96d01678f62 | |
parent | 9339c7d20ff5383b360f79c0ded299c1bfc2e704 (diff) | |
parent | ba71918ad2f6fb336852fd492e5e819eb38201c9 (diff) |
Merge pull request #9280 from nextcloud/bugfix/noid/swift-v3-scope
Swift v3 requires setting a scope
-rw-r--r-- | config/config.sample.php | 10 | ||||
-rw-r--r-- | lib/private/Files/ObjectStore/SwiftFactory.php | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index c9b9c9a1ede..40d83cea372 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1229,10 +1229,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', ], ], diff --git a/lib/private/Files/ObjectStore/SwiftFactory.php b/lib/private/Files/ObjectStore/SwiftFactory.php index d10aaf467ae..8baaec985e8 100644 --- a/lib/private/Files/ObjectStore/SwiftFactory.php +++ b/lib/private/Files/ObjectStore/SwiftFactory.php @@ -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); |