- auth/doc.go: package comment explaining consolidated layout (Open Question 3 resolved) - auth/types.go: User + Session structs, SessionCookieName (D-12), SessionTTL (D-09), SessionExtendThreshold (D-09), ErrSessionNotFound, ErrInvalidHash, ErrIncompatibleVersion - auth/testdb_test.go: setupTestDB creates isolated per-test schema (test_<uuid>), runs goose Up with unique version table, drops schema on cleanup (D-26) TestSetupTestDB_Roundtrip smoke test verifies users table visible - go.mod: added github.com/pressly/goose/v3 v3.27.1 as direct dependency - .env.example: added TEST_DATABASE_URL and SESSION_SECRET with comments (D-14, D-26)
18 lines
868 B
Text
18 lines
868 B
Text
# Postgres connection string used by the web + worker binaries (and `just migrate`).
|
|
DATABASE_URL=postgres://xtablo:xtablo@localhost:5432/xtablo?sslmode=disable
|
|
|
|
# Postgres connection string used by integration tests (auth, session, etc.).
|
|
# Falls back to DATABASE_URL if unset; tests skip if neither is set.
|
|
# The test harness creates an isolated schema per test run and drops it on cleanup.
|
|
TEST_DATABASE_URL=postgres://xtablo:xtablo@localhost:5432/xtablo?sslmode=disable
|
|
|
|
# Session secret — 32 random bytes hex-encoded. Used as the CSRF authentication key.
|
|
# Generate a new value with: openssl rand -hex 32
|
|
# MUST be persistent across restarts (changing it invalidates all active CSRF tokens).
|
|
SESSION_SECRET=
|
|
|
|
# HTTP port for cmd/web.
|
|
PORT=8080
|
|
|
|
# Environment selector: "development" enables the slog text handler; "production" switches to JSON.
|
|
ENV=development
|