schema_version=schema_version,
salt=final_content["_id"],
)
+ if edit_content.get("config", {}).get("credentials"):
+ cloud_credentials = edit_content["config"]["credentials"]
+ if cloud_credentials.get("clientSecret"):
+ edit_content["config"]["credentials"][
+ "clientSecret"
+ ] = self.db.encrypt(
+ edit_content["config"]["credentials"]["clientSecret"],
+ schema_version=schema_version,
+ salt=edit_content["_id"],
+ )
+ elif cloud_credentials.get("SecretAccessKey"):
+ edit_content["config"]["credentials"][
+ "SecretAccessKey"
+ ] = self.db.encrypt(
+ edit_content["config"]["credentials"]["SecretAccessKey"],
+ schema_version=schema_version,
+ salt=edit_content["_id"],
+ )
# create edit operation
final_content["_admin"]["operations"].append(self._create_operation("edit"))
"""
super().format_on_new(content, project_id=project_id, make_public=make_public)
content["schema_version"] = schema_version = "1.11"
+ content["key"] = "registered"
# encrypt passwords
if content.get(self.password_to_encrypt):
schema_version=schema_version,
salt=content["_id"],
)
+ if content.get("config", {}).get("credentials"):
+ cloud_credentials = content["config"]["credentials"]
+ if cloud_credentials.get("clientSecret"):
+ content["config"]["credentials"]["clientSecret"] = self.db.encrypt(
+ content["config"]["credentials"]["clientSecret"],
+ schema_version=schema_version,
+ salt=content["_id"],
+ )
+ elif cloud_credentials.get("SecretAccessKey"):
+ content["config"]["credentials"]["SecretAccessKey"] = self.db.encrypt(
+ content["config"]["credentials"]["SecretAccessKey"],
+ schema_version=schema_version,
+ salt=content["_id"],
+ )
content["_admin"]["operationalState"] = "PROCESSING"
try:
if not content:
content = self.show(session, _id)
+
indata = self._validate_input_edit(indata, content, force=session["force"])
content = self.check_conflict_on_edit(session, content, indata, _id=_id)
# self.format_on_edit(content, indata)
or indata.get("project_role_mappings")
or indata.get("projects")
or indata.get("add_projects")
+ or indata.get("unlock")
+ or indata.get("renew")
):
return _id
if indata.get("project_role_mappings") and (
"old_password": indata.get("old_password"),
"add_project_role_mappings": mappings_to_add,
"remove_project_role_mappings": mappings_to_remove,
+ "system_admin_id": indata.get("system_admin_id"),
+ "unlock": indata.get("unlock"),
+ "renew": indata.get("renew"),
+ "session_user": session.get("username"),
}
)
data_to_send = {"_id": _id, "changes": indata}
self.format_on_new(
content, project_id=session["project_id"], make_public=session["public"]
)
+ self.create_gitname(content, session)
_id = self.auth.create_project(content)
rollback.append({"topic": self.topic, "_id": _id})
self._send_msg("created", content, not_send_msg=None)