Present desktop OTP and sensitive outputs
This commit is contained in:
@@ -148,6 +148,36 @@ fn complex_documents_round_trip_with_storage_owned_metadata() -> TestResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pass_otp_only_entries_keep_typed_metadata_in_the_first_line() -> TestResult {
|
||||
let fixture = FixtureSet::load()?;
|
||||
let store = fixture.materialize_store("basic")?;
|
||||
let repository = Repository::open(store.path())?;
|
||||
let keys = KeyStore::load(fixture.path("keys"))?;
|
||||
let mut secrets = FixtureSecrets::all(&fixture);
|
||||
write_plaintext(
|
||||
&repository,
|
||||
&keys,
|
||||
"documents/otp-only",
|
||||
b"otpauth://totp/Example:alice?secret=JBSWY3DPEHPK3PXP&issuer=Example\n",
|
||||
)?;
|
||||
let document =
|
||||
EntryDocumentService::new(&repository, &keys).open("documents/otp-only", &mut secrets)?;
|
||||
assert_eq!(document.fields().len(), 1);
|
||||
assert_eq!(
|
||||
document.fields()[0].metadata().kind(),
|
||||
EntryFieldKind::OtpUri
|
||||
);
|
||||
assert_eq!(
|
||||
document.fields()[0]
|
||||
.metadata()
|
||||
.otp()
|
||||
.and_then(|otp| otp.issuer()),
|
||||
Some("Example")
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn field_ids_survive_updates_removal_and_reordering() -> TestResult {
|
||||
let fixture = FixtureSet::load()?;
|
||||
|
||||
Reference in New Issue
Block a user