eclinical-requester 1.0.12__py3-none-any.whl → 1.0.14__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.12"
9
+ __version__ = "1.0.14"
@@ -46,7 +46,7 @@ class AuthorizeEdiary(BizBase, AdminSubjectAuthService, CommonSubjectAuthService
46
46
  self.time_mills = time.time()
47
47
  encrypt_pwd = encrypt_password(self.user.password)
48
48
  jwt_authentication_request_dto = SubjectJwtAuthenticationRequest(
49
- self.user.username, encrypt_pwd, self.user.org_code)
49
+ self.user.username, encrypt_pwd, organizationCode=self.user.org_code or None)
50
50
  response = self.auth_subject_login(jwt_authentication_request_dto)
51
51
  if response is None:
52
52
  raise Exception(f"LoginParams failed: {response}")
@@ -0,0 +1,40 @@
1
+ # !/usr/bin/python3
2
+ # -*- coding:utf-8 -*-
3
+ """
4
+ @Author: xiaodong.li
5
+ @Time: 5/22/2025 4:57 PM
6
+ @Description: Description
7
+ @File: decrypt.py
8
+ """
9
+ import base64
10
+ import re
11
+
12
+ from Crypto.Cipher import AES
13
+
14
+
15
+ def decrypt(str_base64: str, is_no_padding: bool = False) -> str:
16
+ key = b'1234567890123456'
17
+ iv = b'1234567890123456'
18
+
19
+ # Base64 解码
20
+ ciphertext = base64.b64decode(str_base64)
21
+
22
+ # 创建 AES 解密器
23
+ mode = AES.MODE_CBC
24
+ cipher = AES.new(key, mode, iv=iv)
25
+
26
+ # 解密
27
+ decrypted = cipher.decrypt(ciphertext)
28
+
29
+ if not is_no_padding:
30
+ # 去除 PKCS#7 padding
31
+ pad_len = decrypted[-1]
32
+ decrypted = decrypted[:-pad_len]
33
+
34
+ # 转成字符串(UTF-8 解码)
35
+ decrypted_str = decrypted.decode('utf-8', errors='replace')
36
+
37
+ # 替换不可见字符(与 JS 中 replace(/[\u0000-\u001F\u007F-\u009F]/g, ' ') 等效)
38
+ cleaned_str = re.sub(r'[\x00-\x1F\x7F-\x9F]', ' ', decrypted_str)
39
+
40
+ return cleaned_str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eclinical_requester
3
- Version: 1.0.12
3
+ Version: 1.0.14
4
4
  Summary: edetek api requester
5
5
  Home-page: http://example.com
6
6
  Author: xiaodong.li
@@ -1,4 +1,4 @@
1
- api_requester/__init__.py,sha256=UcDSkXtvZ8HYHela-2dnWRnKQX2IgZcQlQwcK_0maEA,176
1
+ api_requester/__init__.py,sha256=6Ge9Z-M552pkA-tZPuxUdi3YUCKzdhthKFoxucaHTGA,176
2
2
  api_requester/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  api_requester/core/call_api.py,sha256=iygayWh223Ru0vdrFueLD1UjmU2ZneDULW3oppdUSDA,2765
4
4
  api_requester/core/admin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -42,7 +42,7 @@ api_requester/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
42
42
  api_requester/http/app_url.py,sha256=jTGwxPcu_yts4WZbE9wDl6HqGOB48BdEIGw4Otmo1F0,939
43
43
  api_requester/http/authorize.py,sha256=NEGPWmTwIlCK8ClCNXVrkajvz2utJEHiQbVrDVzF6p8,7608
44
44
  api_requester/http/authorize_ecoa.py,sha256=7KPjkCLp4xjMFybT66GSqhIeelGtn2sP-DokydBuQiI,3940
45
- api_requester/http/authorize_ediary.py,sha256=useGPV_SDAv_fDbU9KJgW4eT_rMQxzwplbsIZ3wXeKI,2910
45
+ api_requester/http/authorize_ediary.py,sha256=zWNR-4Z8jg0ytYmoZJ9upFQIjKMCsv49Qp8gj846mBc,2935
46
46
  api_requester/http/eclinical_requests.py,sha256=JUQ7EPeAvspz-J6GvpoVM2kA4hyGN4AP166hyQlmeFM,9640
47
47
  api_requester/http/exceptions.py,sha256=BG0eSOkYT50Qib_PpjSrNWkcv9p9gBanOvXOWrP7Jz8,2685
48
48
  api_requester/http/gateway.py,sha256=Ntnj-3OtyKLoGpkcCczMWQ0-0XrS5J_qkEcc9jB5AUk,3676
@@ -50,6 +50,7 @@ api_requester/http/sample_headers.py,sha256=4a2z0ITPvnNhXiX0xZHfcexiRQdkIvEv8YUK
50
50
  api_requester/http/token_manager.py,sha256=sQO4zd3smA0XfmEndBwXs-8rRCmjkEU48S8jWxxXevA,919
51
51
  api_requester/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  api_requester/utils/constant.py,sha256=SpHGa9pwLsqUMWc64U6HuDq2K1S-Q1z9hRxW1cq896k,2506
53
+ api_requester/utils/decrypt.py,sha256=21JPFY3VX010KgjH3DvmzGG_-YZeVXklGKaulcYPJ0Q,1007
53
54
  api_requester/utils/json_utils.py,sha256=0fTXGESYxuiHv4ezx_iIrmXv2qwb3Ozd1qRIXenToOQ,2614
54
55
  api_requester/utils/lib.py,sha256=wOXU4hB1tFPHT2X96zmVUfEb7hulowDVO8BN5kV9OpA,14429
55
56
  api_requester/utils/logger.py,sha256=JDRvNV47sCi9cPQ2oAVDuMboCJX1quS8R9wljAdqUU4,1185
@@ -58,8 +59,8 @@ api_requester/utils/placeholder_replacer.py,sha256=umNGeA1KCQ6Ewzsv1xEehLmHtKkgv
58
59
  api_requester/utils/read_file.py,sha256=M4oskAPDzefeVXfhhNmLe4GOjBKNi9WJLF4k474CTlo,2304
59
60
  api_requester/utils/rsa.py,sha256=dr2m3a2M_LYu1Us97EEiMcjZAkpn1yWKIOjyYYubZeg,1202
60
61
  api_requester/utils/time_utils.py,sha256=u1hHO0POBhdXaTQ7VGY_2YjaYxwlrWXGb5phP8iLfOY,579
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,,
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,,