pub struct OrgAwareKeyProvider { /* private fields */ }Expand description
A SyncKeyProvider that keys Scope::Shared { org } ops on a shared
K_org and delegates Scope::Personal to an inner per-user provider. See the
module docs for the hot-path, fail-closed, epoch, and inertness contracts.
Implementations§
Source§impl OrgAwareKeyProvider
impl OrgAwareKeyProvider
Sourcepub fn new(
personal: Arc<dyn SyncKeyProvider>,
org_roots: HashMap<String, BTreeMap<u64, Zeroizing<[u8; 32]>>>,
) -> Self
pub fn new( personal: Arc<dyn SyncKeyProvider>, org_roots: HashMap<String, BTreeMap<u64, Zeroizing<[u8; 32]>>>, ) -> Self
Build over an inner per-user personal provider and a set of
pre-resolved org → K_org roots (each the newest epoch the member can
unwrap). Resolution — fetch wraps, unwrap_org_key, pick newest — happens
OUT OF BAND before construction; this type never touches the directory or
the identity secret.
Roots arrive already in Zeroizing so the root secret is never a bare
Copy array in a heap map on the way in: a HashMap<_, [u8;32]> would be
freed WITHOUT wiping ([u8;32]: Copy → wrapping copies and drops the
original un-zeroized). The out-of-band builder must wrap each
unwrap_org_key result at the source.