Merge pull request #3402 from jtschladen/add-issuer-id-sns-notification
Add "issuer" and "id" fields to SNS notifications
This commit is contained in:
commit
470068f03e
|
@ -441,6 +441,7 @@ class CertificateExportInputSchema(LemurInputSchema):
|
||||||
|
|
||||||
|
|
||||||
class CertificateNotificationOutputSchema(LemurOutputSchema):
|
class CertificateNotificationOutputSchema(LemurOutputSchema):
|
||||||
|
id = fields.Integer()
|
||||||
description = fields.String()
|
description = fields.String()
|
||||||
issuer = fields.String()
|
issuer = fields.String()
|
||||||
name = fields.String()
|
name = fields.String()
|
||||||
|
|
|
@ -50,6 +50,8 @@ def format_message(certificate, notification_type):
|
||||||
json_message = {
|
json_message = {
|
||||||
"notification_type": notification_type,
|
"notification_type": notification_type,
|
||||||
"certificate_name": certificate["name"],
|
"certificate_name": certificate["name"],
|
||||||
|
"issuer": certificate["issuer"],
|
||||||
|
"id": certificate["id"],
|
||||||
"expires": arrow.get(certificate["validityEnd"]).format("YYYY-MM-DDTHH:mm:ss"), # 2047-12-31T22:00:00
|
"expires": arrow.get(certificate["validityEnd"]).format("YYYY-MM-DDTHH:mm:ss"), # 2047-12-31T22:00:00
|
||||||
"endpoints_detected": len(certificate["endpoints"]),
|
"endpoints_detected": len(certificate["endpoints"]),
|
||||||
"owner": certificate["owner"],
|
"owner": certificate["owner"],
|
||||||
|
|
|
@ -21,6 +21,8 @@ def test_format(certificate, endpoint):
|
||||||
"notification_type": "expiration",
|
"notification_type": "expiration",
|
||||||
"certificate_name": certificate["name"],
|
"certificate_name": certificate["name"],
|
||||||
"expires": arrow.get(certificate["validityEnd"]).format("YYYY-MM-DDTHH:mm:ss"),
|
"expires": arrow.get(certificate["validityEnd"]).format("YYYY-MM-DDTHH:mm:ss"),
|
||||||
|
"issuer": certificate["issuer"],
|
||||||
|
"id": certificate["id"],
|
||||||
"endpoints_detected": 0,
|
"endpoints_detected": 0,
|
||||||
"owner": certificate["owner"],
|
"owner": certificate["owner"],
|
||||||
"details": "https://lemur.example.com/#/certificates/{name}".format(name=certificate["name"])
|
"details": "https://lemur.example.com/#/certificates/{name}".format(name=certificate["name"])
|
||||||
|
|
Loading…
Reference in New Issue