Skip to main content

Module register

Module register 

Source
Expand description

Synapse-compatible shared-secret registration backend.

Pairs with the HTTP handlers in tuwunel_api_admin that serve /_synapse/admin/v1/register. Resolves the shared secret from registration.shared_secret or its _file companion at each use and maintains an in-memory nonce store with a 60-second TTL.

The nonce store lives in RAM rather than RocksDB on purpose: each entry’s useful lifespan is shorter than a single block-cache eviction tick, and the working set is bounded by NONCE_CAP regardless of traffic.

Re-exportsΒ§

use std::collections::BTreeMap; πŸ”’
use std::time::Duration; πŸ”’
use std::time::Instant; πŸ”’
use tuwunel_core::implement; πŸ”’
use tuwunel_core::utils; πŸ”’
use tuwunel_core::utils::Secret; πŸ”’
use tuwunel_core::utils::is_secret_set; πŸ”’
use tuwunel_core::utils::resolve_secret; πŸ”’

ConstantsΒ§

NONCE_CAP πŸ”’
NONCE_LENGTH πŸ”’
NONCE_TTL πŸ”’

FunctionsΒ§

drop_oldest πŸ”’
gc_expired πŸ”’

Type AliasesΒ§

Nonces πŸ”’