Code to pass through transport_key_id when storing secret

This can happen in either a PUT or a GET request.  The
SecretStorePluginManager must return the plugin corresponding to
the transport_key_id, and must pass the transport_key as part
of the SecretDTO, so that the plugin will know the contents are
encrypted.

Implements: blueprint add-wrapping-key-to-barbican-server
Change-Id: Ieaa2bb7881cd34bcd891764945ef3c159062d4d4
This commit is contained in:
Ade Lee
2014-07-28 00:26:42 -04:00
parent 81c2440286
commit cd70a208c6
8 changed files with 228 additions and 52 deletions

View File

@@ -137,7 +137,7 @@ class WhenTestingSecretStorePluginManager(testtools.TestCase):
self.assertRaises(
str.SecretStoreSupportedPluginNotFound,
self.manager.get_plugin_store,
True,
transport_key_needed=True,
)
def test_get_store_with_tkey(self):
@@ -146,5 +146,6 @@ class WhenTestingSecretStorePluginManager(testtools.TestCase):
plugin2 = TestSecretStoreWithTransportKey(False)
plugin2_mock = mock.MagicMock(obj=plugin2)
self.manager.extensions = [plugin1_mock, plugin2_mock]
self.assertEqual(plugin2,
self.manager.get_plugin_store(True))
self.assertEqual(
plugin2,
self.manager.get_plugin_store(transport_key_needed=True))