| 1 | |
| 2 | |
| 3 | use std::future::Future; |
| 4 | |
| 5 | use forge_git::GitService; |
| 6 | |
| 7 | use crate::parse::LfsOperation; |
| 8 | |
| 9 | |
| 10 | pub trait GitBackend: Send + Sync + 'static { |
| 11 | |
| 12 | fn authenticate_key( |
| 13 | &self, |
| 14 | algorithm: &str, |
| 15 | key_blob: &[u8], |
| 16 | ) -> impl Future<Output = Option<String>> + Send; |
| 17 | |
| 18 | |
| 19 | |
| 20 | fn prepare( |
| 21 | &self, |
| 22 | user_id: &str, |
| 23 | service: GitService, |
| 24 | repo_path: &str, |
| 25 | git_protocol: Option<&str>, |
| 26 | ) -> impl Future<Output = Result<tokio::process::Command, String>> + Send; |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | fn lfs_authenticate( |
| 32 | &self, |
| 33 | user_id: &str, |
| 34 | repo_path: &str, |
| 35 | operation: LfsOperation, |
| 36 | ) -> impl Future<Output = Result<String, String>> + Send; |
| 37 | } |