Merge pull request #3295 from sirferl/source_options
make options for sources optional
This commit is contained in:
commit
d3d186880b
|
@ -77,15 +77,6 @@ class ADCSSourcePlugin(SourcePlugin):
|
||||||
|
|
||||||
author = "sirferl"
|
author = "sirferl"
|
||||||
author_url = "https://github.com/sirferl/lemur"
|
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):
|
def get_certificates(self, options, **kwargs):
|
||||||
adcs_server = current_app.config.get("ADCS_SERVER")
|
adcs_server = current_app.config.get("ADCS_SERVER")
|
||||||
|
|
|
@ -319,15 +319,6 @@ class EntrustSourcePlugin(SourcePlugin):
|
||||||
|
|
||||||
author = "sirferl"
|
author = "sirferl"
|
||||||
author_url = "https://github.com/sirferl/lemur"
|
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):
|
def __init__(self, *args, **kwargs):
|
||||||
"""Initialize the issuer with the appropriate details."""
|
"""Initialize the issuer with the appropriate details."""
|
||||||
|
|
|
@ -156,12 +156,19 @@ class SourcesList(AuthenticatedResource):
|
||||||
:reqheader Authorization: OAuth token to authenticate
|
:reqheader Authorization: OAuth token to authenticate
|
||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
"""
|
"""
|
||||||
|
if "plugin_options" in data["plugin"]:
|
||||||
return service.create(
|
return service.create(
|
||||||
data["label"],
|
data["label"],
|
||||||
data["plugin"]["slug"],
|
data["plugin"]["slug"],
|
||||||
data["plugin"]["plugin_options"],
|
data["plugin"]["plugin_options"],
|
||||||
data["description"],
|
data["description"],
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
return service.create(
|
||||||
|
data["label"],
|
||||||
|
data["plugin"]["slug"],
|
||||||
|
data["description"],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Sources(AuthenticatedResource):
|
class Sources(AuthenticatedResource):
|
||||||
|
|
Loading…
Reference in New Issue