|  |  |  | 
|---|
|  |  |  | json={"user_name": username, "password": password}, | 
|---|
|  |  |  | headers={'Content-Type': 'application/json'} | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | self._check_response(response) | 
|---|
|  |  |  | return self._check_response(response) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async def login(self, username: str, password: str) -> str: | 
|---|
|  |  |  | public_key = await self.get_public_key_api() | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return result | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async def user_list(self, token: str) -> list: | 
|---|
|  |  |  | url = f"{self.base_url}/api/v1/user/list" | 
|---|
|  |  |  | headers = {'cookie': f"access_token_cookie={token};"} | 
|---|
|  |  |  | async with httpx.AsyncClient() as client: | 
|---|
|  |  |  | response = await client.get(url, headers=headers) | 
|---|
|  |  |  | data = self._check_response(response) | 
|---|
|  |  |  | return data | 
|---|