Skip to content

fix(security): redact API key in UnifiClientOptions.ToString() - #8

Merged
ChrisonSimtian merged 1 commit into
mainfrom
fix/redact-secrets-in-tostring
Jun 1, 2026
Merged

fix(security): redact API key in UnifiClientOptions.ToString()#8
ChrisonSimtian merged 1 commit into
mainfrom
fix/redact-secrets-in-tostring

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Problem

UnifiClientOptions is a record, so the synthesized ToString() prints ApiKey — leaking the X-API-KEY credential into any structured log or string interpolation of the options object.

Fix

Override ToString() to emit ApiKey = ***. Adds a regression test.

Found during a manual security review of the homelab C# clients. Builds clean, tests green (3 passed, 1 skipped).

🤖 Generated with Claude Code

The synthesized record ToString() printed ApiKey, so any structured log
or string interpolation of the options leaked the X-API-KEY credential.
Override ToString() to emit `ApiKey = ***`. Add a regression test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisonSimtian
ChrisonSimtian merged commit 3dab1ad into main Jun 1, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the fix/redact-secrets-in-tostring branch June 1, 2026 01:29
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.

1 participant