Huakun Shen 6995e0b8d9
feat: integrate keyring and stronghold plugin (#39)
* feat: add keyring plugin to handle DB encryption

* feat: integrate stronghold plugin

* feat: use new get_or_set APIs added to keyring plugin

* chore: update keyring submodule

* feat: add stronghold integration

Stronghold loading is too slow for now, waiting for a fix https://github.com/tauri-apps/plugins-workspace/issues/2048
2025-01-04 13:00:16 -05:00

15 lines
364 B
Rust

use tauri::AppHandle;
use tauri_plugin_keyring::KeyringExt;
pub fn setup_keyring(app: &AppHandle) -> anyhow::Result<Option<String>> {
Ok(if cfg!(debug_assertions) {
None
} else {
Some(app.keyring().get_or_set_password(
"kunkun",
"db_key",
uuid::Uuid::new_v4().to_string().as_str(),
)?)
})
}