diff --git a/keystoneauth1/extras/kerberos/__init__.py b/keystoneauth1/extras/kerberos/__init__.py index 1092910c..6ae3ebde 100644 --- a/keystoneauth1/extras/kerberos/__init__.py +++ b/keystoneauth1/extras/kerberos/__init__.py @@ -75,9 +75,11 @@ class MappedKerberos(federation.FederationBaseAuth): use the standard keystone auth process to scope that to any given project. """ - def __init__(self, *args, **kwargs): + def __init__(self, auth_url, identity_provider, protocol, **kwargs): _dependency_check() - super(MappedKerberos, self).__init__(*args, **kwargs) + + super(MappedKerberos, self).__init__(auth_url, identity_provider, + protocol, **kwargs) def get_unscoped_auth_ref(self, session, **kwargs): resp = session.get(self.federated_token_url, diff --git a/keystoneauth1/extras/kerberos/_loading.py b/keystoneauth1/extras/kerberos/_loading.py index 797a18a6..6925ad8e 100644 --- a/keystoneauth1/extras/kerberos/_loading.py +++ b/keystoneauth1/extras/kerberos/_loading.py @@ -25,7 +25,7 @@ class Kerberos(loading.BaseV3Loader): return kerberos.requests_kerberos is not None -class MappedKerberos(loading.BaseV3Loader): +class MappedKerberos(loading.BaseFederationLoader): @property def plugin_class(self): diff --git a/keystoneauth1/tests/unit/extras/kerberos/test_fedkerb_loading.py b/keystoneauth1/tests/unit/extras/kerberos/test_fedkerb_loading.py index 2b189fcc..874543c8 100644 --- a/keystoneauth1/tests/unit/extras/kerberos/test_fedkerb_loading.py +++ b/keystoneauth1/tests/unit/extras/kerberos/test_fedkerb_loading.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +from keystoneauth1 import exceptions from keystoneauth1 import loading from keystoneauth1.tests.unit import utils as test_utils @@ -22,12 +23,26 @@ class FedKerbLoadingTests(test_utils.TestCase): allowed_opts = ['domain-id', 'domain-name', + 'identity-provider', 'project-id', 'project-name', 'project-domain-id', 'project-domain-name', + 'protocol', 'trust-id', 'auth-url', ] self.assertItemsEqual(allowed_opts, opts) + + def create(self, **kwargs): + loader = loading.get_plugin_loader('v3fedkerb') + return loader.load_from_options(**kwargs) + + def test_load_none(self): + self.assertRaises(exceptions.MissingRequiredOptions, self.create) + + def test_load(self): + self.create(auth_url='auth_url', + identity_provider='idp', + protocol='protocol')