直接通过电子邮件和密码创建新用户的登录身份

async def create_identity(self, 
        identity: str, 
        passwd: str, 
    ) -> SessionIdentity :
        """ 直接通过电子邮件和密码创建新用户的登录身份 """

        identity_path = f"{self._prefix_identity}/{identity}"

        profile, _ = await self._client.get(identity_path)
        if profile is not None:
            raise AlreadyExists(f"登陆身份'{identity}'已经注册")

        user_id = await self._user_id_generator.new()

        # 加密登录标识
        hashed = sha256_crypt.using(rounds=2000, salt_size=8).hash(passwd)

        profile = {
            "user_id": user_id,
            "identity": identity,
            "hashed": hashed
        }
    
        value = json.dumps(profile).encode("ascii")
        await self._client.put(identity_path, value)


        return SessionIdentity(user_id=user_id, identity=identity)