Skip to content

Commit 9721373

Browse files
Add ManagementClient and AsyncManagementClient imports; enhance logging support in client wrappers
1 parent 5bff188 commit 9721373

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/auth0/management/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,7 @@
12151215
from .client import AsyncAuth0, Auth0
12161216
from .environment import Auth0Environment
12171217
from .event_streams import EventStreamsCreateRequest
1218+
from .management_client import AsyncManagementClient, ManagementClient
12181219
from .version import __version__
12191220
_dynamic_imports: typing.Dict[str, str] = {
12201221
"Action": ".types",
@@ -3340,6 +3341,8 @@ def __dir__():
33403341
"LogStreamSumoEnum",
33413342
"LogStreamSumoResponseSchema",
33423343
"LogStreamSumoSink",
3344+
"ManagementClient",
3345+
"AsyncManagementClient",
33433346
"MdlPresentationProperties",
33443347
"MdlPresentationRequest",
33453348
"MdlPresentationRequestProperties",

src/auth0/management/core/client_wrapper.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import httpx
1111
from .http_client import AsyncHttpClient, HttpClient
12+
from .logging import LogConfig, Logger
1213

1314

1415
class BaseClientWrapper:
@@ -70,13 +71,15 @@ def __init__(
7071
base_url: str,
7172
timeout: typing.Optional[float] = None,
7273
httpx_client: httpx.Client,
74+
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
7375
):
7476
super().__init__(token=token, headers=headers, base_url=base_url, timeout=timeout)
7577
self.httpx_client = HttpClient(
7678
httpx_client=httpx_client,
7779
base_headers=self.get_headers,
7880
base_timeout=self.get_timeout,
7981
base_url=self.get_base_url,
82+
logging_config=logging,
8083
)
8184

8285

@@ -90,6 +93,7 @@ def __init__(
9093
timeout: typing.Optional[float] = None,
9194
async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None,
9295
httpx_client: httpx.AsyncClient,
96+
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
9397
):
9498
super().__init__(token=token, headers=headers, base_url=base_url, timeout=timeout)
9599
self._async_token = async_token
@@ -99,6 +103,7 @@ def __init__(
99103
base_timeout=self.get_timeout,
100104
base_url=self.get_base_url,
101105
async_base_headers=self.async_get_headers,
106+
logging_config=logging,
102107
)
103108

104109
async def async_get_headers(self) -> typing.Dict[str, str]:

0 commit comments

Comments
 (0)