Seal stored secrets in the adapter that stores them - #327
Merged
Merged
Conversation
vaultpg and modelconfigurationpg now take the credential key and seal and open the secrets they store; vaults and modelconfiguration services no longer take a cipher and their storage interfaces carry plaintext. Ciphertext format and bindings are unchanged, so existing rows still open. A bundle that fails to open is now an internal error instead of a missing credential key.
agentpg returned credentialcrypto.ErrUnavailable when a saved Agent's bundle failed to open or decode, so a wrong key or binding looked like a missing key. A missing key stays ErrUnavailable; a failed open or decode is now an internal error.
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.
Part of #1 (store layering). The adapter that stores a secret now seals and opens it.
Encryption was split two ways. templatepg, skillpg and agentpg sealed inside the adapter; vaults and modelconfiguration sealed in the domain Service. The wave-3 Session PRs will freeze and open configuration in
sessionpgunder the same rule, so the two outliers change first.vaults.NewService(storage, refresher)no longer takes the key;vaultpg.New(units, cipher)does.NewCredential.Token/OAuth,StaticToken,OAuthTx.LoadOAuthGrant/ApplyOAuthRefresh/ApplyOAuthReplacement.vaultpg/seal.go. The pure OAuth rules stay invaults.oauthRefreshTimeout.modelconfiguration.NewService(storage);modelconfigurationpg.New(units, cipher).LoadSealedbecameLoadBundle, which returns the opened bundle and its revision.credentialcrypto.ErrUnavailable.IMPLEMENTATION.md: one sentence stating the encryption rule, and updated owner notes.Ciphertext format and bindings are unchanged. New adapter tests seal the way the old code path did and check that the result still opens.
Behaviour changes:
credential_storage_unavailable.Checks on the head (0a517bb + 2):
go build ./...andgo vet ./services/core/...across the whole modulevaults,vaultpg,modelconfiguration,modelconfigurationpg,agentpgcmd/server, execution and store: the dependency, route, observer, fixture-user and MCP credential tests, by-runscripts/check-names.pyNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.