改造配置文件,去掉敏感信息

This commit is contained in:
mark.tian
2025-12-11 11:23:26 +08:00
parent 851e92ad3a
commit 5616d32024
6 changed files with 104 additions and 61 deletions

View File

@@ -53,6 +53,16 @@ class Settings(BaseSettings):
log_format: str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
log_date_format: str = "%Y-%m-%d %H:%M:%S"
# API配置
_api_authorization_token: str = "" # 内部存储API Authorization Token
@property
def api_authorization_token(self) -> str:
"""API Authorization Token - 只在生产环境下返回"""
if self.environment.lower() == "production":
return self._api_authorization_token
return ""
# 应用配置
app_name: str = "AI Talk Callback API"
environment: str = "production" # 环境: production, test, development