mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-21 05:59:16 +00:00

* 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
15 lines
364 B
Rust
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(),
|
|
)?)
|
|
})
|
|
}
|