Skip to main content

Module tokens

Module tokens 

Source
Expand description

Token registry for the loopback media server.

§Overview

Each call to TokenRegistry::mint produces a cryptographically random, URL-safe base64 token (48 raw bytes → 64 base64 chars) that maps to a TokenRecord containing the S3 coordinates, TTL, and the session that owns it.

§OCP

  • The registry is decoupled from the HTTP server so it can be swapped for a more durable store (e.g. redb) if cross-restart tokens ever become necessary. In v1 tokens are session-scoped and in-memory is sufficient.
  • revoke_session is the single sweep point for session-end cleanup.

Structs§

TokenRecord
Everything the server needs to serve a single media token.
TokenRegistry
Thread-safe, in-memory store of live token records.

Type Aliases§

TokenRegistryHandle
Shared, heap-allocated token registry.