Implement Rust-owned adaptive Android password navigation (#96)
This commit is contained in:
1 parent
36e5f55283
commit
8c9341f214
26 files changed
+1553
-16
No files matched your search
@@ -737,6 +737,50 @@ impl MobileAuthentication {
|
||||
.map_err(MobileAuthenticationError::authentication)
|
||||
}
|
||||
|
||||
/// Open only the entry selected from a still-current navigation page.
|
||||
pub fn navigation_entry(
|
||||
&self,
|
||||
directory: &str,
|
||||
row_id: &str,
|
||||
revision: &str,
|
||||
passphrase: Option<SecretBytes>,
|
||||
unix_seconds: u64,
|
||||
) -> Result<MobileEntryPresentation, MobileAuthenticationError> {
|
||||
let validate = || {
|
||||
let page = crate::mobile_passwords::navigation::navigate_repository(
|
||||
&self.repository,
|
||||
directory,
|
||||
Some(row_id),
|
||||
Some(revision),
|
||||
false,
|
||||
)
|
||||
.map_err(|_| {
|
||||
entry_detail(
|
||||
"Selection Is Unavailable",
|
||||
"Refresh the folder and select the entry again.",
|
||||
)
|
||||
})?;
|
||||
page.selected
|
||||
.filter(|row| {
|
||||
row.row.kind() == crate::mobile_passwords::MobilePasswordRowKind::Entry
|
||||
})
|
||||
.ok_or_else(|| {
|
||||
entry_detail(
|
||||
"Selection Changed",
|
||||
"Refresh the folder and select the entry again.",
|
||||
)
|
||||
})
|
||||
};
|
||||
let selected = validate()?;
|
||||
self.unlock_entry(selected.row.path(), passphrase)?;
|
||||
let presentation = self.entry_page(selected.row.path(), unix_seconds)?;
|
||||
if let Err(error) = validate() {
|
||||
self.manual_lock()?;
|
||||
return Err(error);
|
||||
}
|
||||
Ok(presentation)
|
||||
}
|
||||
|
||||
pub fn entry_page(
|
||||
&self,
|
||||
path: &str,
|
||||
|
||||
Reference in new issue
Block a user