eclinical-requester 1.0.14__py3-none-any.whl → 1.0.16__py3-none-any.whl

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.
api_requester/__init__.py CHANGED
@@ -6,4 +6,4 @@
6
6
  @Description: Description
7
7
  @File: __init__.py.py
8
8
  """
9
- __version__ = "1.0.14"
9
+ __version__ = "1.0.16"
@@ -22,7 +22,7 @@ from api_requester.utils.placeholder_replacer import PlaceholderReplacer
22
22
  class ApiRequester(BizBase):
23
23
 
24
24
  def __init__(self, username=None, password=None, sponsor=None, study=None, test_env=None, app_env=None, app=None,
25
- company=None, role=None, external=False, ttype=None, org_code=None):
25
+ company=None, role=None, external=False, ttype=None, org_code=None, token=None):
26
26
  u = EClinicalUser(
27
27
  username=username,
28
28
  password=password,
@@ -35,6 +35,7 @@ class ApiRequester(BizBase):
35
35
  role=role,
36
36
  external=external,
37
37
  org_code=org_code,
38
+ token=token,
38
39
  )
39
40
  super().__init__(u)
40
41
  self.headers = dict()
api_requester/dto/user.py CHANGED
@@ -11,7 +11,7 @@
11
11
  class EClinicalUser:
12
12
 
13
13
  def __init__(self, username=None, password=None, sponsor=None, study=None, test_env=None, app_env=None, app=None,
14
- company=None, role=None, external=False, org_code=None):
14
+ company=None, role=None, external=False, org_code=None, token=None):
15
15
  # username 用户名
16
16
  # password 密码
17
17
  # app 访问的系统
@@ -30,6 +30,7 @@ class EClinicalUser:
30
30
  self.external = external
31
31
  self.company_level_login = False
32
32
  self.org_code = org_code
33
+ self.token = token # 使用token直接调用接口
33
34
 
34
35
  def __repr__(self):
35
36
  attributes = self.__dict__
@@ -38,6 +38,12 @@ class Authorize(BizBase, AdminAuthService, AdminUserOnBoardApplicationServiceImp
38
38
  CommonSystemEnvServiceImpl.__init__(self)
39
39
 
40
40
  def login(self):
41
+ if self.user.token:
42
+ self.headers = SampleHeaders().add_authorization(self.user.token).to_h()
43
+ self.time_mills = time.time()
44
+ self.user.app = self.login_app
45
+ self.get_current_system_env()
46
+ return
41
47
  if self.login_app == AppEnum.CODING.code:
42
48
  login_app_tip = "{0}({1})".format(self.login_app,
43
49
  self.user.company_level_login is True and "admin" or "study")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eclinical_requester
3
- Version: 1.0.14
3
+ Version: 1.0.16
4
4
  Summary: edetek api requester
5
5
  Home-page: http://example.com
6
6
  Author: xiaodong.li
@@ -1,6 +1,6 @@
1
- api_requester/__init__.py,sha256=6Ge9Z-M552pkA-tZPuxUdi3YUCKzdhthKFoxucaHTGA,176
1
+ api_requester/__init__.py,sha256=UTKfs6PToJmMK2UkZAZrdNM09TMLDFY9uWCvv8WsdN0,176
2
2
  api_requester/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- api_requester/core/call_api.py,sha256=iygayWh223Ru0vdrFueLD1UjmU2ZneDULW3oppdUSDA,2765
3
+ api_requester/core/call_api.py,sha256=nu3AANRty6IVdilRaFGmFeKQijuw6mrCgzU0WzHCOck,2803
4
4
  api_requester/core/admin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  api_requester/core/admin/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  api_requester/core/admin/api/auth_api.py,sha256=dKKOuEnXIKgzhUfaNfSzNm24LREUcvPZ28xxTZisY6w,861
@@ -37,10 +37,10 @@ api_requester/docs/application.yaml,sha256=_yTaHYLd9CdGfM4ua3qbYOO3x36cWjFEcJmPG
37
37
  api_requester/dto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  api_requester/dto/base_dto.py,sha256=nyBGidUblKE6MSK-yvcVSlYDyqPbIEdXiTOvymcFZp0,6904
39
39
  api_requester/dto/biz_base.py,sha256=4lzf6FoXCNBr0OlxbFryf-7v16wfP3Hv6c7WUh-DgNs,874
40
- api_requester/dto/user.py,sha256=SaEBTfm56K-zAKfjABuEI_Ae0bdZP4UIVaBLrrBGVf4,1373
40
+ api_requester/dto/user.py,sha256=M27az447jYRSMJScDzUrP4tUduI22SpGCMe-oZlDTN8,1446
41
41
  api_requester/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  api_requester/http/app_url.py,sha256=jTGwxPcu_yts4WZbE9wDl6HqGOB48BdEIGw4Otmo1F0,939
43
- api_requester/http/authorize.py,sha256=NEGPWmTwIlCK8ClCNXVrkajvz2utJEHiQbVrDVzF6p8,7608
43
+ api_requester/http/authorize.py,sha256=SVYT_iat85RfgR4VJ9dmVC3TnWH-QTxIgDmpz8PAp1s,7873
44
44
  api_requester/http/authorize_ecoa.py,sha256=7KPjkCLp4xjMFybT66GSqhIeelGtn2sP-DokydBuQiI,3940
45
45
  api_requester/http/authorize_ediary.py,sha256=zWNR-4Z8jg0ytYmoZJ9upFQIjKMCsv49Qp8gj846mBc,2935
46
46
  api_requester/http/eclinical_requests.py,sha256=JUQ7EPeAvspz-J6GvpoVM2kA4hyGN4AP166hyQlmeFM,9640
@@ -59,8 +59,8 @@ api_requester/utils/placeholder_replacer.py,sha256=umNGeA1KCQ6Ewzsv1xEehLmHtKkgv
59
59
  api_requester/utils/read_file.py,sha256=M4oskAPDzefeVXfhhNmLe4GOjBKNi9WJLF4k474CTlo,2304
60
60
  api_requester/utils/rsa.py,sha256=dr2m3a2M_LYu1Us97EEiMcjZAkpn1yWKIOjyYYubZeg,1202
61
61
  api_requester/utils/time_utils.py,sha256=u1hHO0POBhdXaTQ7VGY_2YjaYxwlrWXGb5phP8iLfOY,579
62
- eclinical_requester-1.0.14.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
63
- eclinical_requester-1.0.14.dist-info/METADATA,sha256=UqOdJB_P86woNYay1IPstszBAwlCJv313mSkLzrAp2c,719
64
- eclinical_requester-1.0.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
65
- eclinical_requester-1.0.14.dist-info/top_level.txt,sha256=nM6wDThrKcbLCcBGrTBPPtstqV97VyITV-YiKLoUG0U,14
66
- eclinical_requester-1.0.14.dist-info/RECORD,,
62
+ eclinical_requester-1.0.16.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
63
+ eclinical_requester-1.0.16.dist-info/METADATA,sha256=fBMaYFA5ZL35usvG0rQOE7c2hJ-wAulctppX454Ra5Q,719
64
+ eclinical_requester-1.0.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
65
+ eclinical_requester-1.0.16.dist-info/top_level.txt,sha256=nM6wDThrKcbLCcBGrTBPPtstqV97VyITV-YiKLoUG0U,14
66
+ eclinical_requester-1.0.16.dist-info/RECORD,,