From be6a5b859ea58a6025f8bdacf7c8f4f3d9f78c2d Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 22 Sep 2015 09:46:54 -0700 Subject: [PATCH 1/3] adding notification example --- lemur/certificates/views.py | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/lemur/certificates/views.py b/lemur/certificates/views.py index 112c86ad..bd267cdc 100644 --- a/lemur/certificates/views.py +++ b/lemur/certificates/views.py @@ -208,6 +208,46 @@ class CertificatesList(AuthenticatedResource): "notAfter": "2015-06-17T15:21:08", "description": "dsfdsf" }, + "notifications": [ + { + "description": "Default 30 day expiration notification", + "notificationOptions": [ + { + "name": "interval", + "required": true, + "value": 30, + "helpMessage": "Number of days to be alert before expiration.", + "validation": "^\\d+$", + "type": "int" + }, + { + "available": [ + "days", + "weeks", + "months" + ], + "name": "unit", + "required": true, + "value": "days", + "helpMessage": "Interval unit", + "validation": "", + "type": "select" + }, + { + "name": "recipients", + "required": true, + "value": "bob@example.com", + "helpMessage": "Comma delimited list of email addresses", + "validation": "^([\\w+-.%]+@[\\w-.]+\\.[A-Za-z]{2,4},?)+$", + "type": "str" + } + ], + "label": "DEFAULT_KGLISSON_30_DAY", + "pluginName": "email-notification", + "active": true, + "id": 7 + } + ], "extensions": { "basicConstraints": {}, "keyUsage": { From 6a24e88d9ab5a98d406b549183045ab9629dd9e3 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 22 Sep 2015 10:22:12 -0700 Subject: [PATCH 2/3] removing pip install instructions until available --- docs/quickstart/index.rst | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/docs/quickstart/index.rst b/docs/quickstart/index.rst index 35a0b2a8..564bc3b1 100644 --- a/docs/quickstart/index.rst +++ b/docs/quickstart/index.rst @@ -56,23 +56,6 @@ And optionally if your database is going to be on the same host as the webserver $ sudo apt-get install postgres -Installing Lemur ----------------- - -Once you've got the environment setup, you can install Lemur and all its dependencies with -the same command you used to grab virtualenv:: - - pip install -U lemur - -Once everything is installed, you should be able to execute the Lemur CLI, via ``lemur``, and get something -like the following: - -.. code-block:: bash - - $ lemur - usage: lemur [--config=/path/to/settings.py] [command] [options] - - Installing from Source ~~~~~~~~~~~~~~~~~~~~~~ From 06a69c09a0e752f8fcf71b12e57ae5118d858693 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 22 Sep 2015 13:01:05 -0700 Subject: [PATCH 3/3] Fixing a bug where notifications associated during certificate creation would not be respected. --- lemur/certificates/service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemur/certificates/service.py b/lemur/certificates/service.py index 081ea733..9e5db6ad 100644 --- a/lemur/certificates/service.py +++ b/lemur/certificates/service.py @@ -232,7 +232,7 @@ def create(**kwargs): database.update_list(cert, 'notifications', Notification, kwargs.get('notifications')) # create default notifications for this certificate if none are provided - notifications = [] + notifications = cert.notifications if not kwargs.get('notifications'): notification_name = "DEFAULT_{0}".format(cert.owner.split('@')[0].upper()) notifications += notification_service.create_default_expiration_notifications(notification_name, [cert.owner])