tenseleyflow/shithub / 15d0a75

Browse files

S34: session — ImpersonatedUserID/WriteOK/StartedAt fields

Authored by espadonne
SHA
15d0a7536c224ae12f393f863888c8c91688b770
Parents
1178d97
Tree
9b0fc52

1 changed file

StatusFile+-
M internal/auth/session/session.go 8 0
internal/auth/session/session.gomodified
@@ -42,6 +42,14 @@ type Session struct {
4242
 	Flashes   []string          `json:"flashes,omitempty"`
4343
 	Extras    map[string]string `json:"extras,omitempty"`
4444
 	IssuedAt  int64             `json:"iat,omitempty"`
45
+	// ImpersonatedUserID — when non-zero, the admin (UserID above) is
46
+	// currently viewing as this user. ImpersonateWriteOK gates writes
47
+	// (defaults false; admin opts in via the typed-name confirm step
48
+	// in /admin/impersonate). ImpersonationStartedAt drives the
49
+	// inactivity timeout (S34: 1 hour idle).
50
+	ImpersonatedUserID     int64 `json:"imp,omitempty"`
51
+	ImpersonateWriteOK     bool  `json:"impw,omitempty"`
52
+	ImpersonationStartedAt int64 `json:"impt,omitempty"`
4553
 }
4654
 
4755
 // IsAnonymous returns true when no user is bound to the session.