# See the License for the specific language governing permissions and
# limitations under the License.
+from pyrage import x25519
import logging
import random
import string
)
_id = self.db.create(self.topic, profile_create)
+ pubkey, privkey = self._generate_age_key()
+ profile_create["age_pubkey"] = self.db.encrypt(
+ pubkey, schema_version="1.11", salt=_id
+ )
+ profile_create["age_privkey"] = self.db.encrypt(
+ privkey, schema_version="1.11", salt=_id
+ )
rollback.append({"topic": self.topic, "_id": _id})
self.db.set_one(self.topic, {"_id": _id}, profile_create)
if op_id:
profile_ids.remove(_id)
update_dict = {profile_type: profile_ids}
self.db.set_one("clusters", filter_q, update_dict)
+
+ def _generate_age_key(self):
+ ident = x25519.Identity.generate()
+ # gets the public key
+ pubkey = ident.to_public()
+ # gets the private key
+ privkey = str(ident)
+ # return both public and private key
+ return pubkey, privkey
operation_params,
)
_id = self.db.create(self.topic, cls_create)
+ pubkey, privkey = self._generate_age_key()
+ cls_create["age_pubkey"] = self.db.encrypt(
+ pubkey, schema_version="1.11", salt=_id
+ )
+ cls_create["age_privkey"] = self.db.encrypt(
+ privkey, schema_version="1.11", salt=_id
+ )
+ # TODO: set age_pubkey and age_privkey in the default profiles
rollback.append({"topic": self.topic, "_id": _id})
self.db.set_one("clusters", {"_id": _id}, cls_create)
self._send_msg("create", {"cluster_id": _id, "operation_id": op_id})
-r{toxinidir}/requirements-test.txt
pylint
commands =
- pylint -E osm_nbi
+ pylint -E osm_nbi --extension-pkg-allow-list=pyrage
#######################################################################################