Repository navigation
fix: key the Secrets Manager cache by the username and password JSON keys - #259
Merged
Merged
Conversation
…keys A cached secret entry holds the username and password picked with one configuration's secret_username_key and secret_password_key, but the cache key left them out. Two configurations reading different users from the same secret (for example an app user and a migration user) shared one entry, so the second connected as the first's database user. They also shared an in-flight fetch. The cache key now includes both JSON key names. It is also built as a frozen array of frozen strings instead of a colon-joined string, so values that contain a colon (ARNs, endpoint URLs, JSON key names) can no longer make two different keys equal.
sophia-bq
approved these changes
Dec 2, 2026
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
Problem
The Secrets Manager plugin caches the username and password it reads from a secret, keyed by the secret ID, region, endpoint and AWS credentials. The cached entry holds the fields picked with
secret_username_keyandsecret_password_key, but those two settings were not part of the key.Description
Change
SecretsManagerPlugin.cache_keynow includes the username and password JSON key names. The cached entry and the in-flight fetch are both looked up by this key.Behavior change
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.