Implement the authenticated structured entry viewer

This commit is contained in:
Hermes Agent
2026-08-10 06:45:39 +00:00
parent 57a79b7d21
commit cf7a6216ac
8 changed files with 758 additions and 28 deletions

View File

@@ -117,6 +117,19 @@ fn complex_documents_round_trip_with_storage_owned_metadata() -> TestResult {
document.fields()[4].metadata().sensitivity(),
EntrySensitivity::Sensitive
);
let otp = document.fields()[4]
.metadata()
.otp()
.expect("validated OTP metadata");
assert_eq!(otp.kind(), ironstorage::otp::OtpKind::Totp);
assert_eq!(otp.issuer(), Some("Example"));
assert_eq!(otp.account(), "alice");
assert_eq!(otp.algorithm(), ironstorage::otp::OtpAlgorithm::Sha1);
assert_eq!(otp.digits(), 6);
assert_eq!(otp.period(), Some(30));
assert_eq!(otp.counter(), None);
let copied = document.copy_field_value(document.fields()[2].id())?;
assert_eq!(copied.expose(), b"one");
assert!(!format!("{document:?}").contains("pässwörd"));
assert!(!format!("{:?}", document.fields()[4]).contains("JBSWY3DPEHPK3PXP"));
Ok(())