From 9d9d92663bf5d7a837cc15707bbf7f2bfe4175b8 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 25 Sep 2024 11:25:33 +0200 Subject: [PATCH] Add age keypair generation for cluster registration operation Change-Id: If3ee9a83bce2909ac0cfcd7d888b2808acec1f44 Signed-off-by: garciadeblas --- osm_nbi/k8s_topics.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osm_nbi/k8s_topics.py b/osm_nbi/k8s_topics.py index e00326d..6e5e66a 100644 --- a/osm_nbi/k8s_topics.py +++ b/osm_nbi/k8s_topics.py @@ -528,6 +528,14 @@ class K8saddTopic(BaseTopic): operation_params, ) _id = self.db.create(self.topic, cls_add) + pubkey, privkey = self._generate_age_key() + cls_add["age_pubkey"] = self.db.encrypt( + pubkey, schema_version="1.11", salt=_id + ) + cls_add["age_privkey"] = self.db.encrypt( + privkey, schema_version="1.11", salt=_id + ) + # TODO: set age_pubkey and age_privkey in the default profiles self.db.set_one(self.topic, {"_id": _id}, cls_add) rollback.append({"topic": self.topic, "_id": _id}) self._send_msg("register", {"cluster_id": _id, "operation_id": op_id}) -- 2.25.1