huace-aigc-auth-client 1.1.1__py3-none-any.whl → 1.1.2__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.
@@ -90,4 +90,4 @@ __all__ = [
90
90
  "create_sync_config",
91
91
  "create_default_field_mappings",
92
92
  ]
93
- __version__ = "1.1.1"
93
+ __version__ = "1.1.2"
@@ -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, {"is_active": False})
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": 'active' if user_info.is_active else 'disabled',
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.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
@@ -0,0 +1,8 @@
1
+ huace_aigc_auth_client/__init__.py,sha256=XUdOpgiTYKRsmyhCuyH2rY7Ps6Sjsic8xA9nJF71r8U,2163
2
+ huace_aigc_auth_client/legacy_adapter.py,sha256=HRhcoOaTwfHT4F2sfr2JQ3Q5_yd8tngMbycgWjMOGRQ,20966
3
+ huace_aigc_auth_client/sdk.py,sha256=46kkNDmWcce4BkSAT9zn5n8XdURDns3YtXIIfe8TGDU,22453
4
+ huace_aigc_auth_client-1.1.2.dist-info/licenses/LICENSE,sha256=z7dgC7KljhBLNvKjN15391nMj3aLt0gbud8-Yf1F8EQ,1063
5
+ huace_aigc_auth_client-1.1.2.dist-info/METADATA,sha256=gA3CPCKM9-E8bnfeivTTeHasqJd--_JSv3FtjZ0IQ_g,20084
6
+ huace_aigc_auth_client-1.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ huace_aigc_auth_client-1.1.2.dist-info/top_level.txt,sha256=kbv0nQ6PQ0JVneWPH7O2AbtlJnP7AjvFJ6JjM6ZEBxo,23
8
+ huace_aigc_auth_client-1.1.2.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- huace_aigc_auth_client/__init__.py,sha256=_v9V8MS-e_A-2eUU0STsfaCb0-2rZhWk1Qlg2EWhMy4,2163
2
- huace_aigc_auth_client/legacy_adapter.py,sha256=Du9kwJtxdUitqWi77aODPWWOeBVP3Qlabjx2Vo3g1oQ,20970
3
- huace_aigc_auth_client/sdk.py,sha256=Qe_Kb1cVZC-es5LNVHEnZyTIAd06qzonBHflgHWdG6w,22361
4
- huace_aigc_auth_client-1.1.1.dist-info/licenses/LICENSE,sha256=z7dgC7KljhBLNvKjN15391nMj3aLt0gbud8-Yf1F8EQ,1063
5
- huace_aigc_auth_client-1.1.1.dist-info/METADATA,sha256=mC5-YagB6d5dXVXGMdpmtKpAo7g9wUm1fynUd5aSLVU,20054
6
- huace_aigc_auth_client-1.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- huace_aigc_auth_client-1.1.1.dist-info/top_level.txt,sha256=kbv0nQ6PQ0JVneWPH7O2AbtlJnP7AjvFJ6JjM6ZEBxo,23
8
- huace_aigc_auth_client-1.1.1.dist-info/RECORD,,