From bd18bc3d0db0e11164dafe41ffaefea237e8ce76 Mon Sep 17 00:00:00 2001 From: Alvaro Lopez Garcia Date: Thu, 23 Jun 2016 13:09:58 +0200 Subject: [PATCH] oidc: fix OpenID Connect scope option There is a missmatch between the option being defined in the OpenIDConnectPassword loader and the OidcPassword class. The loader defines it as "openid-scope" but the OidcPassword constructor only accepts "scope". Closes-Bug: 1594272 Change-Id: I7dbaaa4eb52c900bcd19da4c274bd35dc8b98c6f --- keystoneauth1/loading/_plugins/identity/v3.py | 1 + keystoneauth1/tests/unit/loading/test_v3.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/keystoneauth1/loading/_plugins/identity/v3.py b/keystoneauth1/loading/_plugins/identity/v3.py index 96872680..54699d04 100644 --- a/keystoneauth1/loading/_plugins/identity/v3.py +++ b/keystoneauth1/loading/_plugins/identity/v3.py @@ -111,6 +111,7 @@ class OpenIDConnectPassword(_OpenIDConnectBase): loading.Opt('username', help='Username'), loading.Opt('password', secret=True, help='Password'), loading.Opt('openid-scope', default="profile", + dest='scope', help='OpenID Connect scope that is requested from OP') ]) diff --git a/keystoneauth1/tests/unit/loading/test_v3.py b/keystoneauth1/tests/unit/loading/test_v3.py index b28f7d95..7867946e 100644 --- a/keystoneauth1/tests/unit/loading/test_v3.py +++ b/keystoneauth1/tests/unit/loading/test_v3.py @@ -150,6 +150,8 @@ class OpenIDConnectPasswordTests(OpenIDConnectBaseTests, utils.TestCase): set(['username', 'password', 'openid-scope']).issubset( set([o.name for o in options])) ) + # openid-scope gets renamed into "scope" + self.assertIn('scope', [o.dest for o in options]) def test_basic(self): access_token_endpoint = uuid.uuid4().hex