Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 99949e5

Browse files
committed
Comment
1 parent 8e16393 commit 99949e5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

quesma/quesma/ui/console_routes.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ var uiFs embed.FS
3131
const quesmaSessionName = "quesma-session"
3232

3333
func init() {
34+
35+
// Here we generate a random key for the session store
36+
// TODO We should use a secure key from the environment on production.
37+
// 32 - is a default key length, taken for example
3438
gothic.Store = sessions.NewCookieStore(securecookie.GenerateRandomKey(32))
3539
}
3640

@@ -252,6 +256,9 @@ func (qmc *QuesmaManagementConsole) initPprof(router *mux.Router) {
252256
router.HandleFunc("/debug/pprof/trace", pprof.Trace)
253257
}
254258

259+
// Here we generate keys for the session store.
260+
// TODO We should use a secure key from the environment on production.
261+
// 32,64 are default key lengths.
255262
var authKey = securecookie.GenerateRandomKey(64)
256263
var encryptionKey = securecookie.GenerateRandomKey(32)
257264
var store = sessions.NewCookieStore(authKey, encryptionKey)

0 commit comments

Comments
 (0)