Wave 2.2: 流式安装输出、软件内授权四模式、本机环境一键装与总览缓存
EOF Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -91,3 +91,26 @@ impl SecretStore for KeyringSecretStore {
|
||||
platform::delete(service, account)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
/// 真机密钥库往返(Windows Credential Manager):写假 key → 读回一致 → 删除清理。
|
||||
/// 运行:cargo test -p agentdock-secrets real_machine_keyring_roundtrip -- --ignored --nocapture
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn real_machine_keyring_roundtrip() {
|
||||
let store = KeyringSecretStore::new();
|
||||
let service = "agentdock.selftest";
|
||||
let account = "api_key";
|
||||
let fake = "sk-test-selftest-only";
|
||||
|
||||
store.set(service, account, fake).expect("写 Credential Manager 应成功");
|
||||
assert!(store.has(service, account), "写后应可读到");
|
||||
assert_eq!(store.get(service, account).unwrap(), fake, "读回应一致");
|
||||
store.delete(service, account).expect("删除应成功");
|
||||
assert!(!store.has(service, account), "删除后应不存在");
|
||||
println!("真机密钥库往返通过(Windows Credential Manager,假 key 已清理)");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user