mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-13 03:30:46 +08:00
Validate UDS sessions every six hours
This commit is contained in:
parent
df97c5e042
commit
2eb168442e
3 changed files with 44 additions and 0 deletions
|
|
@ -280,6 +280,20 @@ export class MemoryStore extends SessionStore {
|
|||
return this._publicRecord(this._purgeExpired(id))
|
||||
}
|
||||
|
||||
async listUdsSessionsForValidation() {
|
||||
const sessions = []
|
||||
for (const [sessionId, record] of this._sessions) {
|
||||
const row = this._purgeExpired(sessionId)
|
||||
if (!row || row.kind !== 'uds') continue
|
||||
sessions.push({
|
||||
sessionId: row.sessionId,
|
||||
empNo: row.empNo,
|
||||
token: typeof row.userData?.token === 'string' ? row.userData.token : '',
|
||||
})
|
||||
}
|
||||
return sessions
|
||||
}
|
||||
|
||||
getBySessionIdSync(sessionId) {
|
||||
const id = String(sessionId || '').trim()
|
||||
if (!id) return null
|
||||
|
|
|
|||
|
|
@ -27,6 +27,11 @@ export class SessionStore {
|
|||
throw new Error('SessionStore#getBySessionId must be implemented')
|
||||
}
|
||||
|
||||
/** Return active UDS sessions and their upstream token for periodic validation. */
|
||||
async listUdsSessionsForValidation() {
|
||||
throw new Error('SessionStore#listUdsSessionsForValidation must be implemented')
|
||||
}
|
||||
|
||||
async touch(sessionId, ttlSeconds) {
|
||||
throw new Error('SessionStore#touch must be implemented')
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue