Implement Android TOTP cached discovery and search (#110)
Android ARM verification / rust (push) Failing after 49m58s
Android ARM verification / android (push) Failing after 8s
Dependency security audit / rustsec (push) Failing after 22s

This commit is contained in:
hugo committed 2026-10-12 20:38:33 +02:00
1 parent 0c8366d34f
commit f4a6edbc68
18 files changed
+1070 -165

No files matched your search

+50 -9
View File
@@ -1271,6 +1271,25 @@ pub struct MobileTotpDiscoveryProgress {
pub unavailable: u32,
}
impl From<ironstorage::mobile_totp::MobileTotpDiscoveryProgress> for MobileTotpDiscoveryProgress {
fn from(progress: ironstorage::mobile_totp::MobileTotpDiscoveryProgress) -> Self {
Self {
phase: progress.phase().into(),
total: progress.total(),
inspected: progress.inspected(),
cache_hits: progress.cache_hits(),
matches: progress.matches(),
unavailable: progress.unavailable(),
}
}
}
#[derive(Clone, uniffi::Record)]
pub struct MobileTotpRefreshResult {
pub progress: MobileTotpDiscoveryProgress,
pub cache_notice: Option<String>,
}
#[derive(uniffi::Object)]
pub struct MobileTotpOperation {
operation: StorageTotpOperation,
@@ -1279,15 +1298,7 @@ pub struct MobileTotpOperation {
#[uniffi::export]
impl MobileTotpOperation {
pub fn progress(&self) -> MobileTotpDiscoveryProgress {
let progress = self.operation.progress();
MobileTotpDiscoveryProgress {
phase: progress.phase().into(),
total: progress.total(),
inspected: progress.inspected(),
cache_hits: progress.cache_hits(),
matches: progress.matches(),
unavailable: progress.unavailable(),
}
self.operation.progress().into()
}
pub fn cancel(&self) {
@@ -2369,6 +2380,36 @@ impl MobileAuthentication {
.map_err(Into::into)
}
pub fn search_cached_totp_navigation(
&self,
query: String,
operation: Arc<MobileTotpOperation>,
) -> Result<Option<Vec<password_navigation::MobileNavigationRow>>, MobileAuthenticationFfiError>
{
self.authentication
.search_cached_totp_navigation(&query, &operation.operation)
.map(|rows| rows.map(|rows| rows.into_iter().map(Into::into).collect()))
.map_err(Into::into)
}
pub fn refresh_totp_catalog(
&self,
operation: Arc<MobileTotpOperation>,
passphrase: Option<String>,
) -> Result<MobileTotpRefreshResult, MobileAuthenticationFfiError> {
self.authentication
.refresh_totp_catalog(
&operation.operation,
passphrase
.map(|value| ironstorage::repository::SecretBytes::new(value.into_bytes())),
)
.map(|result| MobileTotpRefreshResult {
progress: result.progress.into(),
cache_notice: result.cache_notice,
})
.map_err(Into::into)
}
pub fn totp_detail(
&self,
path: String,