huace-aigc-auth-client 1.1.20__tar.gz → 1.1.21__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.20/huace_aigc_auth_client.egg-info → huace_aigc_auth_client-1.1.21}/PKG-INFO +1 -1
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client/__init__.py +1 -1
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client/api_stats_collector.py +7 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client/sdk.py +1 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21/huace_aigc_auth_client.egg-info}/PKG-INFO +1 -1
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/pyproject.toml +1 -1
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/LICENSE +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/MANIFEST.in +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/QUICK_START.txt +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/README.md +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client/legacy_adapter.py +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client/user_context.py +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client/webhook.py +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client/webhook_flask.py +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client.egg-info/SOURCES.txt +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client.egg-info/dependency_links.txt +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client.egg-info/requires.txt +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client.egg-info/top_level.txt +0 -0
- {huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/setup.cfg +0 -0
|
@@ -16,6 +16,7 @@ class ApiStatsCollector:
|
|
|
16
16
|
def __init__(
|
|
17
17
|
self,
|
|
18
18
|
api_url: str,
|
|
19
|
+
app_id: str,
|
|
19
20
|
app_secret: str,
|
|
20
21
|
token: str,
|
|
21
22
|
batch_size: int = 10,
|
|
@@ -27,6 +28,7 @@ class ApiStatsCollector:
|
|
|
27
28
|
|
|
28
29
|
Args:
|
|
29
30
|
api_url: 统计接口 URL(如:http://auth.example.com/api/sdk/stats/report/batch)
|
|
31
|
+
app_id: 应用 ID
|
|
30
32
|
app_secret: 应用密钥
|
|
31
33
|
token: 用户访问令牌
|
|
32
34
|
batch_size: 批量提交大小
|
|
@@ -34,6 +36,7 @@ class ApiStatsCollector:
|
|
|
34
36
|
enabled: 是否启用
|
|
35
37
|
"""
|
|
36
38
|
self.api_url = api_url.rstrip('/')
|
|
39
|
+
self.app_id = app_id
|
|
37
40
|
self.app_secret = app_secret
|
|
38
41
|
self.token = token
|
|
39
42
|
self.batch_size = batch_size
|
|
@@ -138,6 +141,7 @@ class ApiStatsCollector:
|
|
|
138
141
|
|
|
139
142
|
try:
|
|
140
143
|
headers = {
|
|
144
|
+
'X-App-Id': self.app_id,
|
|
141
145
|
'X-App-Secret': self.app_secret,
|
|
142
146
|
'Authorization': f'Bearer {self.token}',
|
|
143
147
|
'Content-Type': 'application/json'
|
|
@@ -167,6 +171,7 @@ _global_collector: Optional[ApiStatsCollector] = None
|
|
|
167
171
|
|
|
168
172
|
def init_api_stats_collector(
|
|
169
173
|
api_url: str,
|
|
174
|
+
app_id: str,
|
|
170
175
|
app_secret: str,
|
|
171
176
|
token: str,
|
|
172
177
|
batch_size: int = 10,
|
|
@@ -178,6 +183,7 @@ def init_api_stats_collector(
|
|
|
178
183
|
|
|
179
184
|
Args:
|
|
180
185
|
api_url: 统计接口 URL
|
|
186
|
+
app_id: 应用 ID
|
|
181
187
|
app_secret: 应用密钥
|
|
182
188
|
token: 用户访问令牌
|
|
183
189
|
batch_size: 批量提交大小
|
|
@@ -190,6 +196,7 @@ def init_api_stats_collector(
|
|
|
190
196
|
global _global_collector
|
|
191
197
|
_global_collector = ApiStatsCollector(
|
|
192
198
|
api_url=api_url,
|
|
199
|
+
app_id=app_id,
|
|
193
200
|
app_secret=app_secret,
|
|
194
201
|
token=token,
|
|
195
202
|
batch_size=batch_size,
|
{huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client/sdk.py
RENAMED
|
@@ -585,6 +585,7 @@ class AuthMiddleware:
|
|
|
585
585
|
from .api_stats_collector import init_api_stats_collector
|
|
586
586
|
self.stats_collector = init_api_stats_collector(
|
|
587
587
|
api_url=self.stats_api_url,
|
|
588
|
+
app_id=self.client.app_id,
|
|
588
589
|
app_secret=self.client.app_secret,
|
|
589
590
|
token=token,
|
|
590
591
|
batch_size=10,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huace_aigc_auth_client-1.1.20 → huace_aigc_auth_client-1.1.21}/huace_aigc_auth_client/webhook.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|