Implement iPhone password search

This commit is contained in:
2026-08-11 21:43:25 +02:00
parent 358ba7d46d
commit a748744425
8 changed files with 397 additions and 10 deletions

View File

@@ -60,6 +60,7 @@ uniffi::setup_scaffolding!();
pub enum MobileTab {
Home,
Passwords,
Search,
Totp,
Preferences,
}
@@ -69,6 +70,7 @@ impl From<StorageTab> for MobileTab {
match tab {
StorageTab::Home => Self::Home,
StorageTab::Passwords => Self::Passwords,
StorageTab::Search => Self::Search,
StorageTab::Totp => Self::Totp,
StorageTab::Preferences => Self::Preferences,
}
@@ -80,6 +82,7 @@ impl From<MobileTab> for StorageTab {
match tab {
MobileTab::Home => Self::Home,
MobileTab::Passwords => Self::Passwords,
MobileTab::Search => Self::Search,
MobileTab::Totp => Self::Totp,
MobileTab::Preferences => Self::Preferences,
}
@@ -1598,6 +1601,13 @@ pub fn mobile_password_page(
.map_err(Into::into)
}
#[uniffi::export]
pub fn mobile_password_search(query: String) -> Result<MobilePasswordPage, MobilePasswordFfiError> {
ironstorage::mobile_passwords::MobilePasswordPage::search(&query)
.map(Into::into)
.map_err(Into::into)
}
#[uniffi::export]
pub fn mobile_authentication() -> Result<Arc<MobileAuthentication>, MobileAuthenticationFfiError> {
Ok(Arc::new(MobileAuthentication {
@@ -1665,7 +1675,7 @@ mod tests {
] {
let shell = super::mobile_shell_fixture(state);
assert_eq!(shell.selected_tab, MobileTab::Home);
assert_eq!(shell.pages.len(), 4);
assert_eq!(shell.pages.len(), 5);
assert!(shell.pages.iter().all(|page| page.state == state));
}
}