Fix parameters for Kerberos Auth Plugin
The auth plugin was not loading when called from the CLI due to the mismatch of variable argument parameter calling convention. This was due in part to not specfying the parameters properly in the plugin, and also due to extending from the wrong base class. Closes-Bug: #1622079 Change-Id: I37a8320b61e7468c173f81348b0a7dd0ee1ad966
This commit is contained in:
parent
c5aeaf6aff
commit
1306c8b0e1
@ -75,9 +75,11 @@ class MappedKerberos(federation.FederationBaseAuth):
|
|||||||
use the standard keystone auth process to scope that to any given project.
|
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()
|
_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):
|
def get_unscoped_auth_ref(self, session, **kwargs):
|
||||||
resp = session.get(self.federated_token_url,
|
resp = session.get(self.federated_token_url,
|
||||||
|
@ -25,7 +25,7 @@ class Kerberos(loading.BaseV3Loader):
|
|||||||
return kerberos.requests_kerberos is not None
|
return kerberos.requests_kerberos is not None
|
||||||
|
|
||||||
|
|
||||||
class MappedKerberos(loading.BaseV3Loader):
|
class MappedKerberos(loading.BaseFederationLoader):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def plugin_class(self):
|
def plugin_class(self):
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from keystoneauth1 import exceptions
|
||||||
from keystoneauth1 import loading
|
from keystoneauth1 import loading
|
||||||
from keystoneauth1.tests.unit import utils as test_utils
|
from keystoneauth1.tests.unit import utils as test_utils
|
||||||
|
|
||||||
@ -22,12 +23,26 @@ class FedKerbLoadingTests(test_utils.TestCase):
|
|||||||
|
|
||||||
allowed_opts = ['domain-id',
|
allowed_opts = ['domain-id',
|
||||||
'domain-name',
|
'domain-name',
|
||||||
|
'identity-provider',
|
||||||
'project-id',
|
'project-id',
|
||||||
'project-name',
|
'project-name',
|
||||||
'project-domain-id',
|
'project-domain-id',
|
||||||
'project-domain-name',
|
'project-domain-name',
|
||||||
|
'protocol',
|
||||||
'trust-id',
|
'trust-id',
|
||||||
'auth-url',
|
'auth-url',
|
||||||
]
|
]
|
||||||
|
|
||||||
self.assertItemsEqual(allowed_opts, opts)
|
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')
|
||||||
|
Loading…
Reference in New Issue
Block a user