yweb 0.1.0__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.
- yweb/__init__.py +454 -0
- yweb/auth/__init__.py +359 -0
- yweb/auth/api/__init__.py +34 -0
- yweb/auth/api/auth_api.py +263 -0
- yweb/auth/api/login_record_api.py +84 -0
- yweb/auth/api/oauth2_api.py +444 -0
- yweb/auth/api/oidc_api.py +104 -0
- yweb/auth/api/user_api.py +232 -0
- yweb/auth/api_key.py +583 -0
- yweb/auth/audit.py +348 -0
- yweb/auth/base.py +394 -0
- yweb/auth/dependencies.py +336 -0
- yweb/auth/jwt.py +519 -0
- yweb/auth/ldap.py +660 -0
- yweb/auth/mfa/__init__.py +55 -0
- yweb/auth/mfa/base.py +135 -0
- yweb/auth/mfa/manager.py +320 -0
- yweb/auth/mfa/otp.py +425 -0
- yweb/auth/mfa/recovery.py +243 -0
- yweb/auth/mfa/totp.py +316 -0
- yweb/auth/mixins.py +425 -0
- yweb/auth/models.py +607 -0
- yweb/auth/oauth2/__init__.py +86 -0
- yweb/auth/oauth2/client.py +180 -0
- yweb/auth/oauth2/grants.py +514 -0
- yweb/auth/oauth2/manager.py +813 -0
- yweb/auth/oauth2/provider.py +283 -0
- yweb/auth/oauth2/token.py +196 -0
- yweb/auth/oidc.py +559 -0
- yweb/auth/password.py +241 -0
- yweb/auth/rate_limiter.py +245 -0
- yweb/auth/schemas.py +68 -0
- yweb/auth/service.py +607 -0
- yweb/auth/session.py +628 -0
- yweb/auth/setup.py +1084 -0
- yweb/auth/token_store.py +526 -0
- yweb/auth/validators.py +457 -0
- yweb/cache/__init__.py +103 -0
- yweb/cache/api.py +254 -0
- yweb/cache/backends.py +361 -0
- yweb/cache/decorators.py +744 -0
- yweb/cache/invalidation.py +353 -0
- yweb/config/__init__.py +73 -0
- yweb/config/loader.py +346 -0
- yweb/config/settings.py +515 -0
- yweb/exceptions/__init__.py +73 -0
- yweb/exceptions/exceptions.py +498 -0
- yweb/exceptions/handlers.py +579 -0
- yweb/log/__init__.py +92 -0
- yweb/log/filter_hooks.py +285 -0
- yweb/log/handlers.py +790 -0
- yweb/log/logger.py +518 -0
- yweb/middleware/__init__.py +54 -0
- yweb/middleware/current_user.py +278 -0
- yweb/middleware/ip_access.py +523 -0
- yweb/middleware/performance.py +57 -0
- yweb/middleware/request_id.py +74 -0
- yweb/middleware/request_logging.py +477 -0
- yweb/organization/__init__.py +251 -0
- yweb/organization/api/__init__.py +219 -0
- yweb/organization/api/department_api.py +449 -0
- yweb/organization/api/employee_api.py +476 -0
- yweb/organization/api/organization_api.py +161 -0
- yweb/organization/enums.py +118 -0
- yweb/organization/factory.py +714 -0
- yweb/organization/helpers.py +403 -0
- yweb/organization/models/__init__.py +21 -0
- yweb/organization/models/department.py +341 -0
- yweb/organization/models/dept_leader.py +80 -0
- yweb/organization/models/emp_dept_rel.py +94 -0
- yweb/organization/models/emp_org_rel.py +160 -0
- yweb/organization/models/employee.py +180 -0
- yweb/organization/models/organization.py +124 -0
- yweb/organization/schemas/__init__.py +54 -0
- yweb/organization/schemas/department.py +102 -0
- yweb/organization/schemas/employee.py +228 -0
- yweb/organization/schemas/organization.py +66 -0
- yweb/organization/services/__init__.py +23 -0
- yweb/organization/services/dept_service.py +419 -0
- yweb/organization/services/emp_service.py +634 -0
- yweb/organization/services/org_service.py +326 -0
- yweb/organization/services/sync_service.py +658 -0
- yweb/orm/__init__.py +352 -0
- yweb/orm/base_dto.py +367 -0
- yweb/orm/base_model.py +99 -0
- yweb/orm/base_schemas.py +103 -0
- yweb/orm/core_model.py +1448 -0
- yweb/orm/db_session.py +689 -0
- yweb/orm/fields.py +836 -0
- yweb/orm/history/__init__.py +51 -0
- yweb/orm/history/current_user.py +203 -0
- yweb/orm/history/history_helper.py +720 -0
- yweb/orm/id_model.py +243 -0
- yweb/orm/orm_extensions/__init__.py +66 -0
- yweb/orm/orm_extensions/cascade_soft_delete.py +326 -0
- yweb/orm/orm_extensions/soft_delete_hook.py +155 -0
- yweb/orm/orm_extensions/soft_delete_ignored_table.py +31 -0
- yweb/orm/orm_extensions/soft_delete_mixin.py +191 -0
- yweb/orm/orm_extensions/soft_delete_rewriter.py +203 -0
- yweb/orm/primary_key_config.py +217 -0
- yweb/orm/primary_key_generators.py +354 -0
- yweb/orm/sortable/__init__.py +43 -0
- yweb/orm/sortable/sortable_fields.py +49 -0
- yweb/orm/sortable/sortable_mixin.py +594 -0
- yweb/orm/statemachine/__init__.py +85 -0
- yweb/orm/statemachine/exceptions.py +153 -0
- yweb/orm/statemachine/state_field.py +86 -0
- yweb/orm/statemachine/state_history.py +380 -0
- yweb/orm/statemachine/state_machine.py +701 -0
- yweb/orm/taggable/__init__.py +65 -0
- yweb/orm/taggable/tag_model.py +400 -0
- yweb/orm/taggable/taggable_mixin.py +538 -0
- yweb/orm/transaction/__init__.py +100 -0
- yweb/orm/transaction/context.py +506 -0
- yweb/orm/transaction/exceptions.py +103 -0
- yweb/orm/transaction/hooks.py +224 -0
- yweb/orm/transaction/manager.py +474 -0
- yweb/orm/transaction/propagation.py +75 -0
- yweb/orm/transaction/retry.py +151 -0
- yweb/orm/transaction/state.py +57 -0
- yweb/orm/tree/__init__.py +70 -0
- yweb/orm/tree/tree_fields.py +114 -0
- yweb/orm/tree/tree_mixin.py +513 -0
- yweb/orm/tree/tree_utils.py +357 -0
- yweb/orm/utils.py +103 -0
- yweb/permission/__init__.py +270 -0
- yweb/permission/api/__init__.py +240 -0
- yweb/permission/api/api_resource_api.py +369 -0
- yweb/permission/api/cache_api.py +112 -0
- yweb/permission/api/permission_api.py +221 -0
- yweb/permission/api/role_api.py +459 -0
- yweb/permission/api/subject_api.py +345 -0
- yweb/permission/cache.py +426 -0
- yweb/permission/decorators.py +252 -0
- yweb/permission/dependencies.py +432 -0
- yweb/permission/enums.py +59 -0
- yweb/permission/exceptions.py +195 -0
- yweb/permission/factory.py +537 -0
- yweb/permission/helpers.py +217 -0
- yweb/permission/mixins.py +114 -0
- yweb/permission/models/__init__.py +42 -0
- yweb/permission/models/api_resource.py +207 -0
- yweb/permission/models/permission.py +141 -0
- yweb/permission/models/role.py +185 -0
- yweb/permission/models/role_permission.py +161 -0
- yweb/permission/models/subject_permission.py +180 -0
- yweb/permission/models/subject_role.py +209 -0
- yweb/permission/schemas/__init__.py +46 -0
- yweb/permission/schemas/assignment.py +135 -0
- yweb/permission/schemas/permission.py +109 -0
- yweb/permission/schemas/role.py +123 -0
- yweb/permission/services/__init__.py +13 -0
- yweb/permission/services/permission_service.py +709 -0
- yweb/permission/services/role_service.py +470 -0
- yweb/permission/types.py +157 -0
- yweb/response/__init__.py +93 -0
- yweb/response/base_response.py +576 -0
- yweb/scheduler/__init__.py +214 -0
- yweb/scheduler/api/__init__.py +89 -0
- yweb/scheduler/api/execution_api.py +113 -0
- yweb/scheduler/api/job_api.py +115 -0
- yweb/scheduler/api/stats_api.py +104 -0
- yweb/scheduler/builder.py +356 -0
- yweb/scheduler/context.py +66 -0
- yweb/scheduler/events.py +88 -0
- yweb/scheduler/executors/__init__.py +17 -0
- yweb/scheduler/executors/async_executor.py +89 -0
- yweb/scheduler/executors/thread_executor.py +119 -0
- yweb/scheduler/factory.py +491 -0
- yweb/scheduler/history.py +591 -0
- yweb/scheduler/http_job.py +324 -0
- yweb/scheduler/job.py +219 -0
- yweb/scheduler/locks/__init__.py +16 -0
- yweb/scheduler/locks/base.py +52 -0
- yweb/scheduler/locks/redis_lock.py +311 -0
- yweb/scheduler/models.py +234 -0
- yweb/scheduler/retry.py +291 -0
- yweb/scheduler/scheduler.py +1814 -0
- yweb/scheduler/stores/__init__.py +16 -0
- yweb/scheduler/stores/base.py +84 -0
- yweb/scheduler/stores/memory.py +71 -0
- yweb/scheduler/stores/orm.py +334 -0
- yweb/scheduler/triggers.py +189 -0
- yweb/storage/__init__.py +234 -0
- yweb/storage/backends/__init__.py +54 -0
- yweb/storage/backends/local.py +504 -0
- yweb/storage/backends/memory.py +367 -0
- yweb/storage/backends/oss.py +484 -0
- yweb/storage/backends/s3.py +532 -0
- yweb/storage/base.py +327 -0
- yweb/storage/config.py +396 -0
- yweb/storage/exceptions.py +322 -0
- yweb/storage/integrations/__init__.py +26 -0
- yweb/storage/integrations/fastapi.py +319 -0
- yweb/storage/integrations/fastapi_multipart.py +401 -0
- yweb/storage/manager.py +515 -0
- yweb/storage/metrics.py +506 -0
- yweb/storage/multipart.py +521 -0
- yweb/storage/secure_url.py +546 -0
- yweb/storage/validators.py +552 -0
- yweb/storage/versioning.py +470 -0
- yweb/utils/__init__.py +65 -0
- yweb/utils/encryption.py +145 -0
- yweb/utils/file_size.py +198 -0
- yweb/utils/generate_id.py +8 -0
- yweb/utils/ip.py +151 -0
- yweb/utils/test_collector.py +258 -0
- yweb/validators/__init__.py +79 -0
- yweb/validators/constraints.py +361 -0
- yweb/version.py +5 -0
- yweb-0.1.0.dist-info/METADATA +76 -0
- yweb-0.1.0.dist-info/RECORD +215 -0
- yweb-0.1.0.dist-info/WHEEL +5 -0
- yweb-0.1.0.dist-info/licenses/LICENSE +21 -0
- yweb-0.1.0.dist-info/top_level.txt +1 -0
yweb/__init__.py
ADDED
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
"""
|
|
2
|
+
YWeb - FastAPI基础类库
|
|
3
|
+
|
|
4
|
+
提供响应封装、中间件、ORM、认证、日志等基础功能
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .version import __version__, __author__, __description__
|
|
8
|
+
|
|
9
|
+
# 导出响应模块
|
|
10
|
+
from .response import (
|
|
11
|
+
# 响应快捷类(推荐)
|
|
12
|
+
Resp,
|
|
13
|
+
# 响应函数(高级用法)
|
|
14
|
+
OK,
|
|
15
|
+
BadRequest,
|
|
16
|
+
Unauthorized,
|
|
17
|
+
Forbidden,
|
|
18
|
+
NotFound,
|
|
19
|
+
InternalServerError,
|
|
20
|
+
Conflict,
|
|
21
|
+
TooManyRequests,
|
|
22
|
+
Warning,
|
|
23
|
+
Info,
|
|
24
|
+
# 泛型响应模型
|
|
25
|
+
PageData,
|
|
26
|
+
PageResponse,
|
|
27
|
+
ItemResponse,
|
|
28
|
+
OkResponse,
|
|
29
|
+
# 动态模型生成工具
|
|
30
|
+
create_response_model,
|
|
31
|
+
create_item_model,
|
|
32
|
+
create_page_model,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
# 导出中间件
|
|
36
|
+
from .middleware import (
|
|
37
|
+
RequestLoggingMiddleware,
|
|
38
|
+
RequestIDMiddleware,
|
|
39
|
+
PerformanceMonitoringMiddleware,
|
|
40
|
+
get_request_id,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# 导出ORM基类
|
|
44
|
+
from .orm import (
|
|
45
|
+
DTO,
|
|
46
|
+
BaseSchemas,
|
|
47
|
+
PaginationField,
|
|
48
|
+
PaginationTmpField,
|
|
49
|
+
Page,
|
|
50
|
+
DateTimeStr,
|
|
51
|
+
BaseModel,
|
|
52
|
+
init_database,
|
|
53
|
+
get_engine,
|
|
54
|
+
get_db,
|
|
55
|
+
# 软删除扩展
|
|
56
|
+
IgnoredTable,
|
|
57
|
+
SoftDeleteRewriter,
|
|
58
|
+
activate_soft_delete_hook,
|
|
59
|
+
is_soft_delete_active,
|
|
60
|
+
generate_soft_delete_mixin_class,
|
|
61
|
+
SimpleSoftDeleteMixin,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
# 导出认证模块
|
|
65
|
+
from .auth import (
|
|
66
|
+
# JWT (原有)
|
|
67
|
+
JWTManager,
|
|
68
|
+
create_jwt_token,
|
|
69
|
+
verify_jwt_token,
|
|
70
|
+
TokenPayload,
|
|
71
|
+
TokenResponse,
|
|
72
|
+
TokenData,
|
|
73
|
+
oauth2_scheme,
|
|
74
|
+
AuthDependency,
|
|
75
|
+
create_auth_dependency,
|
|
76
|
+
RoleChecker,
|
|
77
|
+
get_token_from_header,
|
|
78
|
+
# 统一认证接口 (新增)
|
|
79
|
+
AuthProvider,
|
|
80
|
+
AuthManager,
|
|
81
|
+
AuthType,
|
|
82
|
+
UserIdentity,
|
|
83
|
+
AuthResult,
|
|
84
|
+
# API Key (新增)
|
|
85
|
+
APIKeyManager,
|
|
86
|
+
APIKeyData,
|
|
87
|
+
APIKeyAuthProvider,
|
|
88
|
+
# Session (新增)
|
|
89
|
+
Session,
|
|
90
|
+
SessionManager,
|
|
91
|
+
SessionAuthProvider,
|
|
92
|
+
set_session_cookie,
|
|
93
|
+
clear_session_cookie,
|
|
94
|
+
# LDAP (新增)
|
|
95
|
+
LDAPManager,
|
|
96
|
+
LDAPAuthProvider,
|
|
97
|
+
LDAPConfig,
|
|
98
|
+
LDAPType,
|
|
99
|
+
# OIDC (新增)
|
|
100
|
+
OIDCManager,
|
|
101
|
+
OIDCAuthProvider,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# 导出日志模块
|
|
105
|
+
from .log import (
|
|
106
|
+
setup_logger,
|
|
107
|
+
api_logger,
|
|
108
|
+
auth_logger,
|
|
109
|
+
sql_logger,
|
|
110
|
+
logger,
|
|
111
|
+
get_logger,
|
|
112
|
+
# 日志过滤钩子
|
|
113
|
+
LogFilterHook,
|
|
114
|
+
SensitiveDataFilterHook,
|
|
115
|
+
LogFilterHookManager,
|
|
116
|
+
log_filter_hook_manager,
|
|
117
|
+
# 自定义日志处理器
|
|
118
|
+
TimeAndSizeRotatingFileHandler,
|
|
119
|
+
DailyRotatingFileHandler,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
# 导出工具函数
|
|
123
|
+
from .utils import (
|
|
124
|
+
hash_password,
|
|
125
|
+
verify_password,
|
|
126
|
+
EncryptionUtil,
|
|
127
|
+
parse_file_size,
|
|
128
|
+
format_file_size,
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
# 导出配置
|
|
132
|
+
from .config import (
|
|
133
|
+
AppSettings,
|
|
134
|
+
JWTSettings,
|
|
135
|
+
DatabaseSettings,
|
|
136
|
+
LoggingSettings,
|
|
137
|
+
PaginationSettings,
|
|
138
|
+
ConfigLoader,
|
|
139
|
+
ConfigManager,
|
|
140
|
+
load_yaml_config,
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
# 导出组织管理模块
|
|
144
|
+
from .organization import (
|
|
145
|
+
# 枚举
|
|
146
|
+
ExternalSource,
|
|
147
|
+
EmployeeStatus,
|
|
148
|
+
Gender,
|
|
149
|
+
SyncStatus,
|
|
150
|
+
# Mixin
|
|
151
|
+
TreeMixin,
|
|
152
|
+
# 抽象模型
|
|
153
|
+
AbstractOrganization,
|
|
154
|
+
AbstractDepartment,
|
|
155
|
+
AbstractEmployee,
|
|
156
|
+
AbstractEmployeeOrgRel,
|
|
157
|
+
AbstractEmployeeDeptRel,
|
|
158
|
+
AbstractDepartmentLeader,
|
|
159
|
+
# 服务
|
|
160
|
+
BaseOrganizationService,
|
|
161
|
+
BaseSyncService,
|
|
162
|
+
SyncResult,
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
# 导出异常处理模块
|
|
166
|
+
from .exceptions import (
|
|
167
|
+
# 异常快捷创建类(推荐)
|
|
168
|
+
Err,
|
|
169
|
+
# 错误代码枚举
|
|
170
|
+
ErrorCode,
|
|
171
|
+
ErrorCodeType,
|
|
172
|
+
# 业务异常
|
|
173
|
+
BusinessException,
|
|
174
|
+
AuthenticationException,
|
|
175
|
+
AuthorizationException,
|
|
176
|
+
ResourceNotFoundException,
|
|
177
|
+
ResourceConflictException,
|
|
178
|
+
ValidationException,
|
|
179
|
+
ServiceUnavailableException,
|
|
180
|
+
# 异常处理器
|
|
181
|
+
register_exception_handlers,
|
|
182
|
+
# 验证错误翻译器
|
|
183
|
+
ValidationErrorTranslator,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
# 导出验证约束模块(类似 .NET MVC 特性)
|
|
187
|
+
from .validators import (
|
|
188
|
+
# 验证类型快捷类(推荐)
|
|
189
|
+
Typed,
|
|
190
|
+
# 约束函数
|
|
191
|
+
StringLength,
|
|
192
|
+
RegularExpression,
|
|
193
|
+
Range,
|
|
194
|
+
# 验证类型(高级用法)
|
|
195
|
+
Phone,
|
|
196
|
+
Email,
|
|
197
|
+
Url,
|
|
198
|
+
IdCard,
|
|
199
|
+
CreditCard,
|
|
200
|
+
# 可选验证类型
|
|
201
|
+
OptionalPhone,
|
|
202
|
+
OptionalEmail,
|
|
203
|
+
OptionalUrl,
|
|
204
|
+
OptionalIdCard,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
# 导出定时任务模块
|
|
208
|
+
from .scheduler import (
|
|
209
|
+
# 核心类(推荐)
|
|
210
|
+
Scheduler,
|
|
211
|
+
JobBuilder,
|
|
212
|
+
# 工厂函数(推荐)
|
|
213
|
+
create_scheduler_models,
|
|
214
|
+
setup_scheduler,
|
|
215
|
+
SchedulerModels,
|
|
216
|
+
# 触发器
|
|
217
|
+
cron,
|
|
218
|
+
interval,
|
|
219
|
+
once,
|
|
220
|
+
# 任务基类
|
|
221
|
+
Job,
|
|
222
|
+
HttpJob,
|
|
223
|
+
# 重试策略
|
|
224
|
+
RetryStrategy,
|
|
225
|
+
# 执行上下文
|
|
226
|
+
JobContext,
|
|
227
|
+
# 抽象模型(高级用法)
|
|
228
|
+
AbstractSchedulerJob,
|
|
229
|
+
AbstractSchedulerJobHistory,
|
|
230
|
+
AbstractSchedulerJobStats,
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
# 导出缓存模块
|
|
234
|
+
from .cache import (
|
|
235
|
+
# 装饰器(推荐)
|
|
236
|
+
cached,
|
|
237
|
+
memory_cache,
|
|
238
|
+
redis_cache,
|
|
239
|
+
# 自动失效(推荐)
|
|
240
|
+
cache_invalidator,
|
|
241
|
+
no_auto_invalidation,
|
|
242
|
+
# 类型
|
|
243
|
+
CachedFunction,
|
|
244
|
+
CacheInvalidator,
|
|
245
|
+
# 后端(高级用法)
|
|
246
|
+
CacheBackend,
|
|
247
|
+
MemoryBackend,
|
|
248
|
+
RedisBackend,
|
|
249
|
+
CacheStats,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
__all__ = [
|
|
253
|
+
# 版本信息
|
|
254
|
+
"__version__",
|
|
255
|
+
"__author__",
|
|
256
|
+
"__description__",
|
|
257
|
+
|
|
258
|
+
# Response - 推荐使用
|
|
259
|
+
"Resp", # 响应快捷类:Resp.OK, Resp.NotFound 等
|
|
260
|
+
# Response - 高级用法
|
|
261
|
+
"OK",
|
|
262
|
+
"BadRequest",
|
|
263
|
+
"Unauthorized",
|
|
264
|
+
"Forbidden",
|
|
265
|
+
"NotFound",
|
|
266
|
+
"InternalServerError",
|
|
267
|
+
"Conflict",
|
|
268
|
+
"TooManyRequests",
|
|
269
|
+
"Warning",
|
|
270
|
+
"Info",
|
|
271
|
+
# 泛型响应模型
|
|
272
|
+
"PageData",
|
|
273
|
+
"PageResponse",
|
|
274
|
+
"ItemResponse",
|
|
275
|
+
"OperationResponse",
|
|
276
|
+
# 动态模型生成工具
|
|
277
|
+
"create_response_model",
|
|
278
|
+
"create_item_model",
|
|
279
|
+
"create_page_model",
|
|
280
|
+
|
|
281
|
+
# Middleware
|
|
282
|
+
"RequestLoggingMiddleware",
|
|
283
|
+
"RequestIDMiddleware",
|
|
284
|
+
"PerformanceMonitoringMiddleware",
|
|
285
|
+
"get_request_id",
|
|
286
|
+
|
|
287
|
+
# ORM
|
|
288
|
+
"DTO",
|
|
289
|
+
"BaseSchemas",
|
|
290
|
+
"PaginationField",
|
|
291
|
+
"PaginationTmpField",
|
|
292
|
+
"Page",
|
|
293
|
+
"DateTimeStr",
|
|
294
|
+
"BaseModel",
|
|
295
|
+
"init_database",
|
|
296
|
+
"get_engine",
|
|
297
|
+
"get_db",
|
|
298
|
+
# Soft Delete
|
|
299
|
+
"IgnoredTable",
|
|
300
|
+
"SoftDeleteRewriter",
|
|
301
|
+
"activate_soft_delete_hook",
|
|
302
|
+
"deactivate_soft_delete_hook",
|
|
303
|
+
"is_soft_delete_active",
|
|
304
|
+
"generate_soft_delete_mixin_class",
|
|
305
|
+
"SimpleSoftDeleteMixin",
|
|
306
|
+
|
|
307
|
+
# Auth - JWT (原有)
|
|
308
|
+
"JWTManager",
|
|
309
|
+
"create_jwt_token",
|
|
310
|
+
"verify_jwt_token",
|
|
311
|
+
"TokenPayload",
|
|
312
|
+
"TokenResponse",
|
|
313
|
+
"TokenData",
|
|
314
|
+
"oauth2_scheme",
|
|
315
|
+
"AuthDependency",
|
|
316
|
+
"create_auth_dependency",
|
|
317
|
+
"RoleChecker",
|
|
318
|
+
"get_token_from_header",
|
|
319
|
+
# Auth - 统一认证接口 (新增)
|
|
320
|
+
"AuthProvider",
|
|
321
|
+
"AuthManager",
|
|
322
|
+
"AuthType",
|
|
323
|
+
"UserIdentity",
|
|
324
|
+
"AuthResult",
|
|
325
|
+
# Auth - API Key (新增)
|
|
326
|
+
"APIKeyManager",
|
|
327
|
+
"APIKeyData",
|
|
328
|
+
"APIKeyAuthProvider",
|
|
329
|
+
# Auth - Session (新增)
|
|
330
|
+
"Session",
|
|
331
|
+
"SessionManager",
|
|
332
|
+
"SessionAuthProvider",
|
|
333
|
+
"set_session_cookie",
|
|
334
|
+
"clear_session_cookie",
|
|
335
|
+
# Auth - LDAP (新增)
|
|
336
|
+
"LDAPManager",
|
|
337
|
+
"LDAPAuthProvider",
|
|
338
|
+
"LDAPConfig",
|
|
339
|
+
"LDAPType",
|
|
340
|
+
# Auth - OIDC (新增)
|
|
341
|
+
"OIDCManager",
|
|
342
|
+
"OIDCAuthProvider",
|
|
343
|
+
|
|
344
|
+
# Log
|
|
345
|
+
"setup_logger",
|
|
346
|
+
"api_logger",
|
|
347
|
+
"auth_logger",
|
|
348
|
+
"sql_logger",
|
|
349
|
+
"logger",
|
|
350
|
+
"get_logger",
|
|
351
|
+
"LogFilterHook",
|
|
352
|
+
"SensitiveDataFilterHook",
|
|
353
|
+
"LogFilterHookManager",
|
|
354
|
+
"log_filter_hook_manager",
|
|
355
|
+
"TimeAndSizeRotatingFileHandler",
|
|
356
|
+
"DailyRotatingFileHandler",
|
|
357
|
+
|
|
358
|
+
# Utils
|
|
359
|
+
"hash_password",
|
|
360
|
+
"verify_password",
|
|
361
|
+
"EncryptionUtil",
|
|
362
|
+
"parse_file_size",
|
|
363
|
+
"format_file_size",
|
|
364
|
+
|
|
365
|
+
# Config
|
|
366
|
+
"AppSettings",
|
|
367
|
+
"JWTSettings",
|
|
368
|
+
"DatabaseSettings",
|
|
369
|
+
"LoggingSettings",
|
|
370
|
+
"PaginationSettings",
|
|
371
|
+
"ConfigLoader",
|
|
372
|
+
"ConfigManager",
|
|
373
|
+
"load_yaml_config",
|
|
374
|
+
|
|
375
|
+
# Organization
|
|
376
|
+
"ExternalSource",
|
|
377
|
+
"EmployeeStatus",
|
|
378
|
+
"Gender",
|
|
379
|
+
"SyncStatus",
|
|
380
|
+
"TreeMixin",
|
|
381
|
+
"AbstractOrganization",
|
|
382
|
+
"AbstractDepartment",
|
|
383
|
+
"AbstractEmployee",
|
|
384
|
+
"AbstractEmployeeOrgRel",
|
|
385
|
+
"AbstractEmployeeDeptRel",
|
|
386
|
+
"AbstractDepartmentLeader",
|
|
387
|
+
"BaseOrganizationService",
|
|
388
|
+
"BaseSyncService",
|
|
389
|
+
"SyncResult",
|
|
390
|
+
|
|
391
|
+
# Exceptions - 推荐使用
|
|
392
|
+
"Err", # 异常快捷创建:Err.auth(), Err.not_found() 等
|
|
393
|
+
"ErrorCode", # 错误代码枚举
|
|
394
|
+
"register_exception_handlers", # 注册全局异常处理器
|
|
395
|
+
# Exceptions - 高级用法(类型检查、自定义异常继承、单元测试)
|
|
396
|
+
"ErrorCodeType",
|
|
397
|
+
"BusinessException",
|
|
398
|
+
"AuthenticationException",
|
|
399
|
+
"AuthorizationException",
|
|
400
|
+
"ResourceNotFoundException",
|
|
401
|
+
"ResourceConflictException",
|
|
402
|
+
"ValidationException",
|
|
403
|
+
"ServiceUnavailableException",
|
|
404
|
+
"ValidationErrorTranslator",
|
|
405
|
+
|
|
406
|
+
# Validators - 推荐使用
|
|
407
|
+
"Typed", # 验证类型快捷类:Typed.Phone, Typed.Email 等
|
|
408
|
+
# Validators - 约束函数
|
|
409
|
+
"StringLength",
|
|
410
|
+
"RegularExpression",
|
|
411
|
+
"Range",
|
|
412
|
+
# Validators - 高级用法
|
|
413
|
+
"Phone",
|
|
414
|
+
"Email",
|
|
415
|
+
"Url",
|
|
416
|
+
"IdCard",
|
|
417
|
+
"CreditCard",
|
|
418
|
+
"OptionalPhone",
|
|
419
|
+
"OptionalEmail",
|
|
420
|
+
"OptionalUrl",
|
|
421
|
+
|
|
422
|
+
# Scheduler - 定时任务
|
|
423
|
+
"Scheduler", # 调度器
|
|
424
|
+
"JobBuilder", # 链式配置构建器
|
|
425
|
+
"create_scheduler_models", # 工厂函数(推荐)
|
|
426
|
+
"setup_scheduler", # 一站式设置
|
|
427
|
+
"SchedulerModels", # 模型容器
|
|
428
|
+
"Job", # 任务基类
|
|
429
|
+
"HttpJob", # HTTP 任务基类
|
|
430
|
+
"RetryStrategy", # 重试策略
|
|
431
|
+
"cron", # Cron 触发器
|
|
432
|
+
"interval", # 间隔触发器
|
|
433
|
+
"once", # 一次性触发器
|
|
434
|
+
"JobContext", # 执行上下文
|
|
435
|
+
"AbstractSchedulerJob", # 抽象模型
|
|
436
|
+
"AbstractSchedulerJobHistory", # 抽象模型
|
|
437
|
+
"AbstractSchedulerJobStats", # 抽象模型
|
|
438
|
+
"OptionalIdCard",
|
|
439
|
+
|
|
440
|
+
# Cache - 缓存装饰器
|
|
441
|
+
"cached", # 通用缓存装饰器(推荐)
|
|
442
|
+
"memory_cache", # 内存缓存装饰器
|
|
443
|
+
"redis_cache", # Redis 缓存装饰器
|
|
444
|
+
# Cache - 自动失效
|
|
445
|
+
"cache_invalidator", # 缓存自动失效管理器(推荐)
|
|
446
|
+
"no_auto_invalidation", # 禁用自动失效上下文
|
|
447
|
+
# Cache - 类型
|
|
448
|
+
"CachedFunction", # 缓存函数类型
|
|
449
|
+
"CacheInvalidator", # 失效管理器类型
|
|
450
|
+
"CacheBackend", # 缓存后端基类
|
|
451
|
+
"MemoryBackend", # 内存后端
|
|
452
|
+
"RedisBackend", # Redis 后端
|
|
453
|
+
"CacheStats", # 缓存统计
|
|
454
|
+
]
|