From: garciadeblas Date: Thu, 12 Sep 2024 10:53:09 +0000 (+0200) Subject: Decrypt credentials obtained from DB during vim/cloud account creation X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=7951c77c1f5cccb4264a06ff350fba96bb08b49c;p=osm%2FLCM.git Decrypt credentials obtained from DB during vim/cloud account creation Change-Id: I26b6f2532e89e5c6fb83b7f3c3491cfd70cd4360 Signed-off-by: garciadeblas --- diff --git a/osm_lcm/lcm.py b/osm_lcm/lcm.py index c685ed1..f1770f5 100644 --- a/osm_lcm/lcm.py +++ b/osm_lcm/lcm.py @@ -647,6 +647,13 @@ class Lcm: op_params = params db_vim = self.db.get_one("vim_accounts", {"_id": vim_id}) vim_config = db_vim.get("config", {}) + self.db.encrypt_decrypt_fields( + vim_config.get("credentials"), + "decrypt", + ["password", "secret"], + schema_version=db_vim["schema_version"], + salt=vim_id, + ) self.logger.debug("Db Vim: {}".format(db_vim)) if command in ("create", "created"): self.logger.debug("Main config: {}".format(self.main_config.to_dict()))