huace-aigc-auth-client 1.1.25__py3-none-any.whl → 1.1.26__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.
@@ -172,4 +172,4 @@ __all__ = [
172
172
  # 用户上下文
173
173
  "get_current_user",
174
174
  ]
175
- __version__ = "1.1.25"
175
+ __version__ = "1.1.26"
@@ -852,9 +852,6 @@ class AuthMiddleware:
852
852
 
853
853
  path = request.url.path
854
854
  start_time = time.time()
855
-
856
- # 收集请求参数
857
- request_params = await self._collect_fastapi_request_params(request) if self.enable_stats else None
858
855
 
859
856
  # 检查是否跳过
860
857
  if self._should_skip(path):
@@ -867,6 +864,8 @@ class AuthMiddleware:
867
864
  if not token:
868
865
  logger.warning("AuthMiddleware未提供认证信息")
869
866
  response_time = time.time() - start_time
867
+ # 收集请求参数
868
+ request_params = await self._collect_fastapi_request_params(request) if self.enable_stats else None
870
869
  self._collect_stats(path, request.method, 401, response_time, "", "未提供认证信息", request_params)
871
870
  return JSONResponse(
872
871
  status_code=401,
@@ -885,6 +884,8 @@ class AuthMiddleware:
885
884
  except AigcAuthError as e:
886
885
  logger.error(f"AuthMiddleware认证失败: {e.message}")
887
886
  response_time = time.time() - start_time
887
+ # 收集请求参数
888
+ request_params = await self._collect_fastapi_request_params(request) if self.enable_stats else None
888
889
  self._collect_stats(path, request.method, 401, response_time, token, e.message, request_params)
889
890
  return JSONResponse(
890
891
  status_code=401,
@@ -895,9 +896,13 @@ class AuthMiddleware:
895
896
  try:
896
897
  response = await call_next(request)
897
898
  response_time = time.time() - start_time
899
+ # 收集请求参数
900
+ request_params = await self._collect_fastapi_request_params(request) if self.enable_stats else None
898
901
  self._collect_stats(path, request.method, response.status_code, response_time, token, None, request_params)
899
902
  return response
900
903
  except Exception as e:
904
+ # 收集请求参数
905
+ request_params = await self._collect_fastapi_request_params(request) if self.enable_stats else None
901
906
  response_time = time.time() - start_time
902
907
  self._collect_stats(path, request.method, 500, response_time, token, str(e), request_params)
903
908
  raise
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: huace-aigc-auth-client
3
- Version: 1.1.25
3
+ Version: 1.1.26
4
4
  Summary: 华策AIGC Auth Client - 提供 Token 验证、用户信息获取、权限检查、旧系统接入等功能
5
5
  Author-email: Huace <support@huace.com>
6
6
  License: MIT
@@ -1,12 +1,12 @@
1
- huace_aigc_auth_client/__init__.py,sha256=ryj_DFuA-ARb1FKJCmkw-KAzn0IHsD4gvIGcPRmfsdw,4630
1
+ huace_aigc_auth_client/__init__.py,sha256=UvYxKO3l-WAdwb8Is69IZROn4xJtTzmxOZprp4d_dQg,4630
2
2
  huace_aigc_auth_client/api_stats_collector.py,sha256=UCUu2CHWsJyiAM58-XLQtfxWK0fjZ8TTdw90gv_Gx04,10347
3
3
  huace_aigc_auth_client/legacy_adapter.py,sha256=TVCBAKejE2z2HQFsEwDW8LMiaIkXNfz3Mxv6_E-UJFY,24102
4
- huace_aigc_auth_client/sdk.py,sha256=7EQUjlvITZ3q9KzfZBqRJp2_0u7PeL-ObgxRDzBbpGQ,36821
4
+ huace_aigc_auth_client/sdk.py,sha256=79n-CRyUY6Q7TVS_a5I-U39BB_WA_P_dLiFdAJjZmiE,37255
5
5
  huace_aigc_auth_client/user_context.py,sha256=KzevYLsLv1hv8rlvRw83FT-HugeoBJSJ1Pi56iLWyTE,5592
6
6
  huace_aigc_auth_client/webhook.py,sha256=XQZYEbMoqIdqZWCGSTcedeDKJpDbUVSq5g08g-6Qucg,4124
7
7
  huace_aigc_auth_client/webhook_flask.py,sha256=Iosu4dBtRhQZM_ytn-bn82MpVsyOiV28FBnt7Tfh31U,7225
8
- huace_aigc_auth_client-1.1.25.dist-info/licenses/LICENSE,sha256=z7dgC7KljhBLNvKjN15391nMj3aLt0gbud8-Yf1F8EQ,1063
9
- huace_aigc_auth_client-1.1.25.dist-info/METADATA,sha256=Co9bvEZuwkzQAhyIbBPE5yo54R7WUERGR9LtiiFPCvw,23629
10
- huace_aigc_auth_client-1.1.25.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
11
- huace_aigc_auth_client-1.1.25.dist-info/top_level.txt,sha256=kbv0nQ6PQ0JVneWPH7O2AbtlJnP7AjvFJ6JjM6ZEBxo,23
12
- huace_aigc_auth_client-1.1.25.dist-info/RECORD,,
8
+ huace_aigc_auth_client-1.1.26.dist-info/licenses/LICENSE,sha256=z7dgC7KljhBLNvKjN15391nMj3aLt0gbud8-Yf1F8EQ,1063
9
+ huace_aigc_auth_client-1.1.26.dist-info/METADATA,sha256=n8tmSxO9LtOYxmNvmrkZShMNTjwi8zM9mPsxk3s9efI,23629
10
+ huace_aigc_auth_client-1.1.26.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
11
+ huace_aigc_auth_client-1.1.26.dist-info/top_level.txt,sha256=kbv0nQ6PQ0JVneWPH7O2AbtlJnP7AjvFJ6JjM6ZEBxo,23
12
+ huace_aigc_auth_client-1.1.26.dist-info/RECORD,,