agentswitch 0.6.0

一个通用的 Code Agent 工具配置切换器,支持将任意 OpenAI/Anthropic 协议模型接入到主流 Code Agent CLI 工具中
use agentswitch::sync::crypto::EncryptedValue;
use serde_json;

#[test]
fn test_encrypted_value_serialization() {
    let value = EncryptedValue {
        method: "aes-gcm".to_string(),
        data: "encrypted-data-base64".to_string(),
        nonce: Some("nonce-base64".to_string()),
    };

    let serialized = serde_json::to_string(&value).unwrap();
    assert!(serialized.contains("aes-gcm"));
}

#[test]
fn test_encrypted_value_deserialization() {
    let json = r#"{"method":"aes-gcm","data":"encrypted-data-base64","nonce":"nonce-base64"}"#;
    let value: EncryptedValue = serde_json::from_str(json).unwrap();
    assert_eq!(value.method, "aes-gcm");
}