pub struct TelegramAuth { /* private fields */ }Expand description
Coordinates one-time Telegram login challenges and opaque browser sessions.
Sessions are intentionally process-local in this first implementation. A server restart invalidates browser sessions but does not affect stored conversations.
Implementations§
Source§impl TelegramAuth
impl TelegramAuth
pub fn new(bot_username: Option<String>, cookie_secure: bool) -> Self
Sourcepub fn complete_login(
&self,
token: &str,
telegram_user_id: i64,
first_name: Option<&str>,
identities: &dyn UserIdentityStore,
) -> bool
pub fn complete_login( &self, token: &str, telegram_user_id: i64, first_name: Option<&str>, identities: &dyn UserIdentityStore, ) -> bool
Completes a pending login using the Telegram numeric user ID received from the Bot API update, never a value supplied by the browser.
pub fn register_run(&self, run_id: impl Into<String>, owner: &str)
pub fn owns_run(&self, run_id: &str, owner: &str) -> bool
pub fn runs_for_owner(&self, owner: &str) -> Vec<String>
pub fn owner_for_request(&self, request: &HttpRequest) -> Option<String>
Auto Trait Implementations§
impl !Freeze for TelegramAuth
impl RefUnwindSafe for TelegramAuth
impl Send for TelegramAuth
impl Sync for TelegramAuth
impl Unpin for TelegramAuth
impl UnsafeUnpin for TelegramAuth
impl UnwindSafe for TelegramAuth
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