S34: session — ImpersonatedUserID/WriteOK/StartedAt fields
- SHA
15d0a7536c224ae12f393f863888c8c91688b770- Parents
-
1178d97 - Tree
9b0fc52
15d0a75
15d0a7536c224ae12f393f863888c8c91688b7701178d97
9b0fc52| Status | File | + | - |
|---|---|---|---|
| M |
internal/auth/session/session.go
|
8 | 0 |
internal/auth/session/session.gomodified@@ -42,6 +42,14 @@ type Session struct { | |||
| 42 | Flashes []string `json:"flashes,omitempty"` | 42 | Flashes []string `json:"flashes,omitempty"` |
| 43 | Extras map[string]string `json:"extras,omitempty"` | 43 | Extras map[string]string `json:"extras,omitempty"` |
| 44 | IssuedAt int64 `json:"iat,omitempty"` | 44 | 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"` | ||
| 45 | } | 53 | } |
| 46 | 54 | ||
| 47 | // IsAnonymous returns true when no user is bound to the session. | 55 | // IsAnonymous returns true when no user is bound to the session. |