mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-09-05 07:26:39 +08:00
feat: 支持 Gemini 格式请求,并优化日志和配置
This commit is contained in:
@@ -9,6 +9,12 @@ class SecurityService:
|
||||
def __init__(self, allowed_tokens: list):
|
||||
self.allowed_tokens = allowed_tokens
|
||||
|
||||
async def verify_key(self, key: str):
|
||||
if key not in self.allowed_tokens:
|
||||
logger.error("Invalid key")
|
||||
raise HTTPException(status_code=401, detail="Invalid key")
|
||||
return key
|
||||
|
||||
async def verify_authorization(
|
||||
self, authorization: Optional[str] = Header(None)
|
||||
) -> str:
|
||||
|
||||
Reference in New Issue
Block a user