Phase 10, part 1: users, sessions and form tokens

Schema 32 adds users, memberships and sessions, on both databases.
internal/users keeps accounts (Argon2id passwords), roles and modules,
and sessions whose rows hold only a hash of the cookie's value; they end
after a week unused or 30 days. On the server edition, every page but the
public ones needs a session and sends others to /signin. Every edition's
forms now carry a CSRF token (a cookie repeated in each form, added as
pages render; htmx sends it as a header), besides the same-origin check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 08:49:45 -07:00
co-authored by Claude Opus 5.5
parent d537fb367f
commit 96404a3580
21 changed files with 1475 additions and 21 deletions
+1 -1
View File
@@ -9,6 +9,7 @@ require (
github.com/jackc/pgx/v5 v5.13.0
github.com/minio/minio-go/v7 v7.4.1
github.com/modelcontextprotocol/go-sdk v1.8.0
golang.org/x/crypto v0.59.0
golang.org/x/net v0.63.0
golang.org/x/text v0.44.0
gopkg.in/yaml.v3 v3.0.1
@@ -56,7 +57,6 @@ require (
go.opentelemetry.io/otel/trace v1.33.0 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
go.yaml.in/yaml/v4 v4.0.0-rc.2 // indirect
golang.org/x/crypto v0.59.0 // indirect
golang.org/x/oauth2 v0.35.0 // indirect
golang.org/x/sync v0.25.0 // indirect
golang.org/x/sys v0.50.0 // indirect