eclinical-requester 1.0.11__py3-none-any.whl → 1.0.12__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 +1 -1
- api_requester/core/admin/api/subject_auth_api.py +3 -0
- api_requester/core/admin/dto/jwt_authentication_request.py +1 -0
- api_requester/core/admin/dto/subject_jwt_authentication_request.py +19 -0
- api_requester/core/admin/service/subject_auth_service.py +5 -1
- api_requester/core/call_api.py +3 -2
- api_requester/dto/user.py +4 -2
- api_requester/http/authorize_ediary.py +3 -2
- {eclinical_requester-1.0.11.dist-info → eclinical_requester-1.0.12.dist-info}/METADATA +1 -1
- {eclinical_requester-1.0.11.dist-info → eclinical_requester-1.0.12.dist-info}/RECORD +13 -12
- {eclinical_requester-1.0.11.dist-info → eclinical_requester-1.0.12.dist-info}/WHEEL +1 -1
- {eclinical_requester-1.0.11.dist-info → eclinical_requester-1.0.12.dist-info}/licenses/LICENSE +0 -0
- {eclinical_requester-1.0.11.dist-info → eclinical_requester-1.0.12.dist-info}/top_level.txt +0 -0
api_requester/__init__.py
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
# !/usr/bin/python3
|
2
|
+
# -*- coding:utf-8 -*-
|
3
|
+
"""
|
4
|
+
@Author: xiaodong.li
|
5
|
+
@Time: 2025/07/04 09:01
|
6
|
+
@Description: Description
|
7
|
+
@File: subject_jwt_authentication_request.py
|
8
|
+
"""
|
9
|
+
from dataclasses import dataclass
|
10
|
+
|
11
|
+
from api_requester.core.admin.dto.jwt_authentication_request import JwtAuthenticationRequest
|
12
|
+
|
13
|
+
|
14
|
+
@dataclass
|
15
|
+
class SubjectJwtAuthenticationRequest(JwtAuthenticationRequest):
|
16
|
+
"""
|
17
|
+
The SubjectJwtAuthenticationRequest was generated by Generator from the SubjectJwtAuthenticationRequest.java file.
|
18
|
+
"""
|
19
|
+
organizationCode: str = None
|
@@ -8,6 +8,7 @@
|
|
8
8
|
"""
|
9
9
|
from api_requester.core.admin.api.subject_auth_api import AdminSubjectAuthApi
|
10
10
|
from api_requester.core.admin.dto.jwt_authentication_request import JwtAuthenticationRequest
|
11
|
+
from api_requester.core.admin.dto.subject_jwt_authentication_request import SubjectJwtAuthenticationRequest
|
11
12
|
|
12
13
|
|
13
14
|
class AdminSubjectAuthService(AdminSubjectAuthApi):
|
@@ -18,7 +19,7 @@ class AdminSubjectAuthService(AdminSubjectAuthApi):
|
|
18
19
|
def __init__(self):
|
19
20
|
AdminSubjectAuthApi.__init__(self)
|
20
21
|
|
21
|
-
def auth_subject_login(self, authentication_request:
|
22
|
+
def auth_subject_login(self, authentication_request: SubjectJwtAuthenticationRequest = None):
|
22
23
|
return self.auth_subject_login_api(json=authentication_request)
|
23
24
|
|
24
25
|
def auth_subject_logout(self):
|
@@ -26,3 +27,6 @@ class AdminSubjectAuthService(AdminSubjectAuthApi):
|
|
26
27
|
|
27
28
|
def auth_subject_me(self):
|
28
29
|
return self.auth_subject_me_api()
|
30
|
+
|
31
|
+
def verify_organization_code(self, organization_code: str = None):
|
32
|
+
return self.verify_organization_code_api(params=dict(organizationCode=organization_code))
|
api_requester/core/call_api.py
CHANGED
@@ -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):
|
25
|
+
company=None, role=None, external=False, ttype=None, org_code=None):
|
26
26
|
u = EClinicalUser(
|
27
27
|
username=username,
|
28
28
|
password=password,
|
@@ -33,7 +33,8 @@ class ApiRequester(BizBase):
|
|
33
33
|
app=app,
|
34
34
|
company=company,
|
35
35
|
role=role,
|
36
|
-
external=external
|
36
|
+
external=external,
|
37
|
+
org_code=org_code,
|
37
38
|
)
|
38
39
|
super().__init__(u)
|
39
40
|
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):
|
14
|
+
company=None, role=None, external=False, org_code=None):
|
15
15
|
# username 用户名
|
16
16
|
# password 密码
|
17
17
|
# app 访问的系统
|
@@ -29,11 +29,13 @@ class EClinicalUser:
|
|
29
29
|
self.role = role
|
30
30
|
self.external = external
|
31
31
|
self.company_level_login = False
|
32
|
+
self.org_code = org_code
|
32
33
|
|
33
34
|
def __repr__(self):
|
34
35
|
attributes = self.__dict__
|
35
36
|
info = [
|
36
|
-
str(attributes[item]) for item in
|
37
|
+
str(attributes[item]) for item in
|
38
|
+
["test_env", "username", "role", "company", "sponsor", "study", "app_env", "org_code"]
|
37
39
|
if attributes.get(item) is not None
|
38
40
|
]
|
39
41
|
return "/".join(info)
|
@@ -10,7 +10,7 @@ import time
|
|
10
10
|
|
11
11
|
from loguru import logger
|
12
12
|
|
13
|
-
from api_requester.core.admin.dto.
|
13
|
+
from api_requester.core.admin.dto.subject_jwt_authentication_request import SubjectJwtAuthenticationRequest
|
14
14
|
from api_requester.core.admin.dto.user_on_board_dto import UserOnBoardDto
|
15
15
|
from api_requester.core.admin.service.subject_auth_service import AdminSubjectAuthService
|
16
16
|
from api_requester.core.common.service.subject_auth_service import CommonSubjectAuthService
|
@@ -45,7 +45,8 @@ class AuthorizeEdiary(BizBase, AdminSubjectAuthService, CommonSubjectAuthService
|
|
45
45
|
def _auth(self):
|
46
46
|
self.time_mills = time.time()
|
47
47
|
encrypt_pwd = encrypt_password(self.user.password)
|
48
|
-
jwt_authentication_request_dto =
|
48
|
+
jwt_authentication_request_dto = SubjectJwtAuthenticationRequest(
|
49
|
+
self.user.username, encrypt_pwd, self.user.org_code)
|
49
50
|
response = self.auth_subject_login(jwt_authentication_request_dto)
|
50
51
|
if response is None:
|
51
52
|
raise Exception(f"LoginParams failed: {response}")
|
@@ -1,23 +1,24 @@
|
|
1
|
-
api_requester/__init__.py,sha256
|
1
|
+
api_requester/__init__.py,sha256=UcDSkXtvZ8HYHela-2dnWRnKQX2IgZcQlQwcK_0maEA,176
|
2
2
|
api_requester/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
api_requester/core/call_api.py,sha256=
|
3
|
+
api_requester/core/call_api.py,sha256=iygayWh223Ru0vdrFueLD1UjmU2ZneDULW3oppdUSDA,2765
|
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
|
7
7
|
api_requester/core/admin/api/ecoa_auth_api.py,sha256=kbDB-3dbVEs_XMe95yUNJHLpe0hZCmpIvycATajJCxE,1008
|
8
|
-
api_requester/core/admin/api/subject_auth_api.py,sha256=
|
8
|
+
api_requester/core/admin/api/subject_auth_api.py,sha256=NAWm8TVkn4ZZwYSDQGEKzClUCJib3DxxG3pYnKfFPv0,760
|
9
9
|
api_requester/core/admin/api/user_on_board_application_api.py,sha256=gb7w8NYWsXgnWOla9JMyAyb5gVz3NmLiEb9H7ZlkyQs,897
|
10
10
|
api_requester/core/admin/dto/__init__.py,sha256=qzyXEU5lClt3eyhOuVr-XxwcB6XR4I_1Ez26ioFLuV4,153
|
11
11
|
api_requester/core/admin/dto/cross_user_user_on_board_dto.py,sha256=VSsihBthlfJORhhVeumDQxuF0lUj5vsLUcF3131Wi1s,489
|
12
12
|
api_requester/core/admin/dto/ecoa_onboard_request_dto.py,sha256=SL1NDa1wtvhfJqLvbnmDD-HyR0vKGtoUUybSYiZ7jT8,498
|
13
|
-
api_requester/core/admin/dto/jwt_authentication_request.py,sha256=
|
13
|
+
api_requester/core/admin/dto/jwt_authentication_request.py,sha256=KQCe8nJSsmpldilUbU0MZ1V_A2ZUpv7hm4HE8-rUO7I,498
|
14
14
|
api_requester/core/admin/dto/reset_password_email_request_dto.py,sha256=5n6LYwGxibmmtAbrLSrokd2FHWGk6w4pV0bQ31BFWII,476
|
15
15
|
api_requester/core/admin/dto/sso_token_retrieve_dto.py,sha256=kvdUik1Pvar2AlI_o0i62KnTCkxqZNqk1tHORXeOmI0,452
|
16
|
+
api_requester/core/admin/dto/subject_jwt_authentication_request.py,sha256=dmZ_nizt-gGfoUXqdRvImGn4EPMvLhQl82MaAHuvl7A,560
|
16
17
|
api_requester/core/admin/dto/user_on_board_dto.py,sha256=zsCKgnEttnsCkFlXKfuzkXWbvIhfiWv3jEj8jY6GRbQ,692
|
17
18
|
api_requester/core/admin/service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
19
|
api_requester/core/admin/service/auth_service.py,sha256=foo5XJyDNcg9W9bigcjhKxhVNwUA4LKykOqir_ZfPq4,1062
|
19
20
|
api_requester/core/admin/service/ecoa_auth_service.py,sha256=elwTj49MY-5Dgh6XNstbtmH-Cwh2-ykxE_y_z8Gd41I,1731
|
20
|
-
api_requester/core/admin/service/subject_auth_service.py,sha256=
|
21
|
+
api_requester/core/admin/service/subject_auth_service.py,sha256=Iu5V-XymJk68oHCY3DapOWqYt3Qp2tGksPgAttbRYug,1200
|
21
22
|
api_requester/core/admin/service/user_on_board_application_service.py,sha256=gh3-sQU9JkH_10QQ4vbejqGlFQr9u5oNgHbiQ7ulKcU,1363
|
22
23
|
api_requester/core/admin/service/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
24
|
api_requester/core/admin/service/impl/system_env_service_impl.py,sha256=cWea0iOpUivR3bpiyQNE_1aQKtr2_5_xN9sABV6TBUs,1502
|
@@ -36,12 +37,12 @@ api_requester/docs/application.yaml,sha256=_yTaHYLd9CdGfM4ua3qbYOO3x36cWjFEcJmPG
|
|
36
37
|
api_requester/dto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
38
|
api_requester/dto/base_dto.py,sha256=nyBGidUblKE6MSK-yvcVSlYDyqPbIEdXiTOvymcFZp0,6904
|
38
39
|
api_requester/dto/biz_base.py,sha256=4lzf6FoXCNBr0OlxbFryf-7v16wfP3Hv6c7WUh-DgNs,874
|
39
|
-
api_requester/dto/user.py,sha256=
|
40
|
+
api_requester/dto/user.py,sha256=SaEBTfm56K-zAKfjABuEI_Ae0bdZP4UIVaBLrrBGVf4,1373
|
40
41
|
api_requester/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
41
42
|
api_requester/http/app_url.py,sha256=jTGwxPcu_yts4WZbE9wDl6HqGOB48BdEIGw4Otmo1F0,939
|
42
43
|
api_requester/http/authorize.py,sha256=NEGPWmTwIlCK8ClCNXVrkajvz2utJEHiQbVrDVzF6p8,7608
|
43
44
|
api_requester/http/authorize_ecoa.py,sha256=7KPjkCLp4xjMFybT66GSqhIeelGtn2sP-DokydBuQiI,3940
|
44
|
-
api_requester/http/authorize_ediary.py,sha256=
|
45
|
+
api_requester/http/authorize_ediary.py,sha256=useGPV_SDAv_fDbU9KJgW4eT_rMQxzwplbsIZ3wXeKI,2910
|
45
46
|
api_requester/http/eclinical_requests.py,sha256=JUQ7EPeAvspz-J6GvpoVM2kA4hyGN4AP166hyQlmeFM,9640
|
46
47
|
api_requester/http/exceptions.py,sha256=BG0eSOkYT50Qib_PpjSrNWkcv9p9gBanOvXOWrP7Jz8,2685
|
47
48
|
api_requester/http/gateway.py,sha256=Ntnj-3OtyKLoGpkcCczMWQ0-0XrS5J_qkEcc9jB5AUk,3676
|
@@ -57,8 +58,8 @@ api_requester/utils/placeholder_replacer.py,sha256=umNGeA1KCQ6Ewzsv1xEehLmHtKkgv
|
|
57
58
|
api_requester/utils/read_file.py,sha256=M4oskAPDzefeVXfhhNmLe4GOjBKNi9WJLF4k474CTlo,2304
|
58
59
|
api_requester/utils/rsa.py,sha256=dr2m3a2M_LYu1Us97EEiMcjZAkpn1yWKIOjyYYubZeg,1202
|
59
60
|
api_requester/utils/time_utils.py,sha256=u1hHO0POBhdXaTQ7VGY_2YjaYxwlrWXGb5phP8iLfOY,579
|
60
|
-
eclinical_requester-1.0.
|
61
|
-
eclinical_requester-1.0.
|
62
|
-
eclinical_requester-1.0.
|
63
|
-
eclinical_requester-1.0.
|
64
|
-
eclinical_requester-1.0.
|
61
|
+
eclinical_requester-1.0.12.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
62
|
+
eclinical_requester-1.0.12.dist-info/METADATA,sha256=L79gJj9qu3-hyILQ9oghD1OQ6iOcAPFSzgPH9B5XinU,719
|
63
|
+
eclinical_requester-1.0.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
64
|
+
eclinical_requester-1.0.12.dist-info/top_level.txt,sha256=nM6wDThrKcbLCcBGrTBPPtstqV97VyITV-YiKLoUG0U,14
|
65
|
+
eclinical_requester-1.0.12.dist-info/RECORD,,
|
{eclinical_requester-1.0.11.dist-info → eclinical_requester-1.0.12.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|