From 4d77af791ca834d46f92cb97fc2ec636a092e688 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 23:41:20 +0000 Subject: [PATCH 1/3] Initial plan From dfef73040c4fb65726cb82ad9c9ee11e9b4b08b2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 23:43:54 +0000 Subject: [PATCH 2/3] Fix 401 on poll-status: remove auth requirement from read-only status endpoint Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/15d037ef-2d5e-44ab-a15d-7908187e9106 Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- backend/app/main.py | 7 ++----- backend/app/templates/index.html | 4 ++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/app/main.py b/backend/app/main.py index 8312082..b7feee1 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -583,14 +583,11 @@ async def trigger_imap_poll(auth: dict = Depends(require_admin_auth)): # API endpoint to check status of IMAP polling @app.get("/api/v1/admin/poll-status") -async def get_poll_status(auth: dict = Depends(require_admin_auth)): +async def get_poll_status(): """ - Get the status of IMAP polling (admin only - requires authentication) - - Security: Requires either X-API-Key header or Bearer token + Get the status of IMAP polling (read-only, no authentication required). """ return { "is_running": background_task is not None and not background_task.done(), "last_check": last_check_time.isoformat() if last_check_time else None, - "authenticated_by": auth.get("auth_type"), } diff --git a/backend/app/templates/index.html b/backend/app/templates/index.html index aca43e3..f62eef2 100644 --- a/backend/app/templates/index.html +++ b/backend/app/templates/index.html @@ -200,6 +200,10 @@ function dashboardApp() { async getImapStatus() { try { const response = await fetch('/api/v1/admin/poll-status'); + if (!response.ok) { + console.error('Error checking IMAP status:', response.status); + return; + } const data = await response.json(); const statusIcon = document.getElementById('imap-status-icon'); From 04e6dcfb8cdebcf2ce6b9c1478ea2f44afc21de1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 23:46:37 +0000 Subject: [PATCH 3/3] Rename poll-status to public path /api/v1/poll-status to reflect no-auth design Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/15d037ef-2d5e-44ab-a15d-7908187e9106 Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- backend/app/main.py | 4 ++-- backend/app/templates/index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/app/main.py b/backend/app/main.py index b7feee1..6dc929e 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -581,8 +581,8 @@ async def trigger_imap_poll(auth: dict = Depends(require_admin_auth)): } -# API endpoint to check status of IMAP polling -@app.get("/api/v1/admin/poll-status") +# API endpoint to check status of IMAP polling (public, read-only) +@app.get("/api/v1/poll-status") async def get_poll_status(): """ Get the status of IMAP polling (read-only, no authentication required). diff --git a/backend/app/templates/index.html b/backend/app/templates/index.html index f62eef2..badb426 100644 --- a/backend/app/templates/index.html +++ b/backend/app/templates/index.html @@ -199,7 +199,7 @@ function dashboardApp() { async getImapStatus() { try { - const response = await fetch('/api/v1/admin/poll-status'); + const response = await fetch('/api/v1/poll-status'); if (!response.ok) { console.error('Error checking IMAP status:', response.status); return;