implement a kdbx importer #70

Closed
opened 2026-08-10 20:32:44 +00:00 by hugo · 1 comment
Owner

build a importer for kdbx files that reflects how pass does the imports and generates the structure.

The importer should properly recognize already existing objects and only update changed objects and new objects. it never will delete, it will only add to the vault.

it should have a quick add mode to only add new entries it finds.

it should be hooked up into all apps (cli, gui, tui - not iphone).

this should also look at the actual format in kdbx and we want more than pass is providing in structure, so kdbx formats are properly supported especially for multi-line fields, so they don't break appart. so it should write continuation lines with a leading space to stabilize them against misinterpretation.

build a importer for kdbx files that reflects how pass does the imports and generates the structure. The importer should properly recognize already existing objects and only update changed objects and new objects. it never will delete, it will only add to the vault. it should have a quick add mode to only add new entries it finds. it should be hooked up into all apps (cli, gui, tui - not iphone). this should also look at the actual format in kdbx and we want more than pass is providing in structure, so kdbx formats are properly supported especially for multi-line fields, so they don't break appart. so it should write continuation lines with a leading space to stabilize them against misinterpretation.
hugo added this to the 03 - Cross-platform Iced desktop app milestone 2026-08-10 20:32:44 +00:00
hugo added the enhancement label 2026-08-10 20:32:44 +00:00
Author
Owner

Implemented and pushed in bf75465.

The storage crate now owns a pure-Rust KDBX 3/4 importer with password and optional key-file support. It maps nested groups, passwords/login/URL/notes, validated OTP data, custom fields, tags, autotype metadata, attachments, and history into pass-compatible encrypted entries. Named multiline values use leading-space continuation lines. Full mode adds new and updates changed entries; quick-add skips every existing target; neither mode deletes unrelated vault content. Each changed entry uses the embedded automatic Git committer.

The shared command contract exposes import-kdbx with --key-file and --quick-add. CLI uses hidden password input, the TUI supplies a masked keyboard form and K hotkey, and the desktop app supplies a native database/key picker, secure password field, explicit confirmation, Tools menu/palette action, authentication, and tree refresh. All frontends call the same storage importer.

Review and verification:

  • cargo test --package ironstorage --test command_contract --test kdbx_import: 14 passed
  • cargo test --package ironstorage-cli: 16 passed
  • cargo test --package ironstorage-tui: 97 passed
  • cargo test --package ironstorage-desktop: 34 passed
  • cargo fmt --all -- --check: passed
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets: passed
  • cargo clippy --workspace --all-targets -- -D warnings: passed
  • cargo test --workspace: passed

The focused KDBX compatibility regression proves add/update/unchanged/quick-add behavior, password plus key-file authentication, stable multiline parsing, OTP/custom/autotype/attachment mapping, per-entry encryption, and byte-exact preservation of an unrelated existing entry.

Implemented and pushed in bf75465. The storage crate now owns a pure-Rust KDBX 3/4 importer with password and optional key-file support. It maps nested groups, passwords/login/URL/notes, validated OTP data, custom fields, tags, autotype metadata, attachments, and history into pass-compatible encrypted entries. Named multiline values use leading-space continuation lines. Full mode adds new and updates changed entries; quick-add skips every existing target; neither mode deletes unrelated vault content. Each changed entry uses the embedded automatic Git committer. The shared command contract exposes import-kdbx with --key-file and --quick-add. CLI uses hidden password input, the TUI supplies a masked keyboard form and K hotkey, and the desktop app supplies a native database/key picker, secure password field, explicit confirmation, Tools menu/palette action, authentication, and tree refresh. All frontends call the same storage importer. Review and verification: - cargo test --package ironstorage --test command_contract --test kdbx_import: 14 passed - cargo test --package ironstorage-cli: 16 passed - cargo test --package ironstorage-tui: 97 passed - cargo test --package ironstorage-desktop: 34 passed - cargo fmt --all -- --check: passed - RUSTFLAGS="-D warnings" cargo check --workspace --all-targets: passed - cargo clippy --workspace --all-targets -- -D warnings: passed - cargo test --workspace: passed The focused KDBX compatibility regression proves add/update/unchanged/quick-add behavior, password plus key-file authentication, stable multiline parsing, OTP/custom/autotype/attachment mapping, per-entry encryption, and byte-exact preservation of an unrelated existing entry.
hugo closed this issue 2026-08-11 07:06:40 +00:00
Sign in to join this conversation.