MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / verify_api_key_header

Function verify_api_key_header

src/core/auth.py:36–41  ·  view source on GitHub ↗

Verify API key from Authorization header

(credentials: HTTPAuthorizationCredentials = Security(security))

Source from the content-addressed store, hash-verified

34 return bcrypt.checkpw(password.encode(), hashed.encode())
35
36async def verify_api_key_header(credentials: HTTPAuthorizationCredentials = Security(security)) -> str:
37 """Verify API key from Authorization header"""
38 api_key = credentials.credentials
39 if not AuthManager.verify_api_key(api_key):
40 raise HTTPException(status_code=401, detail="Invalid API key")
41 return api_key
42
43
44async def verify_api_key_flexible(

Callers

nothing calls this directly

Calls 1

verify_api_keyMethod · 0.80

Tested by

no test coverage detected