huace-aigc-auth-client 1.1.10__tar.gz → 1.1.11__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.10/huace_aigc_auth_client.egg-info → huace_aigc_auth_client-1.1.11}/PKG-INFO +1 -1
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/huace_aigc_auth_client/__init__.py +45 -1
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/huace_aigc_auth_client/legacy_adapter.py +3 -1
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/huace_aigc_auth_client/sdk.py +3 -0
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/huace_aigc_auth_client/webhook.py +3 -1
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/huace_aigc_auth_client/webhook_flask.py +3 -1
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11/huace_aigc_auth_client.egg-info}/PKG-INFO +1 -1
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/pyproject.toml +1 -1
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/LICENSE +0 -0
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/MANIFEST.in +0 -0
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/QUICK_START.txt +0 -0
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/README.md +0 -0
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/huace_aigc_auth_client.egg-info/SOURCES.txt +0 -0
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/huace_aigc_auth_client.egg-info/dependency_links.txt +0 -0
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/huace_aigc_auth_client.egg-info/requires.txt +0 -0
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/huace_aigc_auth_client.egg-info/top_level.txt +0 -0
- {huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/setup.cfg +0 -0
{huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/huace_aigc_auth_client/__init__.py
RENAMED
|
@@ -78,6 +78,48 @@ from .webhook_flask import (
|
|
|
78
78
|
register_flask_webhook_routes,
|
|
79
79
|
)
|
|
80
80
|
|
|
81
|
+
def setLogger(log):
|
|
82
|
+
"""
|
|
83
|
+
统一设置所有模块的 logger
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
log: logging.Logger 实例
|
|
87
|
+
|
|
88
|
+
使用示例:
|
|
89
|
+
import logging
|
|
90
|
+
from huace_aigc_auth_client import setLogger
|
|
91
|
+
|
|
92
|
+
logger = logging.getLogger("my_app")
|
|
93
|
+
logger.setLevel(logging.INFO)
|
|
94
|
+
|
|
95
|
+
# 设置 SDK 所有模块使用该 logger
|
|
96
|
+
setLogger(logger)
|
|
97
|
+
"""
|
|
98
|
+
try:
|
|
99
|
+
from .sdk import setLogger as sdk_setLogger
|
|
100
|
+
sdk_setLogger(log)
|
|
101
|
+
except Exception as e:
|
|
102
|
+
print(f"Failed to set logger for sdk module: {e}")
|
|
103
|
+
|
|
104
|
+
try:
|
|
105
|
+
from .legacy_adapter import setLogger as legacy_setLogger
|
|
106
|
+
legacy_setLogger(log)
|
|
107
|
+
except Exception as e:
|
|
108
|
+
print(f"Failed to set logger for legacy_adapter module: {e}")
|
|
109
|
+
|
|
110
|
+
try:
|
|
111
|
+
from .webhook import setLogger as webhook_setLogger
|
|
112
|
+
webhook_setLogger(log)
|
|
113
|
+
except Exception as e:
|
|
114
|
+
print(f"Failed to set logger for webhook module: {e}")
|
|
115
|
+
|
|
116
|
+
try:
|
|
117
|
+
from .webhook_flask import setLogger as webhook_flask_setLogger
|
|
118
|
+
webhook_flask_setLogger(log)
|
|
119
|
+
except Exception as e:
|
|
120
|
+
print(f"Failed to set logger for webhook_flask module: {e}")
|
|
121
|
+
|
|
122
|
+
|
|
81
123
|
__all__ = [
|
|
82
124
|
# 核心类
|
|
83
125
|
"AigcAuthClient",
|
|
@@ -105,5 +147,7 @@ __all__ = [
|
|
|
105
147
|
# Webhook 接收 (Flask)
|
|
106
148
|
"create_flask_webhook_blueprint",
|
|
107
149
|
"register_flask_webhook_routes",
|
|
150
|
+
# Logger 设置
|
|
151
|
+
"setLogger",
|
|
108
152
|
]
|
|
109
|
-
__version__ = "1.1.
|
|
153
|
+
__version__ = "1.1.11"
|
{huace_aigc_auth_client-1.1.10 → huace_aigc_auth_client-1.1.11}/huace_aigc_auth_client/webhook.py
RENAMED
|
@@ -13,7 +13,9 @@ from typing import Callable, Awaitable, Dict, Any, Optional
|
|
|
13
13
|
from fastapi import APIRouter, Request, HTTPException
|
|
14
14
|
|
|
15
15
|
logger = logging.getLogger(__name__)
|
|
16
|
-
|
|
16
|
+
def setLogger(log):
|
|
17
|
+
global logger
|
|
18
|
+
logger = log
|
|
17
19
|
|
|
18
20
|
def verify_webhook_signature(payload: bytes, signature: str, secret: str) -> bool:
|
|
19
21
|
"""
|
|
@@ -14,7 +14,9 @@ from typing import Callable, Dict, Any, Optional
|
|
|
14
14
|
from flask import Blueprint, request, jsonify
|
|
15
15
|
|
|
16
16
|
logger = logging.getLogger(__name__)
|
|
17
|
-
|
|
17
|
+
def setLogger(log):
|
|
18
|
+
global logger
|
|
19
|
+
logger = log
|
|
18
20
|
|
|
19
21
|
def verify_webhook_signature(payload: bytes, signature: str, secret: str) -> bool:
|
|
20
22
|
"""
|
|
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
|