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,
- )
+ if command in ("create", "created", "edit", "edited"):
+ 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()))
op_id = params["operation_id"]
cluster_id = params["cluster_id"]
db_cluster = self.db.get_one("clusters", {"_id": cluster_id})
+ if command in (
+ "create",
+ "created",
+ "register",
+ "registered",
+ "upgrade",
+ "scale",
+ ):
+ self.db.encrypt_decrypt_fields(
+ db_cluster,
+ "decrypt",
+ ["age_pubkey", "age_privkey"],
+ schema_version="1.11",
+ salt=cluster_id,
+ )
op_params = self.get_operation_params(db_cluster, op_id)
db_content = {
"cluster": db_cluster,