litellm/tests/unit/llms/github_copilot
Vansh Singh c2c021c8ca
fix(copilot): accept empty or whitespace stored key with key ref (#52014) (#52032)
* fix(copilot): accept empty or whitespace stored key with key ref (#52014)

* fix(copilot): treat blank GitHub App fields as unset and keep other values fail-closed

Booleans and other non-string App field values stay configured so a
non-App request carrying them still fails closed, and a non-string key
ref no longer passes as a blank one

* fix(copilot): never store blank GitHub App fields on a credential

POST /credentials drops a blank or whitespace-only App field instead of
storing it, and PATCH treats one as a deletion. A stored blank key came
back masked as ***** and the dashboard then edited it as an uploaded key

* fix(copilot): keep non-admin credential creates with blank App fields forbidden

* test(copilot): pin that a null App key on update keeps the stored key

* test(copilot): pin that a false or 0 key ref next to an uploaded key fails closed

* fix(copilot): keep signing a whitespace-only key that has no key ref

A named credential with a whitespace-only App key and no key ref answered
400 at the head, which the router never retries. The merge base reached JWT
signing and answered 401, so a model group with a working sibling kept
serving. Whitespace still counts as unset next to a key ref.

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-16 22:03:15 -08:00
..
embedding fix(github-copilot): send the GitHub token directly instead of exchanging it (#50126) 2026-11-05 09:45:17 -08:00
messages fix(github-copilot): send the GitHub token directly instead of exchanging it (#50126) 2026-11-05 09:45:17 -08:00
responses feat(github_copilot): support GitHub App authentication with PEM upload (#51427) 2026-11-14 10:33:20 -05:00
__init__.py test(unit): make every tests/unit directory a package so pytest collection is unique 2026-09-20 11:50:59 +00:00
test_app_auth.py fix(copilot): accept empty or whitespace stored key with key ref (#52014) (#52032) 2026-11-16 22:03:15 -08:00
test_github_copilot_authenticator.py fix(github-copilot): send the GitHub token directly instead of exchanging it (#50126) 2026-11-05 09:45:17 -08:00
test_github_copilot_transformation.py fix(github-copilot): send the GitHub token directly instead of exchanging it (#50126) 2026-11-05 09:45:17 -08:00
test_github_host.py fix(github-copilot): send the GitHub token directly instead of exchanging it (#50126) 2026-11-05 09:45:17 -08:00
test_per_user_auth.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00