From a3ecf0c88b612cc3a34ca73aaf4c1511c0446366 Mon Sep 17 00:00:00 2001
From: ZhenYi <434836402@qq.com>
Date: Thu, 14 May 2026 21:44:55 +0800
Subject: [PATCH] Separate SSH key probe from authentication
---
libs/git/ssh/authz.rs | 22 ++++++++++----
libs/git/ssh/handle.rs | 65 ++++++++++++++++++++++++++++++++++++------
libs/git/ssh/server.rs | 4 ++-
3 files changed, 75 insertions(+), 16 deletions(-)
diff --git a/libs/git/ssh/authz.rs b/libs/git/ssh/authz.rs
index c137ea6..62d28d4 100644
--- a/libs/git/ssh/authz.rs
+++ b/libs/git/ssh/authz.rs
@@ -14,6 +14,12 @@ pub struct SshAuthService {
db: AppDatabase,
}
+pub struct SshKeyUser {
+ pub user: user::Model,
+ pub key_id: i64,
+ pub key_title: String,
+}
+
impl SshAuthService {
pub fn new(db: AppDatabase) -> Self {
Self { db }
@@ -97,7 +103,7 @@ impl SshAuthService {
pub async fn find_user_by_public_key(
&self,
public_key_str: &str,
- ) -> Result