An easy-to-host PDS on the ATProtocol, iPhone and MacOS. Maintain control of your keys and data, always.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(identity-wallet): fix test fixtures for sign_and_verify_claim success and warnings tests

Use empty rotation_keys in did_doc for success and warnings tests since
the operation adds device_key as a new rotation key. Having signing_key
in old rotation_keys caused a correct "key removed" verification failure.

authored by

Malpercio and committed by
Tangled
9315dce4 0d140b9c

+13 -10
+13 -10
apps/identity-wallet/src-tauri/src/claim.rs
··· 695 695 // OAuthError::NotAuthenticated, which becomes NetworkError("sign_plc_operation failed: Not authenticated") 696 696 if let crate::pds_client::PdsClientError::NetworkError { message } = &e { 697 697 let lower_msg = message.to_lowercase(); 698 - if lower_msg.contains("invalidtoken") || lower_msg.contains("expiredtoken") || lower_msg.contains("not authenticated") { 698 + if lower_msg.contains("invalidtoken") 699 + || lower_msg.contains("expiredtoken") 700 + || lower_msg.contains("not authenticated") 701 + { 699 702 return ClaimError::InvalidToken; 700 703 } 701 704 } ··· 1586 1589 }, 1587 1590 ); 1588 1591 1589 - let (rotation_json, signing_key) = build_test_rotation_op( 1592 + let (rotation_json, _signing_key) = build_test_rotation_op( 1590 1593 &device_key, 1591 1594 vec![device_key.clone()], 1592 1595 services.clone(), ··· 1657 1660 mock_server.base_url(), 1658 1661 ); 1659 1662 1663 + // rotation_keys is empty: this DID has no prior rotation keys, 1664 + // so adding device_key at [0] is purely an addition (no removals to flag). 1660 1665 let did_doc = PlcDidDocument { 1661 1666 did: "did:plc:test".to_string(), 1662 1667 also_known_as: vec!["at://alice.example.com".to_string()], 1663 - rotation_keys: vec![signing_key.clone()], 1668 + rotation_keys: vec![], 1664 1669 verification_methods: serde_json::json!({}), 1665 1670 services: HashMap::new(), 1666 1671 }; ··· 1675 1680 ) 1676 1681 .await; 1677 1682 1678 - assert!( 1679 - result.is_ok(), 1680 - "expected Ok, got: {:?}", 1681 - result.err() 1682 - ); 1683 + assert!(result.is_ok(), "expected Ok, got: {:?}", result.err()); 1683 1684 let (verified_op, _signed_op_json) = result.unwrap(); 1684 1685 assert!( 1685 1686 verified_op.diff.added_keys.contains(&device_key), ··· 2145 2146 }, 2146 2147 ); 2147 2148 2148 - let (rotation_json, signing_key) = 2149 + let (rotation_json, _signing_key) = 2149 2150 build_test_rotation_op(&device_key, vec![device_key.clone()], services, &prev_cid); 2150 2151 2151 2152 mock_server.mock(|when, then| { ··· 2212 2213 }, 2213 2214 ); 2214 2215 2216 + // rotation_keys is empty: no prior rotation keys, 2217 + // so adding device_key at [0] is purely an addition (no removals to flag). 2215 2218 let did_doc = PlcDidDocument { 2216 2219 did: "did:plc:test".to_string(), 2217 2220 also_known_as: vec!["at://alice.example.com".to_string()], 2218 - rotation_keys: vec![signing_key.clone()], 2221 + rotation_keys: vec![], 2219 2222 verification_methods: serde_json::json!({}), 2220 2223 services: original_services, 2221 2224 };