Repository navigation
Secret store: report a failed restore; test the Set request wipe - #4311
Merged
Merged
Conversation
…value is wiped on every path - A failed set whose own restore also fails now returns NotRestored (and logs without the value) instead of swallowing the restore error. - The daemon's Set handler stores through store_and_wipe, tested on the accepted and the refused path, including that the buffer is zeroed. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
issue-4291-secrets-fixes
branch
from
November 19, 2026 14:06
8c59a1f to
8d73d90
Compare
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.
Follow-up to the credential store, from its review. Core side only; no change under
packages/agent.SecretStore::set, if the names index write fails and putting the account back as it was also fails, the error was swallowed and the account was left holding the new value, unlisted. It now returnsSecretError::NotRestored(the daemon maps it toInternal), naming the secret, the index failure and what to run (nodespace secret set <name>to list it ornodespace secret delete <name>), and logs the event without the value. The comment no longer claims the account is left as it was. Tested with a backend whose restore fails, for both an existing old value and none.Setrequest value is wiped on every path, and tested. The handler stores throughstore_and_wipe(&SecretStore, &mut SetSecretRequest), which overwrites the value whether the store accepted it or not. The test calls it on an accepted and a refused request and checks the string is empty and the buffer that held it is zeroed.Tests
secrets::20, daemonsecret_service6; clippy-D warningsclean;bun run test:changedpasses.🤖 Generated with Claude Code