passless-rs 0.17.0

FIDO2 security token emulator
Documentation
//! Initialization complete

use crate::notification::show_info_notification;

use passless_core::error::Result;

use std::path::PathBuf;

pub struct Complete {
    pub(super) store_path: PathBuf,
    pub(super) fingerprint: String,
    pub(super) allow_create_without_prompt: bool,
}

impl Complete {
    pub fn finish(self) -> Result<()> {
        if !self.allow_create_without_prompt {
            let _ = show_info_notification(
                "✅ Password Store Initialized",
                &format!(
                    "Password store successfully initialized at:\n{}\n\nGPG Key: {}",
                    self.store_path.display(),
                    self.fingerprint
                ),
            );
        }

        Ok(())
    }
}