Exemple #1
0
    def test_make_auth_plugin(self):
        creds = {'strategy': 'keystone'}
        insecure = False
        configure_via_auth = True

        self.mock.StubOutWithMock(auth, 'get_plugin_from_strategy')
        auth.get_plugin_from_strategy('keystone', creds, insecure,
                                      configure_via_auth)

        self.mock.ReplayAll()

        self.client.make_auth_plugin(creds, insecure)

        self.mock.VerifyAll()
Exemple #2
0
 def make_auth_plugin(self, creds):
     """
     Returns an instantiated authentication plugin.
     """
     strategy = creds.get('strategy', 'noauth')
     plugin = auth.get_plugin_from_strategy(strategy, creds)
     return plugin
Exemple #3
0
 def make_auth_plugin(self, creds, insecure):
     """
     Returns an instantiated authentication plugin.
     """
     strategy = creds.get("strategy", "noauth")
     plugin = auth.get_plugin_from_strategy(strategy, creds, insecure, self.configure_via_auth)
     return plugin
Exemple #4
0
 def make_auth_plugin(self, creds):
     strategy = creds.get('strategy', 'noauth')
     plugin_class = auth.get_plugin_from_strategy(strategy)
     plugin = plugin_class(creds)
     return plugin
Exemple #5
0
 def test_get_plugin_from_strategy_keystone_configure_via_auth_false(self):
     strategy = auth.get_plugin_from_strategy('keystone',
                                              configure_via_auth=False)
     self.assertIsInstance(strategy, auth.KeystoneStrategy)
     self.assertFalse(strategy.configure_via_auth)
Exemple #6
0
 def test_get_plugin_from_strategy_keystone(self):
     strategy = auth.get_plugin_from_strategy('keystone')
     self.assertIsInstance(strategy, auth.KeystoneStrategy)
     self.assertTrue(strategy.configure_via_auth)
Exemple #7
0
 def test_get_plugin_from_strategy_keystone_configure_via_auth_false(self):
     strategy = auth.get_plugin_from_strategy('keystone',
                                              configure_via_auth=False)
     self.assertIsInstance(strategy, auth.KeystoneStrategy)
     self.assertFalse(strategy.configure_via_auth)
Exemple #8
0
 def test_get_plugin_from_strategy_keystone(self):
     strategy = auth.get_plugin_from_strategy('keystone')
     self.assertIsInstance(strategy, auth.KeystoneStrategy)
     self.assertTrue(strategy.configure_via_auth)