Commit 56ced3b
committed
feat(pam): real-time session log sync via incremental batch uploads
Replaces end-of-session bulk upload with incremental 10-second batch
uploads to enable live monitoring and session intervention.
- Add CallUploadPamSessionEventBatch to post raw event bytes to the new
batch endpoint
- Add sessionUploadState with per-session file offset tracking and mutex
- Add RegisterSession/UnregisterSession for active session management
- Add readFromOffset to read and decrypt new records from a byte offset
- Persist upload progress to a .offset file alongside the .enc recording
for crash recovery; resume from saved offset on restart
- Flush all active sessions every 10 seconds via a new ticker
- Re-register all on-disk session files at startup to resume after crash
- Fall back to legacy bulk upload if the batch endpoint returns 404
- Remove end-of-session bulk upload call from CleanupPAMSession1 parent fa03013 commit 56ced3b
3 files changed
Lines changed: 305 additions & 78 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
1008 | 1009 | | |
1009 | 1010 | | |
1010 | 1011 | | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
1011 | 1029 | | |
1012 | 1030 | | |
1013 | 1031 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
0 commit comments