Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -139,7 +139,7 @@ def validate_api_key_only_devs(api_key: str = Header(...)):
|
|
| 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
|
| 143 |
raise HTTPException(status_code=401, detail="Invalid API key")
|
| 144 |
|
| 145 |
|
|
@@ -187,7 +187,7 @@ def sibyl_system_delete(
|
|
| 187 |
@app.post("/UFoP/banner", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
|
| 188 |
def sibyl_system_ban(
|
| 189 |
item: SibylSystemBan,
|
| 190 |
-
api_key: None = Depends(
|
| 191 |
):
|
| 192 |
if item.user_id == DEVELOPER_ID:
|
| 193 |
return {"status": "false", "message": "Only Developer"}
|
|
@@ -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)
|
| 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
|
| 245 |
):
|
| 246 |
url = SOURCE_ASSISTANT_GOOGLE_AI
|
| 247 |
token = ASSISTANT_GOOGLE_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 |
|
|
|
|
| 187 |
@app.post("/UFoP/banner", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
|
| 188 |
def sibyl_system_ban(
|
| 189 |
item: SibylSystemBan,
|
| 190 |
+
api_key: None = Depends(validate_api_key_only_devs)
|
| 191 |
):
|
| 192 |
if item.user_id == DEVELOPER_ID:
|
| 193 |
return {"status": "false", "message": "Only Developer"}
|
|
|
|
| 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)
|
| 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)
|
| 245 |
):
|
| 246 |
url = SOURCE_ASSISTANT_GOOGLE_AI
|
| 247 |
token = ASSISTANT_GOOGLE_API_KEYS
|