Make web tests database-free and finish review hardening.
Introduce a Store interface with Postgres and in-memory backends, cover mutations/CSRF/session rotation without Postgres, bound avatar decode dimensions, add truncate/prepareAvatar unit tests, and run go test -race in CI.
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ func openDB() (*sql.DB, *store.SessionStore) {
|
||||
}
|
||||
|
||||
func newHandler(db *sql.DB, sessions *store.SessionStore, uploader blob.Uploader) http.Handler {
|
||||
srv, err := web.New(db, sessions.Store(), plumber.TemplateFS, plumber.StaticFS, web.Config{
|
||||
srv, err := web.New(store.NewPostgres(db), sessions.Store(), plumber.TemplateFS, plumber.StaticFS, web.Config{
|
||||
AdminUsername: os.Getenv("ADMIN_USERNAME"),
|
||||
SecureCookie: os.Getenv("SECURE_COOKIE") == "1",
|
||||
Blob: uploader,
|
||||
|
||||
Reference in New Issue
Block a user