rainycode 1.1.6__tar.gz → 1.1.8__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.
- {rainycode-1.1.6 → rainycode-1.1.8}/PKG-INFO +2 -1
- {rainycode-1.1.6 → rainycode-1.1.8}/common_base/aiorequests.py +10 -2
- {rainycode-1.1.6 → rainycode-1.1.8}/common_servers/service/auth_svc.py +1 -1
- {rainycode-1.1.6 → rainycode-1.1.8}/pyproject.toml +2 -1
- {rainycode-1.1.6 → rainycode-1.1.8}/rainycode.egg-info/PKG-INFO +2 -1
- {rainycode-1.1.6 → rainycode-1.1.8}/rainycode.egg-info/requires.txt +1 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_base/consts.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_base/exception.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_base/logging.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_base/response.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_depends/auth_depend.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_models/__init__.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_models/base_model.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_models/user_model.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_models/wechat_model.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_servers/api/auth_api.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_servers/api/wechat_api.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_servers/router.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_servers/schemas/__init__.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_servers/schemas/auth_schema.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_servers/service/wechat_svc.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_utils/bcrypt_util.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_utils/captcha_util.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_utils/ip_util.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_utils/jwt_util.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_utils/snowflake_util.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/common_utils/wechat_util.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/core/base_config.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/core/databases/aiodb.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/core/databases/aioredis.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/core/middleware/http_middleware.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/core/start.py +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/rainycode.egg-info/SOURCES.txt +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/rainycode.egg-info/dependency_links.txt +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/rainycode.egg-info/top_level.txt +0 -0
- {rainycode-1.1.6 → rainycode-1.1.8}/setup.cfg +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rainycode
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.8
|
|
4
4
|
Summary: FastAPI base modules
|
|
5
5
|
Requires-Python: >=3.8
|
|
6
6
|
Requires-Dist: build==1.4.0
|
|
7
7
|
Requires-Dist: aerich==0.9.2
|
|
8
8
|
Requires-Dist: fastapi==0.133.1
|
|
9
9
|
Requires-Dist: aiohttp==3.13.3
|
|
10
|
+
Requires-Dist: certifi==2025.1.31
|
|
10
11
|
Requires-Dist: passlib==1.7.4
|
|
11
12
|
Requires-Dist: redis==7.2.1
|
|
12
13
|
Requires-Dist: pyjwt==2.11.0
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import ssl
|
|
3
|
+
import certifi
|
|
2
4
|
import aiohttp
|
|
3
5
|
|
|
4
6
|
|
|
7
|
+
# 模块级别 SSL 上下文,使用 certifi 证书,避免重复创建
|
|
8
|
+
_SSL_CONTEXT = ssl.create_default_context(cafile=certifi.where())
|
|
9
|
+
|
|
10
|
+
|
|
5
11
|
def parse_url(url, params=None, suffix=None):
|
|
6
12
|
if params:
|
|
7
13
|
query = "&".join(["{}={}".format(k, params[k]) for k in sorted(params.keys())])
|
|
@@ -16,14 +22,16 @@ def parse_url(url, params=None, suffix=None):
|
|
|
16
22
|
|
|
17
23
|
async def get(url, params=None, headers=None, suffix=None):
|
|
18
24
|
url = parse_url(url, params, suffix)
|
|
19
|
-
|
|
25
|
+
connector = aiohttp.TCPConnector(ssl=_SSL_CONTEXT)
|
|
26
|
+
async with aiohttp.ClientSession(connector=connector, trust_env=True) as session:
|
|
20
27
|
async with session.get(url, headers=headers) as response:
|
|
21
28
|
text = await response.text()
|
|
22
29
|
return json.loads(text)
|
|
23
30
|
|
|
24
31
|
|
|
25
32
|
async def post(url, data=None, headers=None):
|
|
26
|
-
|
|
33
|
+
connector = aiohttp.TCPConnector(ssl=_SSL_CONTEXT)
|
|
34
|
+
async with aiohttp.ClientSession(connector=connector, trust_env=True) as session:
|
|
27
35
|
if isinstance(data, dict):
|
|
28
36
|
data = json.dumps(data)
|
|
29
37
|
async with session.post(url, data=data, headers=headers) as response:
|
|
@@ -174,7 +174,7 @@ class AuthService:
|
|
|
174
174
|
|
|
175
175
|
# 构建回调地址
|
|
176
176
|
api_prefix = f"/api/{base_config.app_name}" if base_config.app_name else ""
|
|
177
|
-
callback_url = f"{base_config.base_url}
|
|
177
|
+
callback_url = f"{base_config.base_url}{api_prefix}/wechat/oauth/callback"
|
|
178
178
|
|
|
179
179
|
return WechatUtil.build_oauth_url(
|
|
180
180
|
appid=app_config.app_id,
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "rainycode"
|
|
7
|
-
version = "1.1.
|
|
7
|
+
version = "1.1.8"
|
|
8
8
|
description = "FastAPI base modules"
|
|
9
9
|
requires-python = ">=3.8"
|
|
10
10
|
|
|
@@ -13,6 +13,7 @@ dependencies = [
|
|
|
13
13
|
"aerich == 0.9.2",
|
|
14
14
|
"fastapi == 0.133.1",
|
|
15
15
|
"aiohttp == 3.13.3",
|
|
16
|
+
"certifi == 2025.1.31",
|
|
16
17
|
"passlib==1.7.4",
|
|
17
18
|
"redis == 7.2.1",
|
|
18
19
|
"pyjwt == 2.11.0",
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rainycode
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.8
|
|
4
4
|
Summary: FastAPI base modules
|
|
5
5
|
Requires-Python: >=3.8
|
|
6
6
|
Requires-Dist: build==1.4.0
|
|
7
7
|
Requires-Dist: aerich==0.9.2
|
|
8
8
|
Requires-Dist: fastapi==0.133.1
|
|
9
9
|
Requires-Dist: aiohttp==3.13.3
|
|
10
|
+
Requires-Dist: certifi==2025.1.31
|
|
10
11
|
Requires-Dist: passlib==1.7.4
|
|
11
12
|
Requires-Dist: redis==7.2.1
|
|
12
13
|
Requires-Dist: pyjwt==2.11.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|