pub struct Directory { /* private fields */ }Expand description
Durable identity authorization and user/group root mappings.
Implementations§
Source§impl Directory
impl Directory
Sourcepub fn open(path: &Path, bootstrap_handle: &str) -> Result<Self>
pub fn open(path: &Path, bootstrap_handle: &str) -> Result<Self>
Open the directory and ensure the normalized bootstrap handle exists.
Sourcepub fn provisioning_users(&self) -> Result<Vec<User>>
pub fn provisioning_users(&self) -> Result<Vec<User>>
List preauthorized handles whose Kweb root assignment is incomplete.
Sourcepub fn provisioning_groups(&self) -> Result<Vec<Group>>
pub fn provisioning_groups(&self) -> Result<Vec<Group>>
List observed groups whose Kweb root assignment is incomplete.
Sourcepub fn user(&self, telegram_user_id: i64) -> Result<User>
pub fn user(&self, telegram_user_id: i64) -> Result<User>
Look up one bound identity by stable numeric Telegram ID.
Sourcepub fn group(&self, group_id: &str) -> Result<Group>
pub fn group(&self, group_id: &str) -> Result<Group>
Look up one previously observed opaque Telegram group.
Sourcepub fn group_for_root(&self, root_node_id: NodeId) -> Result<Group>
pub fn group_for_root(&self, root_node_id: NodeId) -> Result<Group>
Look up one ready Telegram group by its canonical Kweb root.
Explicitly authorize one stable numeric Telegram ID for a preauthorized handle.
Sourcepub fn complete_handle_root(
&self,
handle: &str,
root_node_id: NodeId,
) -> Result<User>
pub fn complete_handle_root( &self, handle: &str, root_node_id: NodeId, ) -> Result<User>
Complete the root assignment for a preauthorized handle.
Trait Implementations§
Source§impl IdentitySink for Directory
impl IdentitySink for Directory
fn observe_identity(&self, observation: &IdentityObservation) -> Result<()>
fn whitelist(&self) -> Result<WhitelistSnapshot>
fn request_add_user( &self, requested_by_telegram_user_id: i64, handle: &str, ) -> Result<AddUserOutcome>
fn observe_group(&self, group_id: &str) -> Result<()>
Auto Trait Implementations§
impl !Freeze for Directory
impl RefUnwindSafe for Directory
impl Send for Directory
impl Sync for Directory
impl Unpin for Directory
impl UnsafeUnpin for Directory
impl UnwindSafe for Directory
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more