Repository: auth0/auth0-python
Pull request #187 (2019-04-11 21:28:11)

Update telemetry format
### Changes

- Update telemetry format to comply with internal RFC.
- Remove `requests` version from telemetry.

### References

`SDK-702`

### Testing

- [x] This change adds unit test coverage
- [ ] This change adds integration test coverage
- [x] This change has been tested on the latest version of the platform/language or why not

### Checklist

- [x] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [x] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
- [x] All existing and new tests complete without errors



Patch:
diff --git a/auth0/v3/authentication/base.py b/auth0/v3/authentication/base.py
index c8d03ca..1b670e3 100644
--- a/auth0/v3/authentication/base.py
+++ b/auth0/v3/authentication/base.py
@@ -30,18 +30,9 @@ class AuthenticationBase(object):
             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({
diff --git a/auth0/v3/management/rest.py b/auth0/v3/management/rest.py
index e3c6eac..aafa25f 100644
--- a/auth0/v3/management/rest.py
+++ b/auth0/v3/management/rest.py
@@ -25,19 +25,11 @@ class RestClient(object):
             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({


Test patch:
diff --git a/auth0/v3/test/authentication/test_base.py b/auth0/v3/test/authentication/test_base.py
index 3032cd9..0f20dcf 100644
--- a/auth0/v3/test/authentication/test_base.py
+++ b/auth0/v3/test/authentication/test_base.py
@@ -25,19 +25,11 @@ class TestBase(unittest.TestCase):
                                            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))
diff --git a/auth0/v3/test/management/test_rest.py b/auth0/v3/test/management/test_rest.py
index 9d57843..9403514 100644
--- a/auth0/v3/test/management/test_rest.py
+++ b/auth0/v3/test/management/test_rest.py
@@ -304,19 +304,11 @@ class TestRest(unittest.TestCase):
                                            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))