Esempio n. 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()
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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)
Esempio n. 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)