From 3766b83e21b64208518fcb1a302b010f54427150 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Mon, 2 Oct 2023 16:34:21 -0700 Subject: [PATCH] Add ability to toggle certificate notification and rotation on/off. --- docs/administration.rst | 19 +++++++++++++++++++ lemur/certificates/schemas.py | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/administration.rst b/docs/administration.rst index 6324479d6e..901029f6f1 100644 --- a/docs/administration.rst +++ b/docs/administration.rst @@ -324,6 +324,25 @@ Lemur allows you to fine tune your certificates to your organization. The follow and are used when Lemur creates the CSR for your certificates. +.. data:: LEMUR_DEFAULT_CERTIFICATE_NOTIFY + :noindex: + + Flags the certificate to notify during certificate creation. Defaults to True. + + :: + + LEMUR_DEFAULT_CERTIFICATE_NOTIFY = True + + +.. data:: LEMUR_DEFAULT_CERTIFICATE_ROTATE + :noindex: + + Flags the certificate to rotate on expiration during certificate creation. Defaults to False. + + :: + + LEMUR_DEFAULT_CERTIFICATE_ROTATE = False + .. data:: LEMUR_DEFAULT_COUNTRY :noindex: diff --git a/lemur/certificates/schemas.py b/lemur/certificates/schemas.py index b76b5e683b..f048c4cbc5 100644 --- a/lemur/certificates/schemas.py +++ b/lemur/certificates/schemas.py @@ -94,8 +94,8 @@ class CertificateInputSchema(CertificateCreationSchema): validate=validate.OneOf(CERTIFICATE_KEY_TYPES), missing="ECCPRIME256V1" ) - notify = fields.Boolean(default=True) - rotation = fields.Boolean() + notify = fields.Boolean(default=current_app.config.get("LEMUR_DEFAULT_CERTIFICATE_NOTIFY", True)) + rotation = fields.Boolean(default=current_app.config.get("LEMUR_DEFAULT_CERTIFICATE_ROTATE", False)) rotation_policy = fields.Nested( AssociatedRotationPolicySchema, missing={"name": "default"},