From d0cdc355a4f7a4fcb03c65b8994de436f4b00a52 Mon Sep 17 00:00:00 2001 From: Samriddhi Date: Mon, 3 Apr 2017 14:42:37 +0530 Subject: [PATCH] Updated inconsistent value of scope parameter For explicit unscoped authentication, the keystome server specifies the scope parameter value as 'unscoped'. However keystoneauth1 initialises it to {'unscoped': {}}. This patch removes this inconsistency. Updated the corresponding test for unscoped request which checks the scope parameter in auth to match the 'unscoped' string. Partial-Bug #1637682 Change-Id: I1c9d89fd86773f4acecbefcdad4dca6cff16b58d --- keystoneauth1/identity/v3/base.py | 2 +- keystoneauth1/tests/unit/identity/test_identity_v3.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keystoneauth1/identity/v3/base.py b/keystoneauth1/identity/v3/base.py index 51b78d5c..1f8f8de0 100644 --- a/keystoneauth1/identity/v3/base.py +++ b/keystoneauth1/identity/v3/base.py @@ -154,7 +154,7 @@ class Auth(BaseAuth): elif self.trust_id: body['auth']['scope'] = {'OS-TRUST:trust': {'id': self.trust_id}} elif self.unscoped: - body['auth']['scope'] = {'unscoped': {}} + body['auth']['scope'] = 'unscoped' # NOTE(jamielennox): we add nocatalog here rather than in token_url # directly as some federation plugins require the base token_url diff --git a/keystoneauth1/tests/unit/identity/test_identity_v3.py b/keystoneauth1/tests/unit/identity/test_identity_v3.py index 27018213..5c88105b 100644 --- a/keystoneauth1/tests/unit/identity/test_identity_v3.py +++ b/keystoneauth1/tests/unit/identity/test_identity_v3.py @@ -550,7 +550,7 @@ class V3IdentityPlugin(utils.TestCase): self.assertEqual(token.user_id, ident['password']['user']['id']) self.assertEqual(password, ident['password']['user']['password']) - self.assertEqual({}, body['auth']['scope']['unscoped']) + self.assertEqual('unscoped', body['auth']['scope']) def test_unscoped_with_scope_data(self): a = v3.Password(self.TEST_URL,