huace-aigc-auth-client 1.1.1__tar.gz → 1.1.2__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.
- {huace_aigc_auth_client-1.1.1/huace_aigc_auth_client.egg-info → huace_aigc_auth_client-1.1.2}/PKG-INFO +4 -4
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/QUICK_START.txt +1 -1
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/README.md +3 -3
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/huace_aigc_auth_client/__init__.py +1 -1
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/huace_aigc_auth_client/legacy_adapter.py +3 -3
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/huace_aigc_auth_client/sdk.py +5 -3
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2/huace_aigc_auth_client.egg-info}/PKG-INFO +4 -4
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/pyproject.toml +1 -1
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/LICENSE +0 -0
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/MANIFEST.in +0 -0
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/huace_aigc_auth_client.egg-info/SOURCES.txt +0 -0
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/huace_aigc_auth_client.egg-info/dependency_links.txt +0 -0
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/huace_aigc_auth_client.egg-info/requires.txt +0 -0
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/huace_aigc_auth_client.egg-info/top_level.txt +0 -0
- {huace_aigc_auth_client-1.1.1 → huace_aigc_auth_client-1.1.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: huace-aigc-auth-client
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: 华策AIGC Auth Client - 提供 Token 验证、用户信息获取、权限检查、旧系统接入等功能
|
|
5
5
|
Author-email: Huace <support@huace.com>
|
|
6
6
|
License: MIT
|
|
@@ -46,7 +46,7 @@ AIGC_AUTH_APP_ID=your_app_id
|
|
|
46
46
|
AIGC_AUTH_APP_SECRET=your_app_secret
|
|
47
47
|
|
|
48
48
|
# 可选:鉴权服务地址(默认为生产环境)
|
|
49
|
-
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/api/v1
|
|
49
|
+
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/aigc-auth/api/v1
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
如需通过 Nginx 代理:
|
|
@@ -75,7 +75,7 @@ client = AigcAuthClient()
|
|
|
75
75
|
client = AigcAuthClient(
|
|
76
76
|
app_id="your_app_id",
|
|
77
77
|
app_secret="your_app_secret",
|
|
78
|
-
base_url="https://aigc-auth.huacemedia.com/api/v1"
|
|
78
|
+
base_url="https://aigc-auth.huacemedia.com/aigc-auth/api/v1"
|
|
79
79
|
)
|
|
80
80
|
```
|
|
81
81
|
|
|
@@ -353,7 +353,7 @@ except AigcAuthError as e:
|
|
|
353
353
|
# .env 文件
|
|
354
354
|
AIGC_AUTH_APP_ID=your_app_id
|
|
355
355
|
AIGC_AUTH_APP_SECRET=your_app_secret
|
|
356
|
-
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/api/v1
|
|
356
|
+
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/aigc-auth/api/v1
|
|
357
357
|
|
|
358
358
|
# 同步配置
|
|
359
359
|
AIGC_AUTH_SYNC_ENABLED=true
|
|
@@ -12,7 +12,7 @@ pip install huace-aigc-auth-client
|
|
|
12
12
|
# .env 文件
|
|
13
13
|
AIGC_AUTH_APP_ID=your_app_id
|
|
14
14
|
AIGC_AUTH_APP_SECRET=your_app_secret
|
|
15
|
-
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/api/v1
|
|
15
|
+
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/aigc-auth/api/v1
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
基本使用
|
|
@@ -21,7 +21,7 @@ AIGC_AUTH_APP_ID=your_app_id
|
|
|
21
21
|
AIGC_AUTH_APP_SECRET=your_app_secret
|
|
22
22
|
|
|
23
23
|
# 可选:鉴权服务地址(默认为生产环境)
|
|
24
|
-
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/api/v1
|
|
24
|
+
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/aigc-auth/api/v1
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
如需通过 Nginx 代理:
|
|
@@ -50,7 +50,7 @@ client = AigcAuthClient()
|
|
|
50
50
|
client = AigcAuthClient(
|
|
51
51
|
app_id="your_app_id",
|
|
52
52
|
app_secret="your_app_secret",
|
|
53
|
-
base_url="https://aigc-auth.huacemedia.com/api/v1"
|
|
53
|
+
base_url="https://aigc-auth.huacemedia.com/aigc-auth/api/v1"
|
|
54
54
|
)
|
|
55
55
|
```
|
|
56
56
|
|
|
@@ -328,7 +328,7 @@ except AigcAuthError as e:
|
|
|
328
328
|
# .env 文件
|
|
329
329
|
AIGC_AUTH_APP_ID=your_app_id
|
|
330
330
|
AIGC_AUTH_APP_SECRET=your_app_secret
|
|
331
|
-
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/api/v1
|
|
331
|
+
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/aigc-auth/api/v1
|
|
332
332
|
|
|
333
333
|
# 同步配置
|
|
334
334
|
AIGC_AUTH_SYNC_ENABLED=true
|
|
@@ -283,7 +283,7 @@ class LegacySystemAdapter(ABC):
|
|
|
283
283
|
Returns:
|
|
284
284
|
Dict: 处理结果
|
|
285
285
|
"""
|
|
286
|
-
if event == "user.created" or event == "user.updated":
|
|
286
|
+
if event == "user.created" or event == "user.updated" or event == "user.login":
|
|
287
287
|
# 转换数据格式
|
|
288
288
|
legacy_data = self.transform_auth_to_legacy(data)
|
|
289
289
|
|
|
@@ -308,7 +308,7 @@ class LegacySystemAdapter(ABC):
|
|
|
308
308
|
elif event == "user.deleted":
|
|
309
309
|
# 禁用用户而不是删除
|
|
310
310
|
username = data.get("username")
|
|
311
|
-
await self._update_user_async(username, {"
|
|
311
|
+
await self._update_user_async(username, {"status": "disabled"})
|
|
312
312
|
|
|
313
313
|
return {"success": True, "message": "User disabled"}
|
|
314
314
|
|
|
@@ -479,7 +479,7 @@ class UserSyncService:
|
|
|
479
479
|
"department": user_info.department,
|
|
480
480
|
"company": user_info.company,
|
|
481
481
|
"is_admin": user_info.is_admin,
|
|
482
|
-
"status":
|
|
482
|
+
"status": user_info.status,
|
|
483
483
|
}
|
|
484
484
|
|
|
485
485
|
async def sync_on_login_async(self, auth_user_info) -> Dict[str, Any]:
|
|
@@ -42,6 +42,7 @@ class UserInfo:
|
|
|
42
42
|
department: Optional[str] = None
|
|
43
43
|
company: Optional[str] = None
|
|
44
44
|
is_admin: Optional[bool] = None
|
|
45
|
+
status: Optional[str] = None
|
|
45
46
|
|
|
46
47
|
def __post_init__(self):
|
|
47
48
|
if self.roles is None:
|
|
@@ -91,7 +92,7 @@ class AigcAuthClient:
|
|
|
91
92
|
client = AigcAuthClient(
|
|
92
93
|
app_id="your_app_id",
|
|
93
94
|
app_secret="your_app_secret",
|
|
94
|
-
base_url="https://aigc-auth.huacemedia.com/api/v1" # 可选
|
|
95
|
+
base_url="https://aigc-auth.huacemedia.com/aigc-auth/api/v1" # 可选
|
|
95
96
|
)
|
|
96
97
|
|
|
97
98
|
# 验证 token
|
|
@@ -127,7 +128,7 @@ class AigcAuthClient:
|
|
|
127
128
|
self.base_url = (
|
|
128
129
|
base_url or
|
|
129
130
|
os.getenv("AIGC_AUTH_BASE_URL") or
|
|
130
|
-
"https://aigc-auth.huacemedia.com/api/v1"
|
|
131
|
+
"https://aigc-auth.huacemedia.com/aigc-auth/api/v1"
|
|
131
132
|
)
|
|
132
133
|
self.timeout = timeout
|
|
133
134
|
self.cache_ttl = cache_ttl
|
|
@@ -329,7 +330,8 @@ class AigcAuthClient:
|
|
|
329
330
|
permissions=data.get("permissions", []),
|
|
330
331
|
department=data.get("department"),
|
|
331
332
|
company=data.get("company"),
|
|
332
|
-
is_admin=data.get("is_admin")
|
|
333
|
+
is_admin=data.get("is_admin"),
|
|
334
|
+
status=data.get("status")
|
|
333
335
|
)
|
|
334
336
|
|
|
335
337
|
def check_permissions(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: huace-aigc-auth-client
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: 华策AIGC Auth Client - 提供 Token 验证、用户信息获取、权限检查、旧系统接入等功能
|
|
5
5
|
Author-email: Huace <support@huace.com>
|
|
6
6
|
License: MIT
|
|
@@ -46,7 +46,7 @@ AIGC_AUTH_APP_ID=your_app_id
|
|
|
46
46
|
AIGC_AUTH_APP_SECRET=your_app_secret
|
|
47
47
|
|
|
48
48
|
# 可选:鉴权服务地址(默认为生产环境)
|
|
49
|
-
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/api/v1
|
|
49
|
+
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/aigc-auth/api/v1
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
如需通过 Nginx 代理:
|
|
@@ -75,7 +75,7 @@ client = AigcAuthClient()
|
|
|
75
75
|
client = AigcAuthClient(
|
|
76
76
|
app_id="your_app_id",
|
|
77
77
|
app_secret="your_app_secret",
|
|
78
|
-
base_url="https://aigc-auth.huacemedia.com/api/v1"
|
|
78
|
+
base_url="https://aigc-auth.huacemedia.com/aigc-auth/api/v1"
|
|
79
79
|
)
|
|
80
80
|
```
|
|
81
81
|
|
|
@@ -353,7 +353,7 @@ except AigcAuthError as e:
|
|
|
353
353
|
# .env 文件
|
|
354
354
|
AIGC_AUTH_APP_ID=your_app_id
|
|
355
355
|
AIGC_AUTH_APP_SECRET=your_app_secret
|
|
356
|
-
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/api/v1
|
|
356
|
+
AIGC_AUTH_BASE_URL=https://aigc-auth.huacemedia.com/aigc-auth/api/v1
|
|
357
357
|
|
|
358
358
|
# 同步配置
|
|
359
359
|
AIGC_AUTH_SYNC_ENABLED=true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|