Command for listing sessions
justindotpub opened this issue · 3 comments
fission-codes/go-car-mirror#56 will help give us a list of sessions that are no longer active but still have stats in memory. Otherwise we only have a small window when sessions are returned.
Per discussion with @softwareplumber ...
For now, I think the answer to 'what should ls return' is pragmatically 'the result of Session.Info().String()' listed alongside the URI (client) or Token (server) for each session. When we add security (and yes, thinking about security as a later bolt-on is a bad thing) we will inevitably enrich the session token - it's just random bytes for now, but who knows, it might eventually be or include a DID or ucan. In which case, the server-side ls will be able to return meaningful information about the 'owner' of the session.
Remaining work for this is 1) including all sessions, even those that only exist as stats in the global stats object, and 2) updating the output fields to match the comment above. Later we will also need to ensure that we include sessions that have local TTL'd cache, even if not present in stats.