Skip to main content

ActorKeyDeriver

Type Alias ActorKeyDeriver 

Source
pub type ActorKeyDeriver = dyn Fn(&str) -> Option<Arc<str>> + Send + Sync;
Expand description

Closure-erased actor-key derivation hook.

Consumers that have a notion of an opaque actor identifier (lab uses an HMAC over the JWT subject for non-PII observability) build one and pass it through AuthLayer::with_actor_key_deriver. Consumers without this concept (e.g. cortex) leave it unset.

The closure receives the JWT sub (or "static-bearer" / browser-session subject) and returns a per-request Arc<str> key.