feat: add image fetching

This commit is contained in:
2026-03-20 19:48:18 +01:00
parent fb62111c7f
commit 12388a9908
17 changed files with 2122 additions and 92 deletions

View File

@@ -6,16 +6,15 @@ use pamsock::prot::ServerResponse;
use super::AuthenticateResponse;
#[allow(clippy::from_over_into)]
impl Into<AuthenticateResponse<&'static str>> for ServerResponse {
fn into(self) -> AuthenticateResponse<&'static str> {
use AuthenticateResponse as AR;
impl From<ServerResponse> for AuthenticateResponse<&'static str> {
fn from(value: ServerResponse) -> Self {
use ServerResponse as SR;
match self {
Self::ServerError => AR::Failed("unknown server error"),
Self::Locked => AR::Failed("account locked, too many login attempts"),
Self::Failed => AR::Failed("wrong credentials"),
Self::Succeeded => AR::Success,
match value {
SR::ServerError => Self::Failed("unknown server error"),
SR::Locked => Self::Failed("account locked, too many login attempts"),
SR::Failed => Self::Failed("wrong credentials"),
SR::Succeeded => Self::Success,
}
}
}