Skip to content

Commit 7271f15

Browse files
Revert wrapper file to preserve Auth0 telemetry customizations
1 parent 93aa46a commit 7271f15

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

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