mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 04:40:45 +08:00
- 在 oclaw/ 下重新初始化 Git 仓库 - 补齐子仓库 .gitignore,避免提交本地运行态数据(_local、node_modules、logs 等) - 提交当前工程代码与配置 Made-with: Cursor
21 lines
687 B
Python
21 lines
687 B
Python
"""访问密码解析(环境变量 + 数据库);Streamlit secrets 在认证模块中处理。"""
|
||
|
||
from __future__ import annotations
|
||
|
||
import os
|
||
|
||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||
|
||
|
||
def load_expected_password(store: SqliteStore, *, extra_candidate: str | None = None) -> str | None:
|
||
pwd = (os.getenv("AIA_ASSISTANT_PASSWORD") or "").strip()
|
||
if not pwd:
|
||
pwd = (os.getenv("OPS_ASSISTANT_PASSWORD") or "").strip()
|
||
if not pwd and extra_candidate:
|
||
pwd = extra_candidate.strip()
|
||
if not pwd:
|
||
pwd = (store.get_secret("auth_password") or "").strip()
|
||
return pwd if pwd else None
|
||
|
||
|
||
__all__ = ["load_expected_password"]
|