(
sessionId: string,
namespace: string
)
| 45 | } |
| 46 | |
| 47 | resolveSessionAccess( |
| 48 | sessionId: string, |
| 49 | namespace: string |
| 50 | ): { ok: true; sessionId: string; session: Session } | { ok: false; reason: 'not-found' | 'access-denied' } { |
| 51 | const session = this.sessions.get(sessionId) ?? this.refreshSession(sessionId) |
| 52 | if (session) { |
| 53 | if (session.namespace !== namespace) { |
| 54 | return { ok: false, reason: 'access-denied' } |
| 55 | } |
| 56 | return { ok: true, sessionId, session } |
| 57 | } |
| 58 | |
| 59 | return { ok: false, reason: 'not-found' } |
| 60 | } |
| 61 | |
| 62 | getActiveSessions(): Session[] { |
| 63 | return this.getSessions().filter((session) => session.active) |
nothing calls this directly
no test coverage detected