feat(work): stage authenticated remote approvals with scoped execution fencing

This commit is contained in:
ex_tianzy
2026-11-17 11:43:33 +08:00
parent d2881b82b0
commit c80c6a0d27
19 changed files with 1586 additions and 25 deletions
+7
View File
@@ -42,6 +42,8 @@ class Settings(BaseSettings):
max_result: int = 16000
work_files_enabled: bool = False
work_task_cards_enabled: bool = False
work_remote_approvals_enabled: bool = False
feishu_tenant_key: str = ''
work_file_max_bytes: int = 10*1024*1024
work_file_batch_limit: int = 20
work_file_retention: int = 86400
@@ -57,6 +59,11 @@ class Settings(BaseSettings):
@model_validator(mode="after")
def validate_runtime(self):
if self.work_remote_approvals_enabled:
if (self.credential_mode!='broker'or self.feishu_event_source!='longconn'
or not self.feishu_enabled or not self.feishu_verification_token
or not re.fullmatch(r'[A-Za-z0-9_-]{1,128}',self.feishu_tenant_key)):
raise ValueError('remote approvals require broker, longconn and explicit callback identity')
if self.work_task_cards_enabled and self.credential_mode!='broker':raise ValueError('task cards require broker mode')
if not 1024<=self.work_file_max_bytes<=100*1024*1024 or not 1<=self.work_file_batch_limit<=50 or not 300<=self.work_file_retention<=7*86400:
raise ValueError('invalid work file deployment limits')