Skip to content

Commit 417f24c

Browse files
chore: re-apply Auth0 telemetry customization to regenerated client_wrapper.py
1 parent 1c2136b commit 417f24c

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

.fernignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ tests/authentication/
1919
# Root auth0 __init__.py and py.typed marker
2020
src/auth0/__init__.py
2121
src/auth0/py.typed
22-
<<<<<<< ours
23-
=======
24-
25-
# Telemetry customization (Auth0 format with dynamic versioning)
26-
src/auth0/management/core/client_wrapper.py
27-
>>>>>>> theirs
2822

2923
# Files edited to incorporate both APIs
3024
pyproject.toml

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.4.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.4.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)