fix(server): preserve credential key names in redacted provider responses#569
Open
johntmyers wants to merge 1 commit intomainfrom
Open
fix(server): preserve credential key names in redacted provider responses#569johntmyers wants to merge 1 commit intomainfrom
johntmyers wants to merge 1 commit intomainfrom
Conversation
…nses redact_provider_credentials used HashMap::clear() which removed both keys and values, causing provider list/get to report 0 credential keys. Replace with value-only redaction so key names and counts are preserved while secret values remain hidden. Refs: #350
drew
approved these changes
Mar 24, 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
Fix
provider listandprovider getshowing 0 credential keys by replacingHashMap::clear()with value-only redaction inredact_provider_credentials.Related Issue
Refs #350
Changes
redact_provider_credentialsnow iteratesvalues_mut()and replaces each value with"REDACTED"instead of callingcredentials.clear()"REDACTED") instead of empty mapsRoot Cause
Commit
2d3e6432(part of security hardening PR #548) addedredact_provider_credentialswithcredentials.clear()to prevent credential values from leaking over the API. This correctly hid secrets but also destroyed key names and the key count, causingprovider listto showCREDENTIAL_KEYS: 0andprovider getto show<none>for credential keys.Testing
mise run pre-commitpassesopenshell provider listnow shows correct credential countChecklist