Repository navigation
test(e2e): forward LITELLM_LICENSE to UI e2e proxy #28398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ryan-crabbe-berri
merged 3 commits into
litellm_internal_staging
from
litellm_e2e_license_forwarding
May 22, 2026
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
37 changes: 37 additions & 0 deletions
37
ui/litellm-dashboard/e2e_tests/tests/proxy-admin/license.spec.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import { test, expect } from "@playwright/test"; | ||
| import * as fs from "fs"; | ||
| import { ADMIN_STORAGE_PATH } from "../../constants"; | ||
|
|
||
| /** | ||
| * Sanity check that LITELLM_LICENSE is being forwarded to the proxy when set | ||
| * in the environment (e.g. CircleCI's `e2e_ui_testing` job). The login JWT's | ||
| * `premium_user` claim is the same value the dashboard reads to enable | ||
| * premium-gated UI surfaces (Team-BYOK switch, etc.), so asserting it here | ||
| * catches any future regression where the env var stops being plumbed | ||
| * through `run_e2e.sh` / `.circleci/config.yml`. | ||
| * | ||
| * Skips locally when no license is configured. | ||
| */ | ||
| test.describe("Premium license wiring", () => { | ||
| test("admin session JWT carries premium_user=true when LITELLM_LICENSE is set", () => { | ||
| test.skip( | ||
| !process.env.LITELLM_LICENSE, | ||
| "LITELLM_LICENSE not set in test env — proxy is running unlicensed", | ||
| ); | ||
|
|
||
| const storage = JSON.parse(fs.readFileSync(ADMIN_STORAGE_PATH, "utf-8")); | ||
| const tokenCookie = storage.cookies?.find((c: { name: string }) => c.name === "token"); | ||
| expect(tokenCookie, "token cookie missing from admin storage state").toBeDefined(); | ||
|
|
||
| // Decode the JWT payload (no signature check — we trust globalSetup ran | ||
| // against our own proxy). Payload is the middle base64url segment. | ||
| const jwtParts = tokenCookie.value.split("."); | ||
| expect(jwtParts.length, "token cookie is not a 3-part JWT").toBe(3); | ||
| const [, payloadB64] = jwtParts; | ||
| const payload = JSON.parse( | ||
| Buffer.from(payloadB64, "base64url").toString("utf-8"), | ||
| ); | ||
|
|
||
| expect(payload.premium_user).toBe(true); | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ES2020", | ||
| "module": "esnext", | ||
| "moduleResolution": "bundler", | ||
| "esModuleInterop": true, | ||
| "resolveJsonModule": true, | ||
| "skipLibCheck": true, | ||
| "strict": true, | ||
| "noEmit": true, | ||
| "types": ["node"] | ||
| }, | ||
| "include": ["**/*.ts"], | ||
| "exclude": ["node_modules"] | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we dont, remove d