Skip to content

Commit 9521100

Browse files
Restore Auth0 telemetry and custom client wiring after regeneration
1 parent 06a81e6 commit 9521100

2 files changed

Lines changed: 26 additions & 7 deletions

File tree

src/auth0/management/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2806,6 +2806,8 @@
28062806
from .environment import Auth0Environment
28072807
from .event_streams import EventStreamsCreateRequest
28082808
from .version import __version__
2809+
from .management_client import AsyncManagementClient, CustomDomainHeader, ManagementClient
2810+
from .token_provider import AsyncTokenProvider, TokenProvider
28092811
_dynamic_imports: typing.Dict[str, str] = {
28102812
"Action": ".types",
28112813
"ActionBase": ".types",
@@ -2866,6 +2868,8 @@
28662868
"AssociateOrganizationClientGrantResponseContent": ".types",
28672869
"AsyncApprovalNotificationsChannelsEnum": ".types",
28682870
"AsyncAuth0": ".client",
2871+
"AsyncManagementClient": ".management_client",
2872+
"AsyncTokenProvider": ".token_provider",
28692873
"AttackProtectionCaptchaArkoseResponseContent": ".types",
28702874
"AttackProtectionCaptchaAuthChallengeRequest": ".types",
28712875
"AttackProtectionCaptchaAuthChallengeResponseContent": ".types",
@@ -3837,6 +3841,7 @@
38373841
"CspReportingEndpoints": ".types",
38383842
"CspReportingInfrastructure": ".types",
38393843
"CustomDomain": ".types",
3844+
"CustomDomainHeader": ".management_client",
38403845
"CustomDomainCustomClientIpHeader": ".types",
38413846
"CustomDomainCustomClientIpHeaderEnum": ".types",
38423847
"CustomDomainProvisioningTypeEnum": ".types",
@@ -5111,6 +5116,7 @@
51115116
"LogStreamSumoEnum": ".types",
51125117
"LogStreamSumoResponseSchema": ".types",
51135118
"LogStreamSumoSink": ".types",
5119+
"ManagementClient": ".management_client",
51145120
"MdlPresentationProperties": ".types",
51155121
"MdlPresentationRequest": ".types",
51165122
"MdlPresentationRequestProperties": ".types",
@@ -5364,6 +5370,7 @@
53645370
"TestEventDataContent": ".types",
53655371
"TokenExchangeProfileResponseContent": ".types",
53665372
"TokenExchangeProfileTypeEnum": ".types",
5373+
"TokenProvider": ".token_provider",
53675374
"TokenQuota": ".types",
53685375
"TokenQuotaClientCredentials": ".types",
53695376
"TokenQuotaConfiguration": ".types",
@@ -5687,6 +5694,8 @@ def __dir__():
56875694
"AssociateOrganizationClientGrantResponseContent",
56885695
"AsyncApprovalNotificationsChannelsEnum",
56895696
"AsyncAuth0",
5697+
"AsyncManagementClient",
5698+
"AsyncTokenProvider",
56905699
"AttackProtectionCaptchaArkoseResponseContent",
56915700
"AttackProtectionCaptchaAuthChallengeRequest",
56925701
"AttackProtectionCaptchaAuthChallengeResponseContent",
@@ -7932,6 +7941,7 @@ def __dir__():
79327941
"LogStreamSumoEnum",
79337942
"LogStreamSumoResponseSchema",
79347943
"LogStreamSumoSink",
7944+
"ManagementClient",
79357945
"MdlPresentationProperties",
79367946
"MdlPresentationRequest",
79377947
"MdlPresentationRequestProperties",
@@ -8185,6 +8195,7 @@ def __dir__():
81858195
"TestEventDataContent",
81868196
"TokenExchangeProfileResponseContent",
81878197
"TokenExchangeProfileTypeEnum",
8198+
"TokenProvider",
81888199
"TokenQuota",
81898200
"TokenQuotaClientCredentials",
81908201
"TokenQuotaConfiguration",

src/auth0/management/core/client_wrapper.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# This file was auto-generated by Fern from our API Definition.
2+
# Modified by Auth0 to use Auth0 telemetry format with dynamic versioning
23

4+
import base64
5+
import platform
6+
import sys
37
import typing
8+
from json import dumps
49

510
import httpx
611
from .http_client import AsyncHttpClient, HttpClient
@@ -26,15 +31,18 @@ def __init__(
2631
self._logging = logging
2732

2833
def get_headers(self) -> typing.Dict[str, str]:
29-
import platform
34+
py_version = platform.python_version()
35+
version = sys.modules["auth0"].__version__
36+
37+
auth0_client = dumps({
38+
"name": "auth0-python",
39+
"version": version,
40+
"env": {"python": py_version}
41+
}).encode("utf-8")
3042

3143
headers: typing.Dict[str, str] = {
32-
"User-Agent": "auth0-python/5.7.0",
33-
"X-Fern-Language": "Python",
34-
"X-Fern-Runtime": f"python/{platform.python_version()}",
35-
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
36-
"X-Fern-SDK-Name": "auth0-python",
37-
"X-Fern-SDK-Version": "5.7.0",
44+
"User-Agent": f"Python/{py_version}",
45+
"Auth0-Client": base64.b64encode(auth0_client).decode(),
3846
**(self.get_custom_headers() or {}),
3947
}
4048
headers["Authorization"] = f"Bearer {self._get_token()}"

0 commit comments

Comments
 (0)