[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. 馃珫 Status page with uptime monitoring & API monitoring as code 馃珫 openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor

fix(oauth): fall back to stored or pinned client metadata when the CIMD fetch fails (#2653) master

* fix(oauth): fall back to stored or pinned client metadata when the CIMD fetch fails claude.ai's Cloudflare bot protection challenges Fly egress IPs, so the authorize flow failed with "HTTP 403" before any consent screen. When the live fetch fails, reuse the last stored document, or a pinned one for known clients, instead of rejecting the client. A successful fetch still always wins, and revoked clients stay blocked. Also log non-2xx responses with the Cloudflare diagnostic headers so a challenge is visible in the Fly logs next time. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016uySLnH1sC5gRHdRrHKKTZ * test(oauth): cover the stored-row fallback at the route level The unreachable-document case reused a client id the previous test had already stored, so the new fallback served it. Use an unknown id for the 400 case and assert the stored client survives an outage. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016uySLnH1sC5gRHdRrHKKTZ * fix(oauth): only fall back to stored metadata when the document is unreachable Address review: a 404 or an invalid body stays a hard failure so a de-registered client cannot live on from stale data; only network errors, timeouts, bot challenges, 429 and 5xx use the stored or pinned copy. Re-read the client row before falling back so a revocation during the fetch still wins. Align the fetched-document log with console.warn and seed the route-level fallback test inside the test. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016uySLnH1sC5gRHdRrHKKTZ --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>


+198 -15
4 changed files