Basic implementation of websocket

This commit is contained in:
2025-11-20 16:06:00 +01:00
parent 0d8905d842
commit a1b22699e9
7 changed files with 240 additions and 2 deletions

View File

@@ -28,6 +28,16 @@ pub enum AuthenticatedMethod {
Token(APIToken),
}
impl AuthenticatedMethod {
pub fn light_str(&self) -> String {
match self {
AuthenticatedMethod::Cookie => "Cookie".to_string(),
AuthenticatedMethod::Dev => "DevAuthentication".to_string(),
AuthenticatedMethod::Token(t) => format!("Token({:?} - {})", t.id, t.base.name),
}
}
}
pub struct AuthExtractor {
pub user: User,
pub method: AuthenticatedMethod,