Repository navigation
fix(proxy): verify offline licenses with dotted payloads - #48327
Draft
tanishqbaweja wants to merge 2 commits into
Draft
tanishqbaweja wants to merge 2 commits into
tanishqbaweja wants to merge 2 commits into
Conversation
Contributor
Merging this PR will not alter performance1 warning
Comparing Footnotes |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This branch has not been deployed
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.
Valid offline licenses now work when their signed payload contains dots, including domain names in user IDs. The verifier locates the signature using the RSA key size while preserving signature and expiry validation
Details
TLDR
Problem this solves
How it solves it
User Flow
Before, an offline admin with a valid dotted license cannot open licensed settings
After, the same license enables the settings offline
Relevant issues
Fixes #26231
Credits the signature-width approach in #26234, which closed unmerged. This fix uses the current mapped tests and also covers non-byte-aligned keys and raw dots inside the signature
Testing
The final license tests produce six failures and 38 passes on the original verifier. The fixed license and adjacent health endpoint tests pass, 333 tests with 23 warnings
All listed checks pass. The full lint target includes the repository's type-budget gates and end-to-end type check. Four targeted mutations also fail as intended, last-dot splitting, rounding the signature width down, ignoring the separator, and skipping RSA verification. Their assertion failure counts are 1, 3, 1 and 3 respectively, followed by a passing run after restoring the source
Formatting, full lint and mutation checks ran on
db1791631208a8d1065cdb393185404c51c26555, whose content tree is identical to the current tip. The affected tests were rerun on the current tip, 333 passes in 15.72s, alongside the fresh live API and browser checks belowComplete check record and logs
Pre-Submission checklist
All four required checks pass on
b7496a18a86bd7a0639513635738eb2dc9430047, unit, lint, smoke and cost map. The coverage job also passes, and Codecov reports that all modified coverable lines are coveredThe initial unit run hit an existing tokenizer timing failure, also reproduced separately on unchanged main. GitHub denied the targeted rerun because it requires repository admin rights. One empty commit retried CI successfully with unchanged code and tests. The 333 affected tests and all ten API checks and four browser workflows were rerun on that tip, with fresh screenshots and recordings. Failure measurements and retry record. Automated code reviews have not been posted
The OSV scan reports the same three unfiltered dependency advisories as unchanged main, GHSA-567q-5qvw-pf92 and GHSA-9vhv-jxww-xfm5 in filelock, plus GHSA-xcx6-jx8p-x3h5 in the development dependency @azure/msal-node. Existing upstream proposal #48302 tracks those findings
Screenshots / Proof of Fix
Both revisions use the same generated RSA test key and signed inputs, a real proxy and PostgreSQL, and the unchanged dashboard export from main. The test public key is installed only in the private verification worktrees. The remote license server is unreachable. This exercises actual cryptographic verification with generated licenses, not an issued production license
Setup, signed payload metadata and all ten live curl results
Before (dddbaa8)
Offline license status
curl --fail-with-body -H "Authorization: Bearer $LITELLM_MASTER_KEY" http://127.0.0.1:41475/health/licenselicense_type: community, empty features and null limitsDesktop and phone dashboard
premium_user: falseand show the rejection pictured above and in the phone screenshotAfter (b7496a1)
Offline license status
curl --fail-with-body -H "Authorization: Bearer $LITELLM_MASTER_KEY" http://127.0.0.1:41475/health/licenselicense_type: enterprisewith the signed expiration, features and limits intactDesktop and phone dashboard
premium_user: trueand open the dialog pictured above and in the phone screenshotAll 14 raw screenshots, four annotated screenshots and eight sampled frames per recording were visually inspected. All four browser cases pass with no JavaScript exceptions or HTTP 5xx responses
Caveats
Low
Type
Bug Fix