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.

feat(identity-wallet): add get_stored_did_doc and get_device_key_id Tauri commands and IPC wrappers

- Adds get_stored_did_doc Rust command that retrieves the stored DID document
for a claimed identity and returns it as parsed JSON
- Adds get_device_key_id Rust command that retrieves the device key's did:key URI
for a claimed identity
- Registers both commands in tauri::generate_handler\![]
- Adds TypeScript wrappers in ipc.ts for both commands
- These commands support multi-identity display in IdentityListHome component
by providing DID document data and device key ID for rotation key status badges

authored by

Malpercio and committed by
Tangled
68f26230 8fb03dfc

+43
+37
apps/identity-wallet/src-tauri/src/lib.rs
··· 672 672 identity_store::IdentityStore.list_identities() 673 673 } 674 674 675 + /// Retrieve the stored DID document for a claimed identity. 676 + /// 677 + /// Returns the DID document as parsed JSON, or None if the DID is not registered or 678 + /// the document has not been stored yet. 679 + /// 680 + /// The frontend uses this to extract identity information (handle, PDS URL) for 681 + /// multi-identity card display in IdentityListHome. 682 + #[tauri::command] 683 + fn get_stored_did_doc(did: String) -> Result<Option<serde_json::Value>, identity_store::IdentityStoreError> { 684 + let store = identity_store::IdentityStore; 685 + match store.get_did_doc(&did)? { 686 + Some(json_str) => { 687 + let value: serde_json::Value = serde_json::from_str(&json_str) 688 + .map_err(|e| identity_store::IdentityStoreError::SerializationError { 689 + message: e.to_string(), 690 + })?; 691 + Ok(Some(value)) 692 + } 693 + None => Ok(None), 694 + } 695 + } 696 + 697 + /// Retrieve the device key ID (did:key URI) for a claimed identity. 698 + /// 699 + /// Returns the device key's did:key URI, which can be compared against rotation keys 700 + /// in the DID document to determine if the device key is the primary rotation key. 701 + /// 702 + /// The frontend uses this in IdentityListHome to show rotation key status badges. 703 + #[tauri::command] 704 + fn get_device_key_id(did: String) -> Result<String, identity_store::IdentityStoreError> { 705 + let store = identity_store::IdentityStore; 706 + let device_key = store.get_or_create_device_key(&did)?; 707 + Ok(device_key.key_id) 708 + } 709 + 675 710 /// Check whether the relay can resolve `handle` to `expected_did` via the ATProto 676 711 /// `resolveHandle` endpoint. 677 712 /// ··· 762 797 register_handle, 763 798 check_handle_resolution, 764 799 list_identities, 800 + get_stored_did_doc, 801 + get_device_key_id, 765 802 get_relay_url, 766 803 save_relay_url, 767 804 home::load_home_data,
+6
apps/identity-wallet/src/lib/ipc.ts
··· 480 480 481 481 export const listIdentities = (): Promise<string[]> => 482 482 invoke('list_identities'); 483 + 484 + export const getStoredDidDoc = (did: string): Promise<Record<string, unknown> | null> => 485 + invoke('get_stored_did_doc', { did }); 486 + 487 + export const getDeviceKeyId = (did: string): Promise<string> => 488 + invoke('get_device_key_id', { did });