Repository navigation
feat(fleet-secrets): dual-write put verb — OpStore, sync stamps, pending records (#17143) - #17167
Merged
Merged
Conversation
…ing records (#17143) Ship the #13948 S5 dual-write put: fleet secrets put writes both stores (Bitwarden primary = commit point, 1Password mirror), each stamped at write time with fleet-sync/1 sync metadata (counterpart store:name, kind, truncated SHA-256 last-hash anchor). A mirror failure after the primary landed is reported one-sided by store name and leaves a name-only pending record (fleet-sync.pending.<name>) in the primary for the reconcile to close; a primary failure lands nothing. New OpStore is the op write counterpart of OpSource (create/edit by title, read-back verified, value-free errors); BwsStore gains store_with_note with read-back stamp verification. set --store 1password now writes through OpStore, retiring #15433's refusal. Book reference gains set + put sections; verbs.md table completed.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17143. Refs #13948 (S5).
What
The dual-write
putverb for the secrets plane:fleet-secrets:OpStore— the write counterpart ofOpSource. Creates an "API Credential" item titled by name (or edits the existing title in place), verifies by reading back throughop read, errors value-free. Built from config or single-vault discovery under exactlyOpSource's rules.BwsStore::store_with_note— the sync stamp rides in the Bitwarden secret's note at create time and is verified on the read-back like the value.SecretStoretrait +dual_put— primary (Bitwarden) writes first (the commit point, design §5), then the mirror (1Password), each stampedfleet-sync/1 counterpart=<other-store>:<name> kind=secret hash=<truncated SHA-256 anchor>. Mirror failure after the primary landed →PutReportnames the failed store and a name-only pending record (fleet-sync.pending.<name>, stamp text only — never the value) is left in the primary for the reconcile to close. Primary failure lands nothing and never touches the mirror.fleet secrets put <name>— value on stdin; both stores must be configured or it exits 3 naming the missing one (never a silent single-store write); reports outcomes by store name.set --store 1passwordnow writes throughOpStore; fleet secrets scoping S4: scopedfleet secrets setverb #15433's "no op write path" refusal is retired.set+putsections;verbs.mdsecrets table completed (set/put/refresh rows).Standing write paths (issue item 3)
fleet secrets set(single-store by explicit--store) andfleet bridge exchange'sBwsStorevault writes remain single-store deliberately: the former is the operator's explicit one-store tool (now available for both stores), the latter mints broker-local credentials that are not part of the dual-store estate. Seat-side directbwscreate/edit flows should migrate tofleet secrets put; that migration is a seat runbook change, recorded here and on #13948.Verification
cargo check -p fleet-secretsclean;cargo test -p fleet-secrets— 81 passed, including 7 new tests: OpStore create/edit/error hygiene, stamp agreement across sides, dual-put both-landed, one-sided + pending record, primary-failure isolation.set_store_choicematrix.ophas no configured account in a plain shell and the Bitwarden write project is not configured here, so the live leg is recorded on Secrets plane: pick up and ship the dual-writeputverb (#13948 S5) #17143 for the first dual-provisioned seat rather than faked.Notes
bws secret create --noteis used for the primary stamp; if a bws build without the flag is hit, the write fails loudly at create (runner error), never silently unstamped — and the read-back note comparison catches any silent drop.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.