The GET /api/config endpoint was returning all configuration values in
plaintext, including API keys and passwords. This meant anyone with
network access could read every secret stored in the config.
Add helper functions that identify sensitive keys (those containing
API_KEY, SECRET, or PASSWORD) and replace their values with a masked
form that only shows the last 4 characters (e.g. "***abcd"). The POST
endpoint response is also masked so secrets are never leaked in any
config API response.
Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
Closes #632, related to #620
The
/api/configGET endpoint currently returns API keys in plaintext. This masks sensitive config values (anything containingAPI_KEY,SECRET, orPASSWORD) in the response, showing only the last 4 characters.This way the frontend can still indicate whether a key is configured, without exposing the actual value to anyone with network access.
Changes:
/api/confignow returns masked values for sensitive fields/api/configresponse is also masked (the write itself still accepts full values)