stale/uncommitted
This commit is contained in:
11
util.py
11
util.py
@ -20,7 +20,7 @@ class Utilities:
|
||||
logging.error("Rejected request: No such endpoint")
|
||||
raise HTTPException(detail="Unknown endpoint", status_code=404)
|
||||
|
||||
def check_key(self, path: str, key: str):
|
||||
def check_key(self, path: str, key: str, req_type: int = 0):
|
||||
"""
|
||||
Accepts path as an argument to allow fine tuning access for each API key, not currently in use.
|
||||
"""
|
||||
@ -36,7 +36,14 @@ class Utilities:
|
||||
print("Auth failed")
|
||||
return False
|
||||
|
||||
if path.lower().startswith("/xc/") and not(key.startswith("XC-")):
|
||||
if req_type == 2:
|
||||
if not key.startswith("PRV-"):
|
||||
print("Auth failed - not a PRV key")
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
if path.lower().startswith("/xc/") and not key.startswith("XC-"):
|
||||
print("Auth failed - not an XC Key")
|
||||
return False
|
||||
|
||||
|
Reference in New Issue
Block a user