Phase 1, PR 5: MCP v1 (read tools, known conditions, attach tickets) behind Authelia OAuth #9

Merged
jared merged 3 commits from mcp into main 2026-11-26 17:32:03 -05:00
2 changed files with 9 additions and 2 deletions
Showing only changes of commit af5fb0c609 - Show all commits

No files matched your search

+7 -1
View File
@@ -8,6 +8,7 @@ Pair it with scripts/ui_demo.py to show the pages with replay data.
import sys
from pathlib import Path
from playwright.sync_api import TimeoutError as PlaywrightTimeout
from playwright.sync_api import sync_playwright
PAGES = {
@@ -34,9 +35,14 @@ def main(base: str, out: str) -> None:
continue
page = browser.new_page(viewport=vp, color_scheme=scheme)
for name, path in PAGES.items():
resp = page.goto(base.rstrip('/') + path, wait_until='networkidle')
resp = page.goto(base.rstrip('/') + path, wait_until='domcontentloaded')
if resp is None or resp.status >= 400:
raise SystemExit(f'{path} answered {resp.status if resp else "nothing"}')
# Web fonts come from Google; in CI that can hang. Give it a moment, then go on.
try:
page.wait_for_load_state('networkidle', timeout=10000)
except PlaywrightTimeout:
pass
page.screenshot(path=str(out_dir / f'{name}-{vp_name}-{scheme}.png'), full_page=True)
count += 1
page.close()
+2 -1
View File
@@ -316,7 +316,8 @@ def mcp_post():
try:
claims = verify_token(auth[7:].strip(), settings, current_app.config.get('THOR_JWKS'))
except AuthError as e:
logger.warning('MCP token refused: %s', e)
# Only the reason is logged (PyJWT's message), never the bearer value itself.
logger.warning('MCP sign-in refused: %s', e)
if 'group' in str(e):
return jsonify({'error': 'forbidden', 'error_description': str(e)}), 403
return _unauthorized(settings, 'invalid_token', str(e))