pyxetabase 3.1.0.dev6__tar.gz → 3.1.0.dev8__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.dev8}/PKG-INFO +1 -1
  2. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/commons.py +6 -6
  3. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/opencga_config.py +30 -8
  4. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase.egg-info/PKG-INFO +1 -1
  5. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/setup.py +1 -1
  6. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/LICENSE +0 -0
  7. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/README.rst +0 -0
  8. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/__init__.py +0 -0
  9. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/exceptions.py +0 -0
  10. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/opencga_client.py +0 -0
  11. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/__init__.py +0 -0
  12. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/_parent_rest_clients.py +0 -0
  13. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/admin_client.py +0 -0
  14. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/alignment_client.py +0 -0
  15. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/clinical_analysis_client.py +0 -0
  16. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/cohort_client.py +0 -0
  17. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/cvdb_client.py +0 -0
  18. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/disease_panel_client.py +0 -0
  19. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/family_client.py +0 -0
  20. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/federation_client.py +0 -0
  21. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/file_client.py +0 -0
  22. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/ga4gh_client.py +0 -0
  23. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/individual_client.py +0 -0
  24. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/job_client.py +0 -0
  25. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/meta_client.py +0 -0
  26. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/organization_client.py +0 -0
  27. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/project_client.py +0 -0
  28. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/sample_client.py +0 -0
  29. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/study_client.py +0 -0
  30. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/user_client.py +0 -0
  31. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/variant_client.py +0 -0
  32. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/variant_operation_client.py +0 -0
  33. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_clients/workflow_client.py +0 -0
  34. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/rest_response.py +0 -0
  35. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase/retry.py +0 -0
  36. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase.egg-info/SOURCES.txt +0 -0
  37. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase.egg-info/dependency_links.txt +0 -0
  38. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase.egg-info/requires.txt +0 -0
  39. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/pyxetabase.egg-info/top_level.txt +0 -0
  40. {pyxetabase-3.1.0.dev6 → pyxetabase-3.1.0.dev8}/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.dev8
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
 
@@ -37,12 +37,21 @@ class ClientConfiguration(object):
37
37
  return config_dict
38
38
 
39
39
  def get_sso_login_info(self):
40
+ # Checking if SSO login is specified
40
41
  if (('sso_login' in self._config and self._config['sso_login']) or
41
42
  ('cookies' in self._config and self._config['cookies'])):
42
- python_session_fhand = open(os.path.expanduser("~/.opencga/session.json"), 'r')
43
+
44
+ # Getting session file name
45
+ if 'name' in self._config['rest'] and self._config['rest']['name']:
46
+ host_name = self._config['rest']['name']
47
+ else:
48
+ host_name = 'opencga'
49
+ python_session_fhand = open(os.path.expanduser("~/.opencga/{}_session.json".format(host_name)), 'r')
50
+
51
+ # Loading info from session file
43
52
  session_info = json.loads(python_session_fhand.read())
44
53
  self._config['sso_login'] = True
45
- self._config['cookies'] = session_info['cookies']
54
+ self._config['cookies'] = session_info['attributes']['cookies']
46
55
  self._config['token'] = session_info['token']
47
56
 
48
57
  def _validate_configuration(self):
@@ -55,16 +64,17 @@ class ClientConfiguration(object):
55
64
  if 'host' not in self._config['rest'] or not self._config['rest']['host']:
56
65
  raise ValueError('Missing configuration field "host".')
57
66
 
58
- self._validate_host(self._config['rest']['host'])
67
+ self._validate_host()
59
68
 
60
- @staticmethod
61
- def _validate_host(host):
69
+ def _validate_host(self):
62
70
  try:
63
- r = requests.head(host, timeout=2)
71
+ r = requests.head(self.host, timeout=2, verify=not self.tlsAllowInvalidCertificates)
64
72
  if r.status_code == 302:
65
73
  return
74
+ except requests.exceptions.SSLError:
75
+ raise Exception('Invalid SSL certificate from "{}"'.format(self.host))
66
76
  except requests.ConnectionError:
67
- raise Exception('Unreachable host "{}"'.format(host))
77
+ raise Exception('Unreachable host "{}"'.format(self.host))
68
78
 
69
79
  @property
70
80
  def configuration(self):
@@ -77,7 +87,19 @@ class ClientConfiguration(object):
77
87
  @host.setter
78
88
  def host(self, host):
79
89
  self._config['rest']['host'] = host
80
- self._validate_host(host)
90
+ self._validate_host()
91
+
92
+ @property
93
+ def tlsAllowInvalidCertificates(self):
94
+ if ('tlsAllowInvalidCertificates' in self._config['rest'] and
95
+ self._config['rest']['tlsAllowInvalidCertificates'] is not None):
96
+ return self._config['rest']['tlsAllowInvalidCertificates']
97
+ else:
98
+ return False
99
+
100
+ @tlsAllowInvalidCertificates.setter
101
+ def tlsAllowInvalidCertificates(self, tlsAllowInvalidCertificates):
102
+ self._config['rest']['tlsAllowInvalidCertificates'] = tlsAllowInvalidCertificates
81
103
 
82
104
  @property
83
105
  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.dev8
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.dev8',
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