sync_auth/providers/
qwen_coder.rs1use crate::{AuthProvider, CredentialFile, ValidationResult};
4use std::path::PathBuf;
5
6#[derive(Debug, Clone, Default)]
11pub struct QwenCoderProvider;
12
13#[async_trait::async_trait]
14impl AuthProvider for QwenCoderProvider {
15 fn name(&self) -> &str {
16 "qwen-coder"
17 }
18
19 fn display_name(&self) -> &str {
20 "Qwen Code"
21 }
22
23 fn credential_files(&self) -> Vec<CredentialFile> {
24 let home = dirs::home_dir().unwrap_or_else(|| PathBuf::from("~"));
25 vec![CredentialFile {
26 relative_path: "qwen-coder/dot-qwen".to_string(),
27 local_path: home.join(".qwen"),
28 is_dir: true,
29 }]
30 }
31
32 async fn validate(&self) -> ValidationResult {
33 let home = dirs::home_dir().unwrap_or_else(|| PathBuf::from("~"));
34 let qwen_dir = home.join(".qwen");
35 if qwen_dir.join("oauth_creds.json").exists() || qwen_dir.join("settings.json").exists() {
36 ValidationResult::Valid
37 } else {
38 ValidationResult::Missing
39 }
40 }
41}