Skip to main content

Module send

Module send 

Source
Expand description

bw send command implementation.

Dispatches the subcommands declared on SendArgs / SendCommands in super to the underlying [bitwarden_send::SendClient] methods. The arg parsing surface is intentionally defined in super so the legacy-CLI shape (which is part of the user contract) stays close to the rest of the tools family.

StructsΒ§

CreateInputs πŸ”’
CreateOverrides πŸ”’
CLI-flag overrides applied on top of a full-object JSON create.
EditOverrides πŸ”’
SendArgs
SendCreateArgs
SendDeleteArgs
SendEditArgs
SendFileTemplate πŸ”’
SendFileTemplateBody πŸ”’
SendGetArgs
SendJsonInput πŸ”’
CLI-local shape for the full-object JSON accepted by create/edit.
SendListArgs
SendReceiveArgs
bw send receive <url>. Must stay field-identical to super::ReceiveArgs (bw receive) β€” they are the same command under two names, and both delegate to super::receive::run_receive.
SendRemovePasswordArgs
SendTemplateArgs
SendTextTemplate πŸ”’
SendTextTemplateBody πŸ”’

EnumsΒ§

SendCommands

ConstantsΒ§

DELETE_IN_DAYS_ALLOWED πŸ”’
Allowed values for --deleteInDays, matching the legacy CLI’s enumerated set. Kept as strings so PossibleValuesParser can surface them in --help output.

FunctionsΒ§

build_access_url πŸ”’
Build the shareable Send access URL from a decrypted [bitwarden_send::SendView].
build_auth πŸ”’
build_auth_for_edit πŸ”’
Build the auth field for a [SendEditRequest].
build_create_request πŸ”’
build_create_request_from_view πŸ”’
Build a create request from a full-object [SendView] (the encoded_json path).
build_edit_request πŸ”’
build_edit_request_from_json πŸ”’
Build an edit request by merging a full-object [SendView] (req) over the existing server row, replicating the legacy CLI’s precedence.
compute_deletion_date πŸ”’
create_shortcut πŸ”’
default_auth_type πŸ”’
delete_in_days_parser πŸ”’
Clap value parser for --deleteInDays. Restricts input to the legacy-CLI allowed set (also surfaced in --help) and maps it back to the u64 field type.
dispatch_create πŸ”’
Run bw send create, either from a full-object SendView (json) or from the individual CLI flags. The JSON input, when present, has already been resolved and parsed in SendArgs::run so parse errors surface before the auth check.
dispatch_edit πŸ”’
Run bw send edit, either merging a full-object SendView (json) into the existing server row or applying the individual CLI-flag overrides. The JSON input, when present, has already been resolved and parsed in SendArgs::run.
finalize_emails πŸ”’
get_send πŸ”’
list_sends πŸ”’
parse_emails πŸ”’
Parse the --emails argument into a list of email addresses.
parse_encoded_send_view πŸ”’
Decode and parse the full-object JSON input into a [SendView].
read_encoded_json_input πŸ”’
Resolve the raw full-object JSON input for create/edit.
render_template πŸ”’
require_premium πŸ”’
Enforce the premium-membership precondition for file Sends by inspecting the premium claim on the current user’s access-token JWT (option a from PM-39238). Reads the persisted AUTHENTICATION_TOKENS state β€” the same source the auth middleware attaches to requests β€” so no additional token accessor is needed on the client.
rewrite_api_host_to_vault πŸ”’
Rewrite a leading api. host label to vault. in a scheme://host[/path] URL, e.g. https://api.bitwarden.com -> https://vault.bitwarden.com. Returns None when the URL has no scheme or the host does not start with the api. label (so apiary.example.com is not rewritten).
run_create πŸ”’
run_create_file πŸ”’
Full file-send create pipeline:
to_url_b64 πŸ”’
Convert standard base64 to URL-safe base64 without padding.
web_vault_from_api_url πŸ”’
Derive the web-vault base from an API URL when no web-vault/server URL is configured (the bw login --server and cloud paths). Pure so it can be unit-tested without a live client.
web_vault_url πŸ”’
Resolve the web-vault base URL that /#/send/<access_id>/<url_b64_key> is appended to.