Ufoptg commited on
Commit
9f6e8ad
·
verified ·
1 Parent(s): fdb9fc0

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -6
main.py CHANGED
@@ -90,7 +90,6 @@ DEVELOPER_ID = os.environ["DEVELOPER_ID"]
90
  REVERSE_IMAGE_API = os.environ["REVERSE_IMAGE_API"]
91
  OCR_API_KEY = os.environ["OCR_API_KEY"]
92
  ONLY_DEVELOPER_API_KEYS = os.environ["ONLY_DEVELOPER_API_KEYS"]
93
- ULT_ONLY_API = os.environ["ULT_ONLY_API"]
94
  HUGGING_TOKEN = os.environ["HUGGING_TOKEN"]
95
  ASSISTANT_GOOGLE_API_KEYS = os.environ["ASSISTANT_GOOGLE_API_KEYS"]
96
  #COOKIE_BARD_TOKEN = os.environ["COOKIE_BARD_TOKEN"]
@@ -138,10 +137,6 @@ 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
 
146
  @app.get("/UFoP/blacklist-words")
147
  def blacklist_words():
@@ -220,7 +215,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:
 
90
  REVERSE_IMAGE_API = os.environ["REVERSE_IMAGE_API"]
91
  OCR_API_KEY = os.environ["OCR_API_KEY"]
92
  ONLY_DEVELOPER_API_KEYS = os.environ["ONLY_DEVELOPER_API_KEYS"]
 
93
  HUGGING_TOKEN = os.environ["HUGGING_TOKEN"]
94
  ASSISTANT_GOOGLE_API_KEYS = os.environ["ASSISTANT_GOOGLE_API_KEYS"]
95
  #COOKIE_BARD_TOKEN = os.environ["COOKIE_BARD_TOKEN"]
 
137
  if api_key not in ONLY_DEVELOPER_API_KEYS:
138
  raise HTTPException(status_code=401, detail="Invalid API key")
139
 
 
 
 
 
140
 
141
  @app.get("/UFoP/blacklist-words")
142
  def blacklist_words():
 
215
  @app.get("/UFoP/bans")
216
  def sibyl_system(
217
  user_id: int = Query(..., description="User ID in query parameter"),
218
+ api_key: None = Depends(validate_api_key)
219
  ):
220
  result = db.get_sibyl_system_banned(user_id)
221
  if result is not None: