Refresh Heimdall sessions in hosted access

This commit is contained in:
Meta Vens 2026-05-20 13:43:53 +01:00
commit d90bf8eeef
7 changed files with 246 additions and 26 deletions

View file

@ -27,3 +27,4 @@
{"ts": "2026-04-29T17:29:40+00:00", "type": "implementation", "status": "ok", "note": "Hosted GUI now emits explicit service logs for queue saturation, job queue/start/completion/failure/cancel events, and wait/run/total seconds so load pressure shows up in journald instead of only in transient SSE state."}
{"ts": "2026-04-29T21:40:11+00:00", "type": "implementation", "status": "ok", "note": "Fixed GUI failed-response handling so submit/config/queue/cancel errors read the Response body once, preserving the real server error instead of throwing 'body stream already read'."}
{"ts": "2026-04-29T21:42:58+00:00", "type": "implementation", "status": "ok", "note": "Oversize uploads were hitting nginx 413 before FastAPI and the GUI masked the response with a double-read error; GUI now preflights file size and reads failed responses once so users see the actual upload limit."}
{"ts": "2026-05-20T12:43:01+00:00", "type": "implementation", "status": "ok", "note": "Repixelizer Heimdall mode now stores a separate httpOnly refresh cookie and calls Heimdall's session-refresh endpoint with app-owned Discord/Patreon entitlement policies before forcing provider OAuth again."}

View file

@ -51,6 +51,7 @@ accepted_design:
- Hosted demo inference uses autocorr lattice candidates, capped by the hosted output limit, with low-confidence preview rerank available.
- Hosted mode owns the public front door in `src/repixelizer/gui.py`: `/` is a landing page there, while local/self-host runs keep root as a plain redirect to `/app/`.
- `src/repixelizer/access.py` owns the hosted access seam: trusted-header ingress still works, `GC_ACCESS_MODE=heimdall` verifies Heimdall Ed25519 access tokens locally, and auth attempts are adopted into local httpOnly cookie sessions.
- In Heimdall mode, Repixelizer keeps a separate httpOnly refresh cookie and asks Heimdall to reissue a short-lived access claim before forcing the user back through provider OAuth.
- The solver starts from fixed lattice centers, adds tiny seeded noise, follows a direct hierarchical flatness signal, enforces local lattice coherence through spring relaxation, then rounds to real source pixels for final output.
- Cleanup is local and secondary; it does not define the core reconstruction model.
- `source_fidelity` and `source_structure` separate lattice agreement from visible structure.
@ -87,7 +88,9 @@ current_status:
low-confidence autocorr candidates can be preview-reranked. Hosted web
access is auth-landed without smearing into the
solver: `src/repixelizer/access.py` verifies Heimdall Ed25519 access tokens
locally, tracks auth attempts, and adopts local cookie sessions, while
locally, tracks auth attempts, adopts local cookie sessions, and refreshes
expired/missing access cookies through Heimdall's signed session-refresh
endpoint before falling back to provider OAuth, while
`src/repixelizer/gui.py` owns provider-start routes, direct backend callback
receipt, hosted landing-page login buttons, route guards, and queue/job
ownership checks. Self-host remains permissive by default unless