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
37import typing
8+ from json import dumps
49
510import httpx
611from .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