Skip to content

Add attachment downloads with authenticated binary output - #389

Open
pythonyx135793 wants to merge 5 commits into
doy:mainfrom
pythonyx135793:codex/attachment-download-r1674
Open

pythonyx135793 wants to merge 5 commits into
doy:mainfrom
pythonyx135793:codex/attachment-download-r1674

Conversation

@pythonyx135793

@pythonyx135793 pythonyx135793 commented Oct 25, 2026 •

Copy link
Copy Markdown

Closes #130.

Adds attachment downloads to rbw get:

rbw get "entry" --raw
rbw get "entry" --attachment "file.pdf" --output "./file.pdf"

--raw includes attachment IDs, filenames and sizes. Downloads accept an exact filename or ID; duplicate filenames need an ID. Output is an explicit path, or --output - for binary stdout. Existing files are left intact.

The agent fetches the owning cipher and a fresh attachment URL, uses the current personal/organization and item/file keys, and authenticates the binary data before returning it. It respects the current password-reprompt setting and a lock during download. The vault token is kept off blob requests. Cache saves now publish complete snapshots atomically, fixing a race with automatic sync. Tests cover legacy files, malformed keys/data, cache changes and failed requests as well as normal downloads.

The follow-up also fixes locked-buffer destruction: zeroize the bytes, unlock their memory, then free the allocation. A clone/drop regression covers that lifecycle.

Validation of 6963a224:

  • Linux source checks: 35 tests pass in each all-feature/no-default suite; format, build and strict Clippy pass. All 24 actual CLI/agent checks pass, covering key chains, binary output, no-clobber, reprompt failures, token refresh and locking.
  • Real-server verification: all seven checks pass with Vaultwarden 1.37.4 and official Bitwarden CLI 2025.12.1, including exact downloads and a fresh reprompt after editing the protected item. The fixture and agent shut down, and its container is removed. This fixes the fixture shutdown timeout in the preceding run; both runs test the identical application source.

Project CI passes Linux, macOS and musl tests, the platform builds and docs. Its lint job passes Clippy and formatting, then fails cargo deny on existing dependency advisories and a yanked spin version. Cargo.toml, Cargo.lock and deny.toml are unchanged from 77464d4. Fully clearing that gate needs separate upstream dependency work; the published crypto-bigint fixes do not fit the existing constraints or declared MSRV. No audit exceptions were added here.

For the bounty in #130: @nahili, is your $500 offer still available? PayPal, Wise, USDC or another compatible wallet work for me.

@pythonyx135793 pythonyx135793 changed the title Add attachment downloads with authenticated binary outputAdd attachment downloads with authenticated binary output Add attachment downloads with authenticated binary output Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attachment Support

1 participant