Replace the use of eval when reading env variable OSMNBI_USER_MANAGEMENT 67/14567/1 master
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 17 Sep 2024 16:00:50 +0000 (18:00 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 17 Sep 2024 16:00:53 +0000 (18:00 +0200)
Change-Id: Ic50126edc28f01b501789c35a2abb17e48c51f01
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_nbi/nbi.py

index 3728943..c37e24e 100644 (file)
@@ -2394,7 +2394,7 @@ def _start_service():
     engine_config = cherrypy.tree.apps["/osm"].config
     for k, v in environ.items():
         if k == "OSMNBI_USER_MANAGEMENT":
-            feature_state = eval(v.title())
+            feature_state = v.lower() == "true"
             engine_config["authentication"]["user_management"] = feature_state
         elif k == "OSMNBI_PWD_EXPIRE_DAYS":
             pwd_expire_days = int(v)