One authenticated Management API call. `path` is relative to /api/v2/. Raises httpx.HTTPStatusError on a 4xx/5xx, like raise_for_status() did.
(method: str, path: str, **kwargs)
| 86 | |
| 87 | |
| 88 | async def _mgmt_request(method: str, path: str, **kwargs) -> httpx.Response: |
| 89 | """ |
| 90 | One authenticated Management API call. `path` is relative to /api/v2/. |
| 91 | Raises httpx.HTTPStatusError on a 4xx/5xx, like raise_for_status() did. |
| 92 | """ |
| 93 | token = await _get_management_api_token() |
| 94 | async with _MGMT_SLOTS: |
| 95 | response = await get_http_client().request( |
| 96 | method, |
| 97 | f"{MGMT_API_AUDIENCE}{path}", |
| 98 | headers={"Authorization": f"Bearer {token}"}, |
| 99 | timeout=AUTH0_TIMEOUT, |
| 100 | **kwargs, |
| 101 | ) |
| 102 | response.raise_for_status() |
| 103 | return response |
| 104 | |
| 105 | |
| 106 | def _user_path(user_id: str) -> str: |
no test coverage detected