Commit f4801d3c authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_certificate_authority: Implement revoke on caucase

parent d7d9761f
...@@ -134,6 +134,9 @@ class CaucaseConnector(XMLObject): ...@@ -134,6 +134,9 @@ class CaucaseConnector(XMLObject):
def getCertificate(self, csr_id): def getCertificate(self, csr_id):
return self._getAuthenticatedConnection().getCertificate(csr_id) return self._getAuthenticatedConnection().getCertificate(csr_id)
def revokeCertificate(self, crt_pem, key_pem=None):
if key_pem is None:
return self._getAuthenticatedConnection().revokeCertificate(crt_pem)
return self._getConnection().revokeCertificate(crt_pem, key_pem)
InitializeClass(CaucaseConnector) InitializeClass(CaucaseConnector)
...@@ -118,12 +118,13 @@ class CertificateLoginMixin: ...@@ -118,12 +118,13 @@ class CertificateLoginMixin:
raise ValueError("You cannot revoke certificates from prior implementation!") raise ValueError("You cannot revoke certificates from prior implementation!")
if self.getSourceReference() is not None: if self.getSourceReference() is not None:
raise NotImplementedError() caucase_connector = self._getCaucaseConnector()
crt_pem = caucase_connector.getCertificate(self.getSourceReference())
caucase_connector.revokeCertificate(crt_pem)
else: else:
raise ValueError("No certificate found to revoke!") raise ValueError("No certificate found to revoke!")
security.declarePublic('revokeCertificate') security.declarePrivate('revokeCertificate')
def revokeCertificate(self): def revokeCertificate(self):
"""Revokes existing certificate""" """Revokes existing certificate"""
self._revokeCertificate() self._revokeCertificate()
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment