Skip to main content

Crate bitwarden_importers

Crate bitwarden_importers 

Source
Expand description

§bitwarden-importers

Internal crate implementing format-specific vault importers for the Bitwarden SDK. Do not use directly.

Exposes client.importers() (ImporterClient) with:

  • import_kdbx — parses a KeePass KDBX (.kdbx) database (3.1 + 4, via the keepass crate), encrypts the entries for the user’s personal vault or a given organization, and submits them to the server’s import endpoint. Returns per-type counts.
  • import_onepassword — signs in to a 1Password account with its email, master password and Secret Key, asking a caller-supplied prompt for a TOTP code when the account requires one, downloads and decrypts every vault the account can open, and submits them the same way. Each vault becomes a folder.

§Keeper direct importer

The Keeper “direct” importer logs into Keeper’s API and decrypts the vault on-device. Its access layer is being ported from TypeScript (clients repo) into the keeper module incrementally (strangler-fig). The first piece, keeper::crypto, implements Keeper’s formats — unauthenticated AES-CBC (“aes-v1”), AES-GCM with a prepended nonce (“aes-v2”), an ECDH-P256 → SHA-256 → AES-GCM scheme, and Keeper’s custom encryptionParams blob. These are not Bitwarden cryptography and deliberately do not live in bitwarden-crypto; Use the RustCrypto crates. The crypto is currently internal Rust with no WASM / UniFFI bindings — the low-level primitives are deliberately not exposed across the FFI boundary. Platform bindings will be created once the structured access layer (records, folders, the sync-down protobuf) is ported, so the exposed surface can be record/folder-level operations rather than raw byte arrays.

§Architecture

The shared “interchange” model (ImportingCipher, CipherType, Login/Card/…, and the From<ImportingCipher> for CipherView bridge plus encrypt_import) lives in bitwarden-exporters and is reused here — this crate depends on bitwarden-exporters. CXF import remains in bitwarden-exporters because it is one half of a bidirectional codec.

Modules§

error 🔒
import 🔒
Routing: maps each importer’s public entry to its parser + the generic submit pipeline.
importer_client 🔒
importers 🔒
Format-specific importer parsers. Each parser turns its file format into a crate::pipeline::ParsedImport; the generic pipeline encrypts and submits it.
pipeline 🔒
Generic submit pipeline shared by all SDK importers.
uniffi_support 🔒
wasm 🔒
WASM bindings for the direct 1Password import.

Structs§

CipherTypeCount
Number of imported ciphers of a given type.
Credentials
The credentials for a password + Secret Key login.
ImportOptions
Destination options for a vault import.
ImportSummary
Counts of what an import submitted to the server, broken down by cipher type so the client can render its per-type result table.
ImportTargetCollection
An existing organization collection to assign an org import to. type distinguishes the “My items” default collection (import.rs converts groups to personal folders instead of nested collections) from a normal shared collection.
ImportTargetFolder
An existing personal folder to nest a personal import under.
ImporterClient
OnePasswordImportSummary
Result of a direct 1Password import, including source data that could not be imported.
OnePasswordSignInMethods
How an account can sign in. An account may offer both.
SignInAddress
Where an account signs in, such as my.1password.com.
SkippedItem
An item that could not be read from an otherwise accessible vault.
SkippedVault
A vault that could not be opened.

Enums§

ImportError
ItemCategory
The kind of a vault item, mapped from its template id. The ids are 1Password’s standard category template UUIDs; an unrecognized id is preserved as ItemCategory::Unknown so nothing is lost.
OnePasswordTotpResult
The outcome of a two-factor prompt.
SignInDomain
One of the domains 1Password serves accounts on, as offered in its sign-in form.
SkippedReason
A safe, structured reason for leaving source data unimported.

Constants§

UNIFFI_META_CONST_BITWARDEN_IMPORTERS_RECORD_CIPHERTYPECOUNT 🔒
UNIFFI_META_CONST_BITWARDEN_IMPORTERS_RECORD_IMPORTOPTIONS 🔒
UNIFFI_META_CONST_BITWARDEN_IMPORTERS_RECORD_IMPORTSUMMARY 🔒
UNIFFI_META_CONST_BITWARDEN_IMPORTERS_RECORD_IMPORTTARGETCOLLECTION 🔒
UNIFFI_META_CONST_BITWARDEN_IMPORTERS_RECORD_IMPORTTARGETFOLDER 🔒
UNIFFI_META_CONST_BITWARDEN_IMPORTERS_RECORD_ONEPASSWORDIMPORTSUMMARY 🔒
UNIFFI_META_CONST_NAMESPACE_BITWARDEN_IMPORTERS 🔒
Export namespace metadata.

Traits§

ImporterClientExt
OnePasswordTwoFactorUi
Callback for interactive two-factor authentication.