Skip to content

fix(config): never reveal short API keys in model list - #74

Open
imMamdouhaboammar wants to merge 2 commits into
MagicCube:mainfrom
imMamdouhaboammar:fix/model-list-secret-mask
Open

fix(config): never reveal short API keys in model list#74
imMamdouhaboammar wants to merge 2 commits into
MagicCube:mainfrom
imMamdouhaboammar:fix/model-list-secret-mask

Conversation

@imMamdouhaboammar

Copy link
Copy Markdown

Summary

Prevent helixent config model list from revealing an entire API key when the configured secret is four characters or shorter.

Root cause

The command displayed credentials as ****${APIKey.slice(-4)}. For normal long API keys this reveals only a suffix, but the config schema accepts any non-empty key. A 1 to 4 character secret is therefore reproduced in full after the mask prefix.

Changes

  • fully mask API keys of length 4 or less
  • retain the existing last-four suffix behavior for longer keys
  • centralize masking in a small helper used by the list command
  • add regression tests proving short secrets never appear and longer secrets expose only their final four characters

This complements filesystem permission hardening by keeping the CLI display path from disclosing short configured credentials.

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