Add cert renewals to audit log

This commit is contained in:
Jamie Curnow 2019-05-09 09:20:49 +10:00
parent 099ec00155
commit 3885c0ad6d
2 changed files with 14 additions and 1 deletions

View File

@ -756,7 +756,19 @@ const internalCertificate = {
.patchAndFetchById(certificate.id, {
expires_on: certificateModel.raw('FROM_UNIXTIME(' + cert_info.dates.to + ')')
});
});
})
.then((updated_certificate) => {
// Add to audit log
return internalAuditLog.add(access, {
action: 'renewed',
object_type: 'certificate',
object_id: updated_certificate.id,
meta: updated_certificate
})
.then(() => {
return certificate;
});
})
} else {
throw new error.ValidationError('Only Let\'sEncrypt certificates can be renewed');
}

View File

@ -231,6 +231,7 @@
"deleted": "Deleted {name}",
"enabled": "Enabled {name}",
"disabled": "Disabled {name}",
"renewed": "Renewed {name}",
"meta-title": "Details for Event",
"view-meta": "View Details",
"date": "Date"