From ba71918ad2f6fb336852fd492e5e819eb38201c9 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 23 Apr 2018 19:32:41 +0200 Subject: Swift v3 requires setting a scope Unscoped auth is not guaranteed to return a catalog. So require the scope to be set properly. See https://developer.openstack.org/api-ref/identity/v3/index.html#password-authentication-with-unscoped-authorization Signed-off-by: Roeland Jago Douma --- lib/private/Files/ObjectStore/SwiftFactory.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') 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); -- cgit v1.2.3