#![cfg_attr(docsrs, feature(doc_cfg))]
#![deny(
missing_docs,
warnings,
unused_import_braces,
unused_qualifications,
trivial_casts,
trivial_numeric_casts
)]
pub mod error;
mod keyring;
#[cfg(feature = "encrypted-vfs")]
#[cfg_attr(docsrs, doc(cfg(feature = "encrypted-vfs")))]
pub use keyring::encrypted_vfs;
#[cfg(any(
feature = "file",
feature = "encrypted-vfs",
feature = "memory",
feature = "turso",
feature = "turso-encrypted-io"
))]
#[cfg_attr(
docsrs,
doc(cfg(any(
feature = "file",
feature = "encrypted-vfs",
feature = "turso",
feature = "turso-encrypted-io"
)))
)]
pub use keyring::file_common;
#[cfg(feature = "memory")]
#[cfg_attr(docsrs, doc(cfg(feature = "memory")))]
#[cfg(feature = "indexeddb")]
pub use keyring::indexeddb;
#[cfg(any(
feature = "yubihsm-usb",
feature = "yubihsm-http",
feature = "nitrokey"
))]
#[cfg_attr(
docsrs,
doc(cfg(any(
feature = "yubihsm-usb",
feature = "yubihsm-http",
feature = "nitrokey"
)))
)]
pub use keyring::kms;
#[cfg(all(target_os = "linux", feature = "linux-secret-service"))]
#[cfg_attr(
docsrs,
doc(cfg(all(target_os = "linux", feature = "linux-secret-service")))
)]
pub use keyring::linux;
#[cfg(all(target_os = "macos", feature = "macos-keychain"))]
#[cfg_attr(docsrs, doc(cfg(all(target_os = "macos", feature = "macos-keychain"))))]
pub use keyring::macos;
#[cfg(feature = "memory")]
pub use keyring::memory;
#[cfg(all(feature = "encrypted-vfs", not(feature = "fips")))]
#[cfg_attr(
docsrs,
doc(cfg(all(feature = "encrypted-vfs", not(feature = "fips"))))
)]
pub use keyring::migrate;
#[cfg(feature = "nitrokey")]
#[cfg_attr(docsrs, doc(cfg(feature = "nitrokey")))]
pub use keyring::nitrokey;
#[cfg(feature = "web-storage")]
pub use keyring::web_storage;
#[cfg(feature = "js")]
mod wasm;
#[cfg(feature = "file")]
#[cfg_attr(docsrs, doc(cfg(feature = "file")))]
pub use keyring::sqlcipher;
#[cfg(feature = "turso")]
#[cfg_attr(docsrs, doc(cfg(feature = "turso")))]
pub use keyring::turso;
#[cfg(feature = "turso-encrypted-io")]
#[cfg_attr(docsrs, doc(cfg(feature = "turso-encrypted-io")))]
pub use keyring::turso_encrypted_io;
#[cfg(all(target_os = "windows", feature = "windows-credentials"))]
#[cfg_attr(
docsrs,
doc(cfg(all(target_os = "windows", feature = "windows-credentials")))
)]
pub use keyring::windows;
#[cfg(any(feature = "yubihsm-usb", feature = "yubihsm-http"))]
#[cfg_attr(
docsrs,
doc(cfg(any(feature = "yubihsm-usb", feature = "yubihsm-http")))
)]
pub use keyring::yubihsm;
pub use keyring::*;
#[cfg(feature = "js")]
#[cfg_attr(docsrs, doc(cfg(feature = "js")))]
pub use wasm::{Keyring, request_persistent_storage, stored_keyrings};
#[cfg(any(
all(target_os = "macos", feature = "macos-keychain"),
all(target_os = "linux", feature = "linux-secret-service"),
))]
#[cfg(test)]
mod test {
use super::*;
#[test]
fn parse_peek_criteria_test() {
for pair in &[
("", 0),
("kind=generic", 1),
("kind=internet,account=aws", 2),
("account=aws,service=lox", 2),
("no_delimiter_here", 0),
("valid=1,broken", 1),
("kind=internet,,account=aws", 2),
] {
let criteria = parse_peek_criteria(pair.0);
assert_eq!(criteria.len(), pair.1, "input: {:?}", pair.0);
}
}
}