MCPcopy Create free account
hub / github.com/Trex099/Velocity-Bridge / validate_token

Function validate_token

src-python-windows/server.py:224–228  ·  view source on GitHub ↗
(token: str, request: Request = None)

Source from the content-addressed store, hash-verified

222SECURITY_TOKEN = os.environ.get("SECURITY_TOKEN") or config.get("token", "") or config.get("security_token", "")
223
224def validate_token(token: str, request: Request = None) -> None:
225 if SECURITY_TOKEN and token != SECURITY_TOKEN:
226 client_ip = request.client.host if request and request.client else "unknown"
227 logger.warning(f"Authentication failed from IP: {client_ip}")
228 raise HTTPException(status_code=403, detail="Invalid security token")
229
230def load_history() -> list:
231 try:

Callers 3

get_clipboardFunction · 0.70
upload_imageFunction · 0.70
shutdownFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected