Skip to content

Updating language wrappers and the CLI to calculate the correct value…#1516

Open
cd-bitwarden wants to merge 15 commits into
mainfrom
SM-1595
Open

Updating language wrappers and the CLI to calculate the correct value…#1516
cd-bitwarden wants to merge 15 commits into
mainfrom
SM-1595

Conversation

@cd-bitwarden
Copy link
Copy Markdown
Contributor

… for ValueChanged when updating a secret's value

🎟️ Tracking

https://bitwarden.atlassian.net/jira/software/c/projects/SM/boards/74?assignee=625cb516fd06270069beaf5d&selectedIssue=SM-1595

📔 Objective

Updating the CLI and Language wrappers to properly detect and pass ValueChanged to the Update Secret API Endpoints when the value is changed.

🚨 Breaking Changes

Unsure, TBD.

For breaking changes:

  1. Describe what changed in the public interface
  2. Explain why the change was necessary
  3. Provide migration steps for consumers
  4. Link to any paired consumer PRs if needed

Otherwise, you can remove this section. -->

… for ValueChanged when updating a secret's value
@cd-bitwarden cd-bitwarden requested a review from a team as a code owner May 14, 2026 16:14
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.04%. Comparing base (daed062) to head (d86cf23).

Files with missing lines Patch % Lines
crates/bws/src/command/secret.rs 0.00% 6 Missing ⚠️
crates/fake-server/src/routes.rs 0.00% 4 Missing ⚠️
crates/fake-server/src/lib.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1516      +/-   ##
==========================================
- Coverage   15.15%   15.04%   -0.12%     
==========================================
  Files          21       21              
  Lines        1194     1203       +9     
==========================================
  Hits          181      181              
- Misses       1013     1022       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Calculate whether the secret value has changed by comparing with the
existing secret before updating. This matches the C++ and Go implementations.
Add camelCase rename_all serde attribute to match the JSON field names
sent by language bindings. The binding suse camelCase (valueChanged,
projectIds) while the struct was expecting snake_case.
The Go and other language bindings send valueChanged in the secret update request,
but the Rust SDK's SecretPutRequest doesn't include this field yet. Mark the field
as optional with serde(default) so the fake server can deserialize requests that
don't include it while still accepting and logging the value when present.
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@tangowithfoxtrot tangowithfoxtrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for your work on this!

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.

2 participants