oscar-python 1.1.0b2__tar.gz → 1.1.0b3__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.
Files changed (21) hide show
  1. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/PKG-INFO +1 -1
  2. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python/_utils.py +3 -1
  3. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python/client.py +14 -3
  4. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python.egg-info/PKG-INFO +1 -1
  5. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/LICENSE +0 -0
  6. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/README.md +0 -0
  7. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python/__init__.py +0 -0
  8. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python/_providers/_minio.py +0 -0
  9. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python/_providers/_onedata.py +0 -0
  10. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python/_providers/_providers_base.py +0 -0
  11. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python/_providers/_s3.py +0 -0
  12. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python/_providers/_webdav.py +0 -0
  13. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python/local_test.py +0 -0
  14. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python/storage.py +0 -0
  15. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python.egg-info/SOURCES.txt +0 -0
  16. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python.egg-info/dependency_links.txt +0 -0
  17. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python.egg-info/not-zip-safe +0 -0
  18. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python.egg-info/requires.txt +0 -0
  19. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/oscar_python.egg-info/top_level.txt +0 -0
  20. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/setup.cfg +0 -0
  21. {oscar_python-1.1.0b2 → oscar_python-1.1.0b3}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oscar_python
3
- Version: 1.1.0b2
3
+ Version: 1.1.0b3
4
4
  Summary: OSCAR API for python
5
5
  Home-page: https://github.com/grycap/oscar_python
6
6
  Author: GRyCAP - Universitat Politecnica de Valencia
@@ -48,9 +48,11 @@ def get_headers(c):
48
48
  usr_pass_as_bytes = bytes(c.user+":"+c.password,"utf-8")
49
49
  usr_pass_base_64 = base64.b64encode(usr_pass_as_bytes).decode("utf-8")
50
50
  return {"Authorization": "Basic "+ usr_pass_base_64}
51
- if c._AUTH_TYPE == "oidc":
51
+ if c._AUTH_TYPE == "oidc-agent":
52
52
  token = agent.get_access_token(c.shortname)
53
53
  return get_headers_with_token(token)
54
+ if c._AUTH_TYPE == "oidc":
55
+ return get_headers_with_token(c.oidc_token)
54
56
 
55
57
  """ Function to generate headers with token auth """
56
58
  def get_headers_with_token(token):
@@ -16,7 +16,8 @@
16
16
  import json
17
17
  import yaml
18
18
  import liboidcagent as agent
19
- import oscar_python._utils as utils
19
+ #import oscar_python._utils as utils
20
+ import _utils as utils
20
21
  from oscar_python.storage import Storage
21
22
 
22
23
  _INFO_PATH = "/system/info"
@@ -38,6 +39,8 @@ class Client:
38
39
  self.set_auth_type(options)
39
40
  if self._AUTH_TYPE == 'basicauth':
40
41
  self.basic_auth_client(options)
42
+ if self._AUTH_TYPE == 'oidc-agent':
43
+ self.oidc_agent_client(options)
41
44
  if self._AUTH_TYPE == 'oidc':
42
45
  self.oidc_client(options)
43
46
 
@@ -48,21 +51,29 @@ class Client:
48
51
  self.password = options['password']
49
52
  self.ssl = bool(options['ssl'])
50
53
 
51
- def oidc_client(self, options):
54
+ def oidc_agent_client(self, options):
52
55
  self.id = options['cluster_id']
53
56
  self.endpoint = options['endpoint']
54
57
  self.shortname = options['shortname']
55
58
  self.ssl = bool(options['ssl'])
59
+
60
+ def oidc_client(self, options):
61
+ self.id = options['cluster_id']
62
+ self.endpoint = options['endpoint']
63
+ self.oidc_token = options['oidc_token']
64
+ self.ssl = bool(options['ssl'])
56
65
 
57
66
  def set_auth_type(self, options):
58
67
  if 'user' in options:
59
68
  self._AUTH_TYPE = "basicauth"
60
69
  elif 'shortname' in options:
61
- self._AUTH_TYPE = "oidc"
70
+ self._AUTH_TYPE = "oidc-agent"
62
71
  try:
63
72
  agent.get_access_token(options['shortname'])
64
73
  except agent.OidcAgentError as e:
65
74
  print("ERROR oidc-agent: {}".format(e))
75
+ elif 'oidc_token' in options:
76
+ self._AUTH_TYPE == "oidc"
66
77
  else:
67
78
  raise ValueError("Unrecognized authentication credentials in options")
68
79
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oscar-python
3
- Version: 1.1.0b2
3
+ Version: 1.1.0b3
4
4
  Summary: OSCAR API for python
5
5
  Home-page: https://github.com/grycap/oscar_python
6
6
  Author: GRyCAP - Universitat Politecnica de Valencia
File without changes
File without changes
File without changes
File without changes