Skip to main content
Glama

ThinkDrop Vision Service

by lukaizhi5559
validation.py907 B
""" Request validation middleware """ import os from fastapi import Request, HTTPException from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials security = HTTPBearer(auto_error=False) async def validate_api_key(request: Request, credentials: HTTPAuthorizationCredentials = None): """Validate API key from request""" expected_key = os.getenv('API_KEY', 'your-vision-api-key-here') # Skip validation in development if no key set if expected_key == 'your-vision-api-key-here': return True # Check Authorization header if credentials: if credentials.credentials == expected_key: return True # Check x-api-key header api_key = request.headers.get('x-api-key') if api_key == expected_key: return True raise HTTPException( status_code=401, detail="Invalid or missing API key" )

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lukaizhi5559/thinkdrop-vision-service'

If you have feedback or need assistance with the MCP directory API, please join our Discord server