feat(keyring): 集成系统密钥环安全存储 API key

This commit is contained in:
2026-03-12 17:42:41 +08:00
parent c66d782eab
commit da85fc94b1
17 changed files with 990 additions and 1024 deletions

7
test-keyring/Cargo.toml Normal file
View File

@@ -0,0 +1,7 @@
[package]
name = "test-keyring"
version = "0.1.0"
edition = "2024"
[dependencies]
keyring = "3"

18
test-keyring/src/main.rs Normal file
View File

@@ -0,0 +1,18 @@
use keyring::Entry;
fn main() {
println!("Testing keyring functionality...");
// Test storing password
let entry = Entry::new("test-service", "test-user").unwrap();
println!("Created entry successfully");
entry.set_password("test-password").unwrap();
println!("Stored password successfully");
// Test retrieving password
let retrieved = entry.get_password().unwrap();
println!("Retrieved password: {}", retrieved);
println!("Keyring test completed successfully!");
}