Files
sure/test/controllers/settings
minion1227 e5608ca6d9 fix(settings): allow clearing an encrypted provider API key (#2544)
* fix(settings): allow clearing an encrypted provider API key

`update_encrypted_setting` skipped the write whenever the submitted value
was blank, so clearing the field (which auto-submits an empty value) never
removed the stored key — the masked "********" placeholder just reappeared
on re-render. This affected every encrypted provider key (Twelve Data,
Tiingo, EODHD, Alpha Vantage, Tinkoff).

Treat "********" as "leave unchanged" (the untouched masked placeholder)
but persist nil for an explicit blank submission, so a key can be removed
from the UI.

Closes #2465

* fix(settings): clear the remaining encrypted provider tokens on blank

Route openai_access_token, anthropic_access_token, and
external_assistant_token through update_encrypted_setting so blanking
any of them clears the stored value instead of silently retaining it —
same fix as the securities keys, completing the scope of #2465.

Add regression tests for clearing each token and for the OpenAI masked
placeholder, and reset the newly-touched keys in teardown.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
2026-07-26 07:31:25 +02:00
..