Skip to content

fix: send encryptedFor on cipher create and update - #386

Open
junmo-kim wants to merge 1 commit into
doy:mainfrom
junmo-kim:fix/encrypted-for-385
Open

junmo-kim wants to merge 1 commit into
doy:mainfrom
junmo-kim:fix/encrypted-for-385

Conversation

@junmo-kim

Copy link
Copy Markdown

rbw add and rbw edit currently fail with HTTP 422 against Vaultwarden 1.37.4+ (#385). Vaultwarden now requires an encryptedFor field on cipher create/update, matching what the official Bitwarden clients have been sending for a while.

This change sends encryptedFor (the authenticated user's UUID, as returned by GET /api/sync profile.id) on both cipher POST and PUT. The id is stored in the local db during sync; databases created by older versions simply trigger a sync on first write, so existing setups keep working.

No changes to delete/attachment/folder endpoints and no new dependencies.

Tests: cargo build && cargo test && cargo clippy && cargo fmt --check all pass locally.

@junmo-kim

Copy link
Copy Markdown
Author

The lint failure is pre-existing on main — cargo clippy --all-targets --all-features -- -Dwarnings reports 4 issues that this PR doesn't touch (src/actions.rs:116, src/actions.rs:126, src/api.rs:1756, src/dirs.rs:100; cargo deny check doesn't get to run since clippy fails first). Everything else is green, and the diff itself introduces no new warnings. Happy to send a separate cleanup PR for the clippy findings if useful.

@Chr1s70ph

Copy link
Copy Markdown

That fixed it for me.

@doy can we get this merged?

@DaveMessenger

Copy link
Copy Markdown

The fix is working well for me too. Cheers

@rylos

rylos commented Oct 22, 2026 •

Copy link
Copy Markdown

Thanks for this. In case it's useful for testing: the same field is required on PUT /ciphers/{id}, and Vaultwarden also checks lastKnownRevisionDate when it's sent. My fork rylos/rbw (branch enhanced, based on 1.15.0) does both. Tested against Vaultwarden 1.37.4. The changes are listed at the top of the README. They are too broad for a single PR here, so I'm just leaving a pointer in case it helps someone in the meantime.

timvink added a commit to timvink/dotfiles that referenced this pull request Oct 23, 2026
Vaultwarden 1.37+ rejects rbw add/edit with 422 because rbw 1.15.0 omits
encryptedFor (doy/rbw#385). Apply the issue's fix on top of the 1.15.0 tag
until doy/rbw#386 ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leiserfg added a commit to leiserfg/rbw that referenced this pull request Nov 8, 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.

4 participants