Skip to content

[SM-2083] Adding feature flag gate to server side for secrets versioning - #8330

Open
cd-bitwarden wants to merge 4 commits into
mainfrom
SM-2083-FeatureFlag
Open

[SM-2083] Adding feature flag gate to server side for secrets versioning#8330
cd-bitwarden wants to merge 4 commits into
mainfrom
SM-2083-FeatureFlag

Conversation

@cd-bitwarden

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/SM-2083

📔 Objective

Add Feature Flag Gating to Server Side Secret Versioning Changes

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: REQUEST CHANGES

Reviewed the feature flag gating for Secrets Manager version history: a class-level [RequireFeature(FeatureFlagKeys.SecretsVersioning)] on SecretVersionsController and an IsEnabled check on the version-recording branch in SecretsController.UpdateSecretAsync. The gating itself is correct and complete — both version write paths (secret update and version restore) and all read/delete endpoints are covered, UseFeatureFlagChecks() is already wired in src/Api/Startup.cs, the flag key exists in Constants.cs, and the fully-qualified Bitwarden.Server.Sdk.Features.IFeatureService injection matches the pattern used by SyncController and SendsController. One defect in the gated branch surfaced while tracing the new tests: the version record captures the post-update value rather than the previous one. That behavior predates this PR, but this PR modifies the branch condition and adds the tests that assert the branch, and the new assertions pass either way.

Code Review Details
  • ⚠️ : Gated branch stores the new secret value as the version record because ToSecret has already mutated secret.Value; version history loses the previous value and restore becomes a no-op
    • src/Api/SecretsManager/Controllers/SecretsController.cs:204

Comment thread src/Api/SecretsManager/Controllers/SecretsController.cs
@cd-bitwarden cd-bitwarden added the t:feature Change Type - Feature Development label Sep 9, 2026
@cd-bitwarden
cd-bitwarden requested a review from r-tome September 9, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant