async def create_identity(self, <EOL>identity: str, <EOL>passwd: str, <EOL>) -> SessionIdentity :
identity_path = f"<STR_LIT>"<EOL>profile, _ = await self._client.get(identity_path)<EOL>if profile is not None:<EOL><INDENT>raise AlreadyExists(f"<STR_LIT>")<EOL><DEDENT>user_id = await self._user_id_generator.new()<EOL>hashed = sha256_crypt.using(rounds=<NUM_LIT>, salt_size=<NUM_LIT:8>).hash(passwd)<EOL>profile = {<EOL>"<STR_LIT>": user_id,<EOL>"<STR_LIT>": identity,<EOL>"<STR_LIT>": hashed<EOL>}<EOL>value = json.dumps(profile).encode("<STR_LIT:ascii>")<EOL>await self._client.put(identity_path, value)<EOL>return SessionIdentity(user_id=user_id, identity=identity)<EOL>
直接通过电子邮件和密码创建新用户的登录身份