From 5e33eee5c8661755789d5c4fa78d40437303947a Mon Sep 17 00:00:00 2001 From: sirferl Date: Tue, 8 Dec 2020 10:53:28 +0100 Subject: [PATCH 1/4] make options for sources optional --- lemur/sources/views.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lemur/sources/views.py b/lemur/sources/views.py index 3b4deab7..bc104e33 100644 --- a/lemur/sources/views.py +++ b/lemur/sources/views.py @@ -156,12 +156,19 @@ class SourcesList(AuthenticatedResource): :reqheader Authorization: OAuth token to authenticate :statuscode 200: no error """ - return service.create( - data["label"], - data["plugin"]["slug"], - data["plugin"]["plugin_options"], - data["description"], - ) + if "plugin_options" in data["plugin"]: + return service.create( + data["label"], + data["plugin"]["slug"], + data["plugin"]["plugin_options"], + data["description"], + ) + else: + return service.create( + data["label"], + data["plugin"]["slug"], + data["description"], + ) class Sources(AuthenticatedResource): From 9a380528683814132d78e797a594ceff7ba9ef48 Mon Sep 17 00:00:00 2001 From: sirferl Date: Tue, 8 Dec 2020 11:03:08 +0100 Subject: [PATCH 2/4] Lint - whitespace error fixed --- lemur/sources/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemur/sources/views.py b/lemur/sources/views.py index bc104e33..9c31bdb7 100644 --- a/lemur/sources/views.py +++ b/lemur/sources/views.py @@ -156,7 +156,7 @@ class SourcesList(AuthenticatedResource): :reqheader Authorization: OAuth token to authenticate :statuscode 200: no error """ - if "plugin_options" in data["plugin"]: + if "plugin_options" in data["plugin"]: return service.create( data["label"], data["plugin"]["slug"], From 8a10b861be65f7913d5041cc90027e20b7f32719 Mon Sep 17 00:00:00 2001 From: sirferl Date: Tue, 8 Dec 2020 11:05:55 +0100 Subject: [PATCH 3/4] options not needed any more --- lemur/plugins/lemur_entrust/plugin.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lemur/plugins/lemur_entrust/plugin.py b/lemur/plugins/lemur_entrust/plugin.py index 83547a20..a4cb9a12 100644 --- a/lemur/plugins/lemur_entrust/plugin.py +++ b/lemur/plugins/lemur_entrust/plugin.py @@ -319,15 +319,6 @@ class EntrustSourcePlugin(SourcePlugin): author = "sirferl" author_url = "https://github.com/sirferl/lemur" - options = [ - { - "name": "dummy", - "type": "str", - "required": False, - "validation": "/^[0-9]{12,12}$/", - "helpMessage": "Just to prevent error", - } - ] def __init__(self, *args, **kwargs): """Initialize the issuer with the appropriate details.""" From b93c0282150a567cc16b706ac2583bc5cfb1002d Mon Sep 17 00:00:00 2001 From: sirferl Date: Tue, 8 Dec 2020 11:07:09 +0100 Subject: [PATCH 4/4] source plugin: options not needed any more --- lemur/plugins/lemur_adcs/plugin.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lemur/plugins/lemur_adcs/plugin.py b/lemur/plugins/lemur_adcs/plugin.py index d2efe83f..495885a0 100644 --- a/lemur/plugins/lemur_adcs/plugin.py +++ b/lemur/plugins/lemur_adcs/plugin.py @@ -77,15 +77,6 @@ class ADCSSourcePlugin(SourcePlugin): author = "sirferl" author_url = "https://github.com/sirferl/lemur" - options = [ - { - "name": "dummy", - "type": "str", - "required": False, - "validation": "/^[0-9]{12,12}$/", - "helpMessage": "Just to prevent error", - } - ] def get_certificates(self, options, **kwargs): adcs_server = current_app.config.get("ADCS_SERVER")