Skip to content

Feature/558 replace gorilla sessions#559

Merged
moebiusband73 merged 2 commits into
mainfrom
feature/558-replace-gorilla-sessions
Jun 17, 2026
Merged

Feature/558 replace gorilla sessions#559
moebiusband73 merged 2 commits into
mainfrom
feature/558-replace-gorilla-sessions

Conversation

@moebiusband73

Copy link
Copy Markdown
Member

No description provided.

moebiusband73 and others added 2 commits June 17, 2026 07:54
Browser sessions are now server-side, stored in the SQLite database via
scs/sqlite3store (new `sessions` table, DB migration to version 12) instead
of gorilla/sessions client-side cookie storage. Only an opaque random token
is kept in the cookie; session data lives server-side and survives restarts.

Session middleware is wired as a hybrid to avoid buffering large responses:
scs.LoadAndSave on the login/logout write paths, and a non-buffering
read-only LoadSession middleware on the secured/config/frontend read paths
so the large GraphQL /query responses stream unbuffered. JWT-only APIs
(/api, /userapi, /api/metricstore) and static files are left unwrapped.

The session cookie Secure flag is now derived from the server config (set
when cc-backend terminates TLS itself); previously it was effectively never
set. The SESSION_KEY env var is removed as server-side tokens need no
signing secret. The dormant Bearer-JWT branch in the frontend urql client
is removed; the web UI authenticates GraphQL via the session cookie.

Closes #558

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: b51075f43cc7
@moebiusband73 moebiusband73 self-assigned this Jun 17, 2026

@spacehamster87 spacehamster87 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleaned up frontend JWT path was a historically kept optional pathway, but also was never in use at least since the svelte 5 upgrade of the frontend codebase.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path was cautiously kept as an option, but also was never used. Non-usage is guaranteed at latest with the svelte5 upgrade.

@moebiusband73 moebiusband73 merged commit 07b9a57 into main Jun 17, 2026
2 checks passed
@moebiusband73 moebiusband73 deleted the feature/558-replace-gorilla-sessions branch June 17, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants