diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-04-24 11:05:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-24 11:05:18 +0200 |
commit | e0e687f2a7d15062b6bb80cba4009787bbe91cc7 (patch) | |
tree | e1f5906d413a0b2dc86f16db24122a09db9f8317 | |
parent | 04eed20a64647e844108f982ebd4a9cec10c804f (diff) | |
parent | 7969301976ddfaafff50b4b5634ab9ffaf01b108 (diff) | |
download | nextcloud-server-e0e687f2a7d15062b6bb80cba4009787bbe91cc7.tar.gz nextcloud-server-e0e687f2a7d15062b6bb80cba4009787bbe91cc7.zip |
Merge pull request #9287 from nextcloud/backport/9280/stable-swift-v3
[swift] 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 e3b46069fe8..369873b1914 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -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', ], ], diff --git a/lib/private/Files/ObjectStore/SwiftFactory.php b/lib/private/Files/ObjectStore/SwiftFactory.php index 85bba573001..caa4774daba 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); |