Skip to main content

Module pipeline

Module pipeline 

Source
Expand description

Generic submit pipeline shared by all SDK importers.

A format-specific parser (see crate::importers) produces a ParsedImport; this module encrypts it for the destination, builds the API request, submits it, and reports the counts. Nothing here is format-specific.

StructsΒ§

ParsedImport
Format-agnostic parse result: the ciphers, the folder paths, and which cipher belongs to which folder (by index). Every importer parser produces this for the pipeline to submit.

EnumsΒ§

ImportPayload πŸ”’
The encrypted request model and counts for an import, ready to submit.

FunctionsΒ§

build_org_collections πŸ”’
Builds the collection views for an org import, plus the count of collections actually parsed from the source (excluding the injected target) β€” mirrors build_personal_folders, but for collections. When a target is given it becomes collection 0 and parsed groups are nested beneath it as "{target}/{group}"; with no target, every group becomes a brand-new top-level collection (submitted with no id, same as build_personal_folders submits new folders with no id β€” the server creates on an unmatched/empty id).
build_personal_folders πŸ”’
Builds the folder views to import, plus the count of folders actually parsed from the source (excluding the injected target). When a target folder is given it becomes folder 0 and the imported groups are nested beneath it as "{target}/{group}" β€” the returned count is always names.len(), regardless of whether a target was given, so callers can’t accidentally report the merged list’s length (which includes the pre-existing target) as an import count.
count_by_type πŸ”’
Counts ciphers by vault type, in a stable display order, omitting types with no entries.
filter_restricted πŸ”’
Drops ciphers whose type is restricted and re-indexes the folder relationships.
nest_relationships_under_target πŸ”’
Shifts existing relationships to account for the target folder at index 0 and assigns any folder-less cipher to it.
submit_import πŸ”’
Encrypts a parsed import for the destination (personal vault or organization), submits it to the import endpoint, and returns the per-type counts.
targets_my_items πŸ”’
True when the org-import target is the user’s own β€œMy items” collection
to_kvp πŸ”’
vault_cipher_type πŸ”’
Maps an exporter [CipherType] to the vault [bitwarden_vault::CipherType] discriminant.