Skip to main content

build_access_url

Function build_access_url 

Source
fn build_access_url(
    client: &PasswordManagerClient,
    view: &SendView,
) -> Result<String>
Expand description

Build the shareable Send access URL from a decrypted bitwarden_send::SendView.

Format: <web-vault>/#/send/<access_id>/<url_b64_key>, where <web-vault> is resolved by web_vault_url.

This matches the legacy CLI (SendResponse in apps/cli, which appends accessId + "/" + urlB64Key to env.getSendUrl(), whose self-hosted form is <web-vault>/#/send/) and round-trips through the legacy bw receive parser, which reads the two trailing #-fragment segments (url.hash.slice(1).split("/").slice(-2)) and URL-safe-base64-decodes the key.

Note: we always emit the <web-vault>/#/send/ form. The US-production vanity host (https://send.bitwarden.com/#...) is intentionally not reproduced — hitting the web-vault link directly works in every environment, and the CLI has no authoritative source for the vanity host (see web_vault_url).