Implement the authenticated structured entry viewer
This commit is contained in:
@@ -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(())
|
||||
|
||||
Reference in New Issue
Block a user