pyxetabase 3.1.0.dev6__tar.gz → 3.1.0.dev7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyxetabase might be problematic. Click here for more details.

Files changed (40) hide show
  1. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/PKG-INFO +1 -1
  2. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/commons.py +6 -6
  3. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/opencga_config.py +19 -6
  4. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase.egg-info/PKG-INFO +1 -1
  5. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/setup.py +1 -1
  6. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/LICENSE +0 -0
  7. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/README.rst +0 -0
  8. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/__init__.py +0 -0
  9. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/exceptions.py +0 -0
  10. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/opencga_client.py +0 -0
  11. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/__init__.py +0 -0
  12. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/_parent_rest_clients.py +0 -0
  13. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/admin_client.py +0 -0
  14. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/alignment_client.py +0 -0
  15. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/clinical_analysis_client.py +0 -0
  16. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/cohort_client.py +0 -0
  17. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/cvdb_client.py +0 -0
  18. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/disease_panel_client.py +0 -0
  19. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/family_client.py +0 -0
  20. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/federation_client.py +0 -0
  21. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/file_client.py +0 -0
  22. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/ga4gh_client.py +0 -0
  23. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/individual_client.py +0 -0
  24. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/job_client.py +0 -0
  25. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/meta_client.py +0 -0
  26. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/organization_client.py +0 -0
  27. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/project_client.py +0 -0
  28. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/sample_client.py +0 -0
  29. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/study_client.py +0 -0
  30. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/user_client.py +0 -0
  31. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/variant_client.py +0 -0
  32. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/variant_operation_client.py +0 -0
  33. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_clients/workflow_client.py +0 -0
  34. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/rest_response.py +0 -0
  35. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase/retry.py +0 -0
  36. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase.egg-info/SOURCES.txt +0 -0
  37. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase.egg-info/dependency_links.txt +0 -0
  38. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase.egg-info/requires.txt +0 -0
  39. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/pyxetabase.egg-info/top_level.txt +0 -0
  40. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyxetabase
3
- Version: 3.1.0.dev6
3
+ Version: 3.1.0.dev7
4
4
  Summary: A REST client for OpenCGA enterprise REST web services
5
5
  Author: Daniel Perez-Gil
6
6
  Author-email: daniel.perez@zettagenomics.com
@@ -145,22 +145,22 @@ def _fetch(config, sid, category, resource, method, subcategory=None, query_id=N
145
145
  # Getting REST response
146
146
  if method == 'get':
147
147
  try:
148
- r = requests.get(url, headers=header, cookies=config.cookies)
148
+ r = requests.get(url, headers=header, cookies=config.cookies, verify=not config.tlsAllowInvalidCertificates)
149
149
  except requests.exceptions.ConnectionError:
150
150
  sleep(1)
151
- r = requests.get(url, headers=header, cookies=config.cookies)
151
+ r = requests.get(url, headers=header, cookies=config.cookies, verify=not config.tlsAllowInvalidCertificates)
152
152
  elif method == 'post':
153
153
  try:
154
- r = requests.post(url, json=data, headers=header, cookies=config.cookies)
154
+ r = requests.post(url, json=data, headers=header, cookies=config.cookies, verify=not config.tlsAllowInvalidCertificates)
155
155
  except requests.exceptions.ConnectionError:
156
156
  sleep(1)
157
- r = requests.post(url, json=data, headers=header, cookies=config.cookies)
157
+ r = requests.post(url, json=data, headers=header, cookies=config.cookies, verify=not config.tlsAllowInvalidCertificates)
158
158
  elif method == 'delete':
159
159
  try:
160
- r = requests.delete(url, headers=header, cookies=config.cookies)
160
+ r = requests.delete(url, headers=header, cookies=config.cookies, verify=not config.tlsAllowInvalidCertificates)
161
161
  except requests.exceptions.ConnectionError:
162
162
  sleep(1)
163
- r = requests.delete(url, headers=header, cookies=config.cookies)
163
+ r = requests.delete(url, headers=header, cookies=config.cookies, verify=not config.tlsAllowInvalidCertificates)
164
164
  else:
165
165
  raise NotImplementedError('method: ' + method + ' not implemented.')
166
166
 
@@ -55,16 +55,17 @@ class ClientConfiguration(object):
55
55
  if 'host' not in self._config['rest'] or not self._config['rest']['host']:
56
56
  raise ValueError('Missing configuration field "host".')
57
57
 
58
- self._validate_host(self._config['rest']['host'])
58
+ self._validate_host()
59
59
 
60
- @staticmethod
61
- def _validate_host(host):
60
+ def _validate_host(self):
62
61
  try:
63
- r = requests.head(host, timeout=2)
62
+ r = requests.head(self.host, timeout=2, verify=not self.tlsAllowInvalidCertificates)
64
63
  if r.status_code == 302:
65
64
  return
65
+ except requests.exceptions.SSLError:
66
+ raise Exception('Invalid SSL certificate from "{}"'.format(self.host))
66
67
  except requests.ConnectionError:
67
- raise Exception('Unreachable host "{}"'.format(host))
68
+ raise Exception('Unreachable host "{}"'.format(self.host))
68
69
 
69
70
  @property
70
71
  def configuration(self):
@@ -77,7 +78,19 @@ class ClientConfiguration(object):
77
78
  @host.setter
78
79
  def host(self, host):
79
80
  self._config['rest']['host'] = host
80
- self._validate_host(host)
81
+ self._validate_host()
82
+
83
+ @property
84
+ def tlsAllowInvalidCertificates(self):
85
+ if ('tlsAllowInvalidCertificates' in self._config['rest'] and
86
+ self._config['rest']['tlsAllowInvalidCertificates'] is not None):
87
+ return self._config['rest']['tlsAllowInvalidCertificates']
88
+ else:
89
+ return False
90
+
91
+ @tlsAllowInvalidCertificates.setter
92
+ def tlsAllowInvalidCertificates(self, tlsAllowInvalidCertificates):
93
+ self._config['rest']['tlsAllowInvalidCertificates'] = tlsAllowInvalidCertificates
81
94
 
82
95
  @property
83
96
  def version(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyxetabase
3
- Version: 3.1.0.dev6
3
+ Version: 3.1.0.dev7
4
4
  Summary: A REST client for OpenCGA enterprise REST web services
5
5
  Author: Daniel Perez-Gil
6
6
  Author-email: daniel.perez@zettagenomics.com
@@ -14,7 +14,7 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
14
14
 
15
15
  setup(
16
16
  name='pyxetabase',
17
- version='3.1.0.dev6',
17
+ version='3.1.0.dev7',
18
18
  description='A REST client for OpenCGA enterprise REST web services',
19
19
  long_description=long_description,
20
20
  long_description_content_type='text/x-rst',
File without changes