fix(tests): set premium_user=True in JWT tests that call user_api_key_auth#21641
Merged
fix(tests): set premium_user=True in JWT tests that call user_api_key_auth#21641
Conversation
…_auth JWT auth is an enterprise-only feature. Tests that call user_api_key_auth with enable_jwt_auth=True must set premium_user=True on the proxy server to bypass the enterprise gate, otherwise they fail with: ValueError: JWT Auth is an enterprise only feature. This follows the same pattern as PR #21285 (fix/jwt-enterprise-license-test). Fixed tests: - test_team_token_output - test_allowed_routes_admin - test_allow_access_by_email - test_end_user_jwt_auth Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile SummaryFixed four failing JWT tests by setting Changes:
Tests fixed:
All four tests call Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| tests/proxy_unit_tests/test_jwt.py | Added premium_user=True to four JWT tests to bypass enterprise license check, enabling proper JWT functionality testing |
Last reviewed commit: cde51a5
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four JWT tests in
tests/proxy_unit_tests/test_jwt.pywere failing with:Because
user_api_key_authgatesenable_jwt_authbehind the enterprise license check:The tests set
enable_jwt_auth: Truebut did not setpremium_user = True, causing them to hit the gate instead of testing JWT logic.Fix
Add
setattr(litellm.proxy.proxy_server, "premium_user", True)immediately before thegeneral_settingssetattr in each failing test — the same pattern used by PR #21285.Affected tests:
test_team_token_outputtest_allowed_routes_admintest_allow_access_by_emailtest_end_user_jwt_authRelation to PR #21634
These failures are not related to PR #21634 (which only touches
litellm/llms/azure/azure.py). The same test failures are present onmainindependently.Test plan
test_allow_access_by_email[ishaan@berri.ai-True]passes locally after fixtest_end_user_jwt_authpasses locally after fixtest_team_token_outputandtest_allowed_routes_adminrequire a live DB (CI) — the enterprise gate was the first failure; fixing it unblocks the JWT logic tests