feat: load_path 注册 audit API(owner.audit) + work_env/deploy_account(logined)
This commit is contained in:
parent
359c57b156
commit
4742a67d80
@ -108,6 +108,14 @@ PATHS_LOGINED = [
|
|||||||
f"/{MOD}/api/workspace_delete.dspy",
|
f"/{MOD}/api/workspace_delete.dspy",
|
||||||
f"/{MOD}/api/workspace_popup.dspy",
|
f"/{MOD}/api/workspace_popup.dspy",
|
||||||
f"/{MOD}/workspace_edit.xterm",
|
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")
|
set_perm = os.path.join(root, "set_role_perm.py")
|
||||||
py = sys.executable
|
py = sys.executable
|
||||||
count = 0
|
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:
|
for path in paths:
|
||||||
cmd = [py, set_perm, role, path]
|
cmd = [py, set_perm, role, path]
|
||||||
r = subprocess.run(cmd, capture_output=True, text=True, cwd=root)
|
r = subprocess.run(cmd, capture_output=True, text=True, cwd=root)
|
||||||
@ -140,7 +148,7 @@ def main():
|
|||||||
count += 1
|
count += 1
|
||||||
else:
|
else:
|
||||||
print(f" WARN: {path} -> {r.stderr.strip()[-80:]}")
|
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__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user