v0.2.5-pre.003
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-wallet-lib/tests/dependency_boundary.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Wallet-specific dependency and ownership canaries.
|
||||
|
||||
@@ -40,6 +40,9 @@ fn wallet_manifest_preserves_dependency_firewall() -> std::io::Result<()> {
|
||||
};
|
||||
assert!(manifest.contains("ksp-core-lib"));
|
||||
assert!(manifest.contains("ksp-logging-lib"));
|
||||
assert!(manifest.contains("base64.workspace = true"));
|
||||
assert!(manifest.contains("serde = { workspace = true, features = [\"derive\"] }"));
|
||||
assert!(manifest.contains("serde_json.workspace = true"));
|
||||
assert!(manifest.contains("zeroize.workspace = true"));
|
||||
for forbidden in [
|
||||
"ksp-config-lib",
|
||||
|
||||
67
crates/ksp-wallet-lib/tests/fixtures/kspwallet_v1_wire_only.json
vendored
Normal file
67
crates/ksp-wallet-lib/tests/fixtures/kspwallet_v1_wire_only.json
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"magic": "KSPWALLET",
|
||||
"format_version": 1,
|
||||
"owner_auth_public_key": "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8",
|
||||
"view_descriptor": {
|
||||
"enabled": true,
|
||||
"slot_id": "ICEiIyQlJicoKSorLC0uLw"
|
||||
},
|
||||
"key_slots": [
|
||||
{
|
||||
"slot_id": "EBESExQVFhcYGRobHB0eHw",
|
||||
"role": "owner",
|
||||
"kdf": {
|
||||
"algorithm": "argon2id",
|
||||
"version": 19,
|
||||
"memory_kib": 65536,
|
||||
"iterations": 3,
|
||||
"parallelism": 1,
|
||||
"salt": "MDEyMzQ1Njc4OTo7PD0-Pw"
|
||||
},
|
||||
"wrap": {
|
||||
"algorithm": "xchacha20-poly1305",
|
||||
"nonce": "UFFSU1RVVldYWVpbXF1eX2BhYmNkZWZn",
|
||||
"ciphertext": "gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnp8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"slot_id": "ICEiIyQlJicoKSorLC0uLw",
|
||||
"role": "view",
|
||||
"kdf": {
|
||||
"algorithm": "argon2id",
|
||||
"version": 19,
|
||||
"memory_kib": 32768,
|
||||
"iterations": 4,
|
||||
"parallelism": 1,
|
||||
"salt": "QEFCQ0RFRkdISUpLTE1OTw"
|
||||
},
|
||||
"wrap": {
|
||||
"algorithm": "xchacha20-poly1305",
|
||||
"nonce": "aGlqa2xtbm9wcXJzdHV2d3h5ent8fX5_",
|
||||
"ciphertext": "oKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr8"
|
||||
}
|
||||
}
|
||||
],
|
||||
"owner_control": {
|
||||
"control_version": 1,
|
||||
"algorithm": "xchacha20-poly1305",
|
||||
"nonce": "kJGSk5SVlpeYmZqbnJ2en6ChoqOkpaan",
|
||||
"ciphertext": "wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v"
|
||||
},
|
||||
"metadata": {
|
||||
"metadata_version": 1,
|
||||
"algorithm": "xchacha20-poly1305",
|
||||
"nonce": "qKmqq6ytrq-wsbKztLW2t7i5uru8vb6_",
|
||||
"ciphertext": "EBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4_"
|
||||
},
|
||||
"secret": {
|
||||
"secret_version": 1,
|
||||
"algorithm": "xchacha20-poly1305",
|
||||
"nonce": "wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX",
|
||||
"ciphertext": "QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1-f4CBgoOEhYaHiImKi4yNjo8"
|
||||
},
|
||||
"state_signature": {
|
||||
"algorithm": "ed25519",
|
||||
"signature": "2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_wABAgMEBQYHCAkKCwwNDg8QERITFBUWFw"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-wallet-lib/tests/public_api.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
//! Public API canaries for the Wallet foundation.
|
||||
|
||||
@@ -59,3 +59,20 @@ fn wallet_error_codes_are_available_from_crate_root() {
|
||||
assert_eq!(code.domain(), "wallet");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn strict_v1_envelope_and_transcript_are_available_from_crate_root() -> ksp_core_lib::Result<()> {
|
||||
let source = include_bytes!("fixtures/kspwallet_v1_wire_only.json");
|
||||
let envelope = match ksp_wallet_lib::KspWalletEnvelopeV1::parse_json(source) {
|
||||
std::result::Result::Ok(envelope) => envelope,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
assert_eq!(envelope.format_version(), ksp_wallet_lib::KSPWALLET_FORMAT_VERSION_V1);
|
||||
assert_eq!(envelope.owner_slot().role(), ksp_wallet_lib::WalletKeySlotRoleV1::Owner);
|
||||
assert!(envelope.view_descriptor().enabled());
|
||||
assert!(!envelope.state_transcript().is_empty());
|
||||
assert!(!envelope.owner_slot_aad().is_empty());
|
||||
assert!(envelope.view_slot_aad().is_some());
|
||||
assert!(!envelope.compartment_aad(ksp_wallet_lib::WalletCompartmentKindV1::Metadata).is_empty());
|
||||
return std::result::Result::Ok(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user