def format_on_new(content, project_id=None, make_public=False):
     BaseTopic.format_on_new(content,
                             project_id=project_id,
                             make_public=make_public)
     content["_admin"]["onboardingState"] = "CREATED"
     content["_admin"]["operationalState"] = "DISABLED"
     content["_admin"]["usageState"] = "NOT_IN_USE"
Esempio n. 2
0
 def format_on_new(content, project_id=None, make_public=False):
     BaseTopic.format_on_new(content, make_public=False)
     content["_id"] = content["username"]
     salt = uuid4().hex
     content["_admin"]["salt"] = salt
     if content.get("password"):
         content["password"] = sha256(content["password"].encode('utf-8') +
                                      salt.encode('utf-8')).hexdigest()
Esempio n. 3
0
    def format_on_new(self, content, project_id=None, make_public=False):
        BaseTopic.format_on_new(content,
                                project_id=project_id,
                                make_public=make_public)
        content["schema_version"] = schema_version = "1.1"
        # encrypt passwords
        if content.get("password"):
            content["password"] = self.db.encrypt(
                content["password"],
                schema_version=schema_version,
                salt=content["_id"])

        content["_admin"]["operationalState"] = "PROCESSING"
Esempio n. 4
0
 def format_on_new(content, project_id=None, make_public=False):
     BaseTopic.format_on_new(content, None)
     content["_id"] = content["name"]