Ufoptg commited on
Commit
e13a2a1
1 Parent(s): c2ebe9a

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -4
main.py CHANGED
@@ -138,8 +138,8 @@ def validate_api_key_only_devs(api_key: str = Header(...)):
138
  if api_key not in ONLY_DEVELOPER_API_KEYS:
139
  raise HTTPException(status_code=401, detail="Invalid API key")
140
 
141
- def validate_api_key_only_ULTROID(api_key: str = Header(...)):
142
- if api_key not in ULT_ONLY_API:
143
  raise HTTPException(status_code=401, detail="Invalid API key")
144
 
145
 
@@ -220,7 +220,7 @@ def sibyl_system_ban(
220
  @app.get("/UFoP/bans")
221
  def sibyl_system(
222
  user_id: int = Query(..., description="User ID in query parameter"),
223
- api_key: None = Depends(validate_api_key) or Depends(validate_api_key_only_devs) or Depends(validate_api_key_only_ULTROID)
224
  ):
225
  result = db.get_sibyl_system_banned(user_id)
226
  if result is not None:
@@ -241,7 +241,7 @@ def sibyl_system(
241
  @app.post("/UFoP/G-AI", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
242
  def v1beta3_google_ai(
243
  item: ChatgptCustom,
244
- api_key: None = Depends(validate_api_key) or Depends(validate_api_key_only_ULTROID)
245
  ):
246
  url = SOURCE_ASSISTANT_GOOGLE_AI
247
  token = ASSISTANT_GOOGLE_API_KEYS
 
138
  if api_key not in ONLY_DEVELOPER_API_KEYS:
139
  raise HTTPException(status_code=401, detail="Invalid API key")
140
 
141
+ def validate_api_key_only_ultroid(api_key: str = Header(...)):
142
+ if api_key != ULT_ONLY_API:
143
  raise HTTPException(status_code=401, detail="Invalid API key")
144
 
145
 
 
220
  @app.get("/UFoP/bans")
221
  def sibyl_system(
222
  user_id: int = Query(..., description="User ID in query parameter"),
223
+ api_key: None = Depends(validate_api_key) or Depends(validate_api_key_only_devs) or Depends(validate_api_key_only_ultroid)
224
  ):
225
  result = db.get_sibyl_system_banned(user_id)
226
  if result is not None:
 
241
  @app.post("/UFoP/G-AI", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
242
  def v1beta3_google_ai(
243
  item: ChatgptCustom,
244
+ api_key: None = Depends(validate_api_key or validate_api_key_only_ultroid)
245
  ):
246
  url = SOURCE_ASSISTANT_GOOGLE_AI
247
  token = ASSISTANT_GOOGLE_API_KEYS