Skip to content

Commit d745934

Browse files
authored
update telemetry format (#187)
1 parent b693a7d commit d745934

File tree

4 files changed

+18
-51
lines changed

4 files changed

+18
-51
lines changed

auth0/v3/authentication/base.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,9 @@ def __init__(self, domain, telemetry=True):
3030
auth0_client = json.dumps({
3131
'name': 'auth0-python',
3232
'version': version,
33-
'dependencies': [
34-
{
35-
'name': 'requests',
36-
'version': requests.__version__,
37-
}
38-
],
39-
'environment': [
40-
{
41-
'name': 'python',
42-
'version': py_version,
43-
}
44-
]
33+
'env': {
34+
'python': py_version,
35+
}
4536
}).encode('utf-8')
4637

4738
self.base_headers.update({

auth0/v3/management/rest.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,11 @@ def __init__(self, jwt, telemetry=True):
2525
version = sys.modules['auth0'].__version__
2626

2727
auth0_client = json.dumps({
28-
'name': 'auth0-python', 'version': version,
29-
'dependencies': [
30-
{
31-
'name': 'requests',
32-
'version': requests.__version__,
33-
}
34-
],
35-
'environment': [
36-
{
37-
'name': 'python',
38-
'version': py_version,
39-
}
40-
]
28+
'name': 'auth0-python',
29+
'version': version,
30+
'env': {
31+
'python': py_version,
32+
}
4133
}).encode('utf-8')
4234

4335
self.base_headers.update({

auth0/v3/test/authentication/test_base.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,11 @@ def test_telemetry_enabled_by_default(self):
2525
sys.version_info.micro)
2626

2727
client_info = {
28-
'name': 'auth0-python', 'version': auth0_version,
29-
'dependencies': [
30-
{
31-
'name': 'requests',
32-
'version': requests.__version__
33-
}
34-
],
35-
'environment': [
36-
{
37-
'name': 'python',
38-
'version': python_version
39-
}
40-
]
28+
'name': 'auth0-python',
29+
'version': auth0_version,
30+
'env': {
31+
'python': python_version
32+
}
4133
}
4234

4335
self.assertEqual(user_agent, 'Python/{}'.format(python_version))

auth0/v3/test/management/test_rest.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -304,19 +304,11 @@ def test_enabled_telemetry(self):
304304
sys.version_info.micro)
305305

306306
client_info = {
307-
'name': 'auth0-python', 'version': auth0_version,
308-
'dependencies': [
309-
{
310-
'name': 'requests',
311-
'version': requests.__version__
312-
}
313-
],
314-
'environment': [
315-
{
316-
'name': 'python',
317-
'version': python_version
318-
}
319-
]
307+
'name': 'auth0-python',
308+
'version': auth0_version,
309+
'env': {
310+
'python': python_version
311+
}
320312
}
321313

322314
self.assertEqual(user_agent, 'Python/{}'.format(python_version))

0 commit comments

Comments
 (0)