Fix TUI field visibility and contrast
This commit is contained in:
@@ -160,8 +160,9 @@ pub(crate) mod test_support {
|
||||
use ironstorage::{
|
||||
crypto::{KeyInfo, KeyStore, SecretProvider, SecretProviderError},
|
||||
document::{EntryDocument, EntryDocumentService},
|
||||
repository::{Repository, SecretBytes},
|
||||
repository::{EntryPath, Repository, SecretBytes},
|
||||
};
|
||||
use tempfile::TempDir;
|
||||
|
||||
struct FixtureSecrets;
|
||||
|
||||
@@ -191,6 +192,31 @@ pub(crate) mod test_support {
|
||||
.open(entry, &mut FixtureSecrets)
|
||||
.expect("fixture document")
|
||||
}
|
||||
|
||||
pub(crate) fn fixture_document_from_plaintext(
|
||||
entry: &str,
|
||||
plaintext: &[u8],
|
||||
) -> (TempDir, EntryDocument) {
|
||||
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../../crates/storage/tests/fixtures/compatibility");
|
||||
let store = tempfile::tempdir().expect("temporary fixture store");
|
||||
let repository = Repository::open(store.path()).expect("fixture repository");
|
||||
let keys = KeyStore::load(root.join("keys")).expect("fixture keys");
|
||||
let recipients = keys
|
||||
.resolve_recipients(b"7E5C5241B25F6FFAAD717EBFA132DCB2DC23AE30\n")
|
||||
.expect("fixture recipient");
|
||||
let ciphertext = keys
|
||||
.encrypt(SecretBytes::new(plaintext.to_vec()), &recipients)
|
||||
.expect("fixture encryption");
|
||||
let path = EntryPath::parse(entry).expect("fixture entry path");
|
||||
repository
|
||||
.write_entry(&path, &ciphertext)
|
||||
.expect("fixture entry write");
|
||||
let document = EntryDocumentService::new(&repository, &keys)
|
||||
.open(entry, &mut FixtureSecrets)
|
||||
.expect("fixture document");
|
||||
(store, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user