Skip to content
Snippets Groups Projects
Commit 866cebd9 authored by garciadeblas's avatar garciadeblas
Browse files

Add age keypair generation for cluster registration operation


Change-Id: If3ee9a83bce2909ac0cfcd7d888b2808acec1f44
Signed-off-by: default avatargarciadeblas <gerardo.garciadeblas@telefonica.com>
parent 74eb26a2
No related branches found
No related tags found
No related merge requests found
......@@ -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})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment