Skip to content

fix(server): preserve credential key names in redacted provider responses#569

Open
johntmyers wants to merge 1 commit intomainfrom
fix/provider-list-credential-count
Open

fix(server): preserve credential key names in redacted provider responses#569
johntmyers wants to merge 1 commit intomainfrom
fix/provider-list-credential-count

Conversation

@johntmyers
Copy link
Collaborator

Summary

Fix provider list and provider get showing 0 credential keys by replacing HashMap::clear() with value-only redaction in redact_provider_credentials.

Related Issue

Refs #350

Changes

  • redact_provider_credentials now iterates values_mut() and replaces each value with "REDACTED" instead of calling credentials.clear()
  • Credential key names and counts are preserved in gRPC responses while secret values remain hidden
  • Updated three unit tests to assert redacted values ("REDACTED") instead of empty maps

Root Cause

Commit 2d3e6432 (part of security hardening PR #548) added redact_provider_credentials with credentials.clear() to prevent credential values from leaking over the API. This correctly hid secrets but also destroyed key names and the key count, causing provider list to show CREDENTIAL_KEYS: 0 and provider get to show <none> for credential keys.

Testing

  • mise run pre-commit passes
  • Unit tests updated to verify redacted values
  • Verified on live cluster: openshell provider list now shows correct credential count

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

…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
@johntmyers johntmyers requested a review from a team as a code owner March 24, 2026 14:43
@johntmyers johntmyers self-assigned this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants