Esempio n. 1
0
 def test_list(self):
     api.list(self.request)
     self.key_manager.list.assert_called_once()
     args, kwargs = self.key_manager.list.call_args
     (actual_ctxt, ) = args
     actual_object_type = kwargs.get("object_type")
     actual_metadata_only = kwargs.get("metadata_only")
     self.assertEqual(actual_ctxt, self.ctxt)
     self.assertIsNone(actual_object_type)
     self.assertTrue(actual_metadata_only)
Esempio n. 2
0
 def get_x509_certificate_data(self):
     try:
         return client.list(self.request, object_type=x_509.X509)
     except Exception as e:
         msg = _('Unable to list certificates: "%s".') % (e.message)
         exceptions.handle(self.request, msg)
         return []
Esempio n. 3
0
 def get_passphrase_data(self):
     try:
         return client.list(self.request, object_type=passphrase.Passphrase)
     except Exception as e:
         msg = _('Unable to list passphrases: "%s".') % (e.message)
         exceptions.handle(self.request, msg)
         return []
Esempio n. 4
0
 def get_symmetric_key_data(self):
     try:
         return client.list(self.request,
                            object_type=symmetric_key.SymmetricKey)
     except Exception as e:
         msg = _('Unable to list symmetric keys: "%s".') % (e.message)
         exceptions.handle(self.request, msg)
         return []
Esempio n. 5
0
 def get_public_key_data(self):
     try:
         return client.list(
             self.request, object_type=public_key.PublicKey)
     except Exception as e:
         msg = _('Unable to list private keys: "%s".') % (e.message)
         exceptions.handle(self.request, msg)
         return []
Esempio n. 6
0
 def get_opaque_data_data(self):
     try:
         return client.list(self.request,
                            object_type=opaque_data.OpaqueData)
     except Exception as e:
         msg = _('Unable to list objects: "%s".') % (e.message)
         exceptions.handle(self.request, msg)
         return []