modify: auth插件拆分,将token签发部分交给网关

This commit is contained in:
2026-09-10 16:43:43 +08:00
parent 5ec90a5575
commit c139b0c1d3
23 changed files with 691 additions and 290 deletions
+27
View File
@@ -0,0 +1,27 @@
from typing import Any
from chongming_config import get_config
from chongming_database import Database
from chongming_cache import Cache
def set_global_var(name: str, value: Any) -> None:
"""
设置当前模块的全局变量。
Args:
name: 变量名(字符串)
value: 任意值
"""
globals()[name] = value
config = get_config()
db: Database | None = None
cache: Cache | None = None # chongming_cache.Cache(OAuth state / OTP 验证码)
plugin_config: dict = {} # [workers.config] 运行时配置(github 凭据等)
__all__ = [
"db",
"cache",
"plugin_config",
]