auth: session-cookie storage for the cookie-gated Actions log/rerun routes (fj#103 slice 1) #202
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/session-auth-log-read"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIP, slice 1 of 3. Starts the fix for the fj#103 read tax (tracked in rasterstate/fleet#178): fj can drive the Forgejo Actions log and rerun web-frontend routes, but those reject a PAT and authenticate by browser session cookie only, so
fj run view --logon a private repo dead-ends at "open the browser."This slice adds the storage half, no route behavior change yet:
src/auth/mod.rsunder a disjointsession:<host>keychain key (mirrors thefjord-account:key convention), with anFJ_SESSIONenv override and the 0600 file fallback, plus store/load/delete helpers.fj auth sessionsubcommand: import thei_like_giteacookie via--cookie/--with-cookie(stdin, kept out of shell history) or--clearto forget it. Never echoes the value.fj auth statusnow reports a "Web session" line per host so you can see whether log/rerun routes are enabled.Existing PAT/bearer auth is untouched.
Testing
cargo buildclean;cargo test auth::green (11 tests, +2 new:session_key_is_namespaced_and_disjoint,env_session_trims_and_rejects_empty).fj auth session --helpshows the wired subcommand.Next slices (same issue)
Clientattaches the session cookie +_csrfon the web log reads (src/api/workflow_view.rs), preferring the session when present and falling back to the token; update the fj#103 error text to point atfj auth session.fj run rerun <run>over the same session path.