pub struct AuthHandler<'a> { /* private fields */ }
Implementations§
source§impl<'a> AuthHandler<'a>
impl<'a> AuthHandler<'a>
pub fn verify_setup() -> bool
pub fn new(storage: &'a DataStorage, req: &'a HttpRequest) -> Self
pub async fn validate_email_user( &mut self, username: &String, password: &String, ) -> Result<Option<bool>, String>
pub async fn validate_anon_user( &mut self, id_token: &String, ) -> Result<Option<bool>, UnauthorizedError>
pub async fn create_email_user( &mut self, username: &Username, password: &String, role: UserRole, ) -> Result<(), String>
pub async fn create_anonymous_user( &mut self, token: &String, role: UserRole, ) -> Result<(), String>
pub async fn create_github_user( &mut self, username: &Username, token: &str, role: UserRole, ) -> Result<(), String>
pub fn generate_token(&self) -> Result<UserPostSetAuthResponse, String>
pub fn verify_user(&self, player_id: &PlayerId) -> Result<(), UnauthorizedError>
pub fn get_user_from_token(&self) -> Result<String, UnauthorizedError>
pub fn verify_user_token(&self, player_id: &PlayerId, token: &String) -> bool
pub fn verify_admin(&self) -> Result<(), UnauthorizedError>
pub fn verify_admin_token(&self, token: &String) -> bool
pub async fn get_auth_info_summary( &self, ) -> Result<AuthInfoSummary, AuthInfoSummaryError>
Auto Trait Implementations§
impl<'a> Freeze for AuthHandler<'a>
impl<'a> !RefUnwindSafe for AuthHandler<'a>
impl<'a> !Send for AuthHandler<'a>
impl<'a> !Sync for AuthHandler<'a>
impl<'a> Unpin for AuthHandler<'a>
impl<'a> !UnwindSafe for AuthHandler<'a>
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