litellm/tests/unit/proxy/credential_endpoints
yuneng-jiang b2cc5f25f6
fix(credentials): keep credential labels and edits consistent across UI, API, and replicas (#45835)
* fix(credentials): keep credential labels and edits consistent across UI, API, and replicas

The credential modal flattened stored credential values into the same form object as the
credential's own name, label, and provider, so a stored value keyed credential_name or
display_name replaced the real one and the edit went to the wrong credential or relabeled it.
The modal now submits the top-level fields and credential_values separately

PATCH /credentials now reads the row it merges onto from the writer, so an edit inside the read
replica's lag window no longer writes back an older label or key

POST /credentials answers 409 for a name defined in config instead of creating a DB copy that
shadows it

display_name rules live on the server only. It rejects control, formatting, and line separator
characters, and the UI stops enforcing its own length check and shows the server's error

The models table, model detail view, and model edit picker show the credential's technical name
under its label whenever the two differ

* fix(ui): show credential source in its own column like models

The config marker sat under the credential name. The credentials table now has a Source column
with a Config or DB status badge, matching the Source column on the models table

* test(credentials): unit-test label and prefill helpers and keep the full credential name on hover

Moves displayNameChange and initialFormValues out of the modal so their rules are unit tested,
keeps only the wiring cases in the modal's integration test, makes the label acceptance test
write through the real credentials repository, and adds the full credential name as a hover
title where the models pages truncate it
2026-10-10 16:26:54 -07:00
..
__init__.py test(proxy): move utils, agent_endpoints and endpoint tests into tests/unit/proxy (#44006) 2026-10-01 11:06:42 -07:00
test_endpoints.py fix(credentials): keep credential labels and edits consistent across UI, API, and replicas (#45835) 2026-10-10 16:26:54 -07:00
test_user_provider_credentials.py feat(github_copilot): per-user GitHub OAuth connections for Copilot credentials (#45241) 2026-10-09 15:19:07 -07:00