You're offline — showing cached data

MC-4253

Add proactive T-1 GWS OAuth expiry warning to Luci Auth Portal
2026-06-13 08:47:40 SAST
Home Board MC-4253

Add proactive T-1 GWS OAuth expiry warning to Luci Auth Portal

Elmar request from Telegram: Luci Auth Portal works, but Google Workspace auth expires almost weekly because current Google OAuth app is still in Testing/trial. Add proactive wa...
State Done Next Action Closed Owner Luci Runtime Closed Age 18d ago
MC-4253
Ticket is done; runtime is closed. · profile codex · cwd /home/lucienne/workspace/mission-control · uptime 17d 18h · last activity 17d 16h ago

Description

MC-4253
Elmar request from Telegram: Luci Auth Portal works, but Google Workspace auth expires almost weekly because current Google OAuth app is still in Testing/trial. Add proactive warning before it expires, ideally T-1 day. Current state discovered: - Auth portal: /home/lucienne/workspace/scripts/auth_portal.py on port 8788. - OAuth health task: /home/lucienne/workspace/tasks/oauth-health-check.md runs every 30 minutes and calls /home/lucienne/workspace/scripts/oauth_health_check.py. - Current health check only alerts after token failure/needs_reauth. - GWS credentials live at ~/.config/gws/credentials.json and currently have refresh_token but no explicit expiry/issued_at metadata. - Google Testing-mode refresh tokens commonly expire after ~7 days; Google may return refresh_token_expires_in on token exchange, but if not, we should estimate from auth time / credential mtime. Implement: 1. When Auth Portal completes GWS exchange, persist non-secret metadata alongside credentials, e.g. authorized_at and approximate refresh_token_expires_at. If token response includes refresh_token_expires_in, use it; otherwise default to 7 days for testing-mode GWS, configurable constant/env. 2. Enhance oauth_health_check.py to compute GWS days remaining from metadata/fallback mtime and include it in oauth-health-status.json. 3. Send Telegram warning before expiry, especially at T-1 day. Deduplicate so it does not spam every 30 minutes. Ideally warn once at <=48h and again at <=24h or at minimum <=24h. 4. Update Auth Portal status UI/API to display approximate GWS expiry / days remaining and warning state. 5. Keep existing failure alert behavior. 6. Add/adjust tests or at least deterministic script-level unit coverage for expiry calculation/dedup logic. 7. Verify by running the health check in dry/quiet mode and checking status JSON fields. Do not expose tokens/secrets in logs. Acceptance: - Elmar receives a proactive warning roughly 1 day before GWS Testing-mode token expiry with link to Auth Portal: http://100.118.207.3:8788 - Dashboard/Auth Portal shows the estimated GWS expiry. - Failure alerts still work and no Telegram spam loop occurs. Owner: Luci Runtime/profile: MC worker / Codex or Sonnet dev-loop Expected check-in: within 24h Completion gate: code committed+pushed, health check manually run successfully, status JSON has expiry fields, and alert dedupe verified.

Activity

done
Luci is working...
Live
No activity yet
Help