File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ async def verify_token(self, token: str) -> AccessToken | None:
2121 workspace_slug = headers .get ("x-workspace-slug" )
2222 if workspace_slug :
2323 logger .info ("Using API key from HTTP headers" )
24- expires_at = int (time .time () + 3600 )
24+ expires_at = int (time .time () + 300 )
2525 return AccessToken (
2626 token = token ,
2727 client_id = "api_key_header_user" ,
@@ -34,6 +34,8 @@ async def verify_token(self, token: str) -> AccessToken | None:
3434 )
3535 else :
3636 logger .warning ("x-api-key header found but x-workspace-slug is missing" )
37+ from fastapi import HTTPException
38+ raise HTTPException (status_code = 401 , detail = "Missing x-workspace-slug header. This header is required to scope the API key to a specific workspace." )
3739 except RuntimeError :
3840 # No active HTTP request available (e.g., stdio transport)
3941 logger .debug ("No active HTTP request available for header check" )
You can’t perform that action at this time.
0 commit comments