chore(deps): bump vault to v0.3.0 and adapt to its breaking changes - #418
Merged
Conversation
v0.3.0 is a security release: secrets no longer travel through a shell command, empty vault files are no longer silently reinitialized and overwritten, writes are serialized across processes, and closed vaults report an error rather than panicking. The API surface it breaks here is small: - demoVaultProvider implements the new Metadata() (Metadata, error). - vaultFromName handles the new error. It reports a metadata failure as a field rather than failing the whole view: for an external vault that failure means the backend CLI is missing or the session has expired, which is precisely when someone wants to inspect the vault's configuration. It also called Metadata() twice, which for an external vault meant running the backend command twice per view. Also tightened ValidateIdentifier to reject a leading dash or underscore. This is not cosmetic: flow's rule was a *superset* of the library's new ValidateVaultID, so flow would accept a name like "-myvault" or "_myvault" that the library then refuses -- failing at creation with a less specific message, and leaving any vault already created under such a name unreachable. A new test asserts the subset property directly, since the two rules live in separate repositories and will otherwise drift apart silently. Verified: 32 packages pass under -race, lint clean. The 15 `go vet` warnings about json tags on unexported fields in types/*.gen.go are pre-existing and identical on main. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HtuDuGkSqTfAXSepf8b51p
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Refactor validation comment for clarity and accuracy.
Removed comments explaining the rejection of leading dash or underscore in identifiers.
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.
Summary
Picks up vault v0.3.0, a security and
correctness release. In the library, secrets no longer travel through a shell command,
empty vault files are no longer silently reinitialized and overwritten, writes are
serialized across processes, and closed vaults report an error instead of panicking.
The surface it breaks in flow is small — three call sites — but one compatibility problem
was not a compile error and is the more important half of this PR.
Notable Changes
demoVaultProviderimplements the newMetadata() (Metadata, error).vaultFromNamehandles the new error, and reports a metadata failure as ametadataErrorfield rather than failing the whole view. For an external vault thatfailure means the backend CLI is missing or the session has expired — precisely when a
user wants to inspect the vault's configuration. It also called
Metadata()twice,which for an external vault meant running the backend command twice per view.
ValidateIdentifiernow rejects a leading dash or underscore. flow's rule was asuperset of the library's new
ValidateVaultID, so flow would accept a name like-myvaultor_myvaultthat the library then refuses — failing at creation with a lessspecific message, and leaving any vault already created under such a name unreachable
after upgrade. A new test asserts the subset property directly, because the two rules
live in separate repositories and will otherwise drift apart silently.