From 01678a714f47153e094c0b28365226659b45667f Mon Sep 17 00:00:00 2001 From: sirferl Date: Mon, 14 Sep 2020 09:50:55 +0200 Subject: [PATCH] added required vars check --- lemur/plugins/lemur_entrust/plugin.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lemur/plugins/lemur_entrust/plugin.py b/lemur/plugins/lemur_entrust/plugin.py index d8466513..d5216caa 100644 --- a/lemur/plugins/lemur_entrust/plugin.py +++ b/lemur/plugins/lemur_entrust/plugin.py @@ -5,6 +5,7 @@ import json from lemur.plugins import lemur_entrust as ENTRUST from flask import current_app from lemur.extensions import metrics +from lemur.common.utils import validate_conf def log_status_code(r, *args, **kwargs): @@ -61,6 +62,20 @@ class EntrustIssuerPlugin(IssuerPlugin): def __init__(self, *args, **kwargs): """Initialize the issuer with the appropriate details.""" + required_vars = [ + "ENTRUST_API_CERT", + "ENTRUST_API_KEY", + "ENTRUST_API_USER", + "ENTRUST_API_PASS", + "ENTRUST_URL", + "ENTRUST_ROOT", + "ENTRUST_NAME", + "ENTRUST_EMAIL", + "ENTRUST_PHONE", + "ENTRUST_ISSUING", + ] + validate_conf(current_app, required_vars) + self.session = requests.Session() cert_file_path = current_app.config.get("ENTRUST_API_CERT") key_file_path = current_app.config.get("ENTRUST_API_KEY")