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): register check_identity_status Tauri IPC command

Adds Tauri IPC command that wires PlcMonitor to the frontend:
- Takes AppState with configured PdsClient
- Creates PlcMonitor with PdsClient reference
- Calls check_all() to monitor all managed identities
- Returns list of IdentityStatus with unauthorized changes
- Serializes errors as { code, message } for frontend error handling

Uses lifetime generics to hold PdsClient reference since reqwest::Client
does not implement Clone.

+17 -6
+1
apps/identity-wallet/src-tauri/src/lib.rs
··· 813 813 claim::request_claim_verification, 814 814 claim::sign_and_verify_claim, 815 815 claim::submit_claim, 816 + plc_monitor::check_identity_status, 816 817 ]) 817 818 .run(tauri::generate_context!()) 818 819 .expect("error while running tauri application");
+16 -6
apps/identity-wallet/src-tauri/src/plc_monitor.rs
··· 40 40 ParseError { message: String }, 41 41 } 42 42 43 - pub struct PlcMonitor { 44 - pds_client: PdsClient, 43 + pub struct PlcMonitor<'a> { 44 + pds_client: &'a PdsClient, 45 45 } 46 46 47 - impl PlcMonitor { 48 - pub fn new(pds_client: PdsClient) -> Self { 47 + impl<'a> PlcMonitor<'a> { 48 + pub fn new(pds_client: &'a PdsClient) -> Self { 49 49 Self { pds_client } 50 50 } 51 51 ··· 187 187 None 188 188 } 189 189 190 + /// Tauri IPC command: check all managed identities for unauthorized PLC operations. 191 + /// Returns a list of IdentityStatus, one per managed DID. 192 + #[tauri::command] 193 + pub async fn check_identity_status( 194 + state: tauri::State<'_, crate::oauth::AppState>, 195 + ) -> Result<Vec<IdentityStatus>, MonitorError> { 196 + let monitor = PlcMonitor::new(state.pds_client()); 197 + monitor.check_all().await 198 + } 199 + 190 200 #[cfg(test)] 191 201 mod tests { 192 202 use super::*; ··· 259 269 assert_eq!(json["unauthorizedChanges"].as_array().unwrap().len(), 1); 260 270 } 261 271 262 - /// Test PlcMonitor can be created with a PdsClient. 272 + /// Test PlcMonitor can be created with a PdsClient reference. 263 273 #[test] 264 274 fn test_plc_monitor_creation() { 265 275 let pds_client = PdsClient::new(); 266 - let monitor = PlcMonitor::new(pds_client); 276 + let monitor = PlcMonitor::new(&pds_client); 267 277 // Just verify it constructs without panic 268 278 assert!(true); 269 279 }