1. Overview
The PasswordManagerPage.cpp file is a Password-manager main page implementation in BastionGuard.
Builds the complete vault UI, controls first-run/unlock/lock flows, lists and filters entries, opens edit/import/vault dialogs, and handles reveal, update, and deletion operations.
The documentation below is generated from the supplied source and covers its API surface, runtime responsibilities, data flow, filesystem or command interactions, concurrency model, and security considerations.
2. Source Inventory
- Original path:
password_manager/PasswordManagerPage.cpp - Language: C++
- Source type:
.cpp - Line count: 593
- SHA-256:
74084612b04c5cd98995ed5d58c7e6b78b0ff7a9c301d6aa2c195f62159b3189
3. Dependencies
The file declares the following compile-time dependencies:
Project
PasswordManagerPage.hppPasswordDialogs.hppPasswordImportDialog.hppPasswordVaultView.hpp
GTK/GLib
glibmm/i18n.h
C/C++ Runtime
algorithmcctype
4. Types and Public Contract
No standalone class, structure, or enumeration is declared directly in this file.
5. API and Method Inventory
The following functions or methods are implemented in this file:
PasswordManagerPage::PasswordManagerPage()– Implements the operation represented by this API.PasswordManagerPage::~PasswordManagerPage()– Releases callbacks, threads, timers, or other owned runtime state.PasswordManagerPage::buildUi()– Constructs the corresponding GTK interface section.PasswordManagerPage::setVaultState(bool unlocked, const std::string& msg)– Updates controls and status labels for locked or unlocked state.PasswordManagerPage::reload()– Reloads vault metadata and rebuilds the visible list.PasswordManagerPage::refreshEntries(const std::string& filter)– Filters and renders the current entry collection.PasswordManagerPage::onUnlockClicked()– Handles the on unlock clicked user-interface action.PasswordManagerPage::onLockClicked()– Handles the on lock clicked user-interface action.PasswordManagerPage::onAddClicked()– Handles the on add clicked user-interface action.PasswordManagerPage::onImportClicked()– Handles the on import clicked user-interface action.PasswordManagerPage::onDeleteAllClicked()– Handles the on delete all clicked user-interface action.PasswordManagerPage::onRefreshClicked()– Handles the on refresh clicked user-interface action.PasswordManagerPage::onSearchChanged()– Handles the on search changed user-interface action.PasswordManagerPage::onRevealEntry(const PasswordEntry& entry)– Handles the on reveal entry user-interface action.PasswordManagerPage::onEditEntry(const PasswordEntry& entry)– Handles the on edit entry user-interface action.PasswordManagerPage::onDeleteEntry(const PasswordEntry& entry)– Handles the on delete entry user-interface action.PasswordManagerPage::getParentWindow()– Returns the requested value or computed resource.PasswordManagerPage::logSafe(const std::string& msg)– Appends a log message on the GTK main thread with lifetime protection.
6. Functional Architecture
Page Layout
- Provides a security banner, vault-state controls, action toolbar, search box, scrollable entry list, and operation log.
- Exposes actions for unlock/lock, new record, CSV import, vault view/export, refresh, and complete deletion.
- Uses expandable
PasswordSearchRowwidgets for each record.
Vault Lifecycle
- Initializes the vault and distinguishes first-run master-password creation from normal unlock.
- Disables secret-dependent actions while locked.
- Reloads metadata after add, edit, import, or delete operations.
- Uses a lifetime flag for delayed and idle callbacks.
7. Operational Flow
- Initialize the password-manager storage directory and metadata index.
- Create or verify the master password and transition the vault into unlocked state.
- Load non-secret metadata and asynchronously populate the decrypted secret cache.
- Perform add, edit, reveal, import, export, or delete actions.
- Persist metadata atomically and rewrite the encrypted secret map.
- Clear cached secrets and master-password material when locking.
8. Filesystem and External Command Surface
No hard-coded absolute filesystem path is declared directly in this file.
Commands or Security Primitives Referenced
AES-256-GCMPBKDF2ipsh
9. Concurrency and Lifecycle
- Uses GLib idle callbacks to update GTK from the main thread.
- Uses GLib timers for progress, deferred actions, polling, or cache readiness.
- Uses a lifetime guard so delayed callbacks do not access a destroyed widget.
10. Security Considerations
- Password metadata and encrypted secrets are separated, reducing accidental exposure through the index file.
- Cleartext passwords exist in process memory while the vault is unlocked and during import/export workflows.
- CSV import and export files are unencrypted and must be handled as sensitive data.
- Background callbacks must not outlive their owning GTK objects.
11. Implementation Considerations
- The implementation should remain synchronized with the matching header declarations.
12. Licensing and Branding
The source is distributed under the GNU General Public License version 3.
The source header identifies BastionGuard™ as a trademark and states that the name and branding are not licensed under the GPL.
The software is provided without warranty, including implied warranties of merchantability or fitness for a particular purpose.
