From 4742a67d80b4e1e7f9665daa0206aa7cae3f6749 Mon Sep 17 00:00:00 2001 From: ymq Date: Fri, 14 Aug 2026 12:12:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20load=5Fpath=20=E6=B3=A8=E5=86=8C=20audi?= =?UTF-8?q?t=20API(owner.audit)=20+=20work=5Fenv/deploy=5Faccount(logined)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/load_path.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/load_path.py b/scripts/load_path.py index a645bed..49ba229 100644 --- a/scripts/load_path.py +++ b/scripts/load_path.py @@ -108,6 +108,14 @@ PATHS_LOGINED = [ f"/{MOD}/api/workspace_delete.dspy", f"/{MOD}/api/workspace_popup.dspy", f"/{MOD}/workspace_edit.xterm", + # 工作环境 / 部署账号(普通用户可用) + f"/{MOD}/api/work_env.dspy", + f"/{MOD}/api/deploy_account.dspy", +] + +# 审计日志 API:仅 owner.audit 角色(审计独立性,superuser 也不给) +PATHS_AUDIT = [ + f"/{MOD}/api/audit.dspy", ] @@ -132,7 +140,7 @@ def main(): set_perm = os.path.join(root, "set_role_perm.py") py = sys.executable count = 0 - for role, paths in [("any", PATHS_ANY), ("logined", PATHS_LOGINED)]: + for role, paths in [("any", PATHS_ANY), ("logined", PATHS_LOGINED), ("owner.audit", PATHS_AUDIT)]: for path in paths: cmd = [py, set_perm, role, path] r = subprocess.run(cmd, capture_output=True, text=True, cwd=root) @@ -140,7 +148,7 @@ def main(): count += 1 else: print(f" WARN: {path} -> {r.stderr.strip()[-80:]}") - print(f"Registered {count}/{len(PATHS_ANY)+len(PATHS_LOGINED)} paths for {MOD}") + print(f"Registered {count}/{len(PATHS_ANY)+len(PATHS_LOGINED)+len(PATHS_AUDIT)} paths for {MOD}") if __name__ == "__main__":