pub struct NetworkOrgKeyDirectory { /* private fields */ }Expand description
An OrgKeyDirectory backed by a remote OrgKeyTransport, bound to one
scope (e.g. "org:<id>"). The org-key analogue of NetworkRelay: it
adapts the scope-keyed wire trait into the single-directory local trait so a
client speaks the same OrgKeyDirectory API whether it is fs-backed or
transport-backed. TransportError maps via [transport_err]: an authz
refusal is preserved as OrgKeyDirectoryError::Unauthorized (a security
“no”, not a retry), everything else funnels into Io — the org-key analogue
of how NetworkRelay preserves FrontierTruncated and funnels the rest.
Implementations§
Trait Implementations§
Source§impl OrgKeyDirectory for NetworkOrgKeyDirectory
impl OrgKeyDirectory for NetworkOrgKeyDirectory
Source§fn publish_wrapped(
&mut self,
wrapped: &WrappedOrgKey,
) -> Result<(), OrgKeyDirectoryError>
fn publish_wrapped( &mut self, wrapped: &WrappedOrgKey, ) -> Result<(), OrgKeyDirectoryError>
Publish (or replace) the wrap for
(wrapped.epoch, wrapped.recipient).
Last-write-wins — re-publishing a fresh wrap of the same K_org
(a new ephemeral each time) for a recipient is expected and benign.Source§fn fetch_wrapped(
&self,
epoch: u64,
recipient_user_id: &str,
) -> Result<Option<WrappedOrgKey>, OrgKeyDirectoryError>
fn fetch_wrapped( &self, epoch: u64, recipient_user_id: &str, ) -> Result<Option<WrappedOrgKey>, OrgKeyDirectoryError>
Fetch the wrap addressed to
recipient_user_id at exactly epoch, if
one has been published. Reads are pure (&self) — unlike
crate::relay::Relay, this type has no per-call roster/checkpoint
reconciliation, so a fetch never rewrites state (the fs reference takes a
shared lock and returns; no fsync-on-read).Source§fn fetch_wrapped_for(
&self,
recipient_user_id: &str,
) -> Result<Vec<WrappedOrgKey>, OrgKeyDirectoryError>
fn fetch_wrapped_for( &self, recipient_user_id: &str, ) -> Result<Vec<WrappedOrgKey>, OrgKeyDirectoryError>
Every wrap addressed to
recipient_user_id, newest epoch first — the
client picks the highest epoch it can crate::crypto::unwrap_org_key.Source§fn publish_pubkey(
&mut self,
account_id: &str,
public_hex: &str,
) -> Result<(), OrgKeyDirectoryError>
fn publish_pubkey( &mut self, account_id: &str, public_hex: &str, ) -> Result<(), OrgKeyDirectoryError>
Publish (or replace)
account_id’s X25519 public key.Source§fn fetch_pubkeys(&self) -> Result<Vec<MemberPublicKey>, OrgKeyDirectoryError>
fn fetch_pubkeys(&self) -> Result<Vec<MemberPublicKey>, OrgKeyDirectoryError>
Every member public key in this directory, ordered by
account_id.Auto Trait Implementations§
impl !RefUnwindSafe for NetworkOrgKeyDirectory
impl !UnwindSafe for NetworkOrgKeyDirectory
impl Freeze for NetworkOrgKeyDirectory
impl Send for NetworkOrgKeyDirectory
impl Sync for NetworkOrgKeyDirectory
impl Unpin for NetworkOrgKeyDirectory
impl UnsafeUnpin for NetworkOrgKeyDirectory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more