+ config_to_encrypt = {}
+
+
+class K8sClusterTopic(CommonVimWimSdn):
+ topic = "k8sclusters"
+ topic_msg = "k8scluster"
+ schema_new = k8scluster_new_schema
+ schema_edit = k8scluster_edit_schema
+ multiproject = True
+ password_to_encrypt = None
+ config_to_encrypt = {}
+
+ def format_on_new(self, content, project_id=None, make_public=False):
+ oid = super().format_on_new(content, project_id, make_public)
+ self.db.encrypt_decrypt_fields(content["credentials"], 'encrypt', ['password', 'secret'],
+ schema_version=content["schema_version"], salt=content["_id"])
+ return oid
+
+ def format_on_edit(self, final_content, edit_content):
+ if final_content.get("schema_version") and edit_content.get("credentials"):
+ self.db.encrypt_decrypt_fields(edit_content["credentials"], 'encrypt', ['password', 'secret'],
+ schema_version=final_content["schema_version"], salt=final_content["_id"])
+ deep_update_rfc7396(final_content["credentials"], edit_content["credentials"])
+ oid = super().format_on_edit(final_content, edit_content)
+ return oid
+
+
+class K8sRepoTopic(CommonVimWimSdn):
+ topic = "k8srepos"
+ topic_msg = "k8srepo"
+ schema_new = k8srepo_new_schema
+ schema_edit = k8srepo_edit_schema
+ multiproject = True
+ password_to_encrypt = None
+ config_to_encrypt = {}