コード例 #1
0
    def test_parse_barbican_api_url(self):
        # assert that the correct format is handled correctly
        CONF.keymgr.encryption_api_url = "http://host:port/v1/"
        dummy = barbican.BarbicanKeyManager()
        self.assertEqual(dummy._barbican_endpoint, "http://host:port")

        # assert that invalid api url formats will raise an exception
        CONF.keymgr.encryption_api_url = "http://host:port/"
        self.assertRaises(exception.KeyManagerError,
                          barbican.BarbicanKeyManager)
        CONF.keymgr.encryption_api_url = "http://host:port/secrets"
        self.assertRaises(exception.KeyManagerError,
                          barbican.BarbicanKeyManager)
コード例 #2
0
 def _create_key_manager(self):
     return barbican.BarbicanKeyManager()