-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MB-61292: Fix for PUT /../secrets/<ID>
Fix permissions check: should check not only usages that are being set but also usages that are being replaced. Without this check, for example, bucket admin can overwrite a secret created by full admin that was supposed to be used for things like config encryption. Also this change fixes a race scenario when two parallel changes can hypothetically overwrite some settings of the secret being modified: 1. PUT takes current secret properties and prepares new properties based on that value; 2. Another process modifies some secret properties (auto-rotation); 3. PUT finishes and sets the properties prepared at step #1 4. Change made by step #2 is lost This obvious race was considered imposible in the very first implementation, but then after several changes it became possible:( Change-Id: I3c508e9eb8d8b367bc63bb8aaadfc050c4204160 Reviewed-on: https://review.couchbase.org/c/ns_server/+/216863 Tested-by: Timofey Barmin <[email protected]> Well-Formed: Build Bot <[email protected]> Reviewed-by: Navdeep S Boparai <[email protected]>
- Loading branch information
1 parent
96db79e
commit c296733
Showing
2 changed files
with
66 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters