Skip to content

Commit

Permalink
add revoke by certificate id
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienDucourthial committed Mar 5, 2024
1 parent 56ad935 commit f39e029
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/action/horizon_revoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ActionModule(HorizonAction):
TRANSFERS_FILES = True

def _args(self):
return ["certificate_pem", "revocation_reason", "skip_already_revoked"]
return ["certificate_pem", "certificate_id", "revocation_reason", "skip_already_revoked"]

def run(self, tmp=None, task_vars=None):
result = super(ActionModule, self).run(tmp, task_vars)
Expand Down
3 changes: 2 additions & 1 deletion plugins/module_utils/horizon.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def renew(self, certificate_pem, certificate_id, password=None):

return self.post(self.REQUEST_SUBMIT_URL, json)

def revoke(self, certificate_pem, revocation_reason):
def revoke(self, certificate_pem, certificate_id, revocation_reason):
"""
Revoke a certificate
:type certificate_pem: Union[str,dict]
Expand All @@ -187,6 +187,7 @@ def revoke(self, certificate_pem, revocation_reason):
json = {
"workflow": "revoke",
"certificatePem": self.__load_file_or_string(certificate_pem),
"certificateId": certificate_id,
"revocationReason": revocation_reason,
"template": {
"revocationReason": revocation_reason
Expand Down
4 changes: 4 additions & 0 deletions plugins/modules/horizon_revoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
description: The path to the PEM encoded certificate to revoke.
required: false
type: path
certificate_id:
description: The ID of the certificate to revoke.
required: false
type: str
revocation_reason:
description: The reason for revoking the certificate.
required: false
Expand Down

0 comments on commit f39e029

Please sign in to comment.