Skip to content

Commit 9493f08

Browse files
committed
fix(auth): reduce token TTL and explicitly reject missing workspace slug
1 parent b5cb8d6 commit 9493f08

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

plane_mcp/auth/plane_header_auth_provider.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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")

0 commit comments

Comments
 (0)