```
refactor: 移除审批和回写功能模块 移除了整个审批(approvals)和官方回写(writebacks)功能模块, 包括相关模型、路由、服务和配置项。更新了数据库迁移文件, 删除了相关的审批请求表和官方回写运行表。同时从API路由器中 移除了相应的路由,并调整了安全常量和字段验证器以匹配变更。 ```
This commit is contained in:
@@ -40,34 +40,6 @@ def require_api_key(
|
||||
return principal
|
||||
|
||||
|
||||
def require_approval_api_key(
|
||||
x_approval_api_key: str | None = Header(
|
||||
default=None,
|
||||
alias=HttpHeader.X_APPROVAL_API_KEY,
|
||||
),
|
||||
) -> ApiPrincipal:
|
||||
"""Validate the approval API key and return the approval principal."""
|
||||
|
||||
settings = get_settings()
|
||||
if not settings.approval_api_key and not _has_enabled_keys(settings.approval_api_keys):
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
|
||||
detail=SecurityErrorDetail.APPROVAL_API_KEY_REQUIRED,
|
||||
)
|
||||
principal = _match_service_key(
|
||||
x_approval_api_key,
|
||||
settings.approval_api_key,
|
||||
settings.approval_api_actor,
|
||||
settings.approval_api_keys,
|
||||
)
|
||||
if principal is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail=SecurityErrorDetail.INVALID_APPROVAL_API_KEY,
|
||||
)
|
||||
return principal
|
||||
|
||||
|
||||
def require_audit_api_key(
|
||||
x_audit_api_key: str | None = Header(
|
||||
default=None,
|
||||
|
||||
Reference in New Issue
Block a user