Skip to content

Commit 3885c0a

Browse files
author
Jamie Curnow
committed
Add cert renewals to audit log
1 parent 099ec00 commit 3885c0a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/backend/internal/certificate.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,19 @@ const internalCertificate = {
756756
.patchAndFetchById(certificate.id, {
757757
expires_on: certificateModel.raw('FROM_UNIXTIME(' + cert_info.dates.to + ')')
758758
});
759-
});
759+
})
760+
.then((updated_certificate) => {
761+
// Add to audit log
762+
return internalAuditLog.add(access, {
763+
action: 'renewed',
764+
object_type: 'certificate',
765+
object_id: updated_certificate.id,
766+
meta: updated_certificate
767+
})
768+
.then(() => {
769+
return certificate;
770+
});
771+
})
760772
} else {
761773
throw new error.ValidationError('Only Let\'sEncrypt certificates can be renewed');
762774
}

src/frontend/js/i18n/messages.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231
"deleted": "Deleted {name}",
232232
"enabled": "Enabled {name}",
233233
"disabled": "Disabled {name}",
234+
"renewed": "Renewed {name}",
234235
"meta-title": "Details for Event",
235236
"view-meta": "View Details",
236237
"date": "Date"

0 commit comments

Comments
 (0)