Skip to content

Commit

Permalink
update telemetry format (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbalmaceda authored Apr 12, 2019
1 parent b693a7d commit d745934
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 51 deletions.
15 changes: 3 additions & 12 deletions auth0/v3/authentication/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,9 @@ def __init__(self, domain, telemetry=True):
auth0_client = json.dumps({
'name': 'auth0-python',
'version': version,
'dependencies': [
{
'name': 'requests',
'version': requests.__version__,
}
],
'environment': [
{
'name': 'python',
'version': py_version,
}
]
'env': {
'python': py_version,
}
}).encode('utf-8')

self.base_headers.update({
Expand Down
18 changes: 5 additions & 13 deletions auth0/v3/management/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,11 @@ def __init__(self, jwt, telemetry=True):
version = sys.modules['auth0'].__version__

auth0_client = json.dumps({
'name': 'auth0-python', 'version': version,
'dependencies': [
{
'name': 'requests',
'version': requests.__version__,
}
],
'environment': [
{
'name': 'python',
'version': py_version,
}
]
'name': 'auth0-python',
'version': version,
'env': {
'python': py_version,
}
}).encode('utf-8')

self.base_headers.update({
Expand Down
18 changes: 5 additions & 13 deletions auth0/v3/test/authentication/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,11 @@ def test_telemetry_enabled_by_default(self):
sys.version_info.micro)

client_info = {
'name': 'auth0-python', 'version': auth0_version,
'dependencies': [
{
'name': 'requests',
'version': requests.__version__
}
],
'environment': [
{
'name': 'python',
'version': python_version
}
]
'name': 'auth0-python',
'version': auth0_version,
'env': {
'python': python_version
}
}

self.assertEqual(user_agent, 'Python/{}'.format(python_version))
Expand Down
18 changes: 5 additions & 13 deletions auth0/v3/test/management/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,19 +304,11 @@ def test_enabled_telemetry(self):
sys.version_info.micro)

client_info = {
'name': 'auth0-python', 'version': auth0_version,
'dependencies': [
{
'name': 'requests',
'version': requests.__version__
}
],
'environment': [
{
'name': 'python',
'version': python_version
}
]
'name': 'auth0-python',
'version': auth0_version,
'env': {
'python': python_version
}
}

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

0 comments on commit d745934

Please sign in to comment.