pass roles + debugging
All checks were successful
Build and Push Agent Docker Image / build (push) Successful in 1m3s
Build and Push Web Docker Image / build (push) Successful in 3m59s

This commit is contained in:
2025-12-13 17:23:52 +01:00
parent 0e24515303
commit c808f51eb7
9 changed files with 123 additions and 88 deletions

View File

@@ -35,12 +35,18 @@ mcp = FastMCP("Cavepedia MCP")
def get_user_roles() -> list[str]:
"""Extract user roles from the X-User-Roles header."""
headers = get_http_headers()
print(f"DEBUG: All headers received: {dict(headers)}")
roles_header = headers.get("x-user-roles", "")
print(f"DEBUG: x-user-roles header value: '{roles_header}'")
if roles_header:
try:
return json.loads(roles_header)
except json.JSONDecodeError:
roles = json.loads(roles_header)
print(f"DEBUG: Parsed roles: {roles}")
return roles
except json.JSONDecodeError as e:
print(f"DEBUG: JSON decode error: {e}")
return []
print("DEBUG: No roles header found, returning empty list")
return []
def embed(text, input_type):