Exemplo 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)
Exemplo 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 []
Exemplo 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 []
Exemplo 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 []
Exemplo 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 []
Exemplo 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 []