mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-18 09:53:20 +08:00
初始化:独立 oclaw 仓库首提交
- 在 oclaw/ 下重新初始化 Git 仓库 - 补齐子仓库 .gitignore,避免提交本地运行态数据(_local、node_modules、logs 等) - 提交当前工程代码与配置 Made-with: Cursor
This commit is contained in:
commit
ba3836f00f
579 changed files with 83112 additions and 0 deletions
21
platform/config/passwords.py
Normal file
21
platform/config/passwords.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
"""访问密码解析(环境变量 + 数据库);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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue